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

Add Web REPL using Emscripten #177

Closed
MathematicalDessert opened this issue Nov 8, 2021 · 4 comments · Fixed by #138 or #222
Closed

Add Web REPL using Emscripten #177

MathematicalDessert opened this issue Nov 8, 2021 · 4 comments · Fixed by #138 or #222
Labels
enhancement New feature or request

Comments

@MathematicalDessert
Copy link
Contributor

MathematicalDessert commented Nov 8, 2021

As for code tester - we'd love to get this! I think the easiest path is to build Luau REPL using Emscripten to WASM and create an HTML wrapper around it. Pull requests with that functionality are welcome, feel free to create a separate feature request for that.

Originally posted by @zeux in #120 (comment)

Create a demo page similar to Lua's on the doc site.

PR #138 closes this.

@zeux
Copy link
Collaborator

zeux commented Nov 10, 2021

Oops this wasn't supposed to close. We now have a change that allows us to build Repl with Emscripten. I'm going to take a look at integrating this change into the build process, and figure out how to best integrate it with the web site.

The current top two contenders are:

  • Maybe it's feasible to fetch the GH release artifact, directly or using something like jsdelivr
  • Maybe we should make an npm package and just publish new versions of that package; unpkg can be used after that to source the file.

@MathematicalDessert
Copy link
Contributor Author

Sounds good! Let me know what the end decision is.

@zeux
Copy link
Collaborator

zeux commented Nov 10, 2021

We've tested this lightly and it seems like it should be possible to just load the script from releases, e.g.

<script src="https://github.com/Roblox/luau/releases/download/<TAG>/luau.js"></script>

We could hardcode the tag to latest and make sure we move the tag with each release. Then we can simply upload build artifact with each release as we do with .zip archives for other artifacts.

This leaves the build setup. The only issue with the action that was in the earlier PR was the reliance on a third-party emsdk setup action. Is it possible to simply clone emsdk repository and run install & activate manually? (and maybe use GHA cache to speed this up, although maybe it's already pretty fast?)

@zeux
Copy link
Collaborator

zeux commented Nov 10, 2021

Oh, I should say that I don't know OTOH if the setup above works with .wasm but Emscripten has an option to embed ,wasm into .js so I'm assuming we could use that, which would also make it easier for us as it's just a single file we need to upload with releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
2 participants