Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
vyodaiken
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
20 ms
·
61.
▲
by
vyodaiken
5y ago
I bet the performance differences are minimal except perhaps on some contrived cases. The compiler should not assume things it doesn't know. But show me a benchmark.
62.
▲
by
vyodaiken
5y ago
e.g. assuming UB can't happen: deleting overflow or null pointer checks, deleting comparisons between pointers that are assumed to point at different objects, ...
63.
▲
by
vyodaiken
5y ago
That's good example, because nobody would complain if stack layouts changed and those programs failed. But if the compiler chooses to "optimize away" checks on stack layout, that's a different thing altogether. Also not
64.
▲
by
vyodaiken
5y ago
More than slightly convoluted. The obvious intention is that the compiler ignores overflow and lets the processor architecture make the decision. Assuming that overflow doesn't happen is assuming something false. There's no excuse
65.
▲
by
vyodaiken
5y ago
C programmers prefer control to "optimization". And if you assume UB cannot occur, you should not generate code that makes it happen. Radical UB is not required for optimization: in fact it appears to mostly do nothing positive. T
66.
▲
by
vyodaiken
5y ago
The net result of your argument is the language has no semantics. I write and test with -O0 and show that f(k)=m. Then I run with -O3 and f(k)=random. Am I required to be an expert on C Standard and compiler development in order to know th
67.
▲
by
vyodaiken
5y ago
For your last point, the extent of UB driven changes to semantics is still not widely known in the programmer community. Programmers don't read the standard - they read K&R, and K&R is right now describing a different language.
68.
▲
by
vyodaiken
5y ago
This is a common argument, but it is flat out wrong. If, as claimed, compilers have complete freedom of choice about how to handle UB, they have the choice to e.g. make this behavior depend on the processor architecture. Compiler developers
69.
▲
by
vyodaiken
5y ago
C is designed to allow programmers to insert or remove checks as performance tuning. Compiler UB "optimizations" that remove that ability from the programmer make the language unusable.
70.
▲
by
vyodaiken
5y ago
Good point. C programmers have come to assume that C is a shitty language with terrible semantics and it's their fault for not using Rust or something. They blame the language for the mess made by standards/compilers.
71.
▲
by
vyodaiken
5y ago
"static int y; /* uninitialized / _Bool cond = f(); int x = cond ? 2 : y; / Is it legal to fold this to int x = 2; ? / Hopefully, you'll agree that that is a reasonable optimization. Now consider this co
72.
▲
by
vyodaiken
5y ago
I see this argument a lot, but it's silly. I don't have to care whether gcc changed the settled semantics without notice or documentation out of sincere belief that they were helping or out of a desire to beat a benchmark that doe
73.
▲
by
vyodaiken
5y ago
One issue is that under the prevailing interpretation, the existing semantics is not reliable. You do not know when or if the compilers will take advantage of UB to completely change the semantics they are providing. That's not tenable
74.
▲
by
vyodaiken
5y ago
The current situation is not good for compiler writers either. But nobody has ever shown that either C programmers want to sacrifice safety for "optimizations", or that these UB optimizations actually improve performance of anythi
75.
▲
by
vyodaiken
5y ago
It is completely useless to allow compilers to assume false things about the code they generate.
76.
▲
by
vyodaiken
5y ago
e.g. removing a check for for overflow is definitely NOT ignoring the behavior. Deleting write because it would be undefined behavior for a pointer to point at some location is also NOT ignoring the behavior. Ignoring the behavior is exactl
77.
▲
Undefined behavior in C is a misinterpretation of the Standard
(yodaiken.com)
2 points
by
vyodaiken
5y ago
|
0 comments
78.
▲
by
vyodaiken
5y ago
What are the odds that anyone on the Reason staff understands averages, let alone calculus?
79.
▲
Types Considered Harmful
(yodaiken.com)
1 points
by
vyodaiken
6y ago
|
0 comments
80.
▲
Dennis Ritchie on alias analysis in C (1988)
(yodaiken.com)
1 points
by
vyodaiken
6y ago
|
0 comments
81.
▲
Paxos Demystified
(yodaiken.com)
2 points
by
vyodaiken
7y ago
|
0 comments
82.
▲
by
vyodaiken
7y ago
> Most of your arguments are about freedom as such, not the economics of a free market. Slavery, women's rights, and native american land appropriation fall under this. There is no free market in labor under the rule of "do thi
83.
▲
by
vyodaiken
7y ago
>a far freer market than we have today, as long as you were white Except for the iceberg, the Titanic sailed safely. You don't know anything about the economics of US slavery - which was enormously big business and affected the enti
84.
▲
by
vyodaiken
7y ago
The whole thing is incorrect. You claim "The U.S. came close to a free market at the time of its founding and has become progressively more unfree since" even though "at the time of its founding" the US economy significa
85.
▲
by
vyodaiken
7y ago
>BTW Paxos also has a leader - this is what makes these protocols efficient. That's the funny part of Paxos. Paxos is specifically sold as a multi-proposer protocol. The most subtle and hard to understand part of the protocol is the
86.
▲
by
vyodaiken
7y ago
>There are almost no paxos implementations, correct or otherwise, making it harder to reason about its popularity and ergonomics. If I was cynical, I might guess that the purpose of Paxos these days is to generate expenses and technical
87.
▲
by
vyodaiken
7y ago
I think the answer is that in the late 80s/90s, academic CS decided that the important topics in this area centered on completely asynchronous networks. The super famous, but trivial, FLP "theorem" gave a respectable foundati
88.
▲
by
vyodaiken
7y ago
You don't need Paxos at all. In fact, you should read Liskov's paper https://www.yodaiken.com/2018/07/16/practical-uses-of-synchr... The key is to decide whether timeouts work in your network. If t
89.
▲
by
vyodaiken
7y ago
"A free market exists when force is barred. The U.S. came close to a free market at the time of its founding and has become progressively more unfree since" A large part of the population was forced to enage in hard labor for noth
90.
▲
by
vyodaiken
7y ago
stage 1: elect a single coordinator (which you have to do with paxos anyways) stage 2: the coordinator sends each message over and over until it has accepts from 51% of acceptors or it times out and starts a reformulation of the acceptor se
More ›