In Designing a Programming Language for Funsies (Part 1), I talked about going extreme. Well, my goal is to make the core of the language so small and stupid-easy to implement, and there can be a whole standard library or whatever that's written in the language itself so that it's as portable as possible. I'm gonna walk you through my thought process.
We start with the basic premise of the language. At any given step in the computation, you have a "frame". A frame contains the following information:
The premise of this language is to have first-class frame-manipulation. This comes in the form of what I call xframes (or transframes for long -- since it transforms a frame -- a portmanteau -- it's clever -- get it?).
Let's talk about types. It'd be cool if types could be defined independently of the evaluation apparatus above. All that's really needed is for a type to be able to specify how it should be evaluated. Almost like each type is a "plugin" to the language itself. Most types (like numbers or strings) just store data and don't actually need to be evaluated. The ones that matter are going to be types like an expression, or a symbol. I'm yet undecided on whether the unevaluatable things should all evaluate to an "error" type if they ever end up trying to be directly evaluated, or whether they should evaluate to themselves.
We'll also want types themselves to be first-class, but we'll worry about that later.
Regardless, where we end up following that line of thought, is that types carry the data of how they should be evaluated. So, roughly speaking, the language in which we're implementating our language will represent a type as an object with an "eval" function. The evaluation apparatus then will call the evaluand's type's eval function on the current frame, and output a new frame, which will then be the next frame to be evaluated. And that's the whole of the evaluation apparatus!
Next time, I'll give some sample code.