131 questions
2
votes
1
answer
410
views
How to detect when you are ready to use functions loaded in asm.js module
I'm using emscripten to generate a file a.wasm.js that contains functions in C++ for encryption. The webassembly functions take in and return C-strings that hold JSON data. I want to wrap these asm.js ...
6
votes
1
answer
2k
views
Why is WebAssembly safe and what is the linear memory model?
(1) I heard WebAssembly's safety by providing a linear memory. I wonder what does this linear memory contain? Does the wasm stack and heap locate in this memory space? If yes, I think the stack of ...
3
votes
0
answers
481
views
"Invalid Heap Size" error when writing ASM.js by hand
I'm trying to write some performance intensive js code so I figured I'd give writing asm.js a try. However whenever I try to instantiate my module with a heap I get the following error in both Node.js ...
1
vote
1
answer
60
views
How this piece of ASM.js code should be evaluated by the engine?
According to the spec, the type "int" in ASM.js does not have signedness.
The int type is the type of 32-bit integers where the signedness is not known. In asm.js, the type of a variable ...
2
votes
1
answer
6k
views
LinkError: WebAssembly.instantiate() function import requires a callable
I am practicing WebAssembly at https://github.com/mikerourke/learn-webassembly.
I tried to check the result of "without-glue.html", the last step of "chapter-05-create-load-module"....
1
vote
1
answer
3k
views
link-arg not passing compiler options to rustc
I'm generating asm.js from a Rust file like so:
rustc demo.rs --target asmjs-unknown-emscripten -C opt-level=0 -C link-arg="-s MINIMAL_RUNTIME=1" -C link-arg="-s ENVIRONMENT=web" -C link-arg="-s ...
2
votes
1
answer
218
views
Why asm.js is slower than normal js (prime numbers generation)? How to speed up?
Here is prime numbers generation algorithm, one with "use asm" and another one (similar) without.
In end of live snippet there stats, looks like asm.js runs 4 times slower than pure js, why?
asm.js
...
-1
votes
1
answer
584
views
How to run Asm.js In IE11, getting legacy_vm_support problem
I complied faac.c and opus.c to asm.js. When I run asm.js in IE11, it throws an error message:
this is a legacy browser build with legacy_vm_support
I do not know whether IE11 support asm.js and how ...
2
votes
1
answer
664
views
Undefined symbols when linking against Box2D compiled by Emscripten
TLDR When linking against a static compiled library version of Box2D compilation fails but when including the actual .o files of the Box2D compilation, it works.
I am trying to compile a c++ program ...
4
votes
1
answer
494
views
How to suppress asm.js compilation message?
When using asm.js code some browsers emit a compilation message. This one:
Successfully compiled asm.js code (loaded from cache in 201ms)
Is there a way to suppress this message?
3
votes
0
answers
897
views
emscripten: Memory leak with std::vector & std::map in c++ code
I want to know how to properly delete the memory of std::vector & std:: map allocated in c++ code.
I am sharing my code here
# include <vector>
# include <stdio.h>
# include <...
1
vote
0
answers
31
views
Utilizing a JS lib that has an asm.js component through RoR asset pipeline
I have a 3rd party JS library that utilizes a generated *.asm.js file. That file and, the JS glue code, and HTML work fine when started up locally through python -m SimpleHTTPServer 8000.
I'd like ...
2
votes
1
answer
596
views
How do I access arrays on the asm.js heap from Javascript code, when the array's type is not Uint8?
I'm trying to use emscripten and asm.js in order to speed up my Javascript code. I need to get data from an Int32Array into my compiled C function. According to this Github site I can allocate a ...
7
votes
1
answer
1k
views
rust, WebAssembly, and passing arguments for increased total memory
I have a rust project I am compiling to webasm per http://asquera.de/blog/2017-04-10/the-path-to-rust-on-the-web/
Project compiles. When I run it in Chrome Canary, it runs out of memory and gives me ...
16
votes
1
answer
951
views
How to test the availability of asm.js in a web browser?
Imagine I have a asmjs script but before running the script, I'd like to test and see if the browser supports asm.js or not. If it is false, display a message indicating that the browser is old or ...
1
vote
1
answer
401
views
emscripten code for getpid and getppid functions
My aim to to find out the thread ids and process ids of the thread and the process that are running my javascript code. I could find no functions that could provide me this so I use the basic C code ...
0
votes
1
answer
144
views
Using asm.js to convert external-library-dependent code to javascript
(N.B. I'm still confused about how asm.js works and what types of software it can "auto convert", and I'm also still confused about a lot of terminology along the stack of auto conversion from ...
2
votes
0
answers
190
views
Dynamically Disable Asm.js
I would like to run a a benchmarkjs test on a program that is cross compiled from emscripten.
Is there a way to disable the asm.js optimizations to run it with and without asm?
5
votes
4
answers
2k
views
Disable linking libc in emscripten
I'm curious if it's possible to have emscripten build a binary without libc.
If I have simple.c:
int add1(int x) {
return x + 1;
}
And I don't want to include any of libc, is that possible?
My ...
6
votes
1
answer
2k
views
How can you compile a Rust library to target asm.js?
I've got a Rust library with the following usual structure:
Cargo.toml
src
|--lib.rs
.cargo
|--config (specifies target=asmjs-unknown-emscripten)
target
|......
When I do cargo build, I get a new ...
1
vote
2
answers
856
views
Can I get simple asm.js code? when simple c api code compile using emscripten
First, check my knowledge
c/c++ code >> compile(emscripten [emcc]) >> asm.js code
I can get c/c++ code to asm.js code, is it right?
asm.js code >> compile(binaryen [asm2wasm]) >...
5
votes
0
answers
756
views
Calling Rust compiled to Emscripten produces the error Module.dynCall_ii is not a function
I'm following along with the call from JavaScript tutorial. Instead of using node, I'm calling directly from a web browser:
hello_world/index.html
<!DOCTYPE html>
<html lang="en">
<...
0
votes
1
answer
369
views
Understanding Emscripten/ASM.js and the browser sandbox
Sorry for the basic question here. I'm trying to wrap my head around Emscripten, ASM.js, and compiling lower level languages to javascript.
Here is what I don't understand. You can do things in a ...
2
votes
1
answer
871
views
Emscripten worker-model with SDL audio
As I understand Emscripten worker model, it does not support a shared state. However, I can share global variables between the SDL audio callback and my mainloop, which if I understand this correctly, ...
1
vote
0
answers
194
views
What kind of performance should I expect running Emscripten generated code on Chrome?
I am experimenting with using Emscripten generated code in my Javascript application. The results are pretty disappointing performance-wize. I am seeing 40x slower on Chrome 49.0.2623.110 (compiling ...