-
Notifications
You must be signed in to change notification settings - Fork 79
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
SqueakJS V2 (WIP) #168
base: main
Are you sure you want to change the base?
SqueakJS V2 (WIP) #168
Conversation
Interesting, thanks for sharing! Am I qualified to ask one or two questions? :-)
Sorry if this is out of topic ... |
If no suitable inst var name string can be found, we can easily generate a name like
See here, in particular this section. I haven't done a complete analysis though. This is still a hobby for me ;) I believe we can overall get a 10x improvement in send speed. That would get us to within a magnitude of Cog. |
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 Very interesting read, thank you! :-) |
This uses Smalltalk inst var names for property names prefixed with a `$` (e.g. a Point would use `{ $x: 3, $y: 4 }` in JS). Indexable fields are in an array named `$$` (e.g. in Context you would have `{$sender: ..., $$: [tmp0, tmp1, ...]}`. The `.pointers` property is now a proxy to allow the rest of the VM and primitives to still work. The JIT and optimized primitives will not use this proxy.
I implemented actual var names, see b6a32be The VM still works thanks to the I tried it with various images (old, new, 32-bit, 64-bit) but it may be helpful if you could try others too. Everything should work as before, just slower. |
Could we port v2 to ESM and JS-native classes, considering as, iirc, Lively4 and Lively Next support it, in addition to most non-Lively coding environments and tools? |
I'm not sure how much we would gain from that. We would lose the ability to use the Lively tools at Dan's Smalltalk Zoo though. So I'm not entirely opposed but it's definitely not a priority for me since the behavior wouldn't change at all and v2 is about better behavior. |
That might present an issue, unless Smalltalk Zoo is updated.
My particular issue is about the usage of globals and extension methods, which make SqueakJS hard to optimize, especially AOT, and hard to scope (what if there are two SqueakJSs on one page?). |
Dan is not getting any younger, I doubt that would happen.
The majority of run time will be spent inside of generated code once the new JIT is in place. I don't think spending much effort to optimize the support code is worth the trouble. BTW what AOT are you envisioning? |
Compiling SqueakJS, with a "factory" image, into an appropriate binary with ComponentizeJS or similar tools (for similar purposes as Sugar's EToys integration for my projects) |
I'm sorry, targeting WebAssembly in that way is madness and would result in a much slower execution and a more bloated download. I could elaborate but not on here. We need to take this discussion elsewhere because it's getting very much away from SqueakJS V2. Please continue on the mailing list, preferably vm-dev. If you don't like that, open a separate ticket (but you would get more people to engage on a mailing list) |
Goals of V2: see README
This PR mainly exists as a place for discussion.