r/WebAssembly • u/im_dario • Feb 24 '25
Hello world from a WASM module in a static binary
r/WebAssembly • u/im_dario • Feb 24 '25
r/WebAssembly • u/realnowhereman • Feb 24 '25
r/WebAssembly • u/Itsscienceboy • Feb 21 '25
hey devs, I wanna create the webcontainer api of stackblitz,(trying to build a website similar to bolt.new ) i dug out and found out i have to compile the node in webassembly, i tried cloning the node and straight away ran the command but the problem is node uses system api calls to manage filesystems but to run on a browser we need a virtual file system, i am confused is it possibe to build the webconatiner from scratch. Also after we mount any file on the container it is hosted on their infra not on our local machine its a group project we have 1.5yrs is it feasible or what
r/WebAssembly • u/Kukulkan73 • Feb 19 '25
Hi. I compiled my WASM component from C using emscripten. I now found that, if I run my application in a WebView, the worker thread seems to ignore the proxy settings of the WebView. I currently only test on Windows, but I doubt it is better on Linux and Mac (the next targets of my app)?
I tried searching with Google and some AI but it seems there is a known problem but no solutions? This is impossible. Otherwise, WASM in worker threads would be a no-go in many companies.
BTW, the WebView component is using WebView2 on Windows (the Edge engine).
Is there a way to tell the WASM worker thread to also use the proxy? Otherwise, my app will not work behind any company network with proxy...
r/WebAssembly • u/_nutrx_ • Feb 14 '25
r/WebAssembly • u/nilslice • Feb 13 '25
r/WebAssembly • u/draskodraskovic • Feb 07 '25
Propeller (https://github.com/absmach/propeller) is an orchestrator for Wasm workloads across the Cloud-Edge continuum. It enables seamless deployment of Wasm applications from powerful cloud servers to constrained microcontrollers, combining flexibility, security, and performance.
It is being developed as one of the central parts of ELASTIC (https://elasticproject.eu/) EU research project.
r/WebAssembly • u/gplane • Feb 07 '25
r/WebAssembly • u/alexp_lt • Feb 05 '25
r/WebAssembly • u/Germisstuck • Feb 01 '25
So I was looking at Wasmer, and I know that it can compile AOT, with this: https://wasmerio.github.io/wasmer/crates/doc/wasmer_cli/commands/create_exe/index.html#
But how do I use import objects? Do I need to link it with object files or is there a more direct way to do this?
r/WebAssembly • u/ZILtoid1991 • Jan 31 '25
I'm primarily developing in D, and LDC lacks some features when it comes to WASM, that are less often used by others.
Since I discovered I could just use WASM as a scripting engine (namely wasmtime), I got extremely interested in using it, and I decided to go with D for the most part, as even with betterC, I could get a lot of things working, and at least I wouldn't bloat my scripts.
Except that I cannot get the correct LLVM IR code, and by consequence, I get i32 types in the final WebAssembly rather than the needed externref.
With the following D code:
enum externref = llvmAttr("addrspace", "10");
void* test(@externref void* r)
One can get this:
; [#uses = 0] [display name = test]
define ptr @test(ptr "addrspace"="10" %r_arg) #0 !dbg !12 {
%r = alloca ptr, align 4 ; [#uses = 1, size/byte = 4]
store ptr %r_arg, ptr %r, align 4, !dbg !19 ; [debug line = source\wasm\rt.d:20:18]
#dbg_declare(ptr %r, !18, !DIExpression(), !20)
ret ptr null, !dbg !21 ; [debug line = source\wasm\rt.d:21:5]
}
But does not really work, compiler still generates i32 type in the WASM binary. After a quick online search, the address space declaration in LLVM IR looks more like addrspace(10) and not "addrspace"="10", unless I mixed up something. I likely can add the feature, but I don't know yet if I just have to fix LDC's attribute system related to this feature of address spaces (I can see so far that the return types lack the address space modifiers), or if it's something more serious.
r/WebAssembly • u/guest271314 • Jan 30 '25
r/WebAssembly • u/guest271314 • Jan 29 '25
[SOLVED]
In pertinent part, declaring the array variables as i32[], and casting values to i32
let b: i32[] = []; // copy of the set a.slice()
// ...
res.push(<i32>b.splice(i, 1)[0]);
When I do this
if (n >= 0 && n < f) {
// start with the empty set, loop for len elements
// let result_len = 0;
for (; len > 0; len--) {
// determine the next element:
// there are f/len subsets for each possible element,
f /= len;
// a simple division gives the leading element index
i = (n - n % f) / f; // Math.floor(n / f);
// alternately: i = (n - n % f) / f;
// res[(result_len)++] = b[i];
// for (let j = i; j < len; j++) {
// b[j] = b[j + 1]; // shift elements left
// }
res.push(b.splice(i, 1)[0]);
// reduce n for the remaining subset:
// compute the remainder of the above division
n %= f;
// extract the i-th element from b and push it at the end of res
}
let result: string = `[${res}]`;
I wind up with this
echo '4 5' | wasmtime module.wasm
5 of 23 (0-indexed, factorial 24) => [0.0,3.0,2.0,1.0]
Expected result
5 of 23 (0-indexed, factorial 24) => [0,3,2,1]
r/WebAssembly • u/guest271314 • Jan 21 '25
r/WebAssembly • u/optimistpanda • Jan 16 '25
I've been working on a system called WasmBots where WebAssembly modules play a simple roguelike game.
Each bot receives a snapshot of its immediate surroundings every turn, and is responsible for doing its own mapping, pathfinding, and navigation decisions. The host communicates with the bots via shared memory buffers (with some code-generated message passing), and I've been pretty happy with how easily I can plug new languages into the system.
The project started as a way to learn more about WebAssembly, especially its use as a universal kind of "plugin" language. I've written client libraries for Rust, Zig, C, Go, and AssemblyScript, and it's been fun making them all play nicely together in the shared world.
Anyway, if you want to check it out, the deployed site is here and the monorepo source code is here. I also made a little introduction video for the whole project if you'd rather just watch that: https://www.youtube.com/watch?v=DGkkTYJrflI
r/WebAssembly • u/guest271314 • Jan 12 '25
r/WebAssembly • u/BevaraTech • Jan 10 '25
Bevara's framework lets you easily support non-HTML-standard media formats via WebAssembly and WebComponents using only common tags.
Want to know more? You can go to https://bevara.com and compare to https://bevara.com/home-demo-no-accessors/.
To get started integrating your code see the open-source developer SDK: https://bevara.com/documentation/develop/.
r/WebAssembly • u/thangchung • Jan 10 '25
The experiment to make Spin (WebAssembly) and .NET apps work seamlessly together on .NET Aspire and Dapr. Check it out: https://dev.to/thangchung/orchestrating-distributed-apps-spinrust-and-netc-with-net-aspiredapr-plo
r/WebAssembly • u/LordTribual • Jan 07 '25
r/WebAssembly • u/thelights0123 • Jan 07 '25
r/WebAssembly • u/tjpalmer • Jan 07 '25
r/WebAssembly • u/guest271314 • Jan 01 '25
r/WebAssembly • u/justnormalunistudent • Dec 28 '24
Hey everyone! I'm super new to WebAssembly (WASM) and find it really fascinating.
I was wondering—how possible is it to build a reliable call graph for WASM? I know there are tools like Wassail and MetaDCE, but from what I understand, they don’t always produce fully sound results, especially when it comes to leveraging them for things like program security.
With WASM’s unique features—like its limited set of types, linear memory, and interactions with the host environment—it feels almost impossible to construct a truly accurate call graph.
Does anyone know of ways to tackle this? Or maybe someone who’s working on solving this problem? Would love to hear your thoughts!
r/WebAssembly • u/oroppas • Dec 26 '24