The 2E Programming Language

Getting Started

Jan 12, 2009 -- Version 0.9 released

This version has been sitting in SVN for a while. Was planning on adding a few more features to it, but at this point the core language is in its final form. The two major revisions that you will see between this and the previous release are:
  1. Function arguments and array elements are now delimited by a comma instead of a semi colon. This way, the code more closely resembles C's syntax, and also makes the code more readable.
  2. Function definitions are officially first class values. Previously, a function definition kind of just hung out there. But now, the function definition returns a value refering to the function. So you can do things like
    foo = @myfunc(some code here)
    . This also means that when you define a function, the entire function is treated as an operand, so you will need to make sure you have proper operators around it (in practice, this means something like
    some code; more code; @myfunc(function contents)
    You can also have anonymous functions, just dont specify a function name:
    foo = @(function contents)
    Very handy for creating functions on the fly to place in an array or as arguments to another function.
Another major change is in the internal strucute of the interpreter. The sample Mandelbrot fractal generator, for example, runs at about the same speed as an equivilant version under Perl.

Dec 26, 2006 -- Another new release, version 0.8.2

The next version of the 2e interpreter, ee-0.8.2.tar.gz, is now available. This release includes several new functions which should round out the string handling capabilities of the language. New functions include printf, sprintf, fprintf; strcpy; strcat; strins [string insert]; strcmp; strmatch [regular expression matching]; argnames [which allows position independant arguments to be passed to functions]. The reference secion has been updated with the new functions. Also added are bitwise operators, for performing a binary AND, OR, Invert, shift left, and shift right. The operators used are the same as the C operators for these functions (&; |; ~; <<; >>).

Dec 10, 2006 -- New release, version 0.8.1

New release, 0.8.1, uploaded. This has a number of changes:
* Several new functions have been added, such as readline(), sleep(), getenv(), and split().
* Added portability code so that it compiles cleanly on win32 platforms (tested with mingw under cygwin, with the -mno-cygwin flag). Includes a Makefile.win32
* Added support for processing command line arguments. They are accessed in the same way you would grab function arguments.
You can download it from Sourceforge here

Dec 2, 2006 -- Web site mostly functional

Got a few more reference items and examples to throw on the web site, but it has a more complete tutorial section at least. Next task will be to expand the built in function library, and document it a bit more.

Nov 25, 2006 -- Initial release of 2e, version 0.8

The initial public release of the ee interpreter for the 2e language is available for download. 2e (the two e's refer to "expression evaluator") is an experiment in creating a language that has a minimal learning curve, but has enough functionality to be generally useful. The syntax is composed of operands and operators, function calls, and function definitions. Operands can be literal values (integer / decimal, characters and character strings), variables, and variable arrays. Operators include the standard algebraic operators (+ - / *), comparison, assignment, etc., plus the addition of special purpose operators including sub-expression delimiter ";", an inline conditional similar to C "expr ? expr2 : expr3", plus the addition of an iterative conditional "expr ?? expr2 : expr3" which functions similar to the conditional, but will evaluate expr2 while expr is true. No other flow control is included, since these are sufficient for both inline and general use.

Overall, the language should be fairly easy to master, and the interpreter is designed to be used standalone or imbedded within another application.

License is GNU GPL version 2.