Rust in 2017: what we achieved
blog.rust-lang.org
blog.rust-lang.org
However, your question prompted me to see if I could set a breakpoint and step through a program, and I was able to do it without much effort.
I have the "LLDB Debugger" extension in VSC installed. After that, the trick was to configure its launch.json to have the "program" property set to "${workspaceRoot}/target/debug/mandelbrot".
That's all it took.
Maybe I'd encounter some shortcoming trying to actually use it in anger, but I was happy to be able to do this much.
I seem to run afoul of some obscure, ungooglable edge case almost every time I try to start a debugger I don't use very often, regardless of the platform. Of course this happens when I'm frustrated enough to be considering using a debugger in the first place, which is exactly when you don't want to be rage-googling why your debugger refuses to print symbol names, but only when you start it with exactly the arguments you need to start it with to trigger the bug. Or when you try to send an email more than 500 miles away Or print on a Tuesday. By that point, your debugger problem is worse than your original bug.
There's a strong sense from a vocal portion of the software development community that debuggers aren't really needed (not suggesting that this is you, just a general observation). Coupled with the fact that building a functioning debugging tool is no easy task, we end up in a situation where far too many platforms treat debugging as a second class citizen when it's really an essential feature, even if for some of us it's a feature of last resort.
In the case of logic stuff Tagged Union/Enum types help me force logic at compile time. If I've got a particularly intractable logic problem a good coverage of unit tests works well to flush out any bugs and give me confidence when it comes to refactoring.
There's been a handful of times that I've wanted to reach for the debugger but a couple inspect()/println!() calls did the trick in those cases.
I've encountered a couple annoyances:
A. Using rustc to link somehow removes debugging information from static libraries I wrote in assembly [2]. This is extremely annoying, but I haven't had time to really look into it and it seems others can't reproduce it.
B. There seem to be some occasional oddball problems when stepping through code. Like it'll skip lines, or stay on the same line for many steps. And also an annoyance regarding how that VS Code extension handles "Step Into" for functions you don't have the source for: you can easily get into an infinite popup situation and have to restart the debugger.
IMO the sad truth is that if a great debugger is a prerequisite to use a language, then you're limited to about 5 total languages.
[1] https://marketplace.visualstudio.com/items?itemName=webfreak...
I've never hit these problems, though I have the source for everything I'm compiling in Rust in general.
foo.into_iter().map(|x| x+1)
.filter(|y| y > 2)
My working theory is that it's related to situations where there's multiple statements on the same source line (or inside a block inside a lambda).There's a minor inconvenience of setting up targets for the LLDB to launch tests, etc, but for when it's needed this isn't a huge effort to get going.
I've not yet tried IntelliJ's CLion integration, which I think I've heard is good.
I'm working full time on Rust debugging now. My basic plan is to write a Rust plugin for lldb (WIP branch https://github.com/tromey/lldb/tree/rust); then update LLVM, rustc, lldb, and gdb in sync to add support for missing features.
I'm interested in bug reports and other constructive feedback.
We're now moving towards making Rust have Rust-specific debuginfo for a better debugging experience. tromey (who has commented below) is working on this both for lldb and gdb.
If you’ve got some time to elaborate on how you struggled with the book, I’d be interested in hearing about it!
As an example, reading the official documentation at first was an absolute struggle due to all the terminology and syntax I was only vaguely familiar from the book. It's getting easier as I practice more.
The more documentation -- the merrier. Thanks a ton for your work!
Congratulations on a great 2017, Rust.
Kudos Rust team.
Does Rust have a native(all Rust) implementation of SSH client yet?
(I know ssh2-rs exists, but, I'm looking for a Rust implementation and not a wrapper over libssh2(C))
Does Rust have a stable/documented library for serving Web applications over http/2 yet?
(I have heard about h2, hyper and Rocket, but can I write a basic web app in Rocket and expect it to use http/2?)
I like everything I hear about Rust. I will allocate serious learning time to it when the answers to the above questions turn to yes. Hopefully soon!!!
#2 is coming, but not quite yet.
Static types, on the other hand, actually document things - at the very least what can be passed and what will be returned. This may not be completely necessary when reading code or even writing code in a well known environment and context that fits into programmer's head, but without formal contract programmer is faced with two choices: trust manual or read and understand ALL the code. Python is notorious offender here with args and kwargs - when reading code using some wrapper library I must understand how underlying library is used, because customization of underlying library behavior is not part of wrapper library documentation.
Maybe it's time to finally learn gdb...