To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 8691
8690  |  8692
Subject: 
Re: Embedded language support in LPub
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 9 Apr 2003 00:49:53 GMT
Viewed: 
606 times
  
In lugnet.cad.dev, Kevin L. Clague writes:
Hi All,

LPub fans may be aware that I'm planning on adding scripting language
support into LPub to let the *power* users do what they want, including
prototyping new features that may someday be incorporated directly into LPub.

The idea behind providing a scripting language into LPub potentially
provides support for batch renderings of individual images or multiple sets
of building instructions, intelligent web page generation with advanced page
layout capabilities, label maker capabilities, and pre and post processing
of LPub's outputs at each phase of the building instruction generation process.

I've not really decided if the scripting language will be perl or Tcl.  I
have started working on the capabilities the scripting language needs (the
interface between your scripts and LPub's C++ code.)  I've outlined some of
the ideas in http://www.lugnet.com/cad/dev/~1527 for those who want to
review and feedback.

Feedback on the choice of perl or Tcl is also welcome.  I much prefer
perl's scripting syntax over Tcl's, plus I know perl.

Kevin

Kevin:

Before you choose between Tcl and Perl, you might want to broaden
your focus a little.  Neither Tcl nor Perl are particularly good
extensibility languages, even though Tcl was ostensibly designed
as an extensibility language.

My first recommendation for extensiblity is to choose a language
neutral strategy that I'll elaborate on further below.  The
second choice is probably Java/BeanShell.   The third choice is
Python.  The distant fourth choice is Tcl with Perl coming in
dead last.

By far the best extensiblity solution is language neutral.
With this strategy, you add some code to LPub to allow it
to be accessed via a TCP/IP connection.  For example, you
would add the "-s <port>" option ot LPub to cause it to
go into server mode listening on <port>.

Everybody else would access LPub via the bi-directional
bytes stream interface provided by a TCP/IP stream.  For
most scripting languages, opening a connection to a port
on the local machines is a few lines of code.  After that
each program would talk to the LPub server via a *simple*
protocol that you define.  The protocol would have simple
commands that you define.  For example,

   READ <lpub_file>
   HOOK PREPOV ...
   CREATE HTML ...
   CREATE BOM ...
   WAIT_FOR_CALLBACK ...

The advantages of this strategy are multifold:

  1) Language neutral -- nobody screams that you didn't
     pick their favorite scripting language.
  2) Platform neutral -- scripting languages have all sorts
     of issues needed to get them to run on each platform.
     If, for some reason, the scripting language code does
     not compile/link properly for a platform that you want
     to support; *you* have to figure out why.
  3) Less code restructuring -- you don't have to stand
     on your head to make your code conform to the coding
     conventions of the scripting language.
  4) Version tracking -- the various scripting languages are
     always being revised.  You have to track each revision.

I'll stop here for now.  If the concept appeals to you and
you have further questions, please feel free to ask them.

My $.02,

-Wayne



Message has 3 Replies:
  Re: Embedded language support in LPub
 
(...) oooh - I like this :) not to mention, it allows LPub to work in "server mode", for multiple clients. I'll write the perl implementation for it :) (21 years ago, 9-Apr-03, to lugnet.cad.dev)
  Re: Embedded language support in LPub
 
(...) Yeah, but don't define yet another new protocol. Go with a simple protocol that already exists like XML-RPC. (URL) don't much simpler than that. Plus if you look at the implementations page you'll see that tcl, perl, java, and just about (...) (21 years ago, 9-Apr-03, to lugnet.cad.dev)
  Re: Embedded language support in LPub
 
(...) Thanks for the wonderful suggestion Wayne. (...) I'll go for the language neutral socket solution. (...) I'll only allow one connection though, at least until I reorganize my data. <snip> (...) At first my head started spinning through all (...) (21 years ago, 10-Apr-03, to lugnet.cad.dev)

Message is in Reply To:
  Embedded language support in LPub
 
Hi All, LPub fans may be aware that I'm planning on adding scripting language support into LPub to let the *power* users do what they want, including prototyping new features that may someday be incorporated directly into LPub. The idea behind (...) (21 years ago, 8-Apr-03, to lugnet.cad.dev)

31 Messages in This Thread:









Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR