GithubHelp home page GithubHelp logo

hanks10100 / wasm-examples Goto Github PK

View Code? Open in Web Editor NEW
221.0 10.0 56.0 64 KB

WebAssembly Examples

HTML 19.31% JavaScript 11.09% Shell 2.53% C 10.96% Rust 0.07% WebAssembly 56.03%
wasm c cpp javascript webassembly

wasm-examples's Introduction

WebAssembly Examples

各种 WebAssembly 的例子。可以使用下列激进版浏览器运行。

除了上边几个激进的浏览器,在主流版本里开启 flag 也是可以使用 WebAssembly :

  • Chrome: 打开 chrome://flags/#enable-webassembly,选择 enable
  • Firefox: 打开 about:configjavascript.options.wasm 设置为 true

Examples

每个例子里都有单独的 README。

  • simple: 使用 asm.js 编译成 WebAssembly 的例子。
  • cpp: 用 C/C++ 编译成 WebAssembly 的例子。
  • multi-wasm: 使用多个 wasm 文件。
  • js-api: 在 wasm 中调用 javascript API。
  • rust: 把 Rust 编译成 WebAssembly 的例子。

wasm-examples's People

Contributors

hanks10100 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  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  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wasm-examples's Issues

最新版本,编译成wasm报错

(index):30 Uncaught (in promise) LinkError: WebAssembly.Instance(): Import #0 module="env" function="__memory_base" error: global import must be a number or WebAssembly.Global object
这个是报错信息
emcc math.c -Os -s WASM=1 -s SIDE_MODULE=1 -o math.wasm 这是我运行的命令

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.38.36
clang version 6.0.1 (Cswircachegitchromium.googlesource.com-external-github.com-emscripten--core-emscripten--fastcomp--clang 98df4be387dde3e3918fa5bbb5fc43e1a0e1daac) (Cswircachegitchromium.googlesource.com-external-github.com-emscripten--core-emscripten--fastcomp 1b4148f39a69c7fc62edadd85e4122b68694dfb7) (emscripten 1.38.31 : 1.38.31)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: D:\emsdk\fastcomp\fastcomp\bin
shared:INFO: (Emscripten: Running sanity checks)
这个是我的emcc 版本

求大神指点

Can I use the same example with Data structure?

Can i use the same example with the structure and pass the variable structure to javascript with one function
example:

C Code:

`struct number
{
int x;
int y;
} num;

int numberfun () {
num.x=100;
num.x=400;
return num;
}
`

无法编译rust的示例

错误提示如下:
shared:ERROR: math.rs: No such file or directory ("math.rs" was expected to be an input file, based on the commandline arguments provided)
请问如何配置rust编译

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.