1.7 KiB
IBAFlang (Imperative But Also Functional language)
This repo contains the language definition for IBAF, a language defined in the CBS meta-language. CBS's component-based approach allowed me to define this language with relative ease and generate an editor for syntax highlighting. I highly recommend checking out the project at this URL.
As you may realise from reading the language definition, the language for now is more I than F. That's why this is just version 0.1 of IBAF. If you're interested in seeing how a more complex language can be defined, I recommend taking a look at the language definitions for MiniJava or OCaml-Light.
Project structure
In the repo there are three projects that can be opened in Spoofax
IBAF-cbsis the project that contains the source.cbsfiles that defines the language.IBAF-Editoris the Spoofax project that can be used to build the IDE for IBAF.IBAF-Testsis a project containing some example programs and the funcon terms they compile to.
To actually compile the language yourself you will need to set up the CBS workbench locally. You can find out more on the CBS-IDE page
Some relevant papers:
- CBS introduction: Software meta-language engineering and CBS
- In-depth look at funcons: Fundamental Constructs in Programming Languages
- In-depth look at the CBS workbench/editor: A Component-Based Formal Language Workbench