lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, 21 Jan 1999, David Jeske wrote:

> The distinction I usually grab onto is "where is your main loop". 
> 

totally depends on what I'm going to use Lua for...  I've been
thinking a lot about this.  What I've come up with is to use it as a
pre-processor for these mean plotting and graphing utilities we use
over here.  The data files for the utilities are basically columns of
numbers ("x" over on the left, "ys" on the right).  But to specify
things like size, color, etc. we have stuff like

 &CHOICE
  NIMAGE=1,
  INFO=1,

<snip>

  HEADS(3)='Model-Observations',
  heads=3*' ',
  HEADS_COL=1.,2.,3.,
  HEADS_SIZE=.011,
  SHIFT_HEADS=0.,

<snip>

  JM=46,46,46, 46,46,46, 46,46,46, 46,46,46, 3*46, 3*46,
  LM=1,1,1, 1,1,1, 1,1,1, 1,1,1, 3*1, 3*1,
  FACTOR=1.,1.,1., 1.,1.,1., 1.,1.,1., 1.,1.,1., 3*1., 3*1.,
  OFFSET=0.,0.,0., 0.,0.,0., 0.,0.,0., 0.,0.,0., 3*0., 3*0.,
  UNDEFINED=-1.E30,-1.E30,-1.E30, -1.E30,-1.E30,-1.E30, 12*-1.E30,
  UNDEFINED_COLOR=.62,.62,.62,
  WMAP=T,T,T, T,T,T, T,T,T, T,T,T, 6*T,     
    ICOLOR_map=0,0,0, 0,0,0, 0,0,0, 0,0,0, 6*0, 
    IDOT_map  =0,0,0, 0,0,0, 0,0,0, 0,0,0, 6*0, 
    LMASK     =0,0,0, 0,0,0, 0,0,0, 0,0,0, 6*0, 
    PROJECT   ='CE','CE','CE', 'CE','CE','CE', 12*'CE',
    POLE      ='N','N','N', 'N','N','N', 12*'N',
  EDGE=T,T,T, T,T,T, T,T,T, T,T,T, 6*T,     

<BLAH, BLAH, etc.>

So, I think I could use Lua to my benefit here.  Is Lua well suited to
this type of task?  It may be advantageous to peruse the actual data
files (with C) to determine max's min's etc.  So, C will probably be
involved in some way (extend/embed... I dunno).  BTW, the actual
graphing apps are, essentially, legacy code in FORTRAN.  It would be
nice to put a Lua interpreter inside these apps, but I don't think
that's feasible.


> C/C++ where it's fast. In this case, I have a C program with Lua
> scripting.

okay.

> 
> I have another piece of software where the C code merely does some
> basic program initialization, exports a bunch of functions to lua, and
> then runs "init.lua". The Lua code 'runs' the program by calling the
> extension functions. In this case, I have a Lua program with C
> extensions.

yes, this I can identify with.  This is good.

> However, the nice thing about Lua is that it so easily and nicely fits
> both roles. Lua dosn't have every feature you might want, but it's
> simple enough that you can get it taylored to a task very easily.

Okay, now I know that I'll *have* to do something with Lua.

> 
> -- 
> David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net
> 
>        "Whoever thinks a faultless piece to see,
>     Thinks what ne'er was, nor is, nor e'er shall be." - Alexander Pope
> 
> 

	Jay Glascoe
	jglascoe@jay.giss.nasa.gov
--
boing.