News for hackers. Stuff that matters.
Re:RustViz: Generates Visualizations of Rust Lifetime and Bo... by tialaramex on Monday July 05, 2021 @07:46PM (#27742894)
This is pretty limited right now, judging from their own documentation:

- No branching logic

- No looping

- No explicit lifetime annotation

The academic paper also suggests they haven't (yet) gone as far as to actually assess whether this helps in the only role it could have at this early stage - assist newbies.

With the above limitations a confused but otherwise competent Rust programmer likely will not find this useful, their problem almost certainly involves a loop or branch before they got into trouble and didn't understand the lifetimes.

So until this can cope with looping and branching the key question is whether it can help a Day One Rust programmer to grok lifetimes stuff early, and avoid the case that seems to happen to some people where they're "fighting the borrow checker" because they don't understand what their code means so they're only ever following suggestions in the diagnostics from the compiler.

However even if they struggle to automate this, developing a schema and a library of standard examples, might help lifetime diagrams become "a thing" the way some places teach children to graph sentence grammar. That would also help other languages with lifetime problems - where the language will not tell you that your code is nonsense, it will just break unexpectedly because not only did you have no idea what the lifetime of this Object is when you wrote the program, neither does your compiler or interpreter.

There are no comments on this comment yet.