msteveb / jimtcl

Official repository of Jim Tcl, an open-source, small footprint implementation of Tcl
http://jim.tcl.tk/
Other
428 stars 121 forks source link
embedded scripting-language small tcl

The Jim Interpreter

A small-footprint implementation of the Tcl programming language.


WHAT IS JIM?

Jim is a small footprint implementation of the Tcl programming language written from scratch. Currently Jim Tcl is very feature complete with an extensive test suite (see the tests directory). There are some Tcl commands and features which are not implemented (and likely never will be), including traces and Tk. However, Jim Tcl offers a number of both Tcl8.5 and Tcl8.6 features ({*}, dict, lassign, tailcall and optional UTF-8 support) and some unique features. These unique features include [lambda] with garbage collection, a general GC/references system, arrays as syntax sugar for [dict]tionaries, object-based I/O and more.

Other common features of the Tcl programming language are present, like the "everything is a string" behaviour, implemented internally as dual ported objects to ensure that the execution time does not reflect the semantic of the language :)


WHEN JIM CAN BE USEFUL?

1) Jim provides the ability to write scriptable applications without needing to link your application with a big system. You can include the Jim source directly in your project and use the Jim API to write the glue code that makes your application scriptable in Jim, with the following advantages:

2) The other "field" where Jim can be useful is obviously embedded systems.

3) We are working to make Jim as feature-complete as possible. Thanks to dynamically loaded extensions it may stay as small as it is today but able to do interesting things for you. So it's possible that in the future Jim will be an option as a general purpose language. But don't worry, there is already the mainstream Tcl implementation for this :).


HOW BIG IS IT?

Jim with the default extensions configured and compiled with -Os is about 130k. Without any extensions, it is about 85k.


HOW FAST IS IT?

Jim is, in most code, faster than Tcl7.6p2 (latest 7.x version), and slower than Tcl 8.4.x. You can expect pretty decent performance for such a little interpreter.

If you want a more precise measure, there is 'bench.tcl' inside this distribution that will run both under Jim and Tcl, so just execute it with both the interpreters and see what you get :)


HOW TO COMPILE

Jim was tested under Linux, FreeBSD, MacosX, eCos, QNX, Windows XP (mingw, MVC).

To compile Jim itself try:

./configure make


EXTENSIONS

Many optional extensions are included. Some are C extensions and others are pure Tcl. Form more information, try:

./configure --help


HOW TO EMBED JIM INTO APPLICATIONS

See the "examples.api" directory


HOW TO WRITE EXTENSIONS FOR JIM

See the extensions shipped with Jim, jim-readline.c, jim-clock.c, glob.tcl and oo.tcl


COPYRIGHT and LICENSE

Unless explicitly stated, all files within Jim repository are released under following license:

/ Jim - A small embeddable Tcl interpreter

"first Jim goal: to vent my need to hack on Tcl."

And actually this is exactly why I started Jim, in the first days of January 2005. After a month of hacking Jim was able to run simple scripts, now, after two months it started to be clear to me that it was not just the next toy to throw away but something that may evolve into a real interpreter. In the same time Pat Thoyts and Clemens Hintze started to contribute code, so that the development of new core commands was faster, and also more people hacking on the same code had as result fixes in the API, C macros, and so on.

Currently we are at the point that the core interpreter is almost finished and it is entering the Beta stage. There is to add some other core command, to do a code review to ensure quality of all the parts and to write documentation.

We already started to work on extensions like OOP, event loop, I/O, networking, regexp. Some extensions are already ready for prime time, like the Sqlite extension and the ANSI I/O.


Thanks to...


Enjoy! Salvatore Sanfilippo 10 Mar 2005