LTPL - Lambda Text Processing Language
Language DescriptionLTPL is a language used for generic text processing, it relies on three data-types providing a very expressive and simple syntax. The ideia was mainly influenced by Haskell, Latex and AWK.
We have two separete parts: the defition writing language, and the markup language.
Definition writing language, LTPLThe definition writing language is very similar to Haskell. It is yet under alpha testing phase. Some examples follow:
Some improvements needs to be done at the verbatim code output, if you look on the source code of this document you'll see why. This will be made on the comming versions. Not only verbatim needs to be improved, a lot of "under the hood" things needs some improvemt aswell.
Markup Language, LTPMLThe markup language is very much alike LaTeX. Very easy to write and read (but on the verbatim mode... will be fixed soon). Some example follow:
The output of the above text, using the HTML generation library is:
Testing SectionHere we can put some text, or a list, with three elements:
By the way, this whole site was writen in LTPML, the file is available for download.
Machine DescriptionThe machine that interprets the language is a mixture of a graph reduction machine with a finite stack automaton. The representation of the defitions is just like a normal functional program, it is represented by a tree. This tree is then reduced using a stack (not overwriting the tree structure itself), with this implementation is possible, and easy, to call the same functions anytime, without losing the data.
This implementation was needed because the definition writing language is functional, but the markup language follows a imperative/procedural paradigm, so we need to mix the two in order to achieve a correct interpretation.
Download linksTHE PROJECT STILL IN ALPHA!!!!!
Download at your own risk. The code is provided under the GNU General Public License .
NotesSince the project is yet being born, every aspect can change at any time. Every change will be posted here.
|Victor Cacciari Miraldo - e-mail|