Better HN
topnewbestaskshowjobs
Log inSign up

pcwalton

43,713 karma · joined Aug 22, 2009 (17y ago) · 8,213 submissions

Submissions

comment 1d ago · link · parent

Fortunately, we have statistics to show that actually Rust does reduce memory safety vulnerabilities, so we don't have to speculate about whether it actually helps.

comment 1d ago · link · parent

Building hidden windows is a common Win32 idiom (because, among other reasons, that's the typical way you make a thing that can receive messages).

comment 1d ago · link · parent

Well, if it's in your address space there are numerous ways to figure out what the code is, even if the CPU is trying to hide it from you. Single stepping and looking at registers would give the game away entirely, of course, but there are other ways. It's a losing game I doubt Apple wants to play.

comment 1d ago · link · parent

Well, I was thinking you'd do it for all the .apps and the kernel/kexts, which you can just forbid debugging. But I guess you can't do much about all the code in the dyld shared cache which has to be debuggable, and that's a lot of the OS right there.

comment 1d ago · link · parent

Makes me wonder if the next frontier is going to be something like “the OS is shipped encrypted with keys that only exist in hardware, and all the CPU knows how to do is to decrypt blocks and put them in the i-cache where it will not let you look at them”, to prevent you from doing anything with the OS executables other than running them on Apple chips.

comment 1d ago · link · parent

Rust's safety cannot be obtained through careful design in C++. Dangling references, iterator invalidation, use-after-move, etc. etc.

comment 4d ago · link · parent

You can shift an integer 1 bit to the left by adding it to itself. This should be faster than multiplying by 2 on ancient CPUs.

comment 1w ago · link · parent

This would be fascinating. I've sometimes wondered how computing would have been different if we'd known how to build modern LLMs in the 2000s, despite the much poorer hardware (leaving aside how you could possibly train such a thing back then).

comment 1w ago · link · parent

It remains to be seen whether you can have a useful borrow checker on top of a simpler type system (at least, a type system that's significantly simpler so as to meaningfully reduce compile times). I have my doubts, personally.

comment 1w ago · link · parent

Yeah, this is pretty much a textbook example of what AI agents make possible these days: things that are ridiculously ambitious, but aren't conceptually very difficult (or, at least, are conceptually well-trodden ground). Things like emulators, language runtimes, platform reimplementations like Darling, etc.

JITting Rust isn't conceptually very hard: you just take rustc and make everything dynamic instead of static. The only thing that was stopping it before was the sheer amount of effort. Well, now we have a way to reduce that effort.

comment 1w ago · link · parent

Windows apps don't use syscalls directly; they call into kernel32.dll, which is convenient for Wine. (Microsoft enforces this by scrambling the syscall numbers on OS updates [1].)

[1]: https://j00ru.vexillium.org/syscalls/nt/64/

comment 2w ago · link · parent

It's clustering. You have a bunch of data points and you want to group them into k clusters such that all the data points in a cluster are similar. Like dividing customers into high/medium/low spenders, or whatever (usually you'd have more dimensions than 1D though).

comment 2w ago · link · parent

The firmware blobs almost certainly require Apple's signing keys to modify. Otherwise it'd be a pretty big security hole.

The OS isn't in charge of the firmware; quite the opposite, the firmware is designed to keep secrets even from a compromised OS. That's much of the reason why the Mac's security model isn't compromised by the ability to install Linux in the first place.

comment 2w ago · link · parent

You're never going to be able to get the Apple code off an Apple Silicon Mac anyway, because of the enormous amount of proprietary firmware that the OS has to interface with. Apple Silicon devices offload an exceptional amount of hardware functionality to firmware blobs that the OS just sends messages to. Removing the macOS container wouldn't change this.

comment 3w ago · link · parent

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.

comment 1mo ago · link · parent

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.

comment 1mo ago · link · parent

Userland system DLLs need to allocate memory too.

comment 1mo ago · link · parent

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.

comment 1mo ago · link · parent

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.

comment 6mo ago · link · parent

> 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.

comment 6mo ago · link · parent

> 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.

comment 6mo ago · link · parent

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.

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

I believe HotSpot is usually faster than GCJ.

comment 1y ago · link · parent

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

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

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

comment 1y ago · link · parent

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".)

comment 1y ago · link · parent

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.
12345
274