Crafting Interpreters by Bob Nystrom (Github)
Let's Build a Simple Interpreter: Up to 19 parts up through 2020.
gel: Generic Extensible Language (PDF)
One of the things I like about this paper is that it points out that Lisp and XML are essentially the same creature: Lisp:
(if (< x 3) (print x))
== XML:<if><test op=”lt”><var name=”x”/><const>3</const></test><then><call fun=”print”><arg>x</arg></call></then></if>
I kinda love that.
coAST: coAST is a universal abstract syntax tree that allows to easily analyze each programming language. Especially adding new languages should be easy and generic. (Last update Dec 2018)
MLIR: Creating a Toy Language and AST
Creating a DSL Step by Step, Part 1
Create a programming language that the whole company can understand
Creating a Ruby DSL: A Guide to Advanced Metaprogramming
Towards Dynamically Extensible Syntax: introduces CherryLisp -- a Lisp dialect with dynamically user-definable syntax that suffers from neither of [drawbacks listed in the abstract].
"Three Things I Wish I Knew When I Started Designing Languages"
"The Naked Truth About Writing a Programming Language"
"How Big Should a Programming Language Be?": "... a long-held opinion I have about programming language design: we have a tendency to keep adding features to a language until it becomes so big that its sheer size makes it difficult to use reliably." Yes!
Open, extensible object models: "The artificial distinction between implementation language and end-user language can be eliminated by implementing the language using only end-user objects and messages, making the implementation accessible for arbitrary modification by programmers. We show that three object types and five methods are sufficient to bootstrap an extensible object model and messaging semantics that are described entirely in terms of those same objects and messages."
Intrinsically-Typed Definitional Interpreters for Linear, Session-Typed Languages
Interview with Jesper Louis Andsersen about a ton of languages.
"Less is more: language features"
"A wish list for a new programming language"
A Generic Framework for Automated QA of Software Models: references the OMG's Generic AST Model (GASTM) which I think is related to Abstract Syntax Tree Metamodeling (ASTM), here (PDF) This kinda looks like the generic AST I was futzing about with.
Nanopass: A framework for compiler education | Source in Racket or Scheme
Language Incubator: Repo of language experiments/explorations; "An incubator/sandbox for learning compilers, interpreters, code generation, virtual machines, assemblers, JITs, etc."
Principles of Programming Languages (course) (Source)
Flattening ASTs (and Other Compiler Data Structures)
AsmInterpreter: A simple assembly interpreter to help people with understanding the language without the hassle of setup.
Build your own Lisp teaches C by building a Lisp.
luax: Lua-like programming language for studying compiler and interpreter courses.
Square: A tiny programming language under 200kb.
mal (Make A Lisp): Steps (and collection of implementations) to make your own Lisp.
Writing your own toy language using flex, bison, LLVM; code
Implementing a JIT Compiled Language with Haskell and LLVM
A Tutorial on How to Write a Compiler Using LLVM
learn-programming-languages: Resources for the working programmer to learn more about the fundamentals and theory of programming languages. (Jean Yang)
Concatenative Thinking (wiki): We are interested in both theoretical results and practical programming advice, especially as it pertains to any Concatenative language. We want to bring together disparate language communities and build a common knowledge repository that people can consult to learn more about this family of languages.
Video - Creating a domain specific language for .NET Application
Presentation - Write your own domain specific language with F#
Kaleidoscope: Implementing a language with LLVM in CSharp: "By the end of the tutorial, we’ll have written a bit less than 1000 lines of non-comment, non-blank, lines of code. With this small amount of code, we’ll have built up a very reasonable compiler for a non-trivial language including a hand-written lexer, parser, AST, as well as code generation support with a JIT compiler. While other systems may have interesting “hello world” tutorials, I think the breadth of this tutorial is a great testament to the strengths of LLVM and why you should consider it if you’re interested in language or compiler design."
write_your_own_dynamic_language_runtime: How to write interpreters or dynamic compilers for dynamically typed languages on top of the JVM. This repository provides the basis to implement your own
of a dynamically typed language named smalljs which is almost a subset of JavaScript.
joeq: A Virtual Machine and Compiler Infrastructure (PDF) (Source): entirely implemented in JavaTM, leading to greater reliability, portability, maintainability, and efficiency. It is also language-independent, so code from any supported language can be seamlessly compiled, linked, and executed --- all dynamically!
Scripting and Dynamic Interaction in Java
Video: Nashorn: implementing a dynamic language runtime on JVM (Attila Szegedi)
https://github.com/jonpry/Pill: Pill is an open source interpreter for the Cadence Skill language. Its purpose is to run PCell generator codes used in VLSI. Pill is written in Python and compiles the source into Python bytecode where it is then executed alongside regular python functions at similar speed to "native" python codes. (This is an intriguing idea, and one that deserves some further exploration--if I can go from source to Py bytecode, we skip much of the parsing and get a startup speed benefit.)
(How to Write a (Lisp) Interpreter (in Python)): Norvig builds a simple Scheme in simple Python
ast: The Python official documentation of the ast
module that ships as part of Python. "The ast module helps Python applications to process trees of the Python abstract syntax grammar. The abstract syntax itself might change with each Python release; this module helps to find out programmatically what the current grammar looks like. An abstract syntax tree can be generated by passing ast.PyCF_ONLY_AST as a flag to the compile() built-in function, or using the parse() helper provided in this module. The result will be a tree of objects whose classes all inherit from ast.AST. An abstract syntax tree can be compiled into a Python code object using the built-in compile() function."
Green Tree Snakes: The Missing Python AST docs. Points out a few projects using the Pythong AST:
Code Transformer: "The CodeTransformer is a Transformer based architecture that jointly learns from source code (Context) and parsed abstract syntax trees (AST; Structure). It does so by linking source code tokens to AST nodes and using pairwise distances (e.g., Shortest Paths, PPR) between the nodes to represent the AST. This combined representation is processed in the model by adding the contributions of each distance type to the raw self-attention score between two input tokens (See the paper for more details)."
Create Your Own Programming Language with Rust: Incomplete but interesting first steps
jtc: A toy programming language interpreter that has no dependencies and sits in a single C++ file. C++11 capable compilers should compile it without extra options other than enabling C++11.
Eval: a lightweight interpreter framework written in Swift, evaluating expressions at runtime.
Pointless (Source): a scripting language for learning and fun.
Imp:
IMP: A minimal interpreter for the toy language, IMP, used as an example for building interpreters.
https://github.com/nandor/utcn-imp: Imp Language and Interpreter
Kaleidoscope: the classic from the LLVM website
Dwarf: A very small scripting language written in Elixir.
Bhai: A toy programming language written in Typescript
https://github.com/hisystems/Interpreter: Simple language interpreter written in pure C#.
https://github.com/airtrack/luna: A toy interpreter of lua-like language
https://github.com/sam-astro/Z-Sharp: Custom programming interpreter for ZSharp (Z#), a language I made up.
https://github.com/proglangclass/interpreter: Language built during the Programming Language Masterclass.
https://github.com/JohnEarnest/ok: An open-source interpreter for the K5 programming language.
https://github.com/drmenguin/minilang-interpreter: Interpreter and Read-Eval-Print-Loop for a simple programming language called "MiniLang", written in C++
https://github.com/bbu/simple-interpreter: A hackable and extensible lexer, parser and interpreter for a minimalistic, imperative, C-like language.
https://github.com/oriontransfer/PL0-Language-Tools: An implementation of PL/0 including a tree-based interpreter and virtual machine. http://programming.dojo.net.nz/study/pl0-language-tools/index
https://github.com/jamesdhutton/Interpreter: Interpreter for a simple language
https://github.com/hijkzzz/mini-interpreter: A simple scripting language (supports anonymous functions and clases)
https://github.com/mattgreen/hython: Haskell-powered Python 3 interpreter
https://github.com/yangtau/hedgehog: a toy programming language
https://github.com/progschj/jtc: A toy programming language interpreter in a single C++ file
This is the language described by the book "Writing an Interpreter in Go". Also has a paired book, "Writing a Compiler in Go" which appears to include the creation of a virtual machine for executing the compiled code.
From "Crafting Interpreters":
Last modified 24 November 2023