Readit News logoReadit News
pcwalton commented on Perfecting anti-aliasing on signed distance functions   blog.pkh.me/p/44-perfecti... · Posted by u/ibobev
pcwalton · 22 days ago
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 commented on Canyon.mid   canyonmid.com/... · Posted by u/LorenDB
swat535 · 2 months ago
To be fair, the quality of software has dramatically dropped, apps now take 10 seconds to load, memory usage is maxed, games crash and people needed to reinstall their OS so frequently that Microsoft literally added a "reset PC" option..

You can argue that software does much more than before, sure I agree but no one asked for so much bloat and features in every day apps. My note taking app doesn't need AI.

pcwalton · 2 months ago
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 commented on Writing into Uninitialized Buffers in Rust   blog.sunfishcode.online/w... · Posted by u/luu
adastra22 · 3 months ago
I don't think any of those are undefined behavior in the strict sense in which the term is defined in the C/C++ standards. Pointer casts are defined behavior. I believe the things you point to are either implementation-defined or unspecified, which is different from UB.

It may seem nitpicky, but the downside of relying on implementation defined or unspecified behavior is largely boxed and contained. E.g you might get a memory access error. UB is, in principle, completely unlimited in downside. And because of that, it often interacts badly with optimization passes, resulting in very strange bugs.

pcwalton · 3 months ago
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 commented on Evolution of Rust Compiler Errors   kobzol.github.io/rust/rus... · Posted by u/ingve
steveklabnik · 3 months ago
I was a big advocate of adding error codes. I don't remember specifically the timeline, but we had so much stuff to do for 1.0, it doesn't surprise me that it got pushed back a bit.

At the time, I was thinking about the big old chunky Visual Basic manuals I used to own, and how useful those were.

EDIT: okay, so I'm doing some digging: error codes were added before 1.0... https://github.com/rust-lang/rust/commit/0e80dbe59ea986ea53c...

> This implements the minimal scaffolding that allows mapping diagnostic messages to alpha-numeric codes, which could improve the searchability of errors. In addition, there's a new compiler option, `--explain {code}` which takes an error code and prints out a somewhat detailed explanation of the error.

committed on Jul 10, 2014

I think I've figured out what happened here: the particular error that was chosen didn't have a code until 1.2. The example from this commit does show a code on Rust 1.0.0: https://godbolt.org/z/14hcb3ETG

pcwalton · 3 months ago
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 commented on Evolution of Rust Compiler Errors   kobzol.github.io/rust/rus... · Posted by u/ingve
pcwalton · 3 months ago
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 commented on Designing Cities for Families   bloomberg.com/features/de... · Posted by u/toomuchtodo
rayiner · 3 months ago
Some of them do. But their premise is that there’s a large, unmet demand for dense, walkable neighborhoods in which to raise families. But there are tons of dense, walkable neighborhoods all over the country where prices and demand are quite low. Why the focus on more building and upzoning when you could buy existing stock?

There’s a big urbanist movement in the DC area, but it’s focused on trying to upzone Northern VA and Montgomery County, MD. Meanwhile, most of the Maryland side of the Metro network is underutilized. Urbanists would rather pay triple to try and turn Tysons Corner, VA into an urban area.

pcwalton · 3 months ago
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 commented on Designing Cities for Families   bloomberg.com/features/de... · Posted by u/toomuchtodo
rayiner · 3 months ago
My argument is fully made in good faith hoping urbanists will confront their own revealed preferences. If you’re an urbanist, why wouldn’t you want to raise a family in a city like Baltimore that spends $21,000 per student annually, where you can afford a 3-4BR townhome near transit and shopping?

I used to live in New Rochelle, NY near the Metro North station. It’s walkable and urban, with great transit. The school district spends $25,000/student, compared to $15,000/student in my Maryland suburb. But housing in New Rochelle is quite affordable considering it’s the NYC Metro area—even cheaper than my suburb. Why don’t the urbanists raise their families there?

pcwalton · 3 months ago
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 commented on RIP Usenix ATC   bcantrill.dtrace.org/2025... · Posted by u/joecobb
khuey · 3 months ago
> successful industrial open-source (?) projects loved by academics (Rust)

Is Rust loved by academics? And much more importantly in my mind, was it even recognized by academics before it became an industrial success?

The very first published Rust paper that I'm aware of appeared in the "ACM SIGAda Ada Letters" (https://dl.acm.org/doi/10.1145/2692956.2663188). Today that paper is the most cited paper to ever appear in that journal (which has a 4 decade history) and it's not even close. It also has more citations that all but three papers that appeared at PLDI that same year, for comparison. That certainly doesn't suggest to me that it was recognized at the time. This was also published only 6 months before Rust shipped 1.0. It wasn't that early.

My (third-hand and now-decade-old, so take it for the very little it's worth) recollection is that academic forums weren't interested in Rust because nothing in it is particularly novel in a PL theory sense (a point Graydon himself made from the very beginning, see slides 6 and 7 at http://venge.net/graydon/talks/intro-talk-2.pdf). But it did package those ideas into something that was practically usable for industry and at this point the results speak for themselves.

IMO this is a good example of why a lot of "practitioners" in industry wouldn't bother trying to publish anything in a forum dominated by academics.

pcwalton · 3 months ago
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 commented on How Riot Games is fighting the war against video game hackers   techcrunch.com/2025/05/03... · Posted by u/badmonster
razemio · 4 months ago
It seriously isn't. Effectively you can not ban cheating. A cheater can just use virtual or modified hardware keyboards, displays and mice to cheat. How is a kernel extension going to prevent that? That is the logical next step, which is already being done by some (currently less than alpha). Once we reach this state as a default, nothing can prevent cheating, besides a real tournament with checked hardware. All the effort riot is currently putting into this will be for nothing. I do not understand, how they are missing that.
pcwalton · 4 months ago
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 commented on Reflecting on a Year of Gamedev in Zig   bgthompson.codeberg.page/... · Posted by u/bgthompson
Bolwin · 4 months ago
I think you're talking about stackoverflow not github
pcwalton · 4 months ago
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-...

u/pcwalton

KarmaCake day43605August 22, 2009View Original