TurboWarp / scratch-vm

Scratch VM with a JIT compiler and more features
https://turbowarp.org/
Mozilla Public License 2.0
75 stars 72 forks source link

Update improved type analysis to develop #216

Open Tacodiva opened 4 months ago

Tacodiva commented 4 months ago

Supersedes #160

I still want to do this but last time I got so bogged down by trying to preserve the git history that I stopped working on it. I've decided to just merge the whole thing into one commit so I can stop thinking about git and actually have fun working on this again.

At the time of me opening this PR it passes all the tests but I or someone still needs to go through and lint it because eslint has a lot of complaints. The type analysis itself can still be improved, but I'm happy with where this is at.

I can't merge into "next" because of the aforementioned git problems.

yuri-kiss commented 4 months ago

Monumental task, Gl and i like the look of it :wave:

GarboMuffin commented 4 months ago

The snapshot tests are falling back to naming every compiled script just "script" instead of the procedure variant/code here

https://github.com/TurboWarp/scratch-vm/blob/30a614dfc4885385c5aff6d64a778cb5077904b2/test/snapshot/lib.js#L95-L103

GarboMuffin commented 3 months ago

I will get this on an experiment tonight and get some people to help with testing

GarboMuffin commented 3 months ago

https://experiments.turbowarp.org/next/ this is updated now if anyone wants to help us find regressions

Tacodiva commented 3 months ago

I found a project that wasn't working and have fixed the issue and added tests for it

GarboMuffin commented 3 months ago

https://experiments.turbowarp.org/next/ should be up-to-date again

GarboMuffin commented 3 months ago

I accidentally put this in production last night and got a few (very useless) bug reports very quickly before rolling back

image

Jazza-231 commented 3 months ago

https://github.com/TurboWarp/scratch-vm/assets/81956724/56ce8a5b-d0fb-4ad5-92f4-dd6efc4c543c

https://turbowarp.org/780631097?interpolate&offscreen

Compiler causes different behaviour, in the menu FX sprite, I suspect It is to do with the touching colour block.

Update: Yes, it is, the list usage and normal usage of the touching colour block both do not work.

Tacodiva commented 3 months ago

I've fixed the issues with the touching color and color touching color blocks, as well as an issue where switching to a costume with a number name (like switch costume to "1") would switch to costume number 1 instead of the costume named "1". I feel like I should add a test for at least this second one but I'm not sure if I should create a new execute test or add it to an existing one.

FurryR commented 2 months ago

vm.exports.i_will_not_ask_for_help_when_these_break().ScriptTreeGenerator seems not working, I hope it can be fixed soon.

yuri-kiss commented 2 months ago

vm.exports.i_will_not_ask_for_help_when_these_break().ScriptTreeGenerator seems not working, I hope it can be fixed soon.

The exports are not in this version, and btw it does say not to ask for help so keep that in mind :+1: , regardless I do hope exports are added for this as-well, or if you guys are up to it a basic compiler API for extensions :P

Tacodiva commented 2 months ago

Sorry, those exports being missing was due to a mistake, I should have fixed that up now (though note that their usage may be different to mainline). I've also exposed some of the new classes used in the IR as it may be helpful to have access to their constructors. I have also exposed the new enums being used throughout the IR. Garbo will need to make the final decision on this though.

yuri-kiss commented 2 months ago

With the exports I have made working patches already, This is great, thanks so much lol, also I like how its more type based it helps a lot. (video link tw disc: https://discord.com/channels/837024174865776680/1098474682543509514/1269046708332134471)

CubesterYT commented 2 weeks ago

What's the status of this PR so far? I'd like to know, since this is a great update to TurboWarp.

Tacodiva commented 2 weeks ago

I've just merged develop into this again so, it's ready to go again. Not sure when garbo would consider merging this, I suppose it will be down to when he feels it has been sufficiently tested and he has time to review the code.

yuri-kiss commented 2 weeks ago

epic


From: Tacodiva @.> Sent: Wednesday, September 25, 2024 9:58 PM To: TurboWarp/scratch-vm @.> Cc: Subscribed @.***> Subject: Re: [TurboWarp/scratch-vm] Update improved type analysis to develop (PR #216)

I've just merged develop into this again so, it's ready to go again. Not sure when garbo would consider merging this, I suppose it will be down to when he feels it has been sufficiently tested and he has time to review the code.

— Reply to this email directly, view it on GitHubhttps://github.com/TurboWarp/scratch-vm/pull/216#issuecomment-2375596793, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BAGGRIGQJEMDMLX2PEUT4Z3ZYNS4NAVCNFSM6AAAAABJMHWJL6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZVGU4TMNZZGM. You are receiving this because you are subscribed to this thread.Message ID: @.***>