# WebAssembly (Wasm) Stack Machine on BEAM

**URL:** <https://erlangforums.com/t/webassembly-wasm-stack-machine-on-beam/2957>\
**Category:** BEAM Chat / Discussions\
**Tags:** webassembly, wasm\
**Created:** [October 18, 2023, 5:27am UTC](https://erlangforums.com/t/webassembly-wasm-stack-machine-on-beam/2957 "2023-10-18T05:27:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vances](https://erlangforums.com/user_avatar/erlangforums.com/vances/32/710_2.png) [@vances](https://erlangforums.com/u/vances)\
**Post date:** [October 18, 2023, 5:27am UTC](https://erlangforums.com/t/webassembly-wasm-stack-machine-on-beam/2957/1 "2023-10-18T05:27:02Z")

</div>

Has anyone looked at implementing a [Wasm](https://webassembly.github.io/spec/core/exec/index.html) stack machine on BEAM?

---

<div class="post-metadata">

**Author:** ![Winford](https://erlangforums.com/user_avatar/erlangforums.com/winford/32/1246_2.png) [@Winford](https://erlangforums.com/u/Winford)\
**Post date:** [October 18, 2023, 3:52pm UTC](https://erlangforums.com/t/webassembly-wasm-stack-machine-on-beam/2957/2 "2023-10-18T15:52:03Z")

</div>

We have recently added a WASM port of AtomVM that is still in alpha stage and could use testing and feedback.

The project is on GitHub:

> **[GitHub - atomvm/AtomVM: Tiny Erlang VM](https://github.com/atomvm/AtomVM)**
>
> Tiny Erlang VM. Contribute to atomvm/AtomVM development by creating an account on GitHub.

Here are the docs for getting started with the WASM port:

[https://www.atomvm.net/doc/v0.6.0-alpha.1/getting-started-guide.html#getting-started-with-atomvm-webassembly-port-for-browsers](https://www.atomvm.net/doc/v0.6.0-alpha.1/getting-started-guide.html#getting-started-with-atomvm-webassembly-port-for-browsers)

---

<div class="post-metadata">

**Author:** ![vances](https://erlangforums.com/user_avatar/erlangforums.com/vances/32/710_2.png) [@vances](https://erlangforums.com/u/vances)\
**Post date:** [October 18, 2023, 3:58pm UTC](https://erlangforums.com/t/webassembly-wasm-stack-machine-on-beam/2957/3 "2023-10-18T15:58:12Z")

</div>

That is upside down from what I was asking about but quite interesting none the less.

---

<div class="post-metadata">

**Author:** ![Winford](https://erlangforums.com/user_avatar/erlangforums.com/winford/32/1246_2.png) [@Winford](https://erlangforums.com/u/Winford)\
**Post date:** [October 18, 2023, 4:11pm UTC](https://erlangforums.com/t/webassembly-wasm-stack-machine-on-beam/2957/4 "2023-10-18T16:11:50Z")

</div>

Sorry, I had a funny feeling as soon as I posted that I had your question backwards. 🫣

---

<div class="post-metadata">

**Author:** ![vances](https://erlangforums.com/user_avatar/erlangforums.com/vances/32/710_2.png) [@vances](https://erlangforums.com/u/vances)\
**Post date:** [October 18, 2023, 4:35pm UTC](https://erlangforums.com/t/webassembly-wasm-stack-machine-on-beam/2957/5 "2023-10-18T16:35:02Z")

</div>

I’m also not asking about interfacing to Wasmtime or other external Wasm runtime. I’m wondering how feasible it would be to implement the Wasm stack machine over the BEAM register machine. I assume that the result wouldn’t be performant but it might be useful for portability of simple functions.
