5 comments

[ 2.9 ms ] story [ 21.4 ms ] thread
Hi guys, this is the follow up post of a new series I introduced 2 days ago: A Beginner's Guide to Programming Language Implementation. Today we'll be setting up our development environment, and get started with the actual programming next week.
Damm, in php ;)

But still great. I'm in the same boat (to build a language) and this is a bit closer to it (I will add -hopefully- pattern matching, union types, a relational algebra).

Suggestions (I have read now dozens of things like this):

- Something that is not made clear with interpreters is: I need a garbage collector? What happened with memory?

- I haven't see how manage imports/modules. Look like all the toy interpreters are for run everything at once.

- Any hint in how improve error messages at parsing, if possible.. That depend in what use to parse it..

- Know how do math is nice, but I have wonder, what are the minimun necessary of functions to lift from the host language to make possible to build the standard library from INSIDE the interpreter? So, print is built-in, but maybe map and list?

- I see the introductory post, and think could be nice to support at least List/Arrays (ie a container of things).

- The interpreter code I have seen, in the AST processing have the tendency of be hard to read (with single letters vars and things like that), so consider that too.

Looking forward to your series!

I had a feeling that people would pick at the choice of PHP as an implementation language, but hey, that's part of the game ;)

The code structure will be exactly the same as if I had implemented it in C# or Ruby, so not following the tutorial simply because it's PHP is not a very good reason IMHO.

I will be completely honest with you, some things your asked for are beyond my current knowledge. I began to think about how the standard library could be implemented, but not experimented with this yet. Fortunately, it will be a long time before we get to that point in the series, and I will have figured out how to do it ;) Same thing for modules and imports.

Don't worry about the code, I will try my best to make everything as clear as possible.

Your input is greatly appriated, don't hesitate to give me feedback like this all along the way :)

Looks interesting.

Do you already have a working implementation and if so can we see it?

I wouldn't want to spoil it for you ;)