Skip to content
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

support html5 #4

Open
RodrigoDornelles opened this issue Sep 12, 2024 · 3 comments
Open

support html5 #4

RodrigoDornelles opened this issue Sep 12, 2024 · 3 comments

Comments

@RodrigoDornelles
Copy link

Support for browsers would be interesting, rendering via canvas and using webassembly.

@matiasvlevi
Copy link
Owner

matiasvlevi commented Sep 12, 2024

Yes, definitely.

We would need a js canvas/webgl (canvas for 2D, webgl for 3D) implementation for most of the lu5 bindings.
You might find site/static/js/lu5.js which purpose was to re-implement most of the lu5 bindings. The script is not connected to any website pages at the moment, it is also incomplete since I deemed this not a priority.

We would also need a way of compiling to wasm. That might take a little more research on my side to be done right.

@matiasvlevi
Copy link
Owner

matiasvlevi commented Oct 12, 2024

Hi Again,

I added basic WebAssembly support in the recent commits.

I chose to compile the lu5 interpreter in wasm32-wasi with clang, and then write a JS polyfill in a separate repo.
I added a few live examples
Also, documentation examples can now be executed on the web page (As seen in the docs of v0.1.7/shapes)

This will all be included in the next release,
but you can already use the CDN from npm: https://unpkg.com/lu5-wasm@latest/dist/lu5-wasm.min.js and https://unpkg.com/lu5-wasm@latest/dist/lu5.wasm

what's next? An online editor?

@RodrigoDornelles
Copy link
Author

It was awesome!

Online editor is a cool idea, I'm working on one in my game engine, but I'm bad with frontend. But Microsoft's Monaco Editor is a good component that allows you to embed vscode in a web page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants