roc-lang / roc

A fast, friendly, functional language.
https://roc-lang.org
Universal Permissive License v1.0
3.93k stars 290 forks source link

Editor in web browser #1697

Open dullbananas opened 2 years ago

dullbananas commented 2 years ago

I would like to be able to run a command that lets me access the editor at localhost. This would allow the editor to be used on iPad, either with Github Codespaces or iSH linux emulator. (It might already be possible to use it through iSH but the GUI is too laggy in iSH)

satotake commented 2 years ago

Nice. If this is possible, we can use docker for testing or developing purpose. While this can be solved with nix or docs, I think it is worth considering it since the differences between OSs can be absorbed by container. It could lower entry barriers.

rvcas commented 2 years ago

This might not work for a while. Currently the editor is targeting native graphics. Although it’s possible to emit HTML/JS from the AST, it would require a different approach to handling user interaction events and I’m not sure we’ve even considered supporting web browsers at the moment.

satotake commented 2 years ago

I agree that the priority of native (local) editor is higher than of web editor, in particular in the early stage.

By the way, (this is rough thought) Isn't it possible that both native and web editors are implemented with WebGL/WebGPU (wgpu/wgpu-hal)? Surely, Roc will support first-class wasm compile. It might be more practical in the future.

rvcas commented 2 years ago

Yea that makes sense actually. I forgot we use WebGPU and the wasm stuff is coming along nicely