Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
uecker
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
29 ms
·
691.
▲
by
uecker
11mo ago
Why? Monomorphization often leads to great results in microbenchmarks due to super-specialized code but also to bloat.
692.
▲
by
uecker
11mo ago
At the moment there is no consensus for anything related to this. But most people agree that closures are a good thing because they make certain reoccurring programming patterns safer and easier to write. Why do you disagree?
693.
▲
by
uecker
11mo ago
Assuming we have some choice. Not many people volunteer their time to this work, which is quite a lot and not much fun. Companies also do not invest a lot of resources into C.
694.
▲
by
uecker
11mo ago
BTW: I wrote why the lambda design does not fit C well here: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3654.pdf (and I am not impressed by micro benchmarks)
695.
▲
by
uecker
11mo ago
This.
696.
▲
by
uecker
11mo ago
It means he can edit LaTeX. Of course, JeanHeyd is very qualified, but being project editor for an ISO standard does not require this.
697.
▲
by
uecker
11mo ago
Programming is unforgiving.
698.
▲
by
uecker
11mo ago
In principle C compilers can do this too https://godbolt.org/z/Ev4berx8d although you need to trick them to do this for you. This could certainly be improved.
699.
▲
by
uecker
11mo ago
I take this back ;-) People come up with crazy things. Still I would not call this "C thinking". Building object-oriented code in C is common though and works nicely.
700.
▲
by
uecker
11mo ago
You can use the standard feature with the unreachable sanitizer: https://godbolt.org/z/3hePd18Tn
701.
▲
by
uecker
11mo ago
And I like using enums in C ;-) The compiler tells you to cover all branches. https://godbolt.org/z/bY1P9Kx7n
702.
▲
by
uecker
11mo ago
A multi-inhertiance system is certainly not something somebody who "was thinking in C" would ever come up with. This sounds more like a true C++ mess.
703.
▲
by
uecker
11mo ago
We were talking about Rust issues. But yes, C should have a proper string type. But as long as it does not have a better standardized string type, it is possible to define your own (or use a library).
704.
▲
by
uecker
11mo ago
This is exactly right. The trend is towards comprehensive programming frameworks for convenient programming with batteries included. I hope this trend dies and we focus more on integration into the overall ecosystem again.
705.
▲
by
uecker
11mo ago
Mostly the advantages a listed for C: stability, portability, simplicity, fast compilation times could all in reverse also be considered disadvantages of Rust. I am also not a fan of monomorphization, not of static linking, and not of hav
706.
▲
by
uecker
11mo ago
I plan to be writing C for the next decades even for new projects, because I think it is a great language, and I appreciate its simplicity, fast compilation times, stability, and portability. I am happy if people are excited about Rust, but
707.
▲
by
uecker
11mo ago
"It is better than nothing" is literally what I said. But thinking about it more, I actually think is quite useful. Any kind of signature or out-of-band hash is also only good if the source is not compromised, but knowing after th
708.
▲
by
uecker
11mo ago
It is better than nothing if you note it down. You can compare it later if somebody / or you was compromised to see whether you had the same download as everyone else.
709.
▲
by
uecker
11mo ago
For me it is complex and variably modified types (mandatory in C23).
710.
▲
by
uecker
11mo ago
C has this fixed-sized feature which is what the article points out.
711.
▲
by
uecker
11mo ago
Indeed, I think one should avoid such typedefs. You could wrap it in a struct.
712.
▲
by
uecker
11mo ago
It does warn: https://godbolt.org/z/Gj54f8313 It did not in GCC 13, but I fixed this bug.
713.
▲
by
uecker
11mo ago
You can add that check using -fsanitize=null (and you may want to turn the diagnostic into a run-time trap)
714.
▲
by
uecker
11mo ago
The C feature does not have to be fixed-size though.
715.
▲
by
uecker
11mo ago
Sure. All I am saying is that there are still plenty of compiler bugs related to optimization, which is reason enough for me to recommend being careful with optimization in contexts where correctness is important.
716.
▲
by
uecker
11mo ago
Oh, I didn't meant to imply that there are more common, just that they are common enough to be careful with optimizations.
717.
▲
by
uecker
11mo ago
I am not sure. I saw quite a few of these bugs where programmers were told it is UB but it isn't. For example, people showed me extern void g(int x); int f(int a, int b) { g(b ? 42 : 43); return a / b; } as a
718.
▲
by
uecker
11mo ago
I would say there is a fair share of cases where programmers were told it is UB when it actually was a compiler bug - or non-conformance.
719.
▲
by
uecker
11mo ago
Oh, there are also plenty of bugs. And Clang still does not implement the aliasing model of C. For C, I would definitely recommend -O2 -fno-strict-aliasing
720.
▲
by
uecker
11mo ago
Me neither, I just do not want to make steps backwards because people rewriting stuff for stupid reasons. But your argument is just the old "you do not want to adapt" shaming attempt which I think has no intellectual substance an
More ›