NewsWorld
PredictionsDigestsScorecardTimelinesArticles
NewsWorld
HomePredictionsDigestsScorecardTimelinesArticlesWorldTechnologyPoliticsBusiness
AI-powered predictive news aggregation© 2026 NewsWorld. All rights reserved.
Trending
TrumpTariffTradeAnnounceLaunchNewsPricesStrikesMajorFebruaryPhotosYourCarLotSayCourtDigestSundayTimelineSafetyGlobalMarketTechChina
TrumpTariffTradeAnnounceLaunchNewsPricesStrikesMajorFebruaryPhotosYourCarLotSayCourtDigestSundayTimelineSafetyGlobalMarketTechChina
All Articles
Lil' Fun Langs
Hacker News
Published 2 days ago

Lil' Fun Langs

Hacker News · Feb 20, 2026 · Collected from RSS

Summary

Article URL: https://taylor.town/scrapscript-000 Comments URL: https://news.ycombinator.com/item?id=47091071 Points: 54 # Comments: 3

Full Article

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 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) ~500–1000 Namespace management HaMLet Modules (functors/signatures) ~2000–5000 Type-level computation HaMLet, 1ML Row polymorphism ~300–800 Extended unification EYG, type-systems Algebraic effects ~500–1500 Effect typing, runtime support Eff, Frank, Ante Algebraic subtyping ~500 Polar types, biunification Simple-sub Linear types ~600 Linearity checker Austral Lazy evaluation ~300–500 Thunks, memoization runtime MicroHs, Ben Lynn Garbage collection (Cheney) ~200 Runtime system Most Tail call optimization ~50–100 Codegen (jump instead of call) MinCaml Inline expansion ~100 Normalization pass MinCaml Dead code elimination ~50 Free variable analysis MinCaml Totality checking ~300–500 Coverage analysis, termination checker Tao, Dhall Further reading: Write You a Haskell (and sequel): builds a Haskell subset incrementally: lambda calculus → STLC → HM inference → ADTs → pattern matching → type classes → STG → LLVM. Implementing Functional Languages: a tutorial by Simon Peyton Jones & David Lester: complete implementations of template instantiation, G-Machine, TIM, and parallel G-Machine for a lazy Core language. Reimplemented in C++ with LLVM by Daniel Fedorin. The ZINC experiment: the foundational paper behind OCaml's bytecode compiler. The ZINC abstract machine uses ~140 instructions and 7 registers. Implementations include OMicroB (running OCaml bytecode on PIC18 microcontrollers with <10KB RAM) and HardCaml-Zinc (hardware implementation). Elaboration Zoo: progressive dependent type checking implementations, each a single Haskell file of 200–800 lines, from basic NbE through holes, implicit arguments, and first-class polymorphism. The best resource for understanding modern elaboration. Its companion smalltt (~1–2K LOC Haskell) is a complete dependent type elaborator with normalization-by-evaluation. Modern Compiler Implementation in ML: the Tiger language compiler covers every phase from lexing through graph-coloring register allocation in ~5,000–8,000 LOC of SML. Multiple GitHub implementations target x86-64 and RISC-V. If you want a milliHaskell, all your inspiration/ingredients are right here. Hirrolot's CoC 🤖 The most extreme capability-to-size ratio in this list — a complete Calculus of Constructions (the type theory at the top of the lambda cube) with bidirectional typing, dependent function types, and a type-in-type universe, all in a single OCaml gist of ~60–80 lines. It can express length-indexed vectors and other dependently typed programs. Not ML-family per se, but it demonstrates that full dependent types need not be complex to implement. Gist: gist.github.com/Hirrolot/27e6b02a051df333811a23b97c375196 Harrop MiniML 🤖 MiniML demonstrates the absolute floor for a native-code ML compiler. Using Camlp4 for parsing and OCaml's LLVM bindings, it supports integer arithmetic, conditionals, and recursive first-order functions. Xavier Leroy noted the critical caveat: this is not truly "Mini-ML" since it lacks higher-order first-class functions — adding closures and garbage collection would significantly expand the codebase. Still, it shows what LLVM enables in ~100 lines. Gist: gist.github.com/jdh30/6130c615b5945fd57fc0ea74fcb87e05 Algorithm W 🤖 Algorithm W Step by Step by Martin Grabmüller (~300 LOC, literate Haskell) is the canonical educational implementation of Algorithm W for Hindley-Milner type inference. Self-contained, well-commented, and widely referenced — this is where most people first implement HM inference. Repo: github.com/mgrabmueller/AlgorithmW tomprimozic/type-systems 🤖 A collection of standalone implementations of several inference algorithms in OCaml (~300–600 LOC total): basic Algorithm W, row polymorphism (the technique foundational to Elm's original type system), and HMF (first-class polymorphism with partial inference). Each variant is self-contained in a single directory. Where Algorithm W Step by Step teaches you one algorithm well, this repository shows you what changes when you swap in more powerful type system features. Repo: github.com/tomprimozic/type-systems THIH 🤖 Typing Haskell in Haskell by Mark P. Jones is the definitive executable specification of Haskell 98's complete type system in just 429 lines of core Haskell. It covers kinds, qualified types, type classes, pattern matching types, binding groups, mutual recursion, and defaulting. For context, the Hugs type checker implementing the same semantics spans 90+ pages of C. THIH is a type checker only (no evaluation), but its density of specification per line of code is unmatched. Paper: web.cecs.pdx.edu/~mpj/thih/ Hackage: hackage.haskell.org/package/thih Simple-sub 🤖 ~500 LOC of Scala. Lionel Parreaux's clean reimplementation of Stephen Dolan's MLsub — algebraic subtyping that adds union and intersection types to Hindley-Milner while preserving principal types. No annotations required. The original MLsub won POPL 2017; Simple-sub distills it into an ICFP 2020 Pearl that's small enough to read in one sitting. The ancestor of MLscript, which grows the idea into a full language with OOP and TypeScript interop. Repo: github.com/LPTK/simple-sub Paper: "The Simple Essence of Algebraic Subtyping" (ICFP 2020) PLZoo poly 🤖 ~400–600 LOC, OCaml. Implements a lazy, purely functional language with parametric polymorphism and HM type inference. Its sibling miniml (~300–500 LOC) includes a compiler targeting an abstract machine. Both are part of Andrej Bauer's Programming Languages Zoo, which contains 12+ miniature language implementations, each a few hundred lines of OCaml, covering everything from untyped lambda calculus to call-by-push-value. Website: plzoo.andrej.com Repo: github.com/andrejbauer/plzoo EYG 🤖 ~500 LOC JavaScript interpreter, full implementation in Gleam. EYG ("Eat Your Greens") by Peter Saxton prioritizes predictability, portability, and crash-free programs. It uses row-typed inference (HM extended with row polymorphism), algebraic effects as the sole FFI mechanism, and closure serialization — functions can be sent to other machines for tierless client/server programming. The most distinctive feature: programs are stored as JSON ASTs, not text files. A structural editor makes it impossible to write syntactically invalid programs. Repo: github.com/CrowdHailer/eyg-lang Website: eyg.run Talk: SPLASH/LIVE 2024 Pico-ml 🤖 An OCaml subset with HM type inference that compiles to WebAssembly, implemented in TypeScript. Small and self-contained — unusual for having a TypeScript host language rather than the OCaml/Haskell norm. A good starting point if you want to understand ML compilation targeting the browser. Repo: github.com/Quramy/pico-ml TinyML 🤖 <700 LOC, Standard ML. Packs a lexer, parser, interpreter, and full polymorphic HM type checker into under 700 lines of SML. Referenced on Lambda the Ultimate, this may be the smallest complete implementation with genuine Hindley-Milner inference, though the original download link appears to have gone stale. Reference: lambda-the-ultimate.org/node/2683 Eff 🤖 The or


Share this story

Read Original at Hacker News

Related Articles

Hacker Newsabout 2 hours ago
Volatility: The volatile memory forensic extraction framework

Article URL: https://github.com/volatilityfoundation/volatility3 Comments URL: https://news.ycombinator.com/item?id=47110781 Points: 3 # Comments: 0

Hacker Newsabout 2 hours ago
Holo v0.9: A Modern Routing Stack Built in Rust

Article URL: https://github.com/holo-routing/holo/releases/tag/v0.9.0 Comments URL: https://news.ycombinator.com/item?id=47110634 Points: 4 # Comments: 1

Hacker Newsabout 3 hours ago
The Dance Floor Is Disappearing in a Sea of Phones

Article URL: https://www.bloomberg.com/news/features/2026-02-20/a-boom-in-electronic-dance-music-is-changing-club-culture Comments URL: https://news.ycombinator.com/item?id=47110549 Points: 12 # Comments: 0

Hacker Newsabout 3 hours ago
Attention Media ≠ Social Networks

Article URL: https://susam.net/attention-media-vs-social-networks.html Comments URL: https://news.ycombinator.com/item?id=47110515 Points: 63 # Comments: 13

Hacker Newsabout 3 hours ago
Minions: Stripe's one-shot, end-to-end coding agents – Stripe Dot Dev Blog

Article URL: https://stripe.dev/blog/minions-stripes-one-shot-end-to-end-coding-agents Comments URL: https://news.ycombinator.com/item?id=47110495 Points: 36 # Comments: 29

Hacker Newsabout 3 hours ago
What Is a Database Transaction?

Article URL: https://planetscale.com/blog/database-transactions Comments URL: https://news.ycombinator.com/item?id=47110473 Points: 30 # Comments: 2