Live data from Hacker News

Swift – observations from Rust’s original designer

graydon2.dreamwidth.org

21–30 of 88 posts

Re: Swift – observations from Rust’s original designer

#21
post #6
post #5

Earlier quoted context omitted.

I wouldn't be surprised if Apple ends up open sourcing Swift after it cleans it up, perhaps even making it an LLVM project. I see it similarly to how they handled their own AArch64 backend -- proprietary at first, but mostly for secrecy before it was announced and then merging it with the preexisting backend after it was announced.

How much cleaning up do you expect at this point? It's already both announced and released to developers. Obviously it's not 100% finished, but if they intended to open-source it, I wouldn't expect that announcement to come after publicly releasing it.

They did announce they would not guarantee source compatibility until after the release date. So the language will likely change a bit still.

Re: Swift – observations from Rust’s original designer

#23
post #21
post #6

Earlier quoted context omitted.

How much cleaning up do you expect at this point? It's already both announced and released to developers. Obviously it's not 100% finished, but if they intended to open-source it, I wouldn't expect that announcement to come after publicly releasing it.

They did announce they would not guarantee source compatibility until after the release date. So the language will likely change a bit still.

Huh, I must have missed that. That's definitely contrary to the message most of their stuff is putting out, which is "Go ahead and and use it to write applications." Thanks for pointing that out.

Re: Swift – observations from Rust’s original designer

#25
post #13

I hope ideas will flow the other way too, and Rust adopts some sugar from Swift. I find `if let concrete = optional` sooo much nicer than `match optional { (concrete) => , _ => {} }`. Rust has solid semantics that covers more than Swift. OTOH Apple has put their UX magic into the language's syntax. Some syntax shortcuts, like `.ShortEnumWhenInContext` are delightful. The two combined will be the perfect language ;)

I REALLY like that syntax for the maybe monad.

Re: Swift – observations from Rust’s original designer

#26

Does he knows something of Obj-C? Because a lot what he says coming from elsewhere was already well known in Obj-C, like named parameters, "protocols", etc. Which he barely mentions. I think in the light of Obj-C, the newer C# would be less mentioned.

Objective-C doesn't really have named parameters. Objective-C has arguments spliced into the selector at each colon. (Of course, Swift inherits the selector->parameter limitation, but it goes to somewhat greater lengths to hide it.)

Re: Swift – observations from Rust’s original designer

#27
post #19
post #14

Earlier quoted context omitted.

Why is that comment getting voted down? Everything it states is true. Rust isn't stable. It really hasn't seen any serious use. Even the Rust home page itself currently states, "Rust is a work-in-progress and may do anything it likes up to and including eating your laundry."

It's still in development, but it's a far cry from vaporware, and it's already being used in production at at least one company.

pekk isn't saying Rust is vaporware. The meaning of pekk's post seems to me to be "Since Rust is almost never used in production, outright vaporware would allow people to do the same thing they mostly do with Rust: not use it." In other words, Rust has not yet found a niche, so you can't supplant it in a niche it doesn't yet exist in.

Re: Swift – observations from Rust’s original designer

#28
post #24

What are the distinctive features of Rust that Swift has that aren't in some way derived from ObjC? (I'm sure there are some; I just don't know Rust.)

To name a few: safety enforced at compile-time without any sort of GC/ARC (probably the biggest), more precise control over the hardware (e.g. more concrete pointers), the lack of a required runtime -- basically it has much better support for low-level features while not sacrificing many high-level features.

Re: Swift – observations from Rust’s original designer

#29
post #13

I hope ideas will flow the other way too, and Rust adopts some sugar from Swift. I find `if let concrete = optional` sooo much nicer than `match optional { (concrete) => , _ => {} }`. Rust has solid semantics that covers more than Swift. OTOH Apple has put their UX magic into the language's syntax. Some syntax shortcuts, like `.ShortEnumWhenInContext` are delightful. The two combined will be the perfect language ;)

Funny how this just falls out of JS (in CS):

  if concrete = optional
    call concrete

Re: Swift – observations from Rust’s original designer

#30
post #24

What are the distinctive features of Rust that Swift has that aren't in some way derived from ObjC? (I'm sure there are some; I just don't know Rust.)

Nothing unique to rust.

The biggest thing I see is that it's an imperative language with functional-style ADT's, tuples, sum types, etc.

It also looks fairly similar syntactically (all those let's).

Not sure if there are other things it has in common.

Post reply on HN