Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pcwalton
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
61.
▲
by
pcwalton
1y ago
For fun, try searching YouTube for "speaking latin at the vatican". It's hard to find people who can speak it even there!
62.
▲
by
pcwalton
1y ago
Stolen from one of the mathematician Underwood Dudley's essays on cranks :)
63.
▲
by
pcwalton
1y ago
> I’d be much more excited about that promise [memory safety in Rust] if the compiler provided that safety, rather than asking the programmer to do an extraordinary amount of extra work to conform to syntactically enforced safety rules.
64.
▲
by
pcwalton
1y ago
> I wonder if this kind of trick can be implemented in rustc itself in a more automated fashion to benefit more projects. It partially is, with codegen units. The problem is that you can't generally do that until codegen time, becau
65.
▲
by
pcwalton
1y ago
I mean, if what you want is P4-class performance, the modern semiconductor industry is excellent at delivering that with low TDP. An Apple A18 Pro [1] gives you over 7x the single thread performance of a Pentium 4 Extreme Edition [2] at 8 W
66.
▲
by
pcwalton
1y ago
It's Bournegol [1]! [1]: https://oldhome.schmorp.de/marc/bournegol.html
67.
▲
by
pcwalton
1y ago
Not sure why you think WGSL is owned by the Rust community--it's clearly owned by the W3C. (That's part of why it moves so slowly.) WESL [1] is the community-owned set of extensions to WGSL that, while incomplete, promises to move
68.
▲
by
pcwalton
1y ago
That's a great article. Niche optimization might seem minor, but it actually results in substantial memory usage savings in real-world Rust applications, because idiomatic Rust uses enums everywhere.
69.
▲
by
pcwalton
2y ago
> But, more importantly, the amount of cycles that would be needed to text-wrap most websites is effectively zero. I've measured this, and no, it's not. What you're missing is the complexities of typesetting Unicode and Op
70.
▲
by
pcwalton
2y ago
Remember the days of Zuck saying "going with HTML5 instead of native was our biggest mistake"? Though hardware improvements have done a lot to reduce the perceptible performance gap between native and the Web, browser developers h
71.
▲
by
pcwalton
2y ago
This is sort of true in theory, but in practice there's a major difference in that nearly all the libraries in Swift use a reference-counted (i.e. GC'd) shared-everything model, while in Rust nearly all the libraries use ownership
72.
▲
by
pcwalton
2y ago
Rayiner of 10 years ago started his arguments from axioms other than "the Republican Party is correct" as he does now. I miss old Rayiner. His arguments against the Democratic position on e.g. Citizens United and Bush v. Gore
73.
▲
by
pcwalton
2y ago
I notice that you've retreated to cherry picking polls on specific issues now that Trump's overall approval rating according to poll aggregators is negative (in record time, in fact, with the exception of Trump's first term).
74.
▲
by
pcwalton
2y ago
What does "unspecified" mean in this context? If you mean "the value of a signed integer is unspecified if it overflows", then I can still construct cases in which you lose the optimization that widens a loop induction v
75.
▲
by
pcwalton
2y ago
> But if -fwrapv semantics were mandated by spec, then presumably compilers would at least hardcode a check for such a common optimization (if they are not doing so already). I don't know what this means. The optimization becomes i
76.
▲
by
pcwalton
2y ago
> Even if it is the most common method in text books (I’m not sure that’s true), it’s also almost always wrong. The index must always be sized to fit what you’re indexing over. "The code was wrong, so it was OK that I made it slower
77.
▲
by
pcwalton
2y ago
Have you measured the performance cost? I highly suspect it is not negligible, given that it's the most common way to write inner loops, which are the most performance-sensitive type of code.
78.
▲
by
pcwalton
2y ago
> And obviously there are better justifications for this than "we made the semantics of the language easier for programming language nerds to understand". There are not. For all the noise that we make on message boards about si
79.
▲
by
pcwalton
2y ago
The first example program that demonstrates arrays in The C Programming Language 2nd edition (page 22) uses signed integers for both the induction variable and the array length (the literal 10 becomes int).
80.
▲
by
pcwalton
2y ago
> The C language does not specify that `int` is 32-bits. That is a choice made by compiler developers to make compiling non-portable code written for 32-bit platforms easier, because most codebases wind up baking in assumptions about var
81.
▲
by
pcwalton
2y ago
> Anything from making it implementation defined to unspecified behavior to just throwing a diagnostic warning or having a clang-tidy performance rule. To be clear, you're proposing putting a warning on "for (int i = 0; i <
82.
▲
by
pcwalton
2y ago
I was disappointed that Russ didn't mention the strongest argument for making arithmetic overflow UB. It's a subtle thing that has to do with sign extension and loops. The best explanation is given by ryg here [1]. As a summary: T
83.
▲
by
pcwalton
2y ago
I can't quite parse your statement, but if you mean that bytemuck doesn't let you "rely on the exact binary layout of something in memory", then yes, it does: it lets you cast from a Pod type to another Pod type, which e
84.
▲
by
pcwalton
2y ago
Feudalism is the literal opposite of a highly functional centralized state! And you said 1,000 years, which extends well before the Edo period, even if you consider the Edo period a centralized state (which I would not--the establishment of
85.
▲
by
pcwalton
2y ago
On the contrary, there ended up being not much continuity between pre-Meiji Japan and Meiji Japan--the daimyo's domains were replaced with prefectures and the daimyo themselves were largely forcibly retired. This was intentional on the
86.
▲
by
pcwalton
2y ago
What? This is totally ahistorical. The Meiji era (the beginnings of what we might call a modern Japanese state) didn't start until 1868. Before that, Japan was feudal with wars happening all the time. Quoting from Wikipedia about the i
87.
▲
by
pcwalton
2y ago
> Turns out monomorphization isn't all you need. Turns out that it is, in fact, occasionally useful to unify an object and its behavior in a runtime-polymorphic way. This actually gets the history backwards. Ancient Rust tried to do
88.
▲
by
pcwalton
2y ago
Bad timing on your post. Just today, Elon tried to get content he didn't like taken down from Reddit, using specious legal reasoning: https://mashable.com/article/elon-musk-messaged-reddit-ceo-o...
89.
▲
by
pcwalton
2y ago
> As far as I can tell, any time you want to rely on the exact binary layout of something in memory, you need unsafe. As a corollary, any time you want to bit cast from one type to another, you need unsafe. No, that's what bytemuck
90.
▲
by
pcwalton
2y ago
> I have been working on some software in Rust recently that needs bit and byte manipulation, and we have "unsafe" everywhere and hugely complicated spaghetti compared to the equivalent code in C. I'm curious what makes th
More ›