Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
uecker
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
40 ms
·
901.
▲
by
uecker
1y ago
I recently wrote some paper: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3654.pdf which also includes a short summary of issues when trying to put C++'s lambdas into C.
902.
▲
by
uecker
1y ago
When Linux was created, there was not much choice. In reality, most active projects moved on and only projects with relatively extreme portability requirements stick with C89, mostly because MSVC does not support anything later properly.
903.
▲
by
uecker
1y ago
The Linux kernel and ffmpeg require C11.
904.
▲
by
uecker
1y ago
Virtual machines do not change memory behind your back without your permission.. The issue with jemalloc is very specific problem with a specific Linux API, i.e. MADV_FREE that has the problematic behavior, i.e. it reallocates pages when wr
905.
▲
by
uecker
1y ago
No, but jemalloc uses a kernel API that has the behavior and IMHO is is then non-conforming (when using this API, which I think is configurable). The Facebook bug should be taken as a clear sign that this behavior is a terrible idea and not
906.
▲
by
uecker
1y ago
Integer arithmetic working correctly, converting a pointer to an integer, and converting an integer back to the same object is something which should work. This is what we made sure to guarantee in the provenance TS. Making this work for m
907.
▲
by
uecker
1y ago
I do not see how this adds a substantial cost and it is required for C programs to work correctly and the C standard carefully describes the exact situation where unspecified values are chosen - so the idea that the compiler is then free to
908.
▲
by
uecker
1y ago
I do not imply bad intentions, but I see the arguments brought forward in WG14. It got better in recent years but we had to push back against some rather absurd interpretations of the standard, e.g. that unspecified values can change after
909.
▲
by
uecker
1y ago
> It's that textual inclusion is just a terrible model. You end up reprocessing > the same thing over and over again, everywhere it is used. One could certainly store the interfaces in some binary format, but is it really worth i
910.
▲
by
uecker
1y ago
Ok, thanks. I still do not see where the complexity comes in. I also disagree with most your other points, e.g. that other libraries do not use it seems rather irrelevant. I am certainly not switching to another languages for this reason. T
911.
▲
by
uecker
1y ago
They sometimes screwed up, sometimes just because of bugs, or because different optimization passes had different assumptions that are inconsistent. This somehow contradicts your second point. Compiler have something things implemented wh
912.
▲
by
uecker
1y ago
If you say the header model makes it slower than it could be, you need to compare it to something. I do not see how it causes significant slow downs in C projects (in contrast to C++). And yes, I wrote compilers and (incomplete) preproces
913.
▲
by
uecker
1y ago
You are right, I wasn't thinking straight. I do not fully agree. Creating arbitrary pointers can not work. Forging pointers to implementation-defined memory region would be ok though.
914.
▲
by
uecker
1y ago
Please spell out your criticism exactly. Where do you see an issue with ergonomics? What exactly miss on integration? The safety property for such a type is clear: not being able to access the value when it does not exist. It does this
915.
▲
by
uecker
1y ago
BTW: I think what me annoys me about this comment is the claim that this would be "insane amounts of hidden complexity" . If you you look at the article, it four simple one-line macros: #define maybe(T) struct maybe_##T { bool ok
916.
▲
by
uecker
1y ago
Historically, the reason was was often niche architectures. But sometimes certain behavior dies out and we can make semantics more strict. For example, two's complement is now a requirement for C. Still, we did not make signed overfl
917.
▲
by
uecker
1y ago
Language standards have much less power than people think and compiler-vendors are of course present in the standard working groups. Ultimately, the users need to put pressure on the compiler vendors. Please file bugs - even if this often
918.
▲
by
uecker
1y ago
There may be platforms that are not conforming to the C standard. But I doubt those then have comprehensive implementations of other languages either.
919.
▲
by
uecker
1y ago
I do not think package management should be done at the level of programming languages.
920.
▲
by
uecker
1y ago
I recently filed a bug for this: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116193
921.
▲
by
uecker
1y ago
Most of the "ghosts" are indeed just cleaning up the wording. But compiler writers historically often used any excuse that the standard is not clear to justify aggressive optimization. This starts with an overreaching interpretati
922.
▲
by
uecker
1y ago
I fully agree with your analysis but compilers writers did think the could bend the rules, hence it was necessary to clarify that pointer-to-integer casts do work as intended. This still not in ISO C 23 btw because some compiler vendors did
923.
▲
by
uecker
1y ago
Sorry, maybe I misread your comment. There are certainly languages easier to learn than C, but I would not say C++ or Rust fall into this category. At the same time, I find C compilation extremely fast exactly because of headers. In C you
924.
▲
by
uecker
1y ago
I do not understand what you are tying to say, but it seems to be some hostile rambling.
925.
▲
by
uecker
1y ago
Compilers existing is essential and not trivial (and also usually then what other languages build on). The conformance model of C also allows you to write programs that are portable without change to different platforms. This is possible, m
926.
▲
by
uecker
1y ago
Fixing the actual problems is work-in-progress (as my document also indicates), but naturally it is harder. But the original article also complains about the number of trivial UB.
927.
▲
by
uecker
1y ago
Advantages of C are short compilation time, portability, long-term stability, widely available expertise and training materials, less complexity. IMHO you can today deal with UB just fine in C if you want to by following best practices, and
928.
▲
by
uecker
1y ago
One has to add that from the 218 UB in the ISO C23, 87 are in the core language. From those we already removed 26 and are in progress of removing many others. You can find my latest update here (since then there was also some progress):
929.
▲
by
uecker
1y ago
Thank you!
930.
▲
by
uecker
1y ago
The point is that the error code paths should go avoid even with UBSAN because they are dead, but the optimizer is not able to see this anymore in C++.
More ›