micheleriva / c-vs-ts-wasm Goto Github PK
View Code? Open in Web Editor NEW👽Simple repo I made for myself just to test some WebAssembly compilers.
License: MIT License
👽Simple repo I made for myself just to test some WebAssembly compilers.
License: MIT License
Hi, glad to see someone try compare how different compilers produce wasm's binary.
But I should be mentioned in AS version you use number
type which just alias of f64
instead int32
as in C version. So AS version should looks like:
function fibonacci(i: i32): i32 { // or i64
if (i < 0) return -1
else if (i == 0) return 0
else if (i == 1) return 1
else return fibonacci(i - 1) + fibonacci(i - 2)
}
Another issue is AS doesn't use optimization at all in your build command. So much better is:
"asbuild": "asc src/ts/main.ts -b src/ts/a.out.wasm -t src/ts/a.out.wat --validate --measure -O3"
Thanks!
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.