desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Can you add GPU

Open Boubou78000 opened this issue 1 year ago • 5 comments

Ex: Lines’ pixels for Pen Extension…

Boubou78000 avatar Feb 20 '24 10:02 Boubou78000

Could you provide more detail on what you mean? TurboWarp has the 'Pen+', 'Simple 2D' and 'Simple 3D' extensions which allow you to make projects using GPU rendering. I don't know if there's any way to get the colour at a certain point, but that could be added through an extension, if that's what you meant.

Logabe avatar Oct 12 '24 01:10 Logabe

NVIDIA CUDA or AMD ROCM It is for parallelism.

But turbowarp desktop is just using JS as NodeJS, which is the main cause of the bad performances. So maybe add a JIT or a lower level compiler would be appropriated.

JIT = Just In Time compiler. An example of JIT is the copy patch JIT. It compiles the scratch code to JS and adds tags and we fill the fill tags dynamically.

This comment has really 1 years old, so I thought that no GPU parallelism is what did make turbowarp slower than for example minecraft (which uses GPUs and is as fast as Scratch without). It is maybe true but with the knowledge I have now, I would recommend first other techniques like low level compilers or JITs which would really improve perfs.

Boubou78000 avatar Oct 12 '24 07:10 Boubou78000

the main purpose of TurboWarp is to JIT compile projects to JavaScript, and native machine code compilation isn't really possible because it's made in JavaScript (at most it could compile to WebAssembly, but that would take probably a lot of time to implement)

CST1229 avatar Oct 12 '24 08:10 CST1229

Yes, but the desktop app can admit low level machine code

-------- Message d'origine -------- Le 12/10/2024 10:36, CST1229 a écrit :

the main purpose of TurboWarp is to JIT compile projects to JavaScript, and native machine code compilation isn't really possible because it's made in JavaScript (at most it could compile to WebAssembly, but that would take probably a lot of time to implement)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

Boubou78000 avatar Oct 12 '24 09:10 Boubou78000

Yes, but the desktop app can admit low level machine code

still not really, since the desktop app is essentially just chrome packaged together with the turbowarp website (because it uses electron)

CST1229 avatar Oct 12 '24 10:10 CST1229

Yes, but the desktop app can admit low level machine code

still not really, since the desktop app is essentially just chrome packaged together with the turbowarp website (because it uses electron)

Cannot make a lower level Turbowarp desktop app? Like a milestone or a project? A branch or a fork...

But it will need so much work and time...

Okay. Maybe a long time project that will progress slowly, through many years, who knows? Who cares? It will make a few people happy but nobody really cares!

I think we should create a WIP long term low level turbowarp desktop app... It will live years and years, one contribution here, another one here... Maybe it will never be finished...

I originally posted this message because scratch was too slow, the limits stopped all the creativity, ruining scratch to trending tagspam projects. But Turbowarp was here and expanded the limits... It did so many cool projects (e.g. the mast). But again we reached the maximum power of a JavaScript interpreter. Time to switch to a machine low level code...

And maybe WASM, which can run low level code directly in your browser! This is the only way to expand the limits of Scratch, or it will be stuck here for ever.

Boubou78000 avatar Nov 02 '24 21:11 Boubou78000

I think that it is beyond the scope of TurboWarp. I'm all for a native application that can run Scratch Projects, but it seems a very ambitious project. If you were to develop this application, it would probably be better to just create a player and not an editor (like Scratch 1). You'd also have to likely develop it from scratch as I doubt Scratch's JS (or Flash or Java or Squeak, if you include old versions) code would be that useful for developing a low-level application.

SolidLamp avatar Nov 03 '24 11:11 SolidLamp

Yeah. It’s very ambitious.

And for sure no editor. This is not TurboWarp, it’s another project, that will have an other name... FireWarp maybe?

The hardest will be to incorporate WebGL into a rust / cpp / c app... Should we start without graphics, the easy part?

Boubou78000 avatar Nov 03 '24 12:11 Boubou78000

I actually wrote a basic Scratch interpreter in Rust using the WGPU package. It wasn't very good and I've stopped working on it, but it would be technically possible. I didn't run any benchmarks (as it only supported a couple of blocks and I didn't figure out how to sync the Graphics and Scratch states) but I still feel like it would have under-performed compared to TW. The codebase was messy and I don't think it is worth the time, at least for me.

Logabe avatar Nov 03 '24 18:11 Logabe

Anyway, this conversation has been very derailed.

Logabe avatar Nov 03 '24 18:11 Logabe