Live data from Hacker News

Swift Distributed Actors

swift.org

51–60 of 135 posts

Re: Swift Distributed Actors

#51

Earlier quoted context omitted.

> MHO, the Swift Foundation needs to move much more of the ecosystem to platforms other than Apple's. I suspect Apple is trying to do this for straightforward reasons like wanting to remain relevant and foster community growth as to retain credibility… while also subtly trying to not encourage the use of Swift as a language for any other GUI framework/platform than Cocoa + macOS. Obviously I don’t have any evidence t…

> X11 for macOS is dead I don’t think this is nefarious. X11 is a klunky GUI, at best, compared with pretty much everything else out there. It really can’t hold a candle to more developed GUI systems. I was never interested in Swift as a server language, but that’s mainly because of the “chicken-and-egg” thing, as it was not supported by server infrastructure. I love the language, itself.

> I don’t think this is nefarious. X11 is a klunky GUI, at best,

That's the problem: I see you're being dismissive of X due to its ergonomics and aesthetics despite the fact that X just-works and is still a vital component in computing: the same reason Windows retains both cmd.exe and PowerShell - I feel that your kind of reasoning is why we think Apple is so capricious with their consumer products (removing iPhone headphone ports, deliberately making HomePod incompatible with Android and non-Apple Bluetooth devices, the Trash-can MacPro, etc) they're roistering their own kind of paternalistic computing vision on their users).

People that need reliable, dependable computing experiences need to be able to use all the tools out there: old-but-good, tried-and-tested, no matter how "clunky" they are - and this doesn't neatly fit into the Apple way(TM). While I appreciate and respect Apple immensely for significantly and successfully driving the standards for user-experience and overall product industrial design, it isn't perfect... if only they'd tone-down their institutionalist corporate arrogance.

> compared with pretty much everything else out there. It really can’t hold a candle to more developed GUI systems.

X is a windowing system, it isn't a complete GUI system. Consider that, in fact, what Apple and Microsoft have both done quite successfully since the very beginning of macOS and MS Windows is how they have completely hidden the fact that widget/control libraries, the window-manger, the windowing-system, the compositor, are all completely separate and independent components that actually have no dependencies on each other at all. Having that visual and design consistency between those functionally separate components is what made Windows 95, and MacOS 8 (and especially OS X) so usable and approachable to _normal people_.

Now as X and Wayland are just one component in an entire GUI system, there really isn't a strong argument in removing vital components from their own systems just because they just don't like the way it looks - as though Apple is trying to avoid looking like a HP-UX CDE desktop from the mid-1990s.

I'm rambling, it's 3am now argh.

Re: Swift Distributed Actors

#52

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) languages, then, YES, OO is horrible and weak and full of leakiness in the abstractions. It's a bit like saying that coffee is horrible when all you've ever tasted is cheap-and-nasty instant made from acorns and floor sweepings. C++ and Java (I can't comment on C#, never having used it in anger) are the palest, anaemic shadow of OO programming.

Rant done. This addition to Swift might cause me to look at it more closely. (I don't have any reason/desire to touch the Apple grow-tunnel (as opposed to ecosystems, which are natural and open.) My thoughts have also recently run along lines of "What if we made every message to an object as if it were always remote (in another address space)?" In other words, for decades we've been trying to make RPC calls look (to the programmer) as if they were "just like local calls" and with justifiable lack of success because remote really is more wrinkly than local. So what if, instead of trying to make "remote" look/behave/imitate "local" we went in the other direction and make all calls look like remote calls? It means we have to think about all the failure modes and partial-failure modes of remote calls all of the time. Only, for local address-space calls, they're going to be much more reliable in practise. Is it worth it? Can we bring down the cognitive overhead to an acceptable level?

I'm interested to see whether this Swift effort/initiative approaches this idealised/simplified description.

Re: Swift Distributed Actors

#53

Earlier quoted context omitted.

> X11 for macOS is dead I don’t think this is nefarious. X11 is a klunky GUI, at best, compared with pretty much everything else out there. It really can’t hold a candle to more developed GUI systems. I was never interested in Swift as a server language, but that’s mainly because of the “chicken-and-egg” thing, as it was not supported by server infrastructure. I love the language, itself.

> I don’t think this is nefarious. X11 is a klunky GUI, at best, That's the problem: I see you're being dismissive of X due to its ergonomics and aesthetics despite the fact that X just-works and is still a vital component in computing: the same reason Windows retains both cmd.exe and PowerShell - I feel that your kind of reasoning is why we think Apple is so capricious with their consumer products (removing iPhone h…

Is it Apple’s responsibility to maintain X on the Mac, though?

If they want to implement something that may interfere with X (usually they do this kind of thing because security), should they cripple the experience for half a billion users, to appease a small minority of techies?

I’ve been writing software for Apple devices since 1986, which means that I’ve had lots of rugs pulled out from under me, and have been incandescent with rage at Apple, many times.

That said, I’ve never regretted choosing it as my preferred platform, despite thirty years of insults and put-downs from other tech folks.

Re: Swift Distributed Actors

#54

Earlier quoted context omitted.

> I hope Swift can eventually become more of a general purpose language, as its actually pretty nice and they're introducing features like this that clearly targets server-side programming. I hope for this too. I did a personal project in Swift on Linux and found that I loved the language. However, I was greatly frustrated by the lack of libraries. For Swift to reach the mainstream, IMHO, the Swift Foundation needs t…

> MHO, the Swift Foundation needs to move much more of the ecosystem to platforms other than Apple's. I suspect Apple is trying to do this for straightforward reasons like wanting to remain relevant and foster community growth as to retain credibility… while also subtly trying to not encourage the use of Swift as a language for any other GUI framework/platform than Cocoa + macOS. Obviously I don’t have any evidence t…

But with the web finally becoming the true, real, cross-platform that Microsoft was then-irrationally terrified of 25 years ago, I don’t know what Apple’s strategy is to remain the best provider of the best UX when everyone is going to be using Chromium in some form.

This certainly seems to be the case for desktop apps but not so much for mobile. Personally I'm rooting for the mobile web but the momentum seems to be on Apple's side right now.

Re: Swift Distributed Actors

#55

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…

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

Re: Swift Distributed Actors

#56
Question for folks: where do server-side Swift folks hang out?

I've been writing server-side / enterprise code in Swift for about a year now, and the language has really grown on me.

But it's a small community, and IBM's & Google's departures were a big blow to the feeling of inevitable growth to it.

I'd love to find a watering hole to chat with others in the same small niche.

Re: Swift Distributed Actors

#57
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 distributed actors, we can program distributed systems using the familiar idea of actors and then readily move it to a distributed, e.g., clustered, environment.

With distributed actors, we aim to simplify and push the state of the art of distributed systems programming, the same way we did with concurrent programming with local actors and Swift’s structured concurrency models embedded in the language.

This abstraction does not intend to completely hide away the fact that distributed calls are crossing the network, though. In a way, we are doing the opposite and programming assuming that calls may be remote. This small yet crucial observation allows us to build systems primarily intended for distribution and testable in local test clusters that may even efficiently simulate various error scenarios.

Distributed actors are similar to (local) actors because they encapsulate their state with communication exclusively through asynchronous calls. The distributed aspect adds to that equation some additional isolation, type system, and runtime considerations. However, the surface of the feature feels very similar to local actors."

Amusingly, in a section immediately followed by "Deja Vu All Over Again", Waldo et al. write:

"One conceptual justification for this vision is that whether a call is local or remote has no impact on the correctness of a program. If an object supports a particular interface, and the support of that interface is semantically correct, it makes no difference to the correctness of the program whether the operation is carried out within the same address space, on some other machine, or off-line by some other piece of equipment. Indeed, seeing location as a part of the implementation of an object and therefore as part of the state that an object hides from the outside world appears to be a natural extension of the object-oriented paradigm.

Such a system would enjoy many advantages. It would allow the task of software maintenance to be changed in a fundamental way. The granularity of change, and therefore of upgrade, could be changed from the level of the entire system (the current model) to the level of the individual object. As long as the interfaces between objects remain constant, the implementations of those objects can be altered at will. Remote services can be moved into an address space, and objects that share an address space can be split and moved to different machines, as local requirements and needs dictate. An object can be repaired and the repair installed without worry that the change will impact the other objects that make up the system. Indeed, this model appears to be the best way to get away from the “Big Wad of Software” model that currently is causing so much trouble.

This vision is centered around the following principles that may, at first, appear plausible:

• there is a single natural object-oriented design for a given application, regardless of the context in which that application will be deployed;

• failure and performance issues are tied to the implementation of the components of an application, and consideration of these issues should be left out of an initial design; and

• the interface of an object is independent of the context in which that object is used.

Unfortunately, all of these principles are false. In what follows, we will show why these principles are mistaken, and why it is important to recognize the fundamental differences between distributed computing and local computing."

RMI, some may recall, was heavily influenced by the above critique which lead to the very verbose and ceremonial characteristics of Sun's Java distributed system's APIs that were later criticized as cumbersome.

[1]: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.41.7...

[2]: http://www.cs.yale.edu/homes/aspnes/classes/465/notes.pdf

Re: Swift Distributed Actors

#58

Earlier quoted context omitted.

> I hope Swift can eventually become more of a general purpose language, as its actually pretty nice and they're introducing features like this that clearly targets server-side programming. I hope for this too. I did a personal project in Swift on Linux and found that I loved the language. However, I was greatly frustrated by the lack of libraries. For Swift to reach the mainstream, IMHO, the Swift Foundation needs t…

> MHO, the Swift Foundation needs to move much more of the ecosystem to platforms other than Apple's. I suspect Apple is trying to do this for straightforward reasons like wanting to remain relevant and foster community growth as to retain credibility… while also subtly trying to not encourage the use of Swift as a language for any other GUI framework/platform than Cocoa + macOS. Obviously I don’t have any evidence t…

I never liked X11, its API is much worse than any complaint one can imagine over Win32.

It is no surprise that the only UNIX clones that had a good desktop user experience always did their own thing instead of pursuing the X11/Motif path.

Re: Swift Distributed Actors

#59

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…

Java RMI was based on Objective-C distributed objects ideas actually, so it is no wonder that these things kind of go in circles.

Re: Swift Distributed Actors

#60

Woah, very cool - I guess Distributed Objects is getting a facelift and making a comeback. [1] What's old is new again, as they say. [1] https://developer.apple.com/library/archive/documentation/Co...

DO was super cool... Made things very easy. That said, I guess Swift is trying to do a better version of DO.

RMI did it first, actually.

https://en.wikipedia.org/wiki/Distributed_Objects_Everywhere

> By the time DOE, now known as NEO, was released in 1995, Sun had already moved on to Java as their next big thing. Java was now the GUI of choice for client-side applications, and Sun's OpenStep plans were quietly dropped (see Lighthouse Design). NEO was re-positioned as a Java system with the introduction of the "Joe" framework, but it saw little use. Components of NEO and Joe were eventually subsumed into Enterprise JavaBeans.

Post reply on HN