4 ms·
Show HN: Simple live calculator in Tree-sitter and cranelift JIT
- iwwr 2y agoSo what does it do?
- GrumpyNl 2y agoThere is a demo video on the page.
- unrealhoang 2y agoIt calculates
- faruk74summy 2y ago[dead]
- iroddis 2y agoThank you for posting, I’ve been eyeing using TreeSitter to make some toy languages, and this looks like a great example to learn from. The error.rs error type definitions and the pub(crate) directives were both new to me. It’s crazy to me just how much rust continues to evolve well after the 1.0 release. Error handling in particular seems to be a point of confusion; I’ve seen (and bookmarked) many posts on HN about it. The thiserror crate was new to me, and seems really nice.
- jasonjmcghee 2y agoI've been enjoying tree-sitter, using it for a larger project now. I found it more intuitive than peg, but certainly comes with more... weight (entire subfolder, bindings, build process etc) and is more verbose. But can simplify syntax highlighting and other editor related things. Zed uses it extensively, and all you need are queries for each of the features (https://zed.dev/docs/extensions/languages https://zed.dev/docs/extensions/languages) Miette is responsible for actually rendering the error messages you see- which was new to me, but have always appreciated how that style of error looks and is so much more helpful than "[1:23]"