https://www.reddit.com/r/ProgrammingLanguages/comments/81wkg...
I didn't know about it when I did the initial work for OPy in 2017 though.
I find the "expression-based" style quite interesting and I suspect it will help me understand the "compiler2" code better. I plan to look at it in more detail as I'm optimizing Oil.
This post links to a few posts that mention "byterun". These two pieces of work are probably what pushed me over the edge to apply to Recurse Center! I'm going from May-August this year. I'd love to connect with anyone interested in this kind of thing (e-mail in my profile)
-----
And if you have any advice on how to compile Python to more optimized code, I'm interested. I assume this will involve creating some new VM instructions (i.e. it can't just be done with the bytecode compiler)
This is a very concrete task -- the OSH parser is around 5,000 lines of code that would be very annoying to port to another language. Essentially, it's 3 interleaved recursive descent parsers and a Pratt parser.
I already have benchmarks that show it's 40-50x too slow:
http://www.oilshell.org/release/0.5.alpha2/benchmarks.wwz/os...
Leaving aside the rest of the shell (which is not big either), I think it's an interesting question if you can recover that factor of 40-50 without rewriting the code. It's written in a pretty "static" style without much dynamism. You don't need any special language features in a recursive descent parser.
I already did something like this. I wrote a whole bunch of Python regular expressions for the lexer, then compiled it to C code via re2c:
When are Lexer Modes Useful? http://www.oilshell.org/blog/2017/12/17.html
re2c code: http://www.oilshell.org/blog/2017/12/files/osh-lex.re2c.h.ht...
(And to anticipate a question from passers by: it does not make sense to use a parser generator here -- I wrote about this extensively on the blog, e.g. http://www.oilshell.org/blog/tags.html?tag=parsing#parsing)