Giter Club home page Giter Club logo

webasm-tests's Introduction

Playing with freestanding webasm

This is only proof-of-concept stuff. Nothing here is suitable for real world production use, but it could be adapted to be so

Requires a good clang compiler. All tests were done using using clang-13.

You may need some extra packages installed:

  • clang-13 -- for the compiler
  • libc6-dev-i386 -- for some 32 bit stuff the compiler wants

I also needed to soft link the linker in my ~/bin folder with:

ln -s /usr/bin/wasm-ld-13 wasm-ld

Compiling and running

To compile all libraries and examples use the configure script followed by Ninja:

./config-build
ninja -C build.tmp

To serve the pages you can use the built in Python web server:

python3 -m http.server

Recent versions of Firefox at least won't load the pages from the file system due to new security barriers.

To look at the symbols produced (useful to make sure everything is as it should be and the output doesn't contain things that aren't needed):

wasm-objdump -x test1.wasm

OPUS example

For something more adventurous there is an OPUS decoder. The ./opus.sh script will build the example code along with the bits of libopus and SoftFloat that are required. The file opus.html contains some numerical analysis of decoding a single test OPUS packet (again, look in the console log).

The file opus_long_decode.html contains a play button where you can hear the output from the decoder.

webasm-tests's People

Contributors

kayess avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.