neilsf / XC-BASIC

A compiling BASIC dialect for the Commodore-64
https://xc-basic.net/
MIT License
74 stars 15 forks source link

XC-Basic build options for using it in a browser #142

Closed frenchfaso closed 2 years ago

frenchfaso commented 3 years ago

Hy @neilsf is it possible to compile XC-Basic for one of the following targets:

I would like to build a simple web based XC-Basic code editor that mimics the P5 js webeditor workflow:

I would like it to be all-clientside, so I discarded the "compiler-as-a-service" option.

To make some quick tests, an x86 32 bit linux compiled XC-Basic that can run in a linux js vm alongside dasm would probably be the easiest path.

neilsf commented 3 years ago

Hey @frenchfaso

Although I wonder how XC=BASIC would access files (it reads and writes files on disk)... this part would need to be adjusted to the web environment somehow? Sorry if I'm speaking nonsense, I'm not much of a professional in WebAsssembly.

frenchfaso commented 3 years ago

Thanks!

Although I wonder how XC=BASIC would access files (it reads and writes files on disk)...

I'm not familiar with webassembly either, but Emscripten should take care of this, it has various shims for SDL, OpenGL, FS, etc.. Documentation mentions C/C++ but in theory it should work with every language that uses LLVM.

I will try the Linux js vm route first, seems like the quickest path to a working proof of concept (I might be wrong!) Compiling XC-Basic from git master on a 32 bit linux should give me a 32 bit XC-Basic? No need to modify dub.json or some other config file?

neilsf commented 3 years ago

Compiling XC-Basic from git master on a 32 bit linux should give me a 32 bit XC-Basic?

It should. If compilation fails with an error, let me know because there can be a bug in the code that only shows up in 32-bit systems - I can fix that easily.

No need to modify dub.json or some other config file?

No, it should work without any mod.