HNHacker News
TopNewBestAskShowJobs

pcwalton

43,656 karma · joined August 22, 2009

submissionscomments
pcwalton··on My favourite PowerMac is a Nintendo Wii
Pretty sure the menu bar was Carbon in Snow Leopard, which was the same release that discontinued Classic. Lots of Cocoa widgets called into HIToolbox under the hood. QuickTime wasn't fundamentally changed. And iTunes of course was Carbon code for a very, very long time.
pcwalton··on Why Windows 11 still ships with Windows 95's memory manager hidden inside it
It's not really practical to do this outside of simple cases. For example, a modern userspace GPU driver must allocate lots of memory in hundreds if not thousands of places to implement a standard API and there's no way around that.
pcwalton··on Why Windows 11 still ships with Windows 95's memory manager hidden inside it
Userland system DLLs need to allocate memory too.
pcwalton··on Bevy 0.20
Dioxus is much easier to understand though, and Leptos and Yew are just HTML. One of the core issues is that (a) a scene format for editors, (b) a SwiftUI-like DSL for UI, and (c) a DSL for spawning game objects are just different problems. A single syntax that tries to cover all three ends up being a compromise that satisfies few.
pcwalton··on Bevy 0.20
Some great stuff in this release. I contributed some rendering code, most notably reducing the renderer to O(number of changed entities) on the CPU, that went unmentioned in the release notes.

I do have to say, however, that BSN syntax isn't good and is getting worse. There are too many sigils, and -- to separate list elements (!) is an indication that it's been designed into a corner. The fact that it's not LR(1) should have been an indication that it was misdesigned. The scene format should be redesigned to be editor-first, with ease of VCS merging as a paramount consideration.

pcwalton··on Google Engineer Charged with Insider Trading on Polymarket
> From all state actions I’ve seen for a decade straight in the crypto space, this largely seems to be an education issue that makes the state’s ability to prosecute a brief privilege

Or, you know, they could come up to you in a San Francisco public library while your computer is unlocked and logged into your account, slap handcuffs on you, and image the contents of the laptop's RAM, establishing proof beyond a reasonable doubt that you had access to the Monero account in question. Just like they did with Ross Ulbricht.

If there's anything you should learn from the history of state actions in this space, it's that the USG is very good at overturning naive assumptions about the real-world anonymity of these technologies.

pcwalton··on Running Adobe's 1991 PostScript Interpreter in the Browser
> Apple seems to have lost its academic roots, and suffers for it now. Or I should say, its customers suffer while it grosses almost half a trillion dollars per year. At least with vibe coding we can just whip up a Preview app in an afternoon, so maybe none of this matters anymore.

Eh, I'm with Apple on this one: we can just use Ghostscript. Apple's move effectively forces the few applications that need to use PostScript on macOS to migrate from a proprietary PostScript implementation to an OSS one, which strikes me as ultimately a good thing.

pcwalton··on Your phone is about to stop being yours
You can run arbitrary computations on iOS devices if they're written in JavaScript, WebAssembly, or Swift (via Playgrounds). All of these are Turing complete, and all three compile into machine code. What you don't have without an Apple developer account is direct machine code access.

Also note that apps like Pythonista allow you to write programs that call arbitrary Objective-C APIs without permission from Apple. This means that you have a Turing-complete language running unsigned code that can do anything a signed app can do. Your programs do, however, execute slowly.

pcwalton··on JIT: So you want to be faster than an interpreter on modern CPUs
Sure, but the relevant comparison isn't between languages: it's between a state-of-the-art JIT implementation of one language and a likewise-state-of-the-art AOT implementation of the same language. Unfortunately there aren't many examples of this; most languages have a preferred implementation strategy that receives much more effort than the other one.
pcwalton··on JIT: So you want to be faster than an interpreter on modern CPUs
I believe HotSpot is usually faster than GCJ.
pcwalton··on Perfecting anti-aliasing on signed distance functions
Mathematically, what you want to do here is to calculate the area of the pixel square (or circle; however you want to approximate it) that the shape covers. In this case a linear ramp actually approximates the true value better than smoothstep does. (I had the derivation worked out at some point; I don't have it handy, unfortunately.) Of course, beauty is in the eye of the beholder, and aesthetically one might prefer smoothstep.

By the way, since the article mentions ellipse distance approximations, the fastest way to approximate distance to an ellipse is to use a trick I came up with based on a paper from 1994 [1]: https://github.com/servo/webrender/blob/c4bd5b47d8f5cd684334... Unless it's changed recently, this is what Firefox uses for border radius.

[1]: http://mesh.brown.edu/taubin/pdfs/Taubin-tog94.pdf

pcwalton··on Canyon.mid
Your note taking app doesn't need AI, but it also doesn't need OLE, which represented an equally hot buzzword ("software componentry") of the 90s that Microsoft was trying to shoehorn into everything.

Every generation has its hype cycle; it's nothing new.

pcwalton··on Writing into Uninitialized Buffers in Rust
jcranmer is correct and pointer provenance-related issues are not "boxed and contained". Start here: https://www.ralfj.de/blog/2020/12/14/provenance.html
pcwalton··on Evolution of Rust Compiler Errors
My recollection is that Brian Anderson, who came from the C# world, was an early advocate of the easily-googlable error codes that Microsoft compilers use a lot, and pushed to get them in. That was a good call. (In general Brian had a lot of behind-the-scenes positive influence on Rust: my favorite brson-ism is "if the code doesn't have a test it doesn't exist".)
pcwalton··on Evolution of Rust Compiler Errors
When I was first developing early versions of rustc I was really fascinated with Clang's effort at good error messages, which was helping it gain traction vs. GCC at the time, and I tried to start the Rust compiler project off on the right foot. I'm really glad that the Rust compiler dev community has continued to value great error messages: they're the UX of a compiler, and are every bit as important as UX of any other app.
pcwalton··on Designing Cities for Families
The modal urbanist who lives in the suburbs is usually just someone who wants to be able to have the lifestyle they want without a commute to work. Someone who works at Google in Mountain View but would prefer not to have to drive everywhere, for example. Or, in your example, someone who works at the Pentagon but doesn't want to have to commute from Maryland (or D.C.) in order to live in a walkable area.
pcwalton··on Designing Cities for Families
But urbanists do live in cities? San Francisco proper is, like, the origin of the YIMBY movement. Searching for "baltimore yimby" on Google brings up a lot of advocacy, like this: https://www.thebaltimorebanner.com/community/housing/baltimo...
pcwalton··on RIP Usenix ATC
Yes, all Rust papers anyone tried to submit were consistently rejected up until Rust became popular, at which point Rust became the hot new thing in applied programming language research. Academic PL is very insular (to its detriment, I'm convinced).
pcwalton··on How Riot Games is fighting the war against video game hackers
You can raise the cost of cheating so that cheating kids will get annoyed and go cheat in some other game or scroll TikTok or whatever. We're not exactly dealing with nation-states here.
pcwalton··on Reflecting on a Year of Gamedev in Zig
Yeah, sorry, my mistake. GitHub did report on the SO survey [1], which probably led to my mixup.

Anyway, Rust was still the "most admired" language in 2024 [2].

[1]: https://github.blog/developer-skills/programming-languages-a...

[2]: https://survey.stackoverflow.co/2024/technology#admired-and-...

pcwalton··on Reflecting on a Year of Gamedev in Zig
Yes, you have correctly pointed out that there are some developers who are unhappy with Rust.

I don't really care to have an argument as to whether "Rust has peaked" or not. Rust is the same language now as it was in 2023, and 2022, and 2021, etc., and developers liked it then. That's all.

pcwalton··on Reflecting on a Year of Gamedev in Zig
I'm happy to revise what I said from "Rust keeps winning" to "Rust continually won" if you want to nitpick my choice of verb tenses. It refutes the idea that the "developer joy is pretty low" either way.
pcwalton··on Reflecting on a Year of Gamedev in Zig
Because "else" technically includes "comptime_float", so that case is handled, just not in the way that's expected.

One of the downsides of comptime over generics is that, because it's low-level and procedural instead of high-level and declarative, things like automatically inserting coercions become harder.

pcwalton··on Reflecting on a Year of Gamedev in Zig
https://github.blog/developer-skills/programming-languages-a...
pcwalton··on Reflecting on a Year of Gamedev in Zig
> Rust is still popular but it turns out the developer joy is pretty low.

I mean, Rust keeps winning the "most loved" language contest on GitHub, so it seems someone likes it.

pcwalton··on Reflecting on a Year of Gamedev in Zig
This is a good point. Zig is practically optimized for this: comptime is extremely dynamically typed compared to actual generics, and the lack of memory safety is often "a breath of fresh air"--until you have to actually fix bugs (including security bugs) resulting from it.
pcwalton··on Reflecting on a Year of Gamedev in Zig
> It's not a great hobby language but it is a fantastic professional language,

I never thought I'd live to see the day when someone would say this. The first 5 years of Rust were all "this is interesting for hobby projects but nobody will ever adopt this in industry".

pcwalton··on Office is too slow, so Microsoft is making it load at Windows startup
If Microsoft had adopted this attitude, then by now Excel's market share would probably be 0% and Google Sheets' would be 100%. Microsoft doesn't add features because they like bloated software; they add features because the market demands them, and the market demanded support for more than 65,535 rows.
pcwalton··on Migrating away from Rust
Over the past year I've been working at my studio to add enough features to Bevy to ship real apps, and Bevy is at the point where one can reasonably do that, depending on your needs.
pcwalton··on Migrating away from Rust
> You can't do possibly-erroneous pointer math on a C# object reference.

Bevy entity IDs are opaque and you have to try really hard to do arithmetic on them. You can technically do math on instance IDs in Unity too; you might say "well, nobody does that", which is my point exactly.

> You don't need to deal with the game life cycle AND the memory life cycle with a GC.

I don't know what this means. The memory for a `GameObject` is freed once you call `Destroy`, which is also how you despawn an object. That's managing the memory lifecycle.

> In Unity they free the native memory when a game object calls Destroy() but the C# data is handled by the GC. Same with any plain C# objects.

Is there a use for storing data on a dead `GameObject`? I've never had any reason to do so. In any case, if you really wanted to do that in Bevy you could always use an `EntityHashMap`.

Page 1 of 34Next →