The LDPL Community has compiled this document with the desire to teach and standardize the LDPL programming language. This document contains the specification for the LDPL programming language, as well as explanations, instructions and examples for every feature included in it.
Feedback, corrections and suggestions are welcome, both on the main LDPL repository or by e-mail to firstname.lastname@example.org. You can join the LDPL community at r/ldpl or via IRC on irc.freenode.net channel #ldpl.
The source code for this documentation is available in the LDPL repository.
LDPL is a powerful compiled programming language designed from the ground up to be expressive, readable, fast and easy to learn. It mimics plain English, in the likeness of the good parts of older programming languages like COBOL, with the desire that it can be understood by anybody. LDPL was designed to run on Unix systems, including AMD-64 Linux, macOS, ARMv8 Linux, Android Termux and both Intel and PowerPC OS X (tested from Tiger 10.4 onwards). It even supports UTF-8 out of the box.
1 2 3 4 5 6 7 8 9
LDPL also aims to suppress unreadable code and redundancy by only having one way of doing anything. What a command does should never overlap with the purpose of another command and, as such, every LDPL command does one and only one thing. Every line is a step further towards the completion of an algorithm, no more, no less.
The LDPL Compiler
To use LDPL, you should first download or compile the LDPL compiler. For more information on how to do that, read the How to install LDPL section on the LDPL Readme.
To use the compiler, you must have a C++ compiler already installed on your
system and have mapped it to
c++, found on your PATH. The LDPL Compiler
compiles LDPL code to C++ code and thus this is a requirement for it to work.
Once the compiler is set up, go write some LDPL source code, say
Then compile the source code using
ldpl source.ldpl. The compiled, executable
binary file will be saved as
To use the LDPL compiler, the syntax is as follows:
1 2 3
-f flag can be used to pass extra options to the
c++ compiler when. For
-f=-lSDL could be used to link against SDL. The
flag statement can
also be used as well (
flag "-lSDL") and its use is recommended. More on this
-r you can just compile your project and print the C++ representation
for that code.
You can set the filename for the compiled binary with the
-o flag. For
example, if you want to name your program "dog", you could compile it with
ldpl -o=dog main.ldpl.
On Linux platforms, LDPL builds static binaries by default. If you want to
build non-static ones use the
-c flag tells LDPL to accept source code from the standard input.
You can import extra files and extensions to your LDPL compilation by using the
-i= flag. Extensions can be imported by passing
to this flag; see the Extensions section for more information. The use of the
INCLUDE statement is preferred.
--version print out version info and release details.
--help print this list of options.
The preferred file extension for LDPL source files is '.ldpl'. The extension '.lsc' (LDPL Source File) should also be accepted in case the preferred extension couldn't be used for any reason.
File extensions are important: they help editors to recognize what language your source code is written in and they tell the LDPL compiler how to treat your files.
This LDPL Compiler is distributed under the Apache 2.0 License. All LDPL Dinosaur logos were created by Lartu and are released under a Creative Commons Attribution 4.0 International (CC BY 4.0) license. This documentation is released under the Apache 2.0 License.