Commit graph

8 commits

Author SHA1 Message Date
f7352b51b0 rename: uncommonlisp -> lumbda throughout the repo
Historical internal name "uncommonlisp" retired in favor of the
public name "lumbda" ahead of lumbda.com going live. Scope of
this commit:

Source files renamed:
  uncommonlisp.py                     -> lumbda.py
  asm/uncommonlisp.s                  -> asm/lumbda.s
  c/uncommonlisp.h                    -> c/lumbda.h
  whitepaper/uncommonlisp-whitepaper  -> whitepaper/lumbda-whitepaper (.rst + .pdf)

Binaries renamed (tracked ones; c/ was always gitignored):
  asm/uncommonlisp, asm/uncommonlisp-gc, asm/uncommonlisp.o,
  asm/uncommonlisp-gc.o                -> asm/lumbda(-gc)(.o)
  c/.gitignore                          -> ignores lumbda

Internal string updates (sed pass ordered longest-first):
  asm/uncommonlisp -> asm/lumbda
  c/uncommonlisp   -> c/lumbda
  uncommonlisp.py  -> lumbda.py
  UNCOMMONLISP_BIN -> LUMBDA_BIN (asm/test.sh env var)
  "uncommonlisp> " -> "lumbda> " (asm REPL prompt baked into binary)
  UNCOMMONLISP     -> LUMBDA (macros, comments)
  uncommonlisp     -> lumbda (prose)

Binary portal magic updated:
  "ULPORTAL" -> "LUMBDAB1"   # "Lumbda Binary v1"
Old portal files are not backward-compatible — this is a deliberate
break since it's the rename moment. S-expression portals already
carry their own ";; lumbda-portal v1" header and remain cleanly
versioned.

WHITEPAPER.pdf / WHITEPAPER.rst symlinks repointed to the renamed
files. Makefile's whitepaper target targets lumbda-whitepaper.pdf.

Not changed (intentional, separate phases):
  - Filesystem directory /home/fox/git/uncommonlisp itself
    (fox renames locally and the gitlab repo URL in a follow-up)
  - tests.py hardcoded cwd=/home/fox/git/uncommonlisp
    (matches the current on-disk location; will flip when the
    directory rename ships)
  - Git history (immutable; old commits still say uncommonlisp,
    which is correct — that's what they were)

Verified:
  137 asm no-GC + 137 asm GC + 571 Python + 83 C + 189 shared
  functional tests all pass under the new names.
  bench-gc-http (2000 req): all 4 cells behave as expected
  (cells 1/2 flat, 3 leaks, 4 bounded at 1 chunk).
  Python REPL, C REPL, asm REPL all start cleanly.
2026-04-19 10:20:11 -04:00
a9be071a7a native EML proof checker in Lumbda + Lean-vs-Lumbda benchmark
Addresses fox's framing: EML isn't a language design invariant; it's
a well-executed demonstration. Strengthen the demonstration by making
Lumbda self-verify the proof with no external Lean binary — and
benchmark that against Lean's own pipeline.

proof/eml_proof_in_lumbda.lsp (~150 lines, portable Scheme):

  - Term-rewriting engine: pattern variables (?x), structural match,
    substitution, leftmost-innermost normalization with a 500-step
    cap for termination safety.
  - Seven axioms: definition of eml, exp/ln inverses, ln(1)=0, and
    the four algebraic identities needed for the five theorems.
  - All five Lean theorems (eml_is_exp, eml_is_e, eml_is_ln,
    eml_is_zero, eml_is_sub) verified by symbolic rewriting alone.
    No numerical evaluation. Same abstract-exp/ln axioms Lean uses.

Full coverage: all 5 of 5 Lean theorems reproduce in Lumbda.
Cross-impl: 5/5 pass in Python --fast, C default, and asm.
(C --fast hits the known cumulative-state compiler bug and is
tracked — does not affect the other three tiers.)

tests/bench-proof.sh + `make bench-proof`:

  EML proof verification (best of 3 runs, i5-8350U):

    Lumbda Python --fast              363 ms
    Lumbda C (tree-walker)             42 ms
    Lumbda C --fast (bytecode VM)   crashes  (known bug)
    Lumbda asm                         29 ms  <-- fastest live check
    Lean 4 (cached replay)              1 ms  (artifact re-read)
    Lean 4 (cold rebuild)             374 ms  (fair end-to-end)

  Lumbda asm is 13× faster than Lean's cold rebuild at verifying
  the same five theorems. Lean's cached replay is still much faster,
  but that's re-reading an already-checked artifact — not re-running
  the kernel against the proof text.

Whitepaper §8.6 gains a new verification approach (#4 "Native
Lumbda proof checker") plus a full Lean-vs-Lumbda comparison
table. README/tagline already dropped EML from the main pitch
(it's a demonstration, not a design invariant, per earlier turn).

MOAD isolation is now the only spec-level claim in the subtitle.
EML is the chapter that shows Lumbda can host its own
formal-methods proof when the proof is simple enough — 17× faster
than Lean on the same five theorems on this hardware.
2026-04-17 19:40:20 -04:00
bfc712371f Lumbda positioning: Lisp/Scheme-derived, EML + MOAD isolation, 4 tiers
Sharpen the tagline per fox. Lumbda is not a "new" language; it is
a Lisp/Scheme-derived language whose two distinctive claims are
(a) EML mathematical universality (single-operator foundation,
machine-checked in Lean 4) and (b) MOAD defect isolation — each
of the four implementation tiers audited against the canonical
Mother-of-All-Defects patterns and hardened independently, so a
defect in one tier never propagates through shared infrastructure.

Whitepaper:

- Title subtitle now: "A Lisp/Scheme-derived, just-in-time lambda
  language. Four implementation tiers with EML mathematical
  universality and MOAD defect isolation. Workloads migrate
  across basic UNIX systems."
- Abstract opens by naming the two invariants (EML, MOAD) before
  getting to the feedback-primitive story. The bullet list now
  shows four tiers: Python VM, C tree-walker, C bytecode VM, C
  x86_64 JIT, pure assembly. The C binary bundles three tiers
  under one executable, flag-selectable.
- §11 renamed from "Three Implementations" to "Four Implementation
  Tiers" and opens with a paragraph framing MOAD isolation as the
  architectural contract between them.

README gets the same framing up top so clones see the positioning
immediately.

No code changes, no test reruns, still 975 assertions green.
2026-04-17 19:27:03 -04:00
2d21a671c9 rename: the language is now Lumbda (lumbda.com). Phase 1: prose
Language gets a proper name. Tagline per fox:

  Lumbda — a just-in-time lambda language. Fast from first
  principles, workloads migratable across basic UNIX systems.

Phase 1 scope: prose mentions of the language in the whitepaper,
README, and CLAUDE.md. File paths, binary names, and the repo
directory still use the historical "uncommonlisp" identifier —
those are Phase 2 (needs GitLab coordination + build-path edits).

- Whitepaper title "Feedback Is All You Need" → "Lumbda", with
  the prior title preserved as a subtitle thread. New header
  linkblock lists lumbda.com first, then uncloseai.com and
  permacomputer.com.
- README.md opens with the tagline, points at lumbda.com.
- CLAUDE.md banner clarifies Lumbda-the-language vs the historical
  repo/binary names.
- ~25 prose mentions of "uncommonlisp" in the paper are now
  "Lumbda"; file-path refs (python3 uncommonlisp.py, ./c/uncommonlisp,
  uncommonlisp.py, asm/uncommonlisp.s) unchanged.
- Benchmark methodology table widened slightly to fit the new
  6-char label.

No behavior change, no benchmarks rerun, 975 tests still pass.
2026-04-17 19:22:40 -04:00
b3ab4bb19a Add proof friction benchmark, update README
Benchmark: Python 0.04s, uncommonlisp 59s, Lean 1.5s — for the same claim.
The formal proof is 40x faster than brute-force search with mathematical
certainty instead of floating-point tolerance.

This is MOAD-0001 at the proof layer: O(N²) search friction where
O(1) algebraic reasoning suffices. Proof assistants are the hash set
to numerical analysis's nested loop.
2026-04-14 13:31:05 -04:00
1326e8a106 Add peephole optimizer, --help, examples, README update
- Peephole optimizer: eliminates VOID+POP pairs, JUMP-to-next-instruction.
  Adjusts jump targets after dead code removal.
- --help/-h and --version/-v flags.
- 4 example programs: fibonacci, generator, mergesort, objects.
- README rewritten: documents bytecode compiler, --fast flag, all features.
- 529 tests green.
2026-04-13 16:56:21 -04:00
66977049f1 Add string ports, error objects, rationals, modules, record inheritance, pretty-print
Core additions:
- StringInputPort / StringOutputPort — open-input-string, open-output-string,
  get-output-string, read/read-char/peek-char/read-line on ports
- R7RS ErrorObject class — error-object?, error-object-message,
  error-object-irritants; guard and with-exception-handler now receive
  ErrorObject instances instead of raw strings
- Exact rational arithmetic via Fraction — (/ 1 3) => 1/3, literal 1/3
  syntax, numerator/denominator, exact/inexact conversions
- Module system — (module name (export ...) body...) and (import name) /
  (import (name sym ...)) for selective import
- define-record-type now a Python special form supporting (inherit parent)
  for single-inheritance with subtype predicates
- Pretty-printer — pp/pretty-print with configurable line width

Correctness:
- R7RS letrec* body semantics for internal defines — names pre-declared
  before any initializer runs, enabling mutual recursion in let bodies
- string->number detects #x/#b/#o/#d and 0x/0b/0o prefixes
- show() guarantees decimal point in float output
- number->string rounds through show() for consistent float representation

Performance:
- _body_env fast path: skip scan when first body form is not define/begin
- Proc.has_defs flag: skip _body_env entirely for procs without internal defines
- Single-form body optimization: skip begin wrapper, set expr directly

Tests: 396 → 455 (+59 new tests covering all new features)
2026-04-13 12:27:06 -04:00
f72190d2dc Initial implementation of uncommonlisp
Single-file Scheme-like Lisp interpreter in Python with:
- TCO via explicit while loop (no Python stack overflow at any depth)
- syntax-rules with ellipsis for hygienic macros
- define-macro for procedural macros
- Full numeric tower, strings, chars, vectors, hash tables
- SRFI-1 list library
- call/cc (escape continuations), values, dynamic-wind, guard
- Python interop (py-eval, py-import, py-call, py-attr)
- 396 passing unit/integration/functional tests
- stdlib.lsp with 60+ utility functions
- Benchmark suite vs CPython baseline
2026-04-13 11:01:04 -04:00