Made my day that it references an article I wrote! :-D
Another thing that is kinda neat: there is a duality (a bidirectional transform) between the AST for a tree walking interpreter and the AST for a stack machine. To create the stack machine AST, all you do is remove any occurrence of the expression type in the tree-walking AST; these values are now found on the stack. Obvious when you think about it, but useful nonetheless. I don't think there is a simple equivalent for a register machine as, unless you have an infinite number of registers, you need to do register allocation.
(If the author reads this, my name changed from Noel to Neal at some point. I don't really mind though; my name is a bit unusual and I've been called all sorts of things.)
It'd be cool if you could add some syntax highlighting, because being at it is, it's hard to distinguish comments from code paths. The code snippets are just Scala anyway, aren't they?
Why, in the switch dispatch- and the subroutine threading-variants, is the recursive call in the dispatch function done with a call to loop(...)? Is that some Scala specific thing for recursion?
It's not that bad... But it is bad. It looks cool, and I managed to read the first few paragraphs. But when the code scrolled into view, it stopped looking cool and became an eye-destroying disaster.
YMMV, but OP, if you read this, please consider disabling the text-shadow for code snippets... or disabling syntax highlighting in code snippets. These two things are not a good thing together.
I think they could get a close-enough effect by removing the horizontal lines on the text glyphs themselves. This would still keep the colorscheme and slight glow, but drastically improve readability.
Then, with all due respect, you should not be anywhere near the design or evaluation of accessible systems.
There's people reading this blog with all types of devices, screens, lighting and range of visual acuity. Even if you're blessed with perfect vision and excellent displays, it should be obvious that readability has been lowered for no obvious reason.
The point of a blog is for people to read it, so it fails at its foremost job.
I wasn't saying that I thought it should be adopted as a standard for others to follow - just that (somewhat weirdly) I personally find the code segments on that page quite easy to read.
There is a time and place for text and retro-CRT effects, this isn't one.
Another thing that is kinda neat: there is a duality (a bidirectional transform) between the AST for a tree walking interpreter and the AST for a stack machine. To create the stack machine AST, all you do is remove any occurrence of the expression type in the tree-walking AST; these values are now found on the stack. Obvious when you think about it, but useful nonetheless. I don't think there is a simple equivalent for a register machine as, unless you have an infinite number of registers, you need to do register allocation.
(If the author reads this, my name changed from Noel to Neal at some point. I don't really mind though; my name is a bit unusual and I've been called all sorts of things.)
If I may leave some feedback here...
It'd be cool if you could add some syntax highlighting, because being at it is, it's hard to distinguish comments from code paths. The code snippets are just Scala anyway, aren't they?
Why, in the switch dispatch- and the subroutine threading-variants, is the recursive call in the dispatch function done with a call to loop(...)? Is that some Scala specific thing for recursion?
[0]: https://noelwelsh.com/posts/understanding-vm-dispatch/
YMMV, but OP, if you read this, please consider disabling the text-shadow for code snippets... or disabling syntax highlighting in code snippets. These two things are not a good thing together.
There's people reading this blog with all types of devices, screens, lighting and range of visual acuity. Even if you're blessed with perfect vision and excellent displays, it should be obvious that readability has been lowered for no obvious reason.
The point of a blog is for people to read it, so it fails at its foremost job.