News for hackers. Stuff that matters.
Re:“What Alan Kay Got Wrong About Objects” by ProfHewitt on Sunday November 17, 2019 @08:35PM (#21561272)
Unfortunately, Actors cannot be efficiently implemented in browsers because of the way that they implement concurrency.
Re:“What Alan Kay Got Wrong About Objects” by bitwalker on Sunday November 17, 2019 @10:14PM (#21561628)
I’m not sure I agree. For example, nothing about Erlang makes it unsuitable for a browser environment, it can handle running single threaded, or distributed across workers, where each worker runs its own scheduler. The only limitation is interacting with the DOM, since that must all happen in the main thread, but it is still possible to treat that the same way other blocking I/O is dealt with in the scheduler.

I’m actually working on a compiler/runtime for Erlang for WebAssembly, so I’m maybe more familiar than most with how it works in practice.

Re:“What Alan Kay Got Wrong About Objects” by ProfHewitt on Sunday November 17, 2019 @11:30PM (#21561888)
Workers can be made to work in a browser, but communication can be awkward and slow.
Re:“What Alan Kay Got Wrong About Objects” by monoideism on Monday November 18, 2019 @01:31AM (#21562352)
> Workers can be made to work in a browser, but communication can be awkward and slow.

True, but with the SharedMemory browser API, things are looking up (but not yet implemented in all major browsers).

Re:“What Alan Kay Got Wrong About Objects” by bitwalker on Friday November 22, 2019 @09:14PM (#21611972)
Apologies, Professor, I missed your reply!

SharedArrayBuffer makes communication between schedulers essentially equivalent to non-browser environments, but support for it is still iffy at best due to Spectre. Luckily, that is a temporary problem, not a fundamental issue (SharedArrayBuffer being disabled that is, not Spectre).

In a single-threaded setting, there isn't any significant overhead that I'm aware of between a browser and non-browser environment, aside from any overhead potentially incurred by executing on the WebAssembly VM rather than directly on the host machine. Of course, running single-threaded is less than ideal for other reasons.

Re:“What Alan Kay Got Wrong About Objects” by 7thaccount on Sunday November 17, 2019 @09:07PM (#21561388)
When you say "they", I assume you mean "browsers"? Sorry for the dumb question. I know precious little about web programming and concurrency.
Re:“What Alan Kay Got Wrong About Objects” by Izkata on Sunday November 17, 2019 @10:12PM (#21561619)
Except for webworkers (relatively new, I've not used them and know little about them), javascript in browsers is single-threaded. Even asynchronous things like ajax requests can only handle the result once the thread finishes doing whatever it was doing.
Re:“What Alan Kay Got Wrong About Objects” by 7thaccount on Monday November 18, 2019 @03:16AM (#21562692)
Interesting and thanks for the explanation. Does it have to be single threaded?
Re:“What Alan Kay Got Wrong About Objects” by ProfHewitt on Monday November 18, 2019 @06:28PM (#21569242)
JavaScript in browsers was decreed by the standards committee to be single-threaded forever. Consequently, JavaScript is entirely lacking in concurrency constructs, e.g., implementing a region of mutual exclusion inside a JavaScript program.
Re:“What Alan Kay Got Wrong About Objects” by 7thaccount on Tuesday November 19, 2019 @10:27AM (#21573829)
Thanks! I assume that was for a reason? Or just oversight?