The LX Programming Language
Christophe de Dinechin
Version 1.9 (updated 2002/04/12 02:11:37)
LX is a general purpose compiled programming language, like C, C++, Pascal, Ada or Eiffel. Although LX borrowed a lot from these respected ancestors and many others, trying to incrementally improve over each of them, LX still differs from all these other languages in three important ways:
A few examples of LX code (most of them won't compile as is with the compiler today):
LX has many interesting built-in features. But what makes it really special is the way you can add or change these features. In LX, almost anything can be modified, extended and adapted to suit the needs, from types (integer, arrays, pointers), to runtime behaviors (dynamic dispatch, memory management), to semantics rules (what does X.Y mean?). This extensibility gives the LX programmer seamless access to all programming paradigms out there: object-oriented, functional, declarative, aspect-oriented, etc. In addition, LX can also integrate application-specific concepts in the same convenient manner: symbolic derivative, tasking, customized optimizations, integration with other object models (COM, Corba, .NET), and more...
All this is made possible mostly thanks to an "escape mechanism" called LX pragmas. Pragmas are used to transfer control to extensions outside of the compiler, which can then perform nearly arbitrary tasks on the program being compiled. Since the pragma notation is easy to identify, the impact of well-written extensions is both easy to spot and easy to understand. LX syntax is specifically designed to be robust enough to support nearly arbitrary semantic extensions in a comfortable, readable and maintainable way. This is one reason why LX could not easily be based on any previous language. Some languages such as C++ are already so complex that trying to extend them further would bring them to a point of rupture. Others such as Lisp, have much more flexible semantics, but at the price of a rigid and unnatural syntax.
For more detail, read the Why LX? discussion and the LX Frequently Asked Questions...
Additional objectives in designing a new language, besides implementing and supporting Concept Programming, included:
For these reasons in particular, LX built-in features compare well with existing programming languages.