swiftwasm / swiftwasm-book Goto Github PK
View Code? Open in Web Editor NEWThe SwiftWasm book to get you started
Home Page: https://book.swiftwasm.org/
The SwiftWasm book to get you started
Home Page: https://book.swiftwasm.org/
I have compiled a 'hello world' demo under the instruction of swiftwasm-book. And I found the hello.wasm is very big ( >10MB )。
I think the main reason is that print
will be linked to libswiftCore, which size is 9MB。
AFAK, wasi in wasm is just stubs, it is dynamicly linked at runtime. So I'm trying to exclude these at linkage, by using --allow-undefined
/ --allow-undefined-file=undefined-symbols.txt
after wasm-ld
. But it doesn't work, error is:
wasm-ld: error: /tmp/hello-fcefd1.o: undefined symbol: $sSSN
I don't know how to resolve this, anyone help?
On an Intel Macbook, following the instructions at the bottom of Creating a Browser App to build the Tokamak demo app will result in a fatal error. To solve the issue, the .swift-version in the Tokamak directory needs to match the swift-wasm version on the user's machine.
It would be helpful/ease getting started to create a Note about this fatal error or link to this Issue.
Would you please update setup.md
instructions with the correct approach for restoring the toolchain after installing the swift-wasm package on macOS?
I had trouble reverting to the normal toolchain on macOS. I had to delete and remake the symbolic link because changing the link did not work (even with sudo). I suspect my just forcing the link is not the correct approach (but wasn't able to track down the packaging script for macOS).
The symbolic link is at: /Library/Developer/Toolchains/swift-latest.xctoolchain
After install, the link points to swift-wasm toolchain, which swift build --triple wasm32-unknown-wasi
correctly picks up.
To restore, I presume it should point again e.g., to Xcode:
swift-latest.xctoolchain@
-> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
Note that Xcode in the settings always displayed its own command-line tools, and did not offer the swift-wasm toolchain as a choice for the command-line tools. (I'm unaware of how to set a target-triple for Xcode build of a Swift package.)
For readers: swift-wasm might be transitioning to use an SDK rather than a toolchain, which might alleviate this confusion. See e.g., the response to swiftwasm/swift#5550
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.