Lil’ Fun Langs

Lil’ Fun Langs LOC Host HM ADTs Match Cl. Target Hirrolot’s CoC src ~70 OCaml ✗ ✗ ✗ ✓ Interpreter Harrop MiniML src ~100 OCaml ✗ ✗ ✗ ✗ LLVM → native Algorithm W src ~300 Haskell ✓ ✗ ✗ ✗ Type checker only tomprimozic/type-systems src ~300 OCaml ✓ ✗ ✗ ✗ Type checker only THIH src ~429 Haskell ✓ ✓ ✓ ✗ Type checker only Simple-sub src ~500 Scala ✓ ✗ ✗ ✓ Type checker only PLZoo poly src ~500 OCaml ✓ ✗ ✗ ✓ Interpreter EYG src ~500 Gleam ✓ ✓ ✓ ✓ Interpreter Pico-ml src ~500 TypeScript ✓ ✗ ✗ ✓ WebAssembly TinyML src <700 SML ✓ ✗ ✗ ✓ Interpreter Eff src ~1–2K OCaml ✓ ✓ ✓ ✓ Interpreter Frank src ~1–2K Haskell ✓ ✓ ✓ ✓ Interpreter Grace src ~1–3K Haskell ✓ ✗ ✗ ✓ Interpreter Hackett src ~1–3K Racket ✓ ✓ ✓ ✓ Racket runtime Scrapscript src ~1–3K Python ✓ ✓ ✓ ✓ C/WASM/Cosmo native MinCaml src ~2,000 OCaml ✓ ✗ ✗ ✓ x86/SPARC/PPC native Ben Lynn src ~2,000 Haskell/C ✓ ✓ ✓ ✓ Combinators → C VM 1ML src ~3–5K OCaml ✓ ✗ ✗ ✓ Interpreter mlml src ~3–5K OCaml ✗ ✓ ✓ ✓ x86-64 native Dhall src ~4K Haskell ✗ ✓ ✓ ✓ Normalizer Ante src ~5–10K Rust ✓ ✓ ✓ ✓ Cranelift → native Tao src ~5–10K Rust ✓ ✓ ✓ ✓ Bytecode interpreter Austral src ~5–10K OCaml ✗ ✓ ✓ ✓ C AQaml src ~5–8K OCaml ✗ ✓ ✓ ✓ x86-64 native Borgo src ~5–10K Rust ✓ ✓ ✓ ✓ Go source HaMLet src ~10–15K SML ✓ ✓ ✓ ✓ Interpreter SOSML src ~10–15K TypeScript ✓ ✓ ✓ ✓ Browser interpreter MicroHs src ~15–30K Haskell/C ✓ ✓ ✓ ✓ Combinators → C/JS Lil' Fun Langs I adore small programming languages. Iota is two combinators. tinylisp is 99 lines of C. milliForth is 340 bytes . Fractran multiplies fractions. Oh, K ? I've encountered tiny implementations of Forth, Lisp, C, Prolog, etc., but never "milliHaskell". Yes, I'm still slowly working on scrapscript . ML-style languages carry a pungent monad odor that attracts mathochists. Notable examples include Haskell, Elm, F#, Scala, and OCaml. They're "Lambda Calculus with syntactic sugar", i.e. functional and statically-typed . Most implementations extend Hindley-Milner type inference with algebraic data types , pattern matching, and closures: Feature LOC Dependencies References Integer arithmetic ~50 Parser, codegen MinCaml Floating-point ~100 Parser, codegen (SSE/NEON) MinCaml Booleans + if/then/else ~50 Parser, codegen Everything Let bindings ~30 Parser, normalization Everything First-class functions (closures) ~200 Closure conversion, runtime MinCaml Recursive functions (let rec) ~50 Type inference (occurs check), codegen MinCaml Tuples ~100 Parser, type inference, codegen MinCaml Arrays ~100 Parser, runtime (bounds checking) MinCaml Monomorphic type inference ~100 Unification MinCaml Polymorphic type inference (HM) ~300 Generalization, instantiation Algorithm W, PLZoo Algebraic data types ~200–400 Parser, type checker, runtime (tagging) HaMLet, Tao Pattern matching (basic) ~200 Exhaustiveness check, case trees Tao, Ante Pattern matching (optimized) ~400–600 Maranget's algorithm OCaml, Rust Type classes ~500–2000 Dictionary passing, instance resolution MicroHs, Ben Lynn Modules (basic)

Source: Hacker News | Original Link