Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pcwalton
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
54 ms
·
661.
▲
by
pcwalton
5y ago
I find it interesting that the Web platform ended up being the catalyst to finally get all the OS and GPU vendors to sit down and write a single interoperable API. The existence of wgpu is a very nice outcome for all graphics programmers, e
662.
▲
by
pcwalton
5y ago
This doesn't match the experience of GC'd languages. I've never heard of problems in practice that arose from treating all values present on the stack/registers as GC roots, even if those values are dead in the data flow
663.
▲
by
pcwalton
5y ago
An allocator that can leak (4kB - epsilon) of memory for each allocation is broken. It's not a question of whether the language makes such allocations unusual: free() not actually allowing memory to be freed is a violation of the contr
664.
▲
by
pcwalton
5y ago
By quarantining all memory forever. This is not a scalable solution because keeping one allocation in a 4kB page alive will leak the whole rest of the page. And if you don't quarantine all memory forever then use after free comes back.
665.
▲
by
pcwalton
5y ago
Rustboot's code generator was generally slower than LLVM. I think in some small test cases it might have been faster, but when implementing stuff like structure copies rustboot's codegen was horrendously slow because it would over
666.
▲
by
pcwalton
5y ago
Huh? That's not true at all. It took over 30 minutes to compile the self-hosted Rust compiler with the OCaml compiler, when rustc was far smaller than it is today. rustboot was agonizingly slow, and one of the main reasons why I was so
667.
▲
by
pcwalton
5y ago
The type system of Rust requires you to be clear about which data your code is touching, and whether that code can mutate it or is just reading. This allows a sufficiently smart task system—like that of Bevy—to automatically distribute work
668.
▲
by
pcwalton
5y ago
Another reason for converting pointers to integers without ever doing the reverse operation is to hash them.
669.
▲
by
pcwalton
5y ago
This is overly pedantic. The point is that people using POSIX (i.e. Unix-like) systems expect -h or --help to work, as a matter of convention. What the letter of POSIX-the-standard says doesn't really matter to most people.
670.
▲
by
pcwalton
5y ago
Eh. You can write, and people have written, formal proofs about C code too. In fact, the difference between Rust and C in terms of safety isn't very large if you have an infinite budget to put toward proving all the code that you wri
671.
▲
by
pcwalton
5y ago
In Rust, you can just implement the WebSocket protocol in async, and then users who want the synchronous version just use block_on.
672.
▲
by
pcwalton
5y ago
I remember hearing that studies have shown that the biggest impediment to absolute beginner programmers is the strictness of language syntax. Visual programming makes syntax errors impossible, and that's a huge benefit to those who don
673.
▲
by
pcwalton
5y ago
> RMS was right that compilers should be GPL licensed to prevent exactly this kind of thing (and worse things which are haven't happened yet). The problem with this is that it wouldn't solve the problem in question: Intel would
674.
▲
by
pcwalton
5y ago
RTX Doom isn't an exercise in art direction any more than the Cornell Box is an exercise in art direction. If you want an experience shaped by an art director, pick up your favorite title on Steam. This is a hack that was probably a lo
675.
▲
by
pcwalton
5y ago
I prefer not to tell people what they can and can't do with their spare time. This hack was probably a blast to write. Let people make fun things. Ironically, your advice is essentially "make an indie game", but it's way
676.
▲
by
pcwalton
5y ago
Multi-segment, or tool-assisted, speedruns are legitimate. The problem wasn't that the guy made multi-segment runs--it's that he passed off multi-segment runs as single-segment.
677.
▲
by
pcwalton
5y ago
Wasm is a Harvard architecture mostly because it wants to support implementations based on static recompilation. Obviously, self-modifying code is a problem for static recompilation, and the easiest way to prevent self-modifying code is jus
678.
▲
by
pcwalton
5y ago
This is a textbook middlebrow dismissal. Can we be more specific and less snarky?
679.
▲
by
pcwalton
5y ago
linux-gnu (GNU/Linux) is one component of the triple (x86_64, unknown, linux-gnu). The fact that the hyphen is overloaded to separate both components of the triple and words within those components is unfortunate, but it's probabl
680.
▲
by
pcwalton
5y ago
It is absolutely not the case that you can just quit a company, wait a year, and then dump all their confidential information. Even if there were no legal repercussions (which there are), that's a great way to never be hired again.
681.
▲
by
pcwalton
5y ago
As well as a former engineer on the Swift team at Apple. Aria is more qualified to talk about compilers than 99% of HN.
682.
▲
by
pcwalton
5y ago
> The only thing you have to do to interact with the OS is make system calls. You can do that without going through the C library. If by "the OS" you mean "Linux". On Windows, calling syscalls is explicitly unsupporte
683.
▲
by
pcwalton
5y ago
Yeah. It's important to remember that Mao killed between 15 and 55 million of his own people during the GLF and he still managed to claw his way back to power with the Cultural Revolution a few years later.
684.
▲
by
pcwalton
5y ago
> the runtime information and JIT compilation may allow it to make better optimisations. In practice this mostly means speculative devirtualization. This is absolutely true for C++, which tends to use virtual methods a lot, but Rust does
685.
▲
by
pcwalton
5y ago
Rust (and, for that matter, C++ compilers) have always applied optimizations that rely on alias analysis. What I assume this thread is referring to is the noalias LLVM attribute on &mut function parameters. Rust now applies this.
686.
▲
by
pcwalton
5y ago
> Because cargo is so convenient to use, dependencies are completely out of control: adding a single crate can end up pulling in dozens of dependencies. In my case I ended up with ~150 for ~5 crates! Being able to share code easily is a
687.
▲
by
pcwalton
5y ago
I'm not, because of the object slicing problem. Value types and inheritance don't mix well, and the way Rust expresses inheritance with explicit "dyn" traits solves the problem neatly.
688.
▲
by
pcwalton
5y ago
Pattern matching is much more powerful in Rust than in C++, even with Boost libraries. Type inference is likewise more powerful, as you can overload on return type.
689.
▲
by
pcwalton
5y ago
Both cxx and pyo3 are useful, and there's no need for them to compete. cxx is used in production at massive scale.
690.
▲
by
pcwalton
5y ago
autocxx is a companion library that provides what you're looking for. https://github.com/google/autocxx
More ›