A system assembled by responsibility
Its recipe separates a typed-array lattice substrate, selectable pressure solver, slow deformable medium, control and resource systems, sandboxed example interfaces, analysis, rendering, and the runtime loop.
Build by composition
FragmentCode turns a web program from one opaque block into an ordered recipe of discrete, addressable pieces. Build, revise, share, and load the exact behavior you need—then assemble it into a living program in the browser.
Frag0!!3839
Frag000!!155
exact revision
trusted origin
The basic unit
A fragment is an independently described unit of program behavior that FragmentCode can identify, version, load, replace, and reuse.
It is not limited to a function or a file. A fragment can own a data substrate, add a control, solve a physics step, render an interface, or coordinate an entire runtime phase. Its boundary is the behavior you want to understand and evolve as one piece.
// The server resolves an exact stored revision.
const fragment = {
id: "Frag000!!155",
intent: "Selectable pressure physics",
// A focused behavior with an explicit surface.
api: {
stepPressureField(options) { /* ... */ },
readPressure(x, y) { /* ... */ }
},
summary: "Steps the pressure field while
preserving contracts for downstream fragments."
};
AgentPruned.fragmentInterfaces.register(fragment);
The exact stored representation also carries descriptive and lineage data. Programs save an ordered list of fragment references, then resolve those references when they are assembled.
Observed in real programs
Reviewing stored FragmentCode programs reveals units that span data, behavior, orchestration, presentation, and precise follow-up changes.
Its recipe separates a typed-array lattice substrate, selectable pressure solver, slow deformable medium, control and resource systems, sandboxed example interfaces, analysis, rendering, and the runtime loop.
One ordered recipe grows from THREE.js setup into a voxel boat, animated water terrain, camera panning and zoom, fish-school encounters, embedded minigames, a staged sea-snake chase, and cannon feedback. Descendant fragments refine individual experiences—such as reshaping the hull or changing the snake's approach—while preserving the surrounding game.
A base TV Pong fragment creates the paddles, ball, scoreboard, controls, and update loop. Descendant references preserve refinements such as replacing AI control with a second keyboard control scheme.
Fragments wait for scene assets, add a THREE.js coordinate plane, introduce controls, and refine speed indicators. Each piece augments the existing browser world without requiring a single monolithic rewrite.
Trusted loading
The server is more than a file host. It resolves identities and revisions, applies access rules, and delivers the ordered JavaScript that becomes the program.
Fragments are executable JavaScript. Load them only from a server and operator you trust. A controlled HTTPS origin, exact revision references, authorization, and visible provenance create a clearer boundary than copying scripts from unknown pages or chaining arbitrary third-party CDNs.
Why build this way?
Reference a trusted fragment in another program while keeping its identity and purpose visible.
Create a descendant for one behavior change instead of forking an entire application.
The recipe shows which responsibilities make up a program and the order in which they enter the runtime.
Stable references make it possible to reload a known composition instead of depending on mutable pasted code.
Server-side identity and permissions allow selected people to inspect, run, or edit private work without publishing it.
Fragments remain JavaScript: they can create interfaces, simulations, games, tools, and responsive runtime behavior.
Dynamic by default
Because fragments execute together in the browser, a loaded recipe can generate the page itself and continue changing it over time. Fragments can agree on shared interfaces, respond to users, update models, and render the next frame—turning a saved composition into a live web program.
Start with one behavior
Open FragmentCode to explore saved programs and their revisions, or sign in to begin building with fragments.