Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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

Releases

No releases published

Packages

No packages published