-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
topiary.tweag.io Interactive Playground #171
Comments
Reporting findings, so far, so they don't get lost: WASM vs. RESTA REST API would be very easy to write. However, that would then require a long-term commitment on server infrastructure and all that entails. A WASM target is harder to write, presuming it can be done, but then it can be statically hosted with a trivial maintenance burden. Is WASM possible?The Tree-sitter playground is using WASM. Also, the Rust Sitter project contains this quote in its
That highly suggests that, not only is it possible, but gives two departure points to see how it's done. Notes and Resources
|
Looking a bit more into what Rust Sitter does, I don't think it applies to us. They are using the tool C2Rust to transpile Tree-sitter to Rust code. It then becomes easy to build Wasm using We could have done the same, but the problem is all the various Tree-sitter grammars that also have to build C code as well as depend on the Tree-sitter crate. Rust Sitter doesn't have that problem, because they don't depend on any grammars. They are a tool for creating grammars. The Tree-sitter crate actually consumes grammars as C code. Reworking this as well as all the grammars to Wasm sounds non-trivial. Will now take a look at how the Tree-sitter playground works. |
The Tree-sitter Playground is nice because it is built as one |
Let me point out that @TerrorJack has extensive experience with Wasm, in particular with compiling C code with Wasm. So don't hesitate to ask him for advice. |
I think the way to do this would be something like this:
That's the general idea, anyway. Will update this strategy when I know why it doesn't work 😀 |
A basic version is now implemented and deployed to https://topiary.tweag.io/playground. Let's log any suggested improvements as separate issues. |
Definitely 👍 |
Is your feature request related to a problem? Please describe.
To prototype new queries and to play with Topiary as a formatting engine (e.g., to drive adoption), it would be really useful to have an online, interactive playground at, say, topiary.tweag.io (or similar). These are very common in this space: e.g., Tree Sitter, Shellcheck, Rust, Black (third-party playground), etc.
Describe the solution you'd like
Provide a simple playground website (frontend and backend), with the following widgets:
The output panel would update interactively, on changes to the input widgets.
Describe alternatives you've considered
It's quite easy to rig this up in the terminal, for prototyping and playing, but there's a non-zero amount of friction.
Additional context
Many playgrounds allow you to save/share state. This would be a "nice-to-have", but not strictly necessary, IMO.
The text was updated successfully, but these errors were encountered: