A potential solution would be Pharo -> Slang -> C -> Javascript
Slang converts pharo code to C and Emacscripten converts C to Javascript.
This approach also should produce minimal JS code but it wont be readable.

This C to Js approach also has the advantage of being able to utilize
webassembly and asm.js to provide high performance JS code something that
other approaches that go directly from Pharo to JS will struggle with.

The reason being that tools that support these approaches tend to more
heavily optimize the generated JS code.

The catch here is that you will have to understand both C and JS to iron
out potential issues. So this means this is definitely not a "simple way to
translate Pharo code into JS" as you requested.

Reply via email to