3 ms·
I believe the first issue could be somewhat mitigated if the editor displayed the inferred types as virtual text.
by eterps 4y ago
I believe the first issue could be somewhat mitigated if the editor displayed the inferred types as virtual text.
- ChadNauseam 4y agoRust-analyzer in VSCode does this for local variables, and it's very nice
- cmrdporcupine 4y agoJetbrain's Rust mode for CLion, etc. will do this all over the place -- display inferred/matching types for variables, pattern matches, function arguments, etc. But it would be unfortunate to have to rely on a tool in this way for basic language functionality.
- sacnoradhq 4y agoYes and no. It doesn't matter if a tool is required to elide behavior. In an Ideal World(tm), rust would work more like a functional language by: - elide lifetimes across boundaries, warning if it weren't clearly reducible to less than static - elide types across boundaries, failing that show a counterexample creating a paradox - allow specialization and exclusion of type patterns - discard some dyn and impl for simplicity rather than invent confusing constructs - and of course add dependent typing :)
- bombela 4y agoYou get this for all well known text/code/ide editors via rust-analyzer.