|
|
|
|
|
by sklogic
3833 days ago
|
|
Writing an interpreter is much, much harder than implementing a simple, straightforward compiler. Interpreter is unavoidably convoluted, it is full of very complex things like environment handling, it cannot be split into smaller parts in any sane way. Compiler, on the other hand, is nothing but a trivial sequence of very simple tranforms (as simple as you like), each is nothing but a couple of term rewriting rules. You do not need a Turing-complete language to implement a compiler. |
|
""" How make a REPL, a debugger, how implement pattern matching, type checking, if a interpreter can be fast enough, if possible to avoid to do a whole VM for it, etc... """
REPL, debugger, no-VM and other stuff look easier with interpreters than compilers.
However, I will be happy to be wrong: I wanna the simplest way to get where I want to.
Currently: Working with F#, wanna REPL, debugger, AGDTs, pattern-matching, go-like concurrency, iterators, semi-functional...
Where I hit a big block is how do interop with a interpreter (ie: Call .NET methods) and that look easier with a compiler...