Giter Site home page Giter Site logo

swiftwasm-book's People

Contributors

aiden-leong avatar cobbal avatar jomy10 avatar kateinoigakukun avatar maxdesiatov avatar sidepelican avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swiftwasm-book's Issues

Reduce wasm file size by not static link libs like swiftCore

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?

Toolchain uninstall instructions for MacOS

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.