6 ms·
Hey, thanks for the very insightful comments! Happy to chat about that :D - It is possible to add syntax highlighting to the JS components using nested grammar
by ekzhang 5y ago
Hey, thanks for the very insightful comments! Happy to chat about that :D
- It is possible to add syntax highlighting to the JS components using nested grammars in CodeMirror! I haven't gotten around to it yet though.
- It compiles to JavaScript because the data structures I'm using and passing around are all JavaScript data structures, and modern web browsers also have quite fast JIT compilers for JavaScript. There would likely be some speed bonuses from using WebAssembly in the future, but it would be significantly more complicated - most likely, I'd have to develop some kind of runtime library for the balanced binary search tree indices and everything (likely in Rust), then compile that to Wasm and link everything together. :D
- Execution is done in Web Workers primarily to be sandboxed. As mentioned in the tutorial notebook, we don't want long-running computations or infinite loops to block the render thread and freeze the user's browser; that would be bad! It also lets the user cancel computations if the cell becomes stale. Having multi-threaded execution is also a bonus. Cell outputs are not "cached" directly, but in the sense that they aren't rerun unless their dependencies change. :)
- Exactly! That's what the vision is - exploratory data analysis of public datasets that is reproducible, tangible, and easy to share. I'm not sure if the current form of Percival is the best for this, but that's precisely the problem that I've been thinking about.
- Hopefully it would be possible to embed number-crunching like you mention, though I would really like a declarative interface for such computation. Maybe this could be a cool idea for future research or extension!
I liked working with chumsky for parsing a lot. What really made me excited as this project was taking shape was how _fun_ it felt to interactively play with data queries and see the results appear in my browser in real time. It makes me happy as a web developer as well as a PL designer, both as someone who makes user interfaces. :)