-
Notifications
You must be signed in to change notification settings - Fork 0
Development
૮༼⚆︿⚆༽つ edited this page Mar 14, 2024
·
2 revisions
command dump
$ echo export default /`pomsky -f javascript -Wcompat=0 -p flow.pom`/ > flow.js
$ echo export default /`pomsky -f javascript -Wcompat=0 -p kbd.pom`/ > kbd.js
$ wasm-ld --no-entry --export-dynamic --allow-undefined --import-memory --initial-memory=65536 -z stack-size=0 --features=bulk-memory,multivalue,mutable-globals,reference-types,simd128,relaxed-simd,atomics,sign-ext,nontrapping-fptoint,extended-const,exception-handling,tail-call accessor/index.s.o accessor/null.o -o accessor/null.wasm
$ wasm-opt -Oz --enable-bulk-memory --enable-multivalue --enable-mutable-globals --enable-reference-types --enable-simd --enable-relaxed-simd --enable-threads --enable-sign-ext --enable-nontrapping-float-to-int --enable-extended-const --enable-exception-handling --enable-tail-call accessor/null.wasm -o accessor/null.wasm
$ llvm-mc -triple=wasm32-unknown-unknown -mattr=bulk-memory,multivalue,mutable-globals,reference-types,simd128,relaxed-simd,atomics,sign-ext,nontrapping-fptoint,extended-const,exception-handling,tail-call -filetype=obj accessor/index.s -o accessor/index.s.o
$ rustc --edition 2021 --crate-type cdylib --target wasm32-unknown-unknown -C target-feature=+bulk-memory,+multivalue,+mutable-globals,+reference-types,+simd128,+relaxed-simd,+atomics,+sign-ext,+nontrapping-fptoint,+extended-const,+exception-handling,+tail-call -A warnings -C opt-level=3 -C panic=abort -C no-redzone -C overflow-checks=off -C strip=symbols -C debuginfo=0 --emit=obj,dep-info accessor/null.rs -o accessor/null.o
$ wasm-ld --no-entry --export-dynamic --allow-undefined --import-memory --initial-memory=65536 -z stack-size=0 --features=bulk-memory,multivalue,mutable-globals,reference-types,simd128,relaxed-simd,atomics,sign-ext,nontrapping-fptoint,extended-const,exception-handling,tail-call accessor/index.s.o accessor/number.o -o accessor/number.wasm
$ wasm-opt -Oz --enable-bulk-memory --enable-multivalue --enable-mutable-globals --enable-reference-types --enable-simd --enable-relaxed-simd --enable-threads --enable-sign-ext --enable-nontrapping-float-to-int --enable-extended-const --enable-exception-handling --enable-tail-call accessor/number.wasm -o accessor/number.wasm
$ rustc --edition 2021 --crate-type cdylib --target wasm32-unknown-unknown -C target-feature=+bulk-memory,+multivalue,+mutable-globals,+reference-types,+simd128,+relaxed-simd,+atomics,+sign-ext,+nontrapping-fptoint,+extended-const,+exception-handling,+tail-call -A warnings -C opt-level=3 -C panic=abort -C no-redzone -C overflow-checks=off -C strip=symbols -C debuginfo=0 --emit=obj,dep-info accessor/number.rs -o accessor/number.o
$ wasm-ld --no-entry --export-dynamic --allow-undefined --import-memory --initial-memory=65536 -z stack-size=0 --features=bulk-memory,multivalue,mutable-globals,reference-types,simd128,relaxed-simd,atomics,sign-ext,nontrapping-fptoint,extended-const,exception-handling,tail-call fastops/number.o -o fastops/number.wasm
$ wasm-opt -Oz --enable-bulk-memory --enable-multivalue --enable-mutable-globals --enable-reference-types --enable-simd --enable-relaxed-simd --enable-threads --enable-sign-ext --enable-nontrapping-float-to-int --enable-extended-const --enable-exception-handling --enable-tail-call fastops/number.wasm -o fastops/number.wasm
$ rustc --edition 2021 --crate-type cdylib --target wasm32-unknown-unknown -C target-feature=+bulk-memory,+multivalue,+mutable-globals,+reference-types,+simd128,+relaxed-simd,+atomics,+sign-ext,+nontrapping-fptoint,+extended-const,+exception-handling,+tail-call -A warnings -C opt-level=3 -C panic=abort -C no-redzone -C overflow-checks=off -C strip=symbols -C debuginfo=0 --emit=obj,dep-info fastops/number.rs -o fastops/number.o
$ wasm-ld --no-entry --export-dynamic --allow-undefined --import-memory --initial-memory=65536 -z stack-size=0 --features=bulk-memory,multivalue,mutable-globals,reference-types,simd128,relaxed-simd,atomics,sign-ext,nontrapping-fptoint,extended-const,exception-handling,tail-call instance/offset.s.o instance/scope.s.o instance/number.o -o instance/number.wasm
$ wasm-opt -Oz --enable-bulk-memory --enable-multivalue --enable-mutable-globals --enable-reference-types --enable-simd --enable-relaxed-simd --enable-threads --enable-sign-ext --enable-nontrapping-float-to-int --enable-extended-const --enable-exception-handling --enable-tail-call instance/number.wasm -o instance/number.wasm
$ llvm-mc -triple=wasm32-unknown-unknown -mattr=bulk-memory,multivalue,mutable-globals,reference-types,simd128,relaxed-simd,atomics,sign-ext,nontrapping-fptoint,extended-const,exception-handling,tail-call -filetype=obj instance/offset.s -o instance/offset.s.o
$ llvm-mc -triple=wasm32-unknown-unknown -mattr=bulk-memory,multivalue,mutable-globals,reference-types,simd128,relaxed-simd,atomics,sign-ext,nontrapping-fptoint,extended-const,exception-handling,tail-call -filetype=obj instance/scope.s -o instance/scope.s.o
$ rustc --edition 2021 --crate-type cdylib --target wasm32-unknown-unknown -C target-feature=+bulk-memory,+multivalue,+mutable-globals,+reference-types,+simd128,+relaxed-simd,+atomics,+sign-ext,+nontrapping-fptoint,+extended-const,+exception-handling,+tail-call -A warnings -C opt-level=3 -C panic=abort -C no-redzone -C overflow-checks=off -C strip=symbols -C debuginfo=0 --emit=obj,dep-info instance/number.rs -o instance/number.o
$ wasm-merge --enable-bulk-memory --enable-multivalue --enable-mutable-globals --enable-reference-types --enable-simd --enable-relaxed-simd --enable-threads --enable-sign-ext --enable-nontrapping-float-to-int --enable-extended-const --enable-exception-handling --enable-tail-call vtable/externref.wat.wasm externref vtable/externref.ts.wasm main -o vtable/externref.wasm
$ wasm-metadce --enable-bulk-memory --enable-multivalue --enable-mutable-globals --enable-reference-types --enable-simd --enable-relaxed-simd --enable-threads --enable-sign-ext --enable-nontrapping-float-to-int --enable-extended-const --enable-exception-handling --enable-tail-call -f vtable/externref.json vtable/externref.wasm -o vtable/externref.wasm
$ wasm-opt -Oz --enable-bulk-memory --enable-multivalue --enable-mutable-globals --enable-reference-types --enable-simd --enable-relaxed-simd --enable-threads --enable-sign-ext --enable-nontrapping-float-to-int --enable-extended-const --enable-exception-handling --enable-tail-call vtable/externref.wasm -o vtable/externref.wasm
$ wat2wasm vtable/externref.wat -o vtable/externref.wat.wasm
$ asc -Ospeed --uncheckedBehavior --lowMemoryLimit --noExportMemory --enable bulk-memory,mutable-globals,reference-types,simd,relaxed-simd,threads,exception-handling vtable/externref.ts -o vtable/externref.ts.wasm
$ wasm-merge --enable-bulk-memory --enable-multivalue --enable-mutable-globals --enable-reference-types --enable-simd --enable-relaxed-simd --enable-threads --enable-sign-ext --enable-nontrapping-float-to-int --enable-extended-const --enable-exception-handling --enable-tail-call vtable/funcref.wat.wasm funcref vtable/funcref.ts.wasm main -o vtable/funcref.wasm
$ wasm-metadce --enable-bulk-memory --enable-multivalue --enable-mutable-globals --enable-reference-types --enable-simd --enable-relaxed-simd --enable-threads --enable-sign-ext --enable-nontrapping-float-to-int --enable-extended-const --enable-exception-handling --enable-tail-call -f vtable/funcref.json vtable/funcref.wasm -o vtable/funcref.wasm
$ wasm-opt -Oz --enable-bulk-memory --enable-multivalue --enable-mutable-globals --enable-reference-types --enable-simd --enable-relaxed-simd --enable-threads --enable-sign-ext --enable-nontrapping-float-to-int --enable-extended-const --enable-exception-handling --enable-tail-call vtable/funcref.wasm -o vtable/funcref.wasm
$ wat2wasm vtable/funcref.wat -o vtable/funcref.wat.wasm
$ asc -Ospeed --uncheckedBehavior --lowMemoryLimit --noExportMemory --enable bulk-memory,mutable-globals,reference-types,simd,relaxed-simd,threads,exception-handling vtable/funcref.ts -o vtable/funcref.ts.wasm
All required manifest will be generated if you use nix flake devshell, otherwise generate it on your own via
knit rust-project.json
However, this only enable the auto-completion but not the compile check in rust-analyzer. To enable it you need to do 2 things:
-
Generate missing Cargo.toml (see workspace.members of Cargo.toml in the project root)
knit core/wasm/Cargo.toml
-
Override check command in rust-analyzer from your editor
- VSCode or similar (in
.vscode/settings.json
)"rust-analyzer.check.overrideCommand": ["cargo", "clippy", "--examples", "--bins", "--message-format=json"],
- Helix (in
~/.config/helix/languages.toml
)config = { check = { overrideCommand = ["cargo", "clippy", "--examples", "--bins", "--message-format=json"] } } language-server = { command = "rust-analyzer" }
- VSCode or similar (in