← All projects
Project record1 mention
Originally shared on Hacker News

lungo

lungo treats Lean code as the source of truth: write your logic in Lean and prove it, then lungo generates Rust, Go, Python, TypeScript, Swift and C, carrying the proofs into the output package as checked claims. It consumes the output of Lean's own compiler, ports Lean's runtime to Rust, and the generated code runs without Lean's toolchain on all OSes and in the browser (TypeScript + Wasm), behaving byte-for-byte identically to Lean's own executables.

Last shared
01 / The problem

What it addresses

Keeping an implementation consistent across multiple languages is a bruising battle; the submitter spent a year keeping CapDAG, a protocol for routing work between capabilities, consistent across five languages with thousands of cross-implementation tests, so they proved the core in Lean instead and built lungo around it.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. lungo

    lungo treats Lean code as the source of truth: write your logic in Lean and prove it, then lungo generates Rust, Go, Python, TypeScript, Swift and C, carrying the proofs into the output package as checked claims. It consumes the output of Lean's own compiler, ports Lean's runtime to Rust, and the generated code runs without Lean's toolchain on all OSes and in the browser (TypeScript + Wasm), behaving byte-for-byte identically to Lean's own executables.

    Problem: Keeping an implementation consistent across multiple languages is a bruising battle; the submitter spent a year keeping CapDAG, a protocol for routing work between capabilities, consistent across five languages with thousands of cross-implementation tests, so they proved the core in Lean instead and built lungo around it.

    Posted by @joeharshamshiri · Original source ↗

    Story title · @joeharshamshiri · · Source ↗

    Show HN: Lungo Generates Rust, Python, from Lean Proof Source

    Submitted URL · @joeharshamshiri · · Source ↗

    https://machinefabric.com/lungo/

    Source text · @joeharshamshiri · · Source ↗

    Introducing lungo. It treats Lean code as the source of truth. Write your logic in Lean and prove what you claim it does. lungo generates Rust, Go, Python, TypeScript, Swift and C, with the proofs carried into output package as checked claims.

    Source text · @joeharshamshiri · · Source ↗

    For the past year I’ve toiled to keep CapDAG, my protocol for routing work between capabilities, consistent across five languages with Claude and thousands of cross-impl tests. Between changing core design and varying levels of mirror-parity, it’s been a bruising battle.

    Source text · @joeharshamshiri · · Source ↗

    So I learned Lean and proved the core instead. lungo just fell out of that and is now used all over MachineFabric making my life so much easier. It takes the output from Lean's own compiler and fits right in without requiring Lean’s runtime or toolchain to run generated code.

    Source text · @joeharshamshiri · · Source ↗

    lungo ports Lean’s runtime to Rust so the generated code doesn’t require Lean’s toolchain and runs on all OSes and even in the browser(TypeScript + Wasm). The code keeps Lean’s object layout and behaves byte-for-byte identical to Lean’s own executables.