Skip to content

wortwart/webassembly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebAssembly Demo Project

This project calculates Fibonacci numbers in C++ and JavaScript, using two different algorithms, and measures performance.

  • fibonacci.cpp: C++ code, can be compiled with Emscripten/Clang, c++ or (possibly) other C++ compilers
  • container.html: HTML shell for Emscripten compilation
  • formdata.js: Script required by container.html
  • style.css: CSS required by container.html

This project can be compiled with Emscripten using the following command (Windows syntax):

emcc fibonacci.cpp -s "EXPORTED_FUNCTIONS=['_fibstring']" -s "EXTRA_EXPORTED_RUNTIME_METHODS=['cwrap']" -O3 --shell-file container.html -o fibonacci.html

Linux syntax:

emcc fibonacci.cpp -s EXPORTED_FUNCTIONS='["_fibstring"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap"]' -O3 --shell-file container.html -o fibonacci.html

This project was created as demo for a tutorial in c't Magazin, autumn 2018.

About

WebAssembly demo with Fibonacci numbers in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published