crosslang/GolangLean
Maximus Gorog f5f1701922 Add RosettaStone.lean — Go ↔ Lean translation reference.
Side-by-side comparisons of Go syntax with two Lean encodings:

  * Surface AST (GolangLean.Expr) — mirrors go/ast.Node from upstream.
  * Tiny Go Core (GolangLean.Core.Term) — kernel calculus with proven
    operational + type semantics.

Twelve sections covering: literals, arithmetic, comparison, conditional,
variables/let-binding, functions/application, references/deref/assign,
sequencing. Each example includes a `#eval` running the term through
the proven Core.eval; output matches what's expected at run time.

Demonstrated programs:
  - `(5 + 3) * 2` → 16
  - `let x = 3 in let y = 7 in x < y` → true
  - `(λ x. x*2) 21` → 42
  - `let double = λ x. x*2 in double (double 5)` → 20
  - `let p = &42 in *p = 100; *p` → 100 (heap: [vInt 100])
  - higher-order: `(λ f. λ x. f (f x)) double 3` → 12

Each #eval is a runtime witness for a Core.BigStep derivation. Apply
Core.eval_sound to get a proof of the BigStep relation, and
Core.preservation to get the value's type.

Supporting changes:
  - Added Repr instances for Core.Value and Core.EnvList (manual,
    handling the mutual inductive — derive doesn't compose across the
    mutual block).
  - Added RosettaStone as a lean_lib in lakefile.toml.
2026-05-10 06:49:22 -06:00
..
Core Add RosettaStone.lean — Go ↔ Lean translation reference. 2026-05-10 06:49:22 -06:00
AST.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
BigStep.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Builtins.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Env.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Error.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Eval.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Parser.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
PureEval.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
REPL.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Scanner.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Token.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
Value.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00
ValueEquiv.lean Initial scaffold: Lean 4 reimplementation of Go. 2026-05-10 02:12:19 -06:00