Hacker News new | past | comments | ask | show | jobs | submit login

> Rewrote in FloemUI

Just had a look at this. It's one of the few that doesn't use jsx-like macros, an major anti-feature in my opinion. The jsx stuff looks fancy, but it completely breaks Rust Analyzer. You might not care about code completion, but good luck resolving the complex type+lifetime issues (that UIs in Rust often have) without hover type.

Kudos for showing scope discipline, that's one I will be keeping an eye on.




> The jsx stuff looks fancy, but it completely breaks Rust Analyzer

That's not inherent of macros, but how the parser of the macro body is written. Ideally, the jsx code would be transformed to correct Rust code even on broken input, then Rust Analyzer would map the tokens from the expansion to the tokens from the source code to have context for IDE features (rename, autocompletion, go to definition, etc).

I wrote some stuff [1]. It's a bit all over the place since I'm very bad at writing. Here's also a thread with Rust Analyzer's developers [2]

[1]: https://blog.emi0x7d1.dev/improving-autocompletion-in-your-r... [2]: https://www.reddit.com/r/rust/comments/16x2kzi/improving_aut...


The problem is that you also sometimes need to inspect output tokens that occur between (or that don't logically map to tokens between) the input tokens. I ran into this with Leptos. It's just a bad idea. Floem shows that you can have something that looks awfully similar to HTML, without the unnecessary complexity (and compile times) of JSX macros.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: