Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WASM Compile Target? #387

Open
darth-cheney opened this issue Mar 28, 2019 · 6 comments

Comments

Projects
None yet
4 participants
@darth-cheney
Copy link

commented Mar 28, 2019

Hello all! As some of you might be aware, there has been a lot of progress in the web-world in developing WebAssembly. Many environments and languages can now compile to the wasm binary format. Projects are doing things like putting full Python interpreters and environments in the browser, etc. There is even a nascent movement to come up with a consistent system interface standard for WebAssembly, allowing developers to run wasm code on any platform -- not just the web.

My question is this: what would it take to get the opensmalltalk-vm to compile to WebAssembly and has anyone involved with it considered the option so far?

There would be a great many advantages to running a Smalltalk in the browser this way.

@johnmci

This comment has been minimized.

Copy link
Contributor

commented Mar 28, 2019

$10,000,000 usa

@OpenSmalltalk-Bot

This comment has been minimized.

Copy link

commented Mar 28, 2019

@ccrraaiigg

This comment has been minimized.

Copy link
Member

commented Mar 29, 2019

Yes, I've been following WASM since it attained full browser coverage in 2017. I've built the OpenSmalltalk stack interpreter with emscripten, no major gotchas. Of course we want a WASM Cog. We're waiting for WASM to do garbage collection, and provide an API for running your own generated native code. I expect both of these to arrive in the next two years.

In the meantime, I'm getting very good results running Squeak in web browser and on Node with SqueakJS. The simple bytecode-to-JS dynamic translator that Bert wrote for it is a big win. You get a decent translation of bytecodes to native code via the underlying JS engine (V8 et al).

@OpenSmalltalk-Bot

This comment has been minimized.

Copy link

commented Mar 29, 2019

@ccrraaiigg

This comment has been minimized.

Copy link
Member

commented Mar 29, 2019

It takes a Smalltalk CompiledMethod object, and transcribes the instructions (bytecodes) into a JavaScript method, and makes sure to run that instead the next time the CompiledMethod would normally run. Then V8 optimizes the hell out of that transcribed JS method. It's pretty neat, and makes a huge difference for lots of things, including the UI.

@OpenSmalltalk-Bot

This comment has been minimized.

Copy link

commented Apr 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.