Caspian in the browser GitHub issue

vibecode
{"vibecode": {
    "status": "active_brainstorm",
    "started": "2026-05-17",
    "subsystem": "browser_caspian_engine",
    "purpose": "run_an_entire_caspian_processor_inside_a_web_browser",
    "related_docs": ["vscode-extension.md", "vscode-extension-v2.md"],
    "related_memories": ["feedback_first_contact_strategy"],
    "co_authoring": "claude_capturing_miko_brainstorm_in_realtime"
}}

Brainstorm in progress.


Why GitHub issue

vibecode
{"vibecode": {
    "section": "motivation",
    "use_cases": ["online_sandbox_playground", "spec_docs_with_live_runnable_examples",
                   "tutorials_and_learning", "browser_repl", "zero_install_marketing_demos"],
    "first_contact_alignment": "matches_feedback_first_contact_strategy_user_experiences_caspian_before_installing"
}}

A Caspian engine that runs entirely in the browser unlocks:

All of these align with the [[feedbackfirstcontact_strategy]] memory: let people experience Caspian before buying into the whole system.


Architecture: three independent artifacts GitHub issue

vibecode
{"vibecode": {
    "section": "architectural_decisions",
    "decided_2026-05-17": true,
    "for_browser_sandbox": "wasm_compiled_lua_engine",
    "for_community_and_portability": "ts_engine_consuming_caspianj_only",
    "for_source_parsing_in_typescript": "ts_parser_per_vscode_extension_v2",
    "rejected": "hybrid_ts_parser_plus_wasm_lua_engine_too_much_glue",
    "all_three_artifacts_independent_and_can_ship_separately": true,
    "composition_possible": "ts_parser_plus_ts_engine_gives_full_source_to_result_pipeline_in_pure_js"
}}

Three distinct artifacts, each with its own job, all independently shippable. The browser sandbox uses one (the WASM engine); the other two are for adjacent purposes that compose freely with it.

Artifact 1: WASM-compiled Lua engine — the browser sandbox GitHub issue

The canonical Lua reference engine compiled to WASM (Fengari, lua.vm.js, wasm-lua, or similar). Run the same engine bytes in the browser as on the server.

This is the primary browser sandbox approach.

Artifact 2: TS CaspianJ-only engine — community and portability GitHub issue

A TypeScript engine that consumes canonical CaspianJ and executes it. No Caspian source parser. No transpiler. Just the runtime: bootstrap, materialize, dispatch, role transition, built-in classes.

Parity test: run the V0.01 hello_world.caspj fixture through both the Lua engine and this TS engine; both must return a value with payload == "hello". Same fixture, same expected output. The Lua engine's existing tests (now 213/213) become the conformance suite.

Artifact 3: TS source parser — already in V2 extension plans GitHub issue

A TS-only Caspian parser, planned in vscode-extension-v2.md for the formatter work. Source → CaspianJ.

What was rejected GitHub issue

A hybrid (TS parser handing CaspianJ to a WASM-Lua engine) was on the table but rejected as too much glue for not enough benefit. Each side (TS, WASM-Lua) is well-suited to its own combinations; mixing them in one runtime adds bug surface at the parse/execute boundary without saving meaningful effort.


Why Caspian is particularly well-suited GitHub issue

vibecode
{"vibecode": {
    "section": "good_fit",
    "factors": ["role_model_is_a_perfect_sandbox_fit",
                 "currently_tiny_stdlib_means_small_payload",
                 "engine_already_designed_for_untrusted_code"]
}}

Open questions GitHub issue

---

© 2026 Puck.uno