3 ms·
A simple ES3 interpreter is pretty easy, particularly if you just go for 'the good parts' (plus basic global objects). I can highly recommend mpc[1] if you do,
by PeCaN 11y ago
A simple ES3 interpreter is pretty easy, particularly if you just go for 'the good parts' (plus basic global objects).
I can highly recommend mpc[1] if you do, it's a really amazing library for parser combinators in C. I was never much of a fan of yacc/lex (perhaps out of my ignorance of BNF). With yacc/lex I always felt like I had to have my grammar all planned out (which if you implement JS I suppose isn't a problem) before I could start developing and it was very hard to work incrementally. mpc is very flexible and since it's just a C library I find it a lot easier to iterate with.
1: https://github.com/orangeduck/mpc https://github.com/orangeduck/mpc