MCPcopy Index your code
hub / github.com/EarlGray/language-incubator

github.com/EarlGray/language-incubator @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
774 symbols 1,953 edges 75 files 88 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

language-incubator

An incubator/sandbox for learning compilers, interpreters, code generation, virtual machines, assemblers, JITs, etc.

Hacks that have grown into separate projects:

  • x86/hasm: a simple x86 assembler written in Haskell, for now it's opcode set is very limited;
  • fp/secd: implementation of SECD virtual machine in C with a Scheme-to-SECD compiler;
  • js/slothjs: an effort at a naïve, primitive, savage Javascript interpreter (with parsing offloaded to Esprima);

Some protoprojects that may be interesting:

  • bf/bfjc: a primitive but fully functional x86_64 JIT compiler for BrainFuck, inspired by Adventures in JIT compilation by eliben ;
  • fp/tapl: reimplementation of some typecheckers from TAPL (in Haskell/Prolog), e.g. fullsimple.
  • llvm/kldscp: LLVM tutorial, JIT compiler of a toy language Kaleidoscope;
  • forth/mips/mforth.S: rewrite of the awesome jonesforth from x86/Linux to MIPS/Linux (tested on CI20);
  • c/longjmp/x86: a hackish reimplementation of setjmp/longjmp compliant to GCC x86 ABI;
  • zoo/{calc, miniml, minihs, miniprolog, boa}: a mirror of the awesome PLZoo ;
  • rel/chr: small Constraint Handling Rules examples;

Extension points exported contracts — how you extend this code

Interpretable (Interface)
============================================== Describes things (i.e. AST nodes, [`Function`]) that can be interpreted o [32 …
js/slothjs/src/interpret.rs
Compiler (Interface)
(no doc) [1 implementers]
bf/bfjc/src/lib.rs
ParseFrom (Interface)
`ParseFrom` is a unifying interface for constructing all `ast::*` types. It's not strictly necessary, `impl ast::X { fn [25 …
js/slothjs/src/parse/mod.rs
ToESTree (Interface)
ToESTree de-parses an AST struct into its Esprima representation. [10 implementers]
js/slothjs/src/parse/estree.rs
ToSource (Interface)
(no doc) [11 implementers]
js/slothjs/src/ast/display.rs
Parser (Interface)
Describes anything that can parse JS code. [3 implementers]
js/slothjs/src/runtime/mod.rs

Core symbols most depended-on inside this repo

get
called by 68
js/slothjs/src/heap.rs
map_node
called by 41
js/slothjs/src/parse/jsonnode.rs
drop_cell
called by 35
fp/secd/secd.c
next_token
called by 33
llvm/kldscp/ast.c
to_ref
called by 33
js/slothjs/src/value.rs
get_car
called by 32
fp/secd/secd.c
emit
called by 31
bf/bfjc/src/jit.rs
as_str
called by 30
js/slothjs/src/ast/expr.rs

Shape

Function 355
Method 254
Class 130
Enum 28
Interface 7

Languages

Rust58%
C22%
C++9%
Python4%
Ruby4%
TypeScript2%

Modules by API surface

fp/secd/secd.c103 symbols
llvm/kldscp/ast.c48 symbols
js/slothjs/src/object.rs46 symbols
js/slothjs/src/ast/expr.rs44 symbols
js/slothjs/tests/parse.rs36 symbols
fp/lamcalc.cpp33 symbols
emu/bcpu/BCPU.py32 symbols
js/slothjs/src/value.rs31 symbols
js/slothjs/src/heap.rs30 symbols
rel/rel.rb28 symbols
js/slothjs/src/ast/stmt.rs28 symbols
js/slothjs/src/error.rs20 symbols

For agents

$ claude mcp add language-incubator \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact