Live data from Hacker News

Swift Distributed Actors

swift.org

101–110 of 135 posts

Re: Swift Distributed Actors

#101
post #28

What's the TLDR on why this is a language feature vs a library?

Anything concurrent and distributed you want supported by your runtime a la Erlang. The reason is: you want certain guarantees. For example, in Erlang you can set up a monitor on a process, and when that process exits for any reason , you get a notification, {EXIT, Reason}. Even if that reason was a catastrophic failure of some sort. If this is implemented as a library, then the runtime can kill your code at any time…

Erlang has absolutely no security :-(

Re: Swift Distributed Actors

#102
post #55

Earlier quoted context omitted.

Absolutely. I was watching Alan Kay's "Inventing the Future" talks recorded a few years ago, and this was a thing he referred to in passing. In recent month's, every time I run across the whole "OO is evil/dead/horrible" meme (esp. common here) it turns out to be someone talking whose experience of "OO programming" is limited to C++/Java and their relatives. If your only exposure to OO was those (and similar) languag…

You are describing Erlang and it can not get simpler than that.

I fondly remember Joe Armstrong, who was a good friend.

However, not having a mathematical foundation has been a

severe limitation for Erlang.

The Erlang community is trying to dig its way out with

modifications and extensions. Still have a long way to go.

Of course, no Actors framework is perfect.

Many important implementations have been done Erlang.

Also, significant Erlang projects are ongoing to good effect.

Re: Swift Distributed Actors

#104

So wasn't this part of the original dream for Smalltalk? Then this would seem to be coming full circle: Smalltalk, Objective C, Swift and back. I know some of you are Alan Kay fans so maybe you can comment on that aspect.

Absolutely. I was watching Alan Kay's "Inventing the Future" talks recorded a few years ago, and this was a thing he referred to in passing. In recent month's, every time I run across the whole "OO is evil/dead/horrible" meme (esp. common here) it turns out to be someone talking whose experience of "OO programming" is limited to C++/Java and their relatives. If your only exposure to OO was those (and similar) languag…

Am I correct in thinking that this is similar to "Session Types"?

Re: Swift Distributed Actors

#105

Earlier quoted context omitted.

They are adding features they 'took' to put it kindly from other existing, mature implementations without giving any credit or acknowledgement. Not only that, they expect people to test their beta grade software because they keep releasing it half baked ever since the release of Swift itself. It's embarrassing and it also angers me because these companies have wall gardened their ecosystems to proprietary languages a…

> without giving any credit or acknowledgement You could be forgiven for not being familiar with the Actor model. But if you’re familiar with it, saying that isn’t recognition is bonkers. Everyone who knows what Actors are knows they’re referencing Erlang/OTP.

The Actor Paradigm is much more widespread with offerings from Microsoft, Lightbend, etc.

Re: Swift Distributed Actors

#106
post #97

So wasn't this part of the original dream for Smalltalk? Then this would seem to be coming full circle: Smalltalk, Objective C, Swift and back. I know some of you are Alan Kay fans so maybe you can comment on that aspect.

Yes, but only a part. It’s not just about having something akin to actors for concurrency and execution. It’s also about having a dynamic system - one that can update its behavior not just by manual request, but automatically as the system is running. One way to think about this is propagators. I’m still learning myself, but a compelling example is lisp. With lisp you can write macros that essentially allow you to tr…

Probably can't make much progress without a scientific foundation including the Actors Abstraction.

Re: Swift Distributed Actors

#107
post #55

Earlier quoted context omitted.

You are describing Erlang and it can not get simpler than that.

not really, smalltalk's "actors"[0]/objects are organized around data encapsulation principles. Erlang's "actors"[0]/processes are organized around failure domain principles. It's not unreasonable to go in one direction (making your data encapsulation match failure domains) but if you try to organize Erlang's "actors" around data encapsulation you will wind up with very shitty code (hard to read, hard to test, hard t…

See the following for a rigorous definition of the Actors Abstraction:

https://papers.ssrn.com/abstract=3418003

Re: Swift Distributed Actors

#108

There is an existing, influential, paper called "A Note on Distributed Computing" that hugely influenced Java (and other) languages and frameworks that argued precisely against abstracting away remoteness . The Swift team seems to be challenging that thesis: "[U]nlike other concurrency models, the actor model is also tremendously valuable for modeling distributed systems. Thanks to the notion of location transparent…

Probably not a good idea to burden application programmers

with having to annotate each message send with whether the

receiver is on the current computer or another one in a

Citadel.

Since Actors can move between computers in a Citadel, such

annotations are infeasible in practice.

Of course, modularity, security, and performance should not be

ignored.

Re: Swift Distributed Actors

#109

So wasn't this part of the original dream for Smalltalk? Then this would seem to be coming full circle: Smalltalk, Objective C, Swift and back. I know some of you are Alan Kay fans so maybe you can comment on that aspect.

Given the heritage I’d also say it’s good to recognize the Actor model in Erlang/OTP and the overlap that has with Smalltalk and everything that followed.

The Actors Abstraction is foundational for computer science

analogous to the Natural Numbers in classical mathematics.

Re: Swift Distributed Actors

#110
post #103

How does security work with this? It looks like the actors can talk to each other over the network, but I don't see any means of authentication.

Just like in Erlang, you would handle that at the transport level, and it appears Swift supports providing your own transports. They didn't mention (or I didn't see) whether the transport they are shipping has any specific auth wrapped around it though.
Post reply on HN