Looking for resources on interpreter design

Rémy Mouëza remy.moueza at gmail.com
Sat Jun 8 23:57:51 UTC 2019


On Thursday, 6 June 2019 at 19:38:25 UTC, solidstate1991 wrote:
> I decided to make my college thesis on creating a BASIC 
> interpreter in D for scripting, command line, and other 
> purposes. However, I have an issue with finding resources, 
> meaning that I couldn't work on it yet since I cannot cite 
> anything.
>
> Can anyone help me? It doesn't need to be for D since I 
> understand many other programming languages (and I bet there's 
> a massive lack of literature about D), but I do have budget 
> restrictions, so I cannot buy expensive books. Also I would 
> like to have something also on BASIC.

I have collected a few links I liked about interpreters.

This tutorial explains how to build a lisp in Javascript. The 
author first uses
a simple approach and then revisit in several passes to optimize 
or make some
construct possible (like continuations and exceptions):
http://lisperator.net/pltut/

This paper explains how to build an interpreter using closures. 
This is a
trade-off between the simplicity of an AST based interpreter and 
performance
close to "threaded" code (the program are made of successif call 
to native
library functions):
http://www.iro.umontreal.ca/~feeley/papers/FeeleyLapalmeCL87.pdf

This article is a simple explanation of the fundamental 
principles of a
bytecode interpreter / virtual machine:
https://bernsteinbear.com/blog/bytecode-interpreters/

 From the same author of https://craftinginterpreters.com/:
- An article about inventing a precise garbage collector:
   
http://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/

- The Wren language. Its source code is highly readable, of a 
reasonable size
   and with good explanations on what's going on:
   https://github.com/wren-lang/wren

This articles describe a CESK machine, in a mathematical way. 
There is a link
to some working Racket code at the end. The bottom of the page 
contains links
to subject related to programming language implementation methods:
http://matt.might.net/articles/cesk-machines/

Half of those links are using a variant lisp, as its simplicity 
can help
describe concepts in a concise form. The principles can then be 
applied in
another programming language.


More information about the Digitalmars-d mailing list