In a Nutshell
* Complete C implementation
* Safe pointers and arrays
* Numerous programmer-friendly facilities
* Lacks wide-character support
|Compiling: All the ways of C-ing with EIC’s setup.|
While the author of EiC does not specify any particular system requirements, Linux Magazine Labs recommends:
* 16 MB minimum
Hard Drive Space
* 1 MB hard drive
* 1ibc6-compatible distribution
Edmond Breen’s EiC (Embeddable/Extensible Interactive C) is an open source program that provides one of the most complete and well-designed language interpreters we’ve ever seen. Supported platforms include Linux, Solaris, IRIX, HP-UX, NetBSD, FreeBSD, and 32-bit Windows. In fact, EiC is so rich in function that only a taste of its capabilities can be presented in this review.
EiC compiles C code into an intermediate bytecode on the fly and then executes it. Unlike Java’s, this two-stage process is completely invisible to the programmer. More interesting is that EiC provides three different ways to run C code: You can run it as a normal C program, as a script file, or in interactive mode. The C program mode is what you would expect — you invoke EiC and pass it the name of the C program to run, along with parameters to pass to the program, and it does so.
The script-file capability is particularly useful for Linux users, since it provides virtually 100 percent compatible C capabilities in a scripting language, as well as CGI compatibility.
The most intriguing option is the interactive mode, which lets you hoist headers into the namespace; define constants, variables, and functions; invoke functions; assign values to variables; and generally turn your Linux system into a C machine.
Boiling the C
We installed EiC from the prebuilt binary for Linux, but it does require setting an environment variable, which makes rolling out EiC across platforms a bit trickier than we wish. We experienced no problems when running both the sample code and our own programs.
We were pleased to see that EiC provides strong support for single- and multidimensional arrays (limited only by memory size), as well as the standard C and POSIX.1 libraries, with only a few features missing. One notable gap is the lack of wide-character support.
One significant architectural difference between C and EiC involves pointers and arrays. All “safe” EiC pointers have three components: the visible address, as well as the upper and lower bounds the pointer can be used to manipulate. These bounds are used to check all memory references at execution time, and they travel with the pointer during assignments. But even this capability can be turned off by declaring a pointer with the unsafe keyword or using
a compiler directive to change the default to unsafe. Similarly, array-bounds violations are caught at execution time.
EiC’s documentation is vast by the standards of most software today, free or otherwise. A 181-page manual is available from the author’s Web site in PostScript or DVI format.
Because of EiC’s depth and flexibility, it’s ideal for multiple purposes. It can run scripts and “real” C programs or it can be used as a learning aid for those who are just getting up to speed with C. Because of its technical strengths and open source nature, it’s not hard at all to imagine EiC garnering enough community support to challenge Java as a client-side tool under Linux.