Downloads | Language | Toolchain | Rationale | Documents |
Lichen is both a Python-like language and a toolchain for that language.
Some objectives:
Despite building on a long history of experimentation, Lichen still requires some work to be done for it to be more widely usable.
The Lichen language foregoes various dynamic aspects of Python to provide a foundation upon which more predictable programs can be built, while preserving essential functionality to make the core of the language seem very much "like Python" (thus yielding the name "Lichen"). The general syntax is largely identical to Python, with only certain syntactic constructs being deliberately unsupported, largely because the associated features are not desired.
The Lichen toolchain employs existing tokeniser and parser software to obtain an abstract syntax tree which is then inspected to provide data to support deductions about the structure and nature of a given program. With the information obtained from these processes, a program is then constructed, consisting of a number of source files in the target compilation language (which is currently the C programming language). This generated program may be compiled and run, hopefully producing the results intended by the source program's authors.
Lichen source files use the .py suffix since the language syntax is superficially compatible with Python, allowing text editors to provide highlighting and editing support for Lichen programs without the need to reconfigure such tools. However, an alternative, recommended suffix is likely to be introduced in future.
By employing a refined language design, Lichen aims to let each program define its structure conveniently, be readily inspected, and thus support deductions about the use of the program's objects by the code. The result should be more predictable programs that can be translated to other, more efficient, representations. The Lichen toolchain should be able to tell the programmer useful things about their programs that it may also be able to make use of itself. It not only aims to report information about programs that might be of interest to the developer, but it seeks to produce functioning, translated programs that can actually be run.