What does HackerNews think of grammars-v4?
Grammars written for ANTLR v4; expectation that the grammars are free of actions.
https://github.com/antlr/grammars-v4
There is everything from assembly and C++ to glsl and scripting languages, arithmetic, games, and other weird formats like freedesktop shortcuts, llvm ir or verilog.
A relevant PR:
https://github.com/ggerganov/llama.cpp/pull/1773
The plan is to support arbitrary grammar files to constrain token generation, similar to the grammar files here:
Many of them are incomplete, but it gives a good idea of how the grammar looks for ANTLR.
I used the ANTLR grammar for parsing CSS in DiffLens (https://github.com/marketplace/difflens). DiffLens uses the typescript compiler itself to parse TS and JS.
I've also used Roslyn to parse C# (and F#). I wonder if the ruby compiler itself exposes a parser.
I think hush is going in the wrong direction. The majority of shell automation is associated with running IaC and container images / orchestration tools.
Shell scripts don't need to follow functional programming or OOP. They need to be container-oriented / VM-oriented / image-oriented with a conformation to YAML notation as this is already the adopted norm for containers and IaC.
We are almost there with ANTLR grammars... https://github.com/antlr/grammars-v4