Page 1 of 1

Note to Fred - use WebAssembly

Posted: Tue Dec 14, 2021 10:21 am
by OgreVorbis
I really think SpiderBasic would benefit from having a WebAssembly backend. Given that PB compiles to x86 assembly, I would think that producing WebAsm instead would be easier than JavaScript. Of course, it's already done in JS, so it might be a little annoying to re-do it, but it would be worth it. You'd probably see increased performance and the backend would be less of a cluster... I'm sure producing JS doesn't look pretty. Also, the way this compiles JS doesn't look very readable, but it could output "somewhat" readable WebAsm.

It'd make me a lot happier to use it. Part of the reason I like PB is that I know it's a clean language inside and out. Unlike something like Python for example, which is slow and ugly.

Re: Note to Fred - use WebAssembly

Posted: Thu Mar 10, 2022 11:48 am
by perb
PB compiles now with llvm as target. And llvm could deliver webassembly. So it would be good for PB to use this.

Re: Note to Fred - use WebAssembly

Posted: Tue Mar 15, 2022 2:23 am
by skywalk
PB v6 beta's added a C transpiler. Instead of generating ASM and custom compiling for a limited x86_x64 architecture, you can choose to transpile direct to C and apply the newly installed C compiler with optimization for even faster machine code and newer targets like the RaspberryPI or ARM based PC's!
LLVM was abandoned due to its complexity.

Once v6 goes release, it will be interesting to see what's next for SpiderBasic.
WASM is on the rise and will eventually overtake JS in browsers mainly because it saves power on mobile devices. Mobile drives browser tech, not PC's.
I would stick with JS until the WASM libs mature.

Re: Note to Fred - use WebAssembly

Posted: Tue Nov 14, 2023 1:57 pm
by Quin
skywalk wrote: Tue Mar 15, 2022 2:23 am PB v6 beta's added a C transpiler. Instead of generating ASM and custom compiling for a limited x86_x64 architecture, you can choose to transpile direct to C and apply the newly installed C compiler with optimization for even faster machine code and newer targets like the RaspberryPI or ARM based PC's!
LLVM was abandoned due to its complexity.

Once v6 goes release, it will be interesting to see what's next for SpiderBasic.
WASM is on the rise and will eventually overtake JS in browsers mainly because it saves power on mobile devices. Mobile drives browser tech, not PC's.
I would stick with JS until the WASM libs mature.
Agreed fully. I'd love to see SB compile to WASM, but maybe it needs to become more mature first.

Re: Note to Fred - use WebAssembly

Posted: Tue Nov 14, 2023 7:43 pm
by plouf
we all want that but since i see reported many times long ago i.e. viewtopic.php?p=6121&hilit=wasm#p6121

and no move done, i guess it has little hopes for the foreseen future.
too many thing are pending for SB... and webasm i think is not first priority