feat: add native runtime ABI
MoonBit parallel FFI specification workspace.
luna_thread/
luna_thread/moon.mod.json
luna_thread/luna_thread.mbt
luna_thread/plan/
luna_thread/shared/
luna_thread/backend/
native/
js/
docs/moonbit-parallel-spec-en.typ
docs/moonbit-parallel-spec-zh.typ
docs/template/
docs/spec-review-report-zh.md
The project stack follows the realization paths defined in the spec:
MoonBit facade -> MoonBit C FFI -> C wrapper -> C runtime
MoonBit facade -> MoonBit JS FFI -> JS wrapper -> N-API addon -> C runtime
So the practical development environment needs:
moon
moonc
clang
cmake
make
node
npm
python3
typst
On macOS with Apple clang, OpenMP usually requires libomp:
libomp
brew install libomp
Run the environment check:
./scripts/check-env.sh
Include document compilation only when needed:
CHECK_DOCS=1 ./scripts/check-env.sh
Check the MoonBit module:
make moon-check
Configure the native runtime scaffold:
make native-configure
Install and build the JS addon scaffold:
make js-install make js-build
Build the documentation when needed:
make docs
The specification should be committed in part-sized history slices:
Application or proposal drafts are ignored by .gitignore.
.gitignore
luna_thread
MoonBit parallel FFI specification workspace.
Repository Layout
luna_thread/: MoonBit library module rootluna_thread/moon.mod.json: MoonBit module metadataluna_thread/luna_thread.mbt: root MoonBit facade packageluna_thread/plan/,luna_thread/shared/,luna_thread/backend/: package split for shared types and backend FFInative/: C runtime and wrapper scaffoldjs/: N-API addon scaffolddocs/moonbit-parallel-spec-en.typ: authoritative English specificationdocs/moonbit-parallel-spec-zh.typ: Chinese mirror translationdocs/template/: Typst paper templatesdocs/spec-review-report-zh.md: Chinese review notesDevelopment Environment
The project stack follows the realization paths defined in the spec:
MoonBit facade -> MoonBit C FFI -> C wrapper -> C runtimeMoonBit facade -> MoonBit JS FFI -> JS wrapper -> N-API addon -> C runtimeSo the practical development environment needs:
moon,mooncclang,cmake,makenode,npm,python3typstOn macOS with Apple clang, OpenMP usually requires
libomp:Quick Start
Run the environment check:
Include document compilation only when needed:
Check the MoonBit module:
Configure the native runtime scaffold:
Install and build the JS addon scaffold:
Build the documentation when needed:
Commit Strategy
The specification should be committed in part-sized history slices:
Application or proposal drafts are ignored by
.gitignore.