logoalt Hacker News

01HNNWZ0MV43FF • yesterday at 2:59 PM • 3 replies • view on HN

> In the simplest form it continues to serve other messages, making the actor reentrant, which can create incredibly surprising scenarios as code executes while you don't expect to changing actor fields in unexpected ways.

That's probably why GUI programming is so hard and every GUI sucks.

Anything that happens outside RAM requires you to respond to every possible input in the middle of any possible operation


Replies

torginus • yesterday at 4:38 PM

I'm not sure if actors are still a popular paradigm in UI programming, which I think it's where most people who used it had a chance to encounter it. Win32 certainly used to use it as did traditional Qt, but modern systems have moved to more of a MVC approach.

cowlevel • yesterday at 7:36 PM

Oldschool UIs would often just unapologetically freeze or make a ding sound if you did things out of order.

In Win32, when you show a message box, that MessageBox or DialogBox function doesn't return until the dialog box closes. Inside the function is a separate event loop (or message pump, by the Win32 name) and whenever it gets a user input event unrelated to the dialog, it plays a ding noise, flashes the dialog box, and ignores it. The whole time it's on-screen, the program is sitting there with a bunch of stuff on its stack, probably blocking in the middle of an event handler. And yet nobody found this unintuitive to use or to program!

(This is obvious to anyone who's programmed Win32 but I figure a lot of HN readers have only done web)

dapperdrake • yesterday at 3:57 PM

Re-entrancy

Thread-safety

What is old os new again.

Unix also learned this the hard way with signals and job control. Signals are still footguns.

➕ show 2 replies