Small embeddable and OSI compliant language?

Hi everybody.

This may be slightly off topic - I am looking for an embeddable script interpreter or VM. If you know of any more appropriate groups to post to, please let me know. It should have the following features:

- Stand alone interpreter (or VM) should have very small memory footprint (less than 500k on Windows). - Reasonably high level programming language (on par with python/Java/ Ruby). - Available on all Windows platforms since Windows 98 as well as Linux and Mac OS X. - Must be available under an Open Source license. - Actively developed by well established community or organization. - A reasonable number of extra modules available. - Must be possible to deploy stand alone applications written in the language without requiring cumbersome install processes. - A small "Hello world" program including interpreter (or VM) and nessecary libraries for deployment should take up no more than approximately 500k.

Things that would be nice to have:

- Bindings to GTK, TK or other cross platform GUI library. - POSIX sockets. - Some kind of IDE. Eclipse/Visual Studio integration would be best.

So far, my best take is Lua. I had a look at Caml Light, but it looks somewhat academic and outdated. Most larger script languages (such as perl, python) has all of the features above, except that the final payload quickly reaches 2M which is too large.

Regards,

Michael.

Reply to
Michael Zedeler
Loading thread data ...

Half a Meg heh? Gee, that is small.

Wow - you are not asking for much then.

Did you take a look at Pawn? It might do some of what you want, but definitely not all. I'm not to familiar with it myself but you didn't mention it as one of the options you had investigated so it might be worth a look. I know people use it with FreeRTOS.org.

formatting link

--
Regards,
Richard.

+ http://www.FreeRTOS.org
13 official architecture ports, 1000 downloads per week.

+ http://www.SafeRTOS.com
Certified by TÜV as meeting the requirements for safety related systems.
Reply to
FreeRTOS.org

Lua might be what you are looking for. From the site

formatting link

What is Lua? ------------

Lua is a powerful, fast, light-weight, embeddable scripting language. Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.

Lua is written in almost 100% ansi C, and thus runs on about every piece of hardware with a few hunderd Kb of ram.

Those are all available, although not in the base lua install. You'll need 3d party libraries for that.

Oops, so you found Lua already. Note to self: first read, then type.

Is there any reason why Lua can't do the job for you?

--
:wq
^X^Cy^K^X^C^C^C^C
Reply to
Ico

Sounds like this is not for an embedded microcontroller or processor, but rather for a PC application, right?

Lua and Pawn are terrific choices, bur rhere are many choices when it comes to a PC running Windows. It depends on what you feel comfortable with, and what is most likely to fit with your implementation language (probably C?). The target language of Pawn is more like C, and Lua is more like BASIC, but both are implemented in C. Of course, you can use a real Basic interpreter if you want.

Eric

Reply to
Eric

Personally I'd recommend Tcl. This is what it was originally designed to do and has been highly successful in the CAD/CAM market.

On-disk footprint on windows is roughly 500k though RAM footprint is

1.5M. If low memory is really important you could look at older interpreters especially in the Tcl7 family. I've seen one running with only around 500-600k of RAM. All Cisco routers have Tcl7 installed instead of the current Tcl8 probably due to low memory footprint requirements.

Tcl fits the bill.

Tcl runs on IBM mainframes and AS/400s, Windows NT, 95, 98, ME, XP, Windows/CE, OS/2, Novell Netware, Cray supercomputers, Digital's VMS, Tandem Guardian, HP MPE/ix, Mac OS, and all flavours of Unix, as well as dozens of smaller operating systems like Acorn RISCOS, Amiga and Atari ST.

BSD license.

In addition by being actively developed by the Tcl Core Team, Tcl is also actively supported by ActiveState.

Depends on what "reasonable" means. Tcl certainly has more third party extensions/modules out there than Lua but not nearly as much as Perl.

Google "freewrap" and "starpack". They basically append your script to the end of an interpreter's executable.

As I've said, the on-disk footprint of Tcl (as a dll) is roughly 500k. The interpreter executable is around 20k. I'd expect a statically linked interpreter to therefore be around 550-600k.

Tcl is the natural choice for Tk. Though Tk adds around 500k to both memory and on-disk footprint. It should be noted that most languages that binds to Tk does it by first binding to Tcl. This is because the default Tk distribution uses Tcl heavily for startup scripts. Indeed experience from Perl shows us that Tk when used with Tcl can lead to much *smaller* memory footprint than Tk without Tcl (this may seem counter-intuitive but that's what happened). So if you decide to use Tk with another scripting language like Lua or Perl you'll actually end up running *two* interpreters -- the scripting interpreter you're using and Tcl running in the background servicing Tk. So I'd suggest cutting out the third wheel and use Tcl/Tk directly.

Only TCP/IP. There is an extension that supports UDP/IP but I don't know of any extension that supports the full family (Unix domain sockets, raw sockets etc..).

Eclipse has Tcl support. Though I'd strongly suggest checking out ActiveState's Komodo IDE (the Komodo editor is free but the full fledged IDE costs $$).

I typically deploy my code by "freewrapping" them into a single executable. Freewrap IS quite heavy at 1.2M (this includes Tk by the way) but bear in mind that freewrap also statically links the dde, registry, zlib/zvfs and winico (for icon manipulations under windows) extensions. If I need to distribute on floppies (yes, clients do still use them) I use older versions of freewrap which comes in under 1M.

Reply to
slebetman

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.