morganstanley / hobbes

A language and an embedded JIT compiler
http://hobbes.readthedocs.io/
Apache License 2.0
1.17k stars 106 forks source link

hexpr.parse.H appears twice in the codebase, and the wrong one is used #326

Closed adam-antonik closed 4 years ago

adam-antonik commented 4 years ago

lib/hobbes/read/pgen/pgen.sh generates lib/hobbes/read/pgen/hexpr.parse.H, but hexpr.y includes include/hobbes/read/pgen/hexpr.parse.H instead (which lags behind the lib/ version in terms of git commit). Should pgen.sh not move the header to the include directory and the copy version in lib/ be deleted?

kthielen commented 4 years ago

Stupid oversight, made the fix here: https://github.com/Morgan-Stanley/hobbes/pull/327

I think that the parser could use some renovation -- it started off as this flex/bison parser, but eventually syntax was added to hobbes to natively support definition of LALR parsers. If we just "crossed the streams" then we could reuse the same parser generator code we already use there, and also support a kind of modular syntax. This is somewhat controversial, not everyone believes that modular syntax is a good idea.

Several years back, I made a prototype in this project (https://github.com/kthielen/ww -- ignore the Walt Whitman stuff, it's an inside joke). I think that it could be useful to reboot the parser this way, but it's probably best to develop consensus first.

I'll close this issue once the fix PR is merged.

kthielen commented 4 years ago

Fix merged