Now, I want to build a scripting facility into the system. It should
be possible to load scripts into the system. The script communicates
with a virtual serial port. The script should be able to send strings
to the 'port' to wait for responses etc.
Does anyone have experience with this form of embedded scripting? Is
there any source code available, preferably in C/C++.
Andreas Eide
>I am working on an embedded system.
>Now, I want to build a scripting facility into the system.
>Does anyone have experience with this form of embedded scripting? Is
>there any source code available, preferably in C/C++.
S-Lang is a C-like interpreted language that is freely available at:
space.mit.edu under /pub/davis
I've used it both for Windows application scripting and in an embedded
system. It works very well.
I looked at embedding tcl, but it was hell of a job. A lot of other people
embed BASIC or Forth. I'm still looking for a nice and simple embeddable
scripting language.
The most common languages for embedded use that support are BASIC and
Forth. MPE specialises in Forth systems. We also have a version written
in C. Send me your postal address for more details.
--
Stephen Pelc, s...@mpeltd.demon.co.uk
MicroProcessor Engineering - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 1703 631441, fax: +44 1703 339691
Andreas,
You could also take a look at a language called LUA. It's also intended
for embedded applications, but seems more modern than Tcl. For instance,
it can compile to byte-code, just like Java, resulting in better
performance (I assume). I recently downloaded the source of botht e
compiler and interpreter, and I was very positively surprised by its
quality. It compiled on my Mac without as much as a warning, and ran
first time! It definitely deserves to be checked out.
Regards,
Mike
* What is Lua?
Lua is a simple, yet powerful, language for extending applications.
Lua has been developed by TeCGraf, the Computer Graphics Technology
Group
of PUC-Rio, the Pontifical Catholic University of Rio de Janeiro,
Brazil.
Dozens of industrial products developed by TeCGraf use Lua.
* Some features of Lua
+ a simple, pascal-like, syntax
+ powerful data description constructs (e.g., associative arrays)
+ user-controlled type constructors
+ fallbacks for extending the language in unconventional ways (e.g.,
inheritance, overloading)
+ garbage collection
+ Lua programs are compiled into bytecodes, which are then interpreted
+ portable, written in ANSI C (runs in Unix, DOS, Windows, Mac, Cray,
...)
* Availability
The latest version of Lua is always available at the following
locations:
In Brazil: ftp://ftp.icad.puc-rio.br/pub/lua/lua.tar.gz
In Canada: ftp://csg.uwaterloo.ca/pub/lhf/lua/lua.tar.gz
In Germany: ftp://ftp.uni-trier.de/pub/languages/lua/lua.tar.gz
In Greece: ftp://ftp.ntua.gr/pub/lang/lua/lua.tar.gz
Home page: http://www.inf.puc-rio.br/~roberto/lua.html
The current version is 2.5.
--
Dataton - TRUE MULTIMEDIA integration and show control systems.
Check it out at http://www.dataton.com
There is a BASIC Interpreter available under LINUX.
I think it must be available as source.
If i remember correct this version of BASIC is also available under MS-DOS.
Next time i will look at the name of this BASIC version.
--
with best regards / mit freundlichen Grüßen
Heinz-Jürgen Oertel
port GmbH
The command was something like: CTTY COM1 <enter>
After which you can run any DOS command over the serial port that
produces standard output. Eg. DIR, COPY, run programs etc.
The only thing that should be avoided is direct screen writes (they
work, but you will not see them).
To create a .BAT file is then just a command like:
COPY CON TEST.BAT (could be COPY COM1 TEST.BAT, i'm not sure)
.. send the contents of your "script" and stop with ^Z
Run it with :
TEST
Even ancient EDLIN works.
Maybe you don't like it, but it is a quick solution, versatile and for
free.
Joop.
> Ken Tindell <k...@nrtt.demon.co.uk> wrote:
> +---------------
> | I looked at embedding tcl, but it was hell of a job. A lot of other people
> | embed BASIC or Forth. I'm still looking for a nice and simple embeddable
> | scripting language.
> +---------------
>
> Then you might want to look at Scheme. Quite a few p.d. versions out there,
> some of them quite small, some fairly full-featured. Start with one of the
> various Scheme repositories:
FSF just released (GNU) Guile, a version of Scheme designed for embedding
(primarily in software applications, but it should still be realtively
easy to embed it in firmware).
--
Jeffrey B. Siegal
Quiotix Corporation
+1 415 782-6012
http://www.quiotix.com
Then you might want to look at Scheme. Quite a few p.d. versions out there,
some of them quite small, some fairly full-featured. Start with one of the
various Scheme repositories:
http://www.cs.cmu.edu/afs/cs.cmu.edu/project/ai-repository/ai/lang/scheme/0.html
http://www-swiss.ai.mit.edu/scheme-home.html
http://www.cs.indiana.edu/scheme-repository/SRhome.html
Yes, it's a (cleaned-up) dialect of Lisp, but don't let that scare you...
-Rob
-----
Rob Warnock, 7L-551 rp...@sgi.com
Silicon Graphics, Inc. http://reality.sgi.com/rpw3/
2011 N. Shoreline Blvd. Phone: 415-933-1673 FAX: 415-933-0979
Mountain View, CA 94043 PP-ASEL-IA
>
>You could also take a look at a language called LUA. It's also intended
>for embedded applications, but seems more modern than Tcl. For instance,
>it can compile to byte-code, just like Java, resulting in better
>performance (I assume). I recently downloaded the source of botht e
>compiler and interpreter, and I was very positively surprised by its
>quality. It compiled on my Mac without as much as a warning, and ran
>first time! It definitely deserves to be checked out.
>
>Regards,
>Mike
>
What are the memory requirements of LUA?