eclipse-langium / langium

Next-gen language engineering / DSL framework
https://langium.org/
MIT License
754 stars 68 forks source link

Request for example: Please add a language example #587

Closed rishavs closed 2 years ago

rishavs commented 2 years ago

I am very interested in trying out langium and have done the basic tutorial in the web site. However, I am not able to make much progress due to the lack of actual language examples to refer to. I understand that langium is fairly new but having a few simple languages in the examples repository would make it a lot easier for people to try out langium.

The languages that i feel are simple enough, and yet show much of how to go about designing frontends, would be;

  1. Lua
  2. Lox
  3. c99

Lox would be the best example to start with IMO, as there is substantial documentation in the Crafting interpreters books about the language design and details which a lot of frontend devs would likely have gone through.

Later on, the following more advanced examples would also be great to have

  1. Monkey
  2. ES5
  3. Lisp-like language
  4. Python like whitespace based language
msujew commented 2 years ago

Hi @rishavs, glad to hear you're interested in using Langium :)

We try to keep the examples in the repo relatively simple, but I've went ahead and created a new langium-lox repo that contains a basic implementation of the language. It doesn't have any validation/interpreter functionality yet, and classes are also missing, but everything else should be working. Take a look and try it out if you like.

rishavs commented 2 years ago

Thank you @msujew !!