[-] FizzyOrange@programming.dev 27 points 1 week ago

It's not because we have tested this program extensively on every C++ compiler, but because the language rules of C++ say so.

Debatable. Saying things in a prose specification doesn't magically make them happen. Tests and reference models can though.

I also don't really agree with the SIL requirements that languages need to have rigorous specifications to be safe. Clearly it's better if they do, but would your rather fly on a rocket controlled by C code or Rust code?

IMO a specification would be really nice to have, but it main purpose is to tick a certification checkbox, which is why the only one that exists was written specifically for that purpose.

[-] FizzyOrange@programming.dev 27 points 1 week ago

asking the maintainers to lock down APIs which the C devs purposefully leave malleable, in part, to avoid binary blob drivers being feasible.

No, they were asking them to define the semantics of the filesystem APIs. Those semantics are not encoded in the C API but the Rust devs wanted to encode them in the Rust API to avoid making mistakes.

The C devs didn't want to, not because of concerns about binary drivers, but because the semantics are already broken. Apparently different filesystem drivers assume different semantics for the same functions and it's a whole mess. They don't want to face up to this and certainly don't want anyone pointing it out, so clearly it must be the Rust devs' fault for wanting APIs to have consistent semantics.

The rest of your comment is nonsense.

[-] FizzyOrange@programming.dev 31 points 2 weeks ago

Yes it's terrible. The only hope on the horizon is uv. It's significantly better than all the other tooling (Poetry, pip, pipenv, etc.) so I think it has a good chance of reducing the options to just Pip or uv at least.

But I fully expect the Python Devs to ignore it, and maybe even make life deliberately difficult for it like they did for static analysers. They have some strange priorities sometimes.

[-] FizzyOrange@programming.dev 44 points 2 months ago

I think I disagree with everything here.

Exceptions Are Much Easier to Work With

Well, they're "easier" in the same way that dynamic typing is easier. It's obviously less work initially just to say "screw it; any error gets caught in main()". But that's short term easiness. In the long term its much more painful because:

  1. You don't know which functions might produce errors, and therefore you don't know where you should be even trying to handle errors. (Checked exceptions are the answer here but they are relatively rarely used in practice.)
  2. Actually handling errors properly often involves responding to errors from individual function calls - at least adding human readable context to them. That is stupidly tedious with exceptions. Every line turns into 5. Sometime it makes the code extremely awkward:
try {
   int& foo = bar();
} catch (...) {
   std::cout << "bar failed, try ...\n";
   return nullopt;
}
foo = 5;

(It actually gets worse than that but I can't think of a good example.)

Over 100× less code! [fewer exception catching in their C++ database than error handling in a Go database]

Well... I'm guessing your codebase is a lot smaller than the other one for a start, and you're comparing with Go which is kind of worst case... But anyway this kind of proves my point! You only actually have proper error handling in 140 places - apparently mostly in tests. In other words you just throw all exceptions to main().

System errors [he's mainly talking about OOM, stack overflow & arithmetic errors like integer overflow]

Kind of a fair point I guess. I dunno how you can reasonably stack overflows without exceptions. But guess what - Rust does have panic!() for that, and you can catch panics. I'd say that's one of the few reasonable cases to use catch_unwind.

Exceptions Lead to Better Error Messages

Hahahahahaha. I dunno if a bare stack trace with NullPointerException counts as a "better error message". Ridiculous.

Exceptions Are More Performant

Sure maybe in error handling microbenchmarks, or particularly extreme examples. In real world code it clearly makes little difference. Certainly not enough to choose an inferior error handling system.

I would say one real reason to prefer exceptions over Result<>s is they are a fair bit easier to debug because you can just break on throw. That's tricky with Result<> because creating a Err is not necessarily an error. At least I have not found a way to "break on Err". You can break on unwrap() but that is usually after the stack has been unwound quite a bit and you lose all context.

[-] FizzyOrange@programming.dev 38 points 3 months ago

I would say because a) there are zero alternatives, and b) it's pretty powerful; you can generally do pretty much any layout even if it requires hacks, c) switching to something else is clearly infeasible so it's not worth even asking for.

Just have to live with it (on the web at least).

[-] FizzyOrange@programming.dev 40 points 4 months ago

I don't think VSCode's mantra is that it "just works". It's definitely a "platform" IDE like Eclipse was.

[-] FizzyOrange@programming.dev 32 points 4 months ago

Rust adoption is stagnating

Is it? I would like to see some evidence for that.

because of [the small standard library and potentially supply chain security issues]

Yeah I can guarantee that is not a significant reason for people to avoid Rust. If it was people wouldn't use NPM, where the problem is even worse.

I do think it would be good to putt some more stuff in the standard library makes sense, or even just add some kind of official sanction of de facto standard library crates like regex.... But this author is an idiot.

[-] FizzyOrange@programming.dev 25 points 6 months ago

I disagree. People run Bash scripts they haven't read all the time.

Hell some installers are technically Bash scripts with a zip embedded in them.

[-] FizzyOrange@programming.dev 30 points 6 months ago

Ha they literally said about 5 times in this page that people often say "it's just a skill issue"... and here you are.

I love Rust but the author's points are 100% valid.

[-] FizzyOrange@programming.dev 27 points 7 months ago

Yeah... Usually if you join a company with bad practices it's because the people who already work there don't want to do things properly. They tend to not react well to the new guy telling them what they're doing wrong.

Only really feasible if you're the boss, or you have an unreasonable amount of patience.

[-] FizzyOrange@programming.dev 42 points 7 months ago

Honestly those things just don't sound like common enough actions to be worth shaving 0.5 seconds off. How often do you know exactly how many lines to move a line by? And how often do you even need to move a line that far?

I still don't buy it.

[-] FizzyOrange@programming.dev 34 points 7 months ago

This is a misconception that's common among beginner C programmers. They think C is high level assembly and don't understand the kinds of optimisations modern compilers make. And they think they're hardcore and don't make mistakes.

Hope you figure it out eventually.

view more: ‹ prev next ›

FizzyOrange

joined 1 year ago