Repository navigation
bib: C and C++ feasibility plan (go-embedded-c, go-embedded-cpp) - #20
Merged
Merged
Conversation
bib/c-cpp.md: sources pinned (N1570, N2310, llvmorg-23.1.4, cc/v4 v4.30.5, ccgo v4.38.0, libc v1.79.1, xeus-cpp 0.10.0, CppInterOp v1.9.0, emscripten 4.0.9, wazero v1.12.0, wasi-libc, gcc 15.2.0, c-testsuite, csmith), measured sizes, the decision for each language, plan table and risks. C: reuse modernc.org/cc/v4 (runs with a hand-made Config, also as GOOS=wasip1 under wazero), write a C -> wasm32 code generator and a cell runtime, libc = wasi-libc. C++: clang-repl compiled to wasm on the same runtime, behind a measured gate (wazero v1.12.0 refuses the 71 MB clang module: legacy exception handling). tools/srccount counts files, lines and bytes; tools/wasmimports validates a module with wazero and lists what its host must provide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
bib/c-cpp.md, the bibliography and feasibility plan for C and C++ notebook cells in pure Go (go-embedded-c, go-embedded-cpp), followingbib/julia.mdandbib/TEMPLATE.md.Decisions:
modernc.org/cc/v4(BSD-3) as the front end. It runs with a hand-madeConfigand no host compiler, also asGOOS=wasip1under wazero, and adds about 3.9 MB to aGOOS=jsbinary. Write a C → wasm32 code generator and a cell runtime (shared memory and table) on wazero, with the browser engine in the playground. libc is wasi-libc. ccgo is rejected because it needsgo buildat cell time and modernc libc has no js/wasip1 target. A tree interpreter is rejected because it would be slower than the reference.clang/lib/Semaalone is 333 996 lines at llvmorg-23.1.4, and libc++ headers are 330 575 lines. The plan is clang-repl compiled to wasm (the CppInterOp build that xeus-cpp-lite uses) on the C runtime, behind a measured gate. Today, wazero v1.12.0 refuses the 71 256 623-byte clang module because it uses legacy exception handling (0x06). Native clang-repl delegation is rejected.Also adds two measurement tools, both with 100 % coverage:
tools/srccountcounts files, lines and bytes.tools/wasmimportsvalidates a module with wazero and lists what its host must provide.The README index is updated. This change adds the
github.com/tetratelabs/wazerov1.12.0 dependency fortools/wasmimports.🤖 Generated with Claude Code