Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
haberman
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
20 ms
·
211.
▲
by
haberman
3y ago
You are entitled to your opinion. C isn't perfect, but as someone who spends my life trying to optimize the efficiency and code size of critical loops to the max, I like the direction C has gone with UB and optimizations. It's n
212.
▲
by
haberman
3y ago
> The point to me is that using memcpy instead of pointer casts is NOT an improvement. The improvement comes when there are multiple accesses that could potentially point to the same memory. Consider a silly function: void f(int16
213.
▲
by
haberman
3y ago
There is also the issue of the branch predicate itself. It is always a true dependency, but when is its value actually needed? For cmov, it is needed before dependent instructions can even be executed. For branch instructions, it is only
214.
▲
by
haberman
3y ago
You are correct, I should have clarified, subsequent instructions that depend on the result of the cmov cannot execute until the cmov has executed. Whereas subsequent instructions that depend on the result of the branch instruction can
215.
▲
by
haberman
3y ago
> jump-if-equal and set-if-equal would seem to have the same level of predictability. The difference is that branches have dedicated hardware (branch predictors) that will speculatively execute subsequent instructions based on their best
216.
▲
by
haberman
3y ago
> jumps are a lot slower than conditional arithmetic. This statement is true if the jumps are unpredictable. If the jumps are predictable, then jumps will be faster. Linus had a whole rant about this back in the day, arguing that cmov
217.
▲
by
haberman
3y ago
Thanks! I didn't experiment with gmtime_r() since it goes in the other direction (UnixTime -> civil time). I wouldn't expect timegm() or gmtime_r() to depend on current timezone, since both are hard-coded to use UTC. I never
218.
▲
by
haberman
3y ago
Do you mean the conversion from YYYY-MM-DD to Unix Time? That can be quite fast; I wrote a blog article showing some algorithms that take less than 10ns to perform the conversion: https://blog.reverberate.org/2020/05&#
219.
▲
by
haberman
3y ago
> Stop funding by zip code, that's the cause of it. What is your basis for saying this? Info I have come across suggests the opposite: https://freddiedeboer.substack.com/p/is-the-conventional-wis...
220.
▲
by
haberman
3y ago
How is the wet market theory any better on this account? Here is an article from a year ago reporting on two peer reviewed papers published in Science claiming zoonotic origin: https://edition.cnn.com/2022/07/26&#
221.
▲
by
haberman
3y ago
I used to strongly agree with this. This is an article I wrote on the subject 10 years ago: https://blog.reverberate.org/2013/09/ll-and-lr-in-context-wh... I even had ideas like what you mentioned about encoding
222.
▲
by
haberman
3y ago
Does `#%%` have special meaning to the tooling? Are you able to view the output as a pseudo-notebook? EDIT: Googled and answered my own question. Here are docs describing the feature: https://code.visualstudio.com/docs
223.
▲
by
haberman
3y ago
That seems like a fair read. Maybe I would restate as: Reddit: If we had all Apollo's users, and showed them ads, we could make $20M/year more than we are making now. What Christian meant to say: Ok, if that's really true, h
224.
▲
by
haberman
3y ago
I listened and I'm still confused. I would love to see someone state clearly: 1. What was Christian actually offering to do in exchange for $10M? 2. What did the Reddit person think that Christian was offering to do in exchange for $10
225.
▲
by
haberman
3y ago
Even if you don't mention Lisp, people will assume you were trying to make it a Lisp and complain that you didn't follow Lisp precedent. Examples can be found in this very comment section.
226.
▲
by
haberman
3y ago
On flights you want noise cancellation. Maybe you could pair these with noise-cancelling AirPods, but then would you still get the "spatial audio"?
227.
▲
by
haberman
3y ago
This is a motte and bailey argument. The motte: nobody is perfectly neutral, so no journalism can be perfectly objective. (true) The bailey: it is normal and reasonable for journalists to present a biased narrative without even attempting
228.
▲
by
haberman
3y ago
I saw this article a few days ago, hopefully it is true: https://www.pcworld.com/article/1939160/at-last-the-raspberr...
229.
▲
by
haberman
3y ago
I personally find returning a type from a comptime function to be quite elegant. Template parameters and regular parameters are unified into a single concept. Zig's comptime is analogous to constinit, because it lets you compute a val
230.
▲
by
haberman
3y ago
The killer feature of Zig IMO is comptime. C++ has spent over a decade now marching towards making more and more of the language available at compile time, but in an awkward and complicated way (constexpr, consteval, constinit). Zig comes
231.
▲
by
haberman
3y ago
A choral variant of this: https://cpdl.org/
232.
▲
by
haberman
3y ago
> Linking native code doesn't really care about optimizing the size of the output and is just just trying to make sure all code paths can be called with some kind of code. That is not true at all. There are many use cases where nat
233.
▲
by
haberman
3y ago
I would love it if some of these educational YouTube videos came with exercises. I watch a lot of educational YouTube videos. But I've come to see them as more entertainment than education. Not in terms of the quality of the videos (
234.
▲
by
haberman
3y ago
I only had time to skim, but the primitives described here (acquire, release, happens before) sound almost exactly like the model that was standardized in C++11 and C11.
235.
▲
by
haberman
3y ago
I was really positive on Rust for at least five years. But several experiences have led me to reconsider this position, most notably the difficulty using arena allocation: https://blog.reverberate.org/2021/12/19&#
236.
▲
by
haberman
3y ago
I am a C programmer. For me the language is a means to an end. I prefer to work on problems where both performance and code size is paramount. The kinds of problems where it makes economic sense to spend months or years of engineer time
237.
▲
by
haberman
4y ago
Do you have a reference for this? Does it use a C backend that is part of LLVM, or is it something Zig-specific? What are its limitations? Can it compile libraries to C, or only entire applications? I have wanted Rust and Zig to support
238.
▲
by
haberman
4y ago
Judges do the opposite of looking at each case individually. The overriding principle of common law jurisdictions is stare decisis , which is to apply principles consistently according to precedent. For my part, I look at this as an itera
239.
▲
by
haberman
4y ago
It sounds like you don't think anyone should ever have to defend the question of why they apply different standards to different cases. Suppose we have two warring factions that both constantly accuse each other of wrongs that they als
240.
▲
by
haberman
4y ago
Asking this question is the only way of determining whether a person is acting from a truly principled position, or whether they are using situational ethics. The only true principle is one that binds your allies and your opponents equally.
More ›