archives

Question on categorizing a language

I would like to solicit some opinions from the community on a language concept I've been working on. I'm not sure what category to describe it as. The language is called 2e -- two e's, as in expression evaluator -- and for the most part, that is exactly what it does, evaluate an expression.

Other than the syntax used for defining functions, the whole program is one large single expression, composed of operators and operands. What looks like a statement delimiter (the ";" operator) is actually similar to the comma operator in C; it is a "join", where the expression on both sides of the operator are evaluated, and the left side result is thrown away and the right hand expression result is returned. This is why I assert that the whole program (minus function definitions) is one single expression.

Conditionals are handled via a C style inline-conditional and "while" loops are done with an iterative variant of the inline-conditional syntax, so that complex code segments can be part of a larger expression. There are no other flow control constructs (other than function calls).

On the surface, it looks like a procedural language, but it doesn't execute a sequence of steps, instead it evaluates one expression. Also, functions are recursive, and you can pass functions as arguments to other functions. These two items combined make it almost fit the requirements for a functional language. However, it includes a standard assignment operator that is used to change state of variables (the assignment operator can logically appear anywhere in an expression, just like C), so that seems to exclude it from the functional category (although there is no reason you can't program in a functional style).

So my main question is, what type of language is this, functional or procedural? Or some other type that I haven't studied? My second question is if anyone would find this language useful for any projects or research purposes. The main appeals of the language is an algebraically "clean" syntax and a rather simple easy to understand interpreter. The parser was done by hand using classical algorithms, instead of using lexx / yacc, and the interpreter is provided in the form of a library that can be imbedded into other applications. I've got some clean up to do on the code to make it usable for study (there's been some performance modifications added that end up making it harder to read; I've got plans to fix that), and more documentation is needed. I've seen mention on this site of plans that others have for creating experimental languages, feel free to grab any techniques or code that you want.

The site for 2e is lang2e.sourceforge.net, where there is some documentation and code samples, but I can post some specifics that highlight various language aspects if that helps.

Thanks.