Developers can now run Pharo, a Smalltalk-based environment known for rapid and immediate iteration, directly within a web browser using WebAssembly. This development allows users to explore emergent results and artistic construction in a portable way, though it introduces specific challenges regarding how the browser handles mouse input and canvas scaling.
Pharo in the Browser
The primary source introduces a project that enables Pharo to run in a web browser via WebAssembly. Pharo is a Smalltalk environment where developers often value the ability to see intermediate or unintended results during the construction of a project, such as a Minesweeper clone.
The technical mechanism is believed by some observers to be a bytecode interpreter compiled with Emscripten. Because WebAssembly has a limited execution model, there is currently no attempt at JITing or pre-compiling the image code, which is a notable constraint for a dynamic language like Smalltalk.
User Experience and Technical Friction
Commenters on Hacker News have identified specific technical bugs in the current implementation. For instance, one user reported that the environment renders incorrectly in Firefox, with mouse clicks failing to align with the canvas when the browser is zoomed.
Another commenter noted that the experience can feel 'hacky' because of the friction between the software and the hardware. They argued that running a full environment in a browser requires significant resources and drivers to align the experience with a native operating system.
Trade-offs and Limitations
While the browser port increases accessibility, some participants in the discussion questioned if this move defeats the core purpose of using Pharo. The trade-off involves gaining portability at the cost of the seamless performance found in a native environment.
Unresolved questions remain regarding how to build the code and how to overcome the limitations of the WebAssembly execution model for Smalltalk's dynamic features. Current users have suggested CSS adjustments, such as removing specific transform scales, as temporary workarounds for rendering issues.
