←back to thread

611 points LorenDB | 3 comments | | HN request time: 0s | source
Show context
choeger ◴[] No.43912866[source]
All this has been known in the PL design community for decades if not half a century by now.

Two things are incredibly frustrating when it comes to safety in software engineering:

1. The arrogance that "practitioners" have against "theorists" (everyone with a PhD in programming languages)

2. The slowness of the adoption of well-tested and thoroughly researched language concepts (think of Haskell type classes, aka, Rust traits)

I like that Rust can pick good concepts and design coherent language from them without inventing its own "pragmatic" solution that breaks horribly in some use cases that some "practitioners" deem "too theoretical."

replies(4): >>43913128 #>>43915349 #>>43916215 #>>43917609 #
bigbuppo ◴[] No.43917609[source]
It's weird that this sort of debate around C++ often leaves out the fact that many of the problems with C++ were known before C++ even existed. Outside of a few specific buckets, there is no reason to use C++ for any new projects, and really, there never has been. If you can't stomach Rust for some reason, and I'm one of those people, there are plenty of choices out there without all the pitfalls of C++ or C.
replies(1): >>43918203 #
ivmaykov ◴[] No.43918203[source]
> If you can't stomach Rust for some reason, and I'm one of those people, there are plenty of choices out there without all the pitfalls of C++ or C.

Unless you are doing embedded programming ...

replies(1): >>43918549 #
fsloth ◴[] No.43918549{3}[source]
I think embedded is one of the specific buckets.

You target the compiler your client uses for their platform. There is very little choice there.

replies(1): >>43922404 #
1. int_19h ◴[] No.43922404{4}[source]
Even then you're probably better off using something safer that transpiles to C.
replies(1): >>43925522 #
2. fsloth ◴[] No.43925522[source]
”Transpiles to c” - how do you generally optimize single line performance hotspots in that case?
replies(1): >>43930952 #
3. int_19h ◴[] No.43930952[source]
I don't see why that would make any difference? The generated C code is just a build artifact in this case, similar to IRs often used by compilers internally. You don't think about e.g. gcc IR when you optimize hotspots in code written in C, though - you just look at the C source and the generated asm code. If you have, say, Zig transpiling to C (which it can do with `-ofmt=c`), you'd similarly look at the Zig source and the generated asm code.