codefrau / SqueakJS

A Squeak Smalltalk VM in Javascript
https://squeak.js.org
MIT License
379 stars 76 forks source link

Vector graphics for Cuis #169

Open codefrau opened 5 months ago

codefrau commented 5 months ago

Originally posted by @bpieber in https://github.com/codefrau/SqueakJS/issues/168#issuecomment-2152916896

I love the fact that SqueakJS runs a recent Cuis image. It pauses often when using it, though. I wonder if porting the VectorEnginePlugin would help and be feasible? Juan also mentioned the possibility to implement the VectorCanvas using Web APIs. Maybe that would be easier?

codefrau commented 5 months ago

Both would work, and yes that should help a lot.

“Easier” is relative – VectorEnginePlugin is just a Slang plugin, you could generate the JS code for it like I did for most other Slang plugins. Mind the last time I generated that code was in 2014, my VMMakerJS package is probably out of date. So either you adapt it to current VMMaker (which I would greatly appreciate!) or you find an old VMMaker version that is compatible.

How much work it would be to implement VectorCanvas in JS (and if the overhead would be worth it) I can't say. Maybe @jvuletich has an idea? You could write a SqueakJS plugin in JS, or use SqueakJS's JSBridge, which lets you directly call Javascript code.