[Vm-dev] tracking WebAssembly

Ryan Macnak rmacnak at gmail.com
Sun Apr 14 17:16:10 UTC 2019

On Mon, Mar 18, 2019 at 7:58 PM Eliot Miranda <eliot.miranda at gmail.com>

> > On Mar 18, 2019, at 1:50 PM, Levente Uzonyi <leves at caesar.elte.hu>
> wrote:
> > Wouldn't it be easier to just use emscripten to compile the current C
> code directly to wasm?
> > I mean, it would probably be a smaller undertaking to create the
> necessary bindings/plugins for emscripten than to generate wasm code
> directly from VMMaker and rewrite the platform code.
> Sure, but running a stack machine virtually above another stack machine is
> going to be far less efficient than mapping the Cog Smalltalk stack to the
> WebAssembly stack.  So it’s an issue of performance and ambition.  I tend
> to choose the ambitious route, within affordability constraints.

The WebAssembly stack is too restrictive to directly host the Smalltalk
stack. By design, it's not possible to get an address into the stack. For C
code, Emscripten places locals that have their address taken into a shadow
stack that lives in WebAssembly memory. A direct translation from Slang to
WebAssembly would have to do the same.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20190414/e06babc4/attachment.html>

More information about the Vm-dev mailing list