EmbeddedRelated.com
Forums

Scripting engine

Started by Pierre de Vos January 25, 2005
Hi

I'm looking for a small scripting engine to embed on typically a Mega128 
processor.  I'm only looking for something simple, maybe a simple C-type 
interpreter that allows rudimantary constructs: loops, function calls, etc.

Here's what I want to do: we have an instrument based on an ATMega128, with 
a LCD, keypad and MMC flash disk.  I would like to implement user defined 
data capture capability.  The idea is to write some LCD, keypad and disk 
API's that can be accessed from a user defined script, to implement the 
actual functionality, e.g define screens with some data entry widgets, 
buttons, etc and be able to controll the user input with the script, making 
the data-entry procedure configurable.

Any pointers appreciated.

Pierre 


In article <ct64nu$dj5$1@ctb-nnrp2.saix.net>, pierre.devos@webmail.co.za 
says...
> Hi > > I'm looking for a small scripting engine to embed on typically a Mega128 > processor. I'm only looking for something simple, maybe a simple C-type > interpreter that allows rudimantary constructs: loops, function calls, etc. > > Here's what I want to do: we have an instrument based on an ATMega128, with > a LCD, keypad and MMC flash disk. I would like to implement user defined > data capture capability. The idea is to write some LCD, keypad and disk > API's that can be accessed from a user defined script, to implement the > actual functionality, e.g define screens with some data entry widgets, > buttons, etc and be able to controll the user input with the script, making > the data-entry procedure configurable.
Small maybe? http://www.compuphase.com/small.htm Robert
> Hi > > I'm looking for a small scripting engine to embed on typically a Mega128 > processor. I'm only looking for something simple, maybe a simple C-type > interpreter that allows rudimantary constructs: loops, function calls,
etc.
>
Forth? Wim
"Wim Ton" <wimton@blueyonder.co.uk> wrote in message
news:99JJd.9518$MR3.2733@fe1.news.blueyonder.co.uk...
> > Hi > > > > I'm looking for a small scripting engine to embed on typically a Mega128 > > processor. I'm only looking for something simple, maybe a simple C-type > > interpreter that allows rudimantary constructs: loops, function calls, > etc. > > > > Forth? > > Wim > >
I've never looked at Forth so maybe a few questions: I use C for the main part of the firmware, so is there a Forth interpreter written in C around. Can I, from interpreted Forth, call back into already compiled code (C) to provide the API's to the Forth script, passing data to/from? Pierre
Pierre de Vos wrote:
> Hi > > I'm looking for a small scripting engine to embed on typically a
Mega128
> processor. I'm only looking for something simple, maybe a simple
C-type
> interpreter that allows rudimantary constructs: loops, function
calls, etc.
> > Here's what I want to do: we have an instrument based on an
ATMega128, with
> a LCD, keypad and MMC flash disk. I would like to implement user
defined
> data capture capability. The idea is to write some LCD, keypad and
disk
> API's that can be accessed from a user defined script, to implement
the
> actual functionality, e.g define screens with some data entry
widgets,
> buttons, etc and be able to controll the user input with the script,
making
> the data-entry procedure configurable. > > Any pointers appreciated. > > Pierre
Years ago (late 80s?) I played around with a very small c-like interpreter from the c users group (they distributed it on a cd of theirs). It was called something like tiny c (but I keep finding a compiler by that name using google). It would probably be perfect for what you are doing. It did functions, loops, etc. I seem to recall it didn't support structures. It was possible to add calls to existing libraries by extending the interpreter. It was not real fast, it worked by parsing the text of your script. It was very small, just a few hundred lines of c code. If you can't find it somewhere on-line, drop me an email and I'll try to dig up the cd. I still have it somewhere. Mark
Pierre de Vos wrote:
> I'm looking for a small scripting engine
I have not used it, and know nothing more about it, but: http://eic.sourceforge.net/overview/ -- Nicholas O. Lindan, Cleveland, Ohio Consulting Engineer: Electronics; Informatics; Photonics. To reply, remove spaces: n o lindan at ix . netcom . com psst.. want to buy an f-stop timer? nolindan.com/da/fstop/
> > > I'm looking for a small scripting engine to embed on typically a
Mega128
> > > processor. I'm only looking for something simple, maybe a simple
C-type
> > > interpreter that allows rudimantary constructs: loops, function calls, > > etc. > > > > > > > Forth? > > > > Wim > > > > > > I've never looked at Forth so maybe a few questions: > > I use C for the main part of the firmware, so is there a Forth interpreter > written in C around. Can I, from interpreted Forth, call back into
already
> compiled code (C) to provide the API's to the Forth script, passing data > to/from? >
I am not a Forth user, but a quick Google showed various implementations for the AVR, and in some you can do a call to anywhere. Forth interpreters are usually written in Forth with a small bit of assembler. Wim
On Tue, 25 Jan 2005 20:56:06 +0200, "Pierre de Vos"
<pierre.devos@webmail.co.za> wrote:

>Hi > >I'm looking for a small scripting engine to embed on typically a Mega128 >processor. I'm only looking for something simple, maybe a simple C-type >interpreter that allows rudimantary constructs: loops, function calls, etc. > >Here's what I want to do: we have an instrument based on an ATMega128, with >a LCD, keypad and MMC flash disk. I would like to implement user defined >data capture capability. The idea is to write some LCD, keypad and disk >API's that can be accessed from a user defined script, to implement the >actual functionality, e.g define screens with some data entry widgets, >buttons, etc and be able to controll the user input with the script, making >the data-entry procedure configurable. > >Any pointers appreciated.
Look at http://www.lua.org Whether it is small enough to fit into an ATmega128 is a different matter. Regards Anton Erasmus
"Wim Ton" <wimton@blueyonder.co.uk> writes:

> > I'm looking for a small scripting engine to embed on typically a Mega128 > > processor. [...] > > Forth?
Last time I looked into this, kforth seemed like a nicely built kernel-embeddable FORTH interpreter/compiler. - FChE
On Wed, 26 Jan 2005 12:25:17 +0200, "Pierre de Vos"
<pierre.devos@webmail.co.za> wrote:

>I've never looked at Forth so maybe a few questions: > >I use C for the main part of the firmware, so is there a Forth interpreter >written in C around. Can I, from interpreted Forth, call back into already >compiled code (C) to provide the API's to the Forth script, passing data >to/from?
Yes. Usually a Forth system in C is larger than a custom Forth and the code it compiles is slower. Talk to me by email if you like. We do lots of embedded Forth systems. If you want to see what a big Forth system can do, see www.ccssa.com who are in Cape Town. Stephen -- Stephen Pelc, stephenXXX@INVALID.mpeltd.demon.co.uk MicroProcessor Engineering Ltd - More Real, Less Time 133 Hill Lane, Southampton SO15 5AF, England tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691 web: http://www.mpeltd.demon.co.uk - free VFX Forth downloads