I tried to install bacon, by doing
cargo install —locked bacon
on the CLI on my Raspberry Pi. After a lot of downloading and compiling, the process just got stuck right at the end, the one before last module just kept saying it was compiling.
Does this sound as a known problem?
The binary is definitely slower to compile compared to other part. You can:
- Wait longer . It took about 1 minute on my machine (with a high end CPU).
- Try use a faster linker (like lld).
- Try upgrade compiler version. rustc 1.72.0 has a compiler perf regression.
Do I feel stupid now
Patience did the trick!
But now that I know you know bacon, may I ask if I understand the usage of bacon correctly? As I see it now, I start bacon in the directory in which cargo new has placed src/main.rs. After I do some work on main.rs and I save it, bacon tells me the compiler warnings and errors.
But that doesn’t really feel like very useful. I was under the impression that bacon would be helping as you type. Maybe that is asking to much, but do I understand correctly that this is what bacon does?
Bacon updates the errors and warnings every time you save. Which can be more convenient as you type, since not every keystroke ends up with a valid Rust program, anyways.
Bacon replaces most use-cases of frequently manually running cargo check (or test, run, etc..) in the terminal. It's advantages beyond firing automatically is: the nicer line-break handling (you can toggle between wrap and cutting off, the latter often makes the general structure of the error message more readable), the option to collapse the warnings and errors into a concise overview, and the fact that your errors/warnings start at the top, with the option to scroll down - not at the bottom with an option to scroll up (and the scroll further into older invocations).
But bacon doesn't create anything original. It just displays the output of
cargo check (or similar commands) more nicely, and automatically re-runs it for you. I typically have it open in a window next to my editor, so I can just hit CTRL+S to (save and) show the updated list of errors and warnings for my program.
Thanks, I have been playing around with it a little, and I think I am happy with it
Rust analyzer does that
Bacon doesn't - but it's a really neat tool for what it does. Every compiled language should have one like it...