Some links from https://github.com/imteekay/programming-language-research
Creating the Bolt compiler (series):
Language Incubator: Repo of language experiments/explorations; "An incubator/sandbox for learning compilers, interpreters, code generation, virtual machines, assemblers, JITs, etc."
of a dynamically typed language named smalljs which is almost a subset of JavaScript.
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."
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)."
https://github.com/menezesd/epic-lang: interpreter for Python-like programming language with braces
Green Tree Snakes: The Missing Python AST docs. Points out a few projects using the Python AST:
(How to Write a (Lisp) Interpreter (in Python)): Norvig builds a simple Scheme in simple Python
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.)
https://github.com/jszheng/py3antlr4book: Covert ANTLR4 book source code to Python3 version.
https://github.com/maxmalysh/tiny-py-interpreter: Python interpreter written in Python; uses ANTLR4
Compiler Hacking (using Chocopy)
A simple Hindley-Milner type system in Go
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
https://github.com/proglangclass/interpreter: Language built during the Programming Language Masterclass.
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 02 October 2024