LDef introduction

Creating your own programming languages is hard work. In fact most developers never get involved in such tasks due to the complexity and time-consuming nature of compilers.

02237439ec5958f6ec7362f726a94696-cogwheels-red-circle-icon-by-vexelsLDef, short for language definition file format, is a system for making programming languages. It takes the complexity out of the picture by giving you a complete assembler, linker and established runtime out of the box. A system that you can integrate in both C++ and Delphi.

LDef shares some of the architectural aspects of .net, in that you have an established infrastructure at the bottom, followed by layers of languages on top. Regardless of the language – they all resolve to bytecodes and they all run on the virtual machine.

The assembler accepts a code-format which is essentially C/C++. The difference on this level is that there is no run-time library. The C language is there to provide easy, readable structure for what is ultimately an object-oriented, garbage collected execution model.


C/C++ provides form for the assembly code

The thing that is exciting about LDef is its promise: a language definition format. Namely that you will be able to design a programming language as a single file. When you feed this file to the pre-processor, it learns the language and will then be able to compile whatever source-code you send its way.

Making language adaptation fun

There is nothing like LDef on the market. You have systems that are somewhat similar, or “parser makers” (Gold parser is an example) for example; these are hard to use language analysis programs, that based on a cryptic and equally hard to define file – builds a parser and “language dictionary” for you.

There are also compiler makers, where you feed a series of source-code files and the system figures out the commonalities. Based on this it generates a compiler stub. A stub where you have to write the actual code generator.

None of these options offer you an established runtime environment, a program model or ways to define unique features of your language,

The goal of LDef is to overcome this and offer something new. Something that is small, fast, requires little resources and best of all – a system that is portable and runs on all systems supported by gcc/fpc.