2 ms·
The other languages do not (as my parent claimed) write stacktraces to a log somehow. I suspect that in reality they've ommitted to explain that they're expecte
by tialaramex 2y ago
The other languages do not (as my parent claimed) write stacktraces to a log somehow. I suspect that in reality they've ommitted to explain that they're expected to write all the C++ code to make that stacktrace and write it to a log, but once you add those steps you're back to parity with Rust, the Rust programmers can write a stacktrace to a log too.
In the specific case of "Hello, World" it's more embarrassing. The Rust Hello World does indeed experience and report errors if there are any, the canonical C just ignores them, as does the C++.
- HumanOstrich 2y ago> The Rust Hello World does indeed experience and report errors if there are any, the canonical C just ignores them, as does the C++. Can you give an example for each of those?
- tialaramex 2y agohttps://github.com/sunfishcode/hello-world-vs-io-errors?tab=readme-ov-file https://github.com/sunfishcode/hello-world-vs-io-errors?tab=...
- HumanOstrich 2y agoThank you for providing a reference. After reading the blog post on that page, I'm even less convinced that your point is useful. I don't think it's a bug if, like in the C example, you don't handle the return value of the function you are calling. The strace shows that the function returned an error, but the code doesn't check it. Not a language flaw. In fact, in most of the languages that "don't have the bug", the runtime is automagically capturing the issue and aborting the program. Like an exception. Rust just "doesn't have the bug" because the compiler forces you to handle the error. All the .NET languages do the same thing at runtime and force you to handle the I/O error... with an exception handler. Unfortunately, your talking points just seem like more Rust fanaticism trying to discredit any other language. This happens in every single discussion about any language other than Rust, especially C/C++. I'm not going to engage any further.