The Jim Interpreter 0.51 review

by on

Jim is an opensource small footprint implementation of the Tcl programming language

License: The Apache License 2.0
File size: 0K
Developer: antirez
0 stars award from

Jim is an opensource small footprint implementation of the Tcl programming language. It implements a large subset of Tcl and adds new features like references with garbage collection, closures, built-in Object Oriented Programming system, Functional Programming commands, First class arrays. All this with a binary size of 70kb (that can be reduced further excluding some command).

Jim is currently a work in progress, but most of the core language is already implemented and it is possible to use it to run many unmodified Tcl programs, so if you want to start to evaluate it, or want to look at our internal design and virtual machine, go to the download section.

Jim's goal is to provide a powerful language implemented in roughly 10k lines of code that is presented as a single C file and an header file, in order to allow developers to put Jim inside their applications, as scripting language, configuration file syntax, without to depend on external libraries or other big systems.

We belive scripting is a very interesting feature for many applications, but developers are often not encouraged to link the application to a big external system. Jim try to address this problem providing a very simple to understand and small footprint implementation of a language that is ideal for scripting, and at the same time is powerful and able to scale.

Another field where Jim may help is the one of Embedded Systems. Jim is written in ANSI-C, is very little both in binary size and memory requirements, and the Tcl language is just ideal for this tasks (For example, CISCO routers are using Tcl).

Here are some key features of "The Jim Interpreter":
Support for important features that will be availabe in Tcl8.5, like dict and {expand}.
Arrays in Jim aren't collection of variables like in Tcl, but a first class type. Array access syntax is in Jim syntax sugar to set and get dictionaries elements.
A compact design. Jim is currently less than 10k lines of code. It does a heavy use of dual ported objects, in Jim even the VM pseudo-bytecode is a specialized Jim_Obj type.
lambda with garbage collection, and a reference system to build linked data structures.
closures, Jim's procedures can have persistent procedure-specific variables (called statics). Statics initialization value can be caputred form the procedure creation context, so it is very similar to lexical scoping to use. This is how The Paul Graham's accumulator procedure looks like in Jim:

proc accumulator n {
lambda increment n {
set n [+ $n $increment]

Math operations as commands (together with expr support).
Ability to load extensions at runtime via a STUB system. Even programs using Jim that are linked statically are able to load extensions.
70Kbyte binary size!.

The Jim Interpreter 0.51 keywords