Skip to content

make lib + two-file amalgamation: ship the embeddable artifact #397

Description

@InauguralPhysicist

Why. The embedding API is near Lua-class (multi-state, handles, buffers, abort flag, trace sink — proven by a bare-metal OS consumer), but an embedder must hand-replicate the SOURCES-minus-main.c list from the Makefile. Lua's time-to-embedded-in-minutes comes from the one-file amalgamation; this is the last real delta.

What.

  • tools/amalgamate.sh emitting eigenscript_all.c + eigs_embed.h ("copy two files, call eigs_open").
  • make lib producing libeigenscript.a.
  • Anti-drift: convert make embed-smoke and ouroboros/aot/build.sh to link against the amalgamation/lib so the artifact can never rot (three ad-hoc consumers of the same source list exist today).
  • docs/EMBEDDING.md "drop-in" quickstart section, with the trace-sink/replay and abort seams as headline features.

Acceptance. A fresh directory with the two amalgamation files + a 20-line host builds and runs eval with gcc alone; embed-smoke passes linked against it; CI covers the amalgamated build.

Effort: days. Source: 2026-07-04 survey (embedding dimension).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions