Re: Opinions on Dart’s Isolates?
"Richard O'Keefe" <[email protected]> Sun, 9 Jan 2022 22:31:16 +1300
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <CABcYAdKFqvhX6jJkmt-Rir37MZn3PxEvGceGy-Kq9k=vO4uBGw@mail.gmail.com> |
I'm irresistibly reminded of this exchange from the Goon Show episode "The Great Bank of England Robbery": SEAGOON: How do you play the inside of a cylindrical record backwards? BLOONOK: Quite simple, you put it on in the opposite direction, going away from you, the other way. Dart/Isolates/Flutter looks WONDERFUL if I put my Javascript spectacles on, but with my Erlang glasses it's a dreadful tangle of "callbacks" and objects. Isolates, good. The key thing about an isolate is its event loop, AND IT'S NOT YOUR EVENT LOOP. You can't even see it. It's DART's event loop, doing whatever Dart wants to do. You cannot tailor it. You cannot have a process which has different selective receives in different states. Communication between isolates is in terms of actions, not messages. It's as if someone heard of the actor model (which is actually where Smalltalk started, irony of ironies), and passed the idea on to Sven the User Interface Designer https://dilbert.com/strip/1994-12-27 . OK, so I'm exaggerating for humourous effect, but when the sales pitch for a programming language puts up such horrible examples of what *ought* to be very simple and the presenter says how simple it is, somebody isn't getting *something*. I think it was the video on async/await that I understood what was bothering me. All this subtle and elaborate syntax, because THE BASIC IDEA IS THAT CONCURRENCY IS ABNORMAL. That fundamental view is built into the language: NORMAL programming is sequential object-oriented programming, concurrent processes are the ABNORMAL exception that needs "heavyweight" interfaces to cope with the mind-twisting horror. (The many-angled ones live at the bottom of the Mandelbrot set, as it were.) The basic idea of Erlang is that CONCURRENCY IS NORMAL. It's not quite as extreme as Flat Concurrent Prolog or Guarded Horn Clauses where the idea was the concurrent programming was the ONLY kind. This was Joe Armstrong's genius, and I'm so sad that he's not here to read that comment. Don't add concurrency to an existing programming language. Start with concurrency and add a language to that. So it is a good thing that Dart programmers have something better to work with than C++ programmers. It could have been even better, but it can't get *much* better without ceasing to be Dart. On Sun, 9 Jan 2022 at 11:25, Garry Hodgson <[email protected]> wrote: > I’ve been looking into Flutter a bit as a platform for phone apps, and > that got me looking into the Dart language. Their approach to concurrency > feels awful familiar, with “isolates” looking a lot like Erlang processes. > It’s actually pretty cool, nice and clean, albeit wrapped in some OO noise. > I imagine, though don’t know, that they were influenced by Erlang/Elixir, > although I suppose something like parallel evolution of the Actor model > could be responsible as well (sharks and whales look a lot alike). > > Anyway, I wondered what other Erlangers thought about it. You can find an > overview here: > > https://www.youtube.com/watch?v=vl_AaCgudcY > > >