DEV Community

Discussion on: Sadly, I must say goodbye to Leaf (my programming language)

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

I got into languages from many different approaches. Doing a full language stack is a lot of work, fortunately there are many things you can do before that.

  1. Build a simple grammar at first using something like XML or YAML that have existing parsers. It won't be as pretty as you want, but it'll skip the parsing stage.
  2. Create an interpreter instead of a compiler. This is a giant switch statement that reads in the commands and executes them rather than producing a standalone program.

That combination would let you have a minimal toy language working within a day. I've used that combination many times before on DSL's. One time I added an M4 macro layer on top to create a custom syntax.