Minimalistic languages: lex/yacc and bytecode is enough

I’m surprised a bit: why minimalistic languages are not considered to be usable?

For example, it is easy at least for learning purposes to use only a very basic toolset such as lex, yacc, and native tiny C compiler to make your own custom microlanguage which you can extend step by step while you are progressing.

But it considered complex to write custom assembly-like languages, and unpopular anywhere including embedded development, where it will be usable to have rigid interpreter core + tiny applets run over the air update (IoT, control, hobby automation).

I would have two notes on this:

  1. Would you need an editor? If this is the case I would go for a Language Workbench, such as Xtext or maybe textX, if you want something more lightweight. The goal is to lower the cost of building the whole language toolset and in my opinion an editor is a big part of it
  2. I would not use Lex & Yacc but ANTLR instead. Some thoughts on this are here: Why you should not use (f)lex, yacc and bison - Strumenta Strumenta

That said I agree there are many applications where minimalistic languages would be really useful. A key to make them more useful is in my opinion to reduce the cost of building them and the skills necessary to maintain them. Support in the long term is something that scares many possible adopters, I think

1 Like

I agree that ANTLR is a far more modern tool for generating parsers.

However, it isn’t the parsing/compilation that is hard nowadays, but the runtime for your little language will likely be as complex if not more so, than the compiler. The higher the level of the language (and the more leverage it provides), the bigger and more complex the runtime. In my Beads language the compiler is 25k lines, and the runtime is 31k.

1 Like