Live data from Hacker News

Winding down the Swift 3 release

thread.gmane.org

21–30 of 65 posts

Re: Winding down the Swift 3 release

#21
post #3

Now, with swift 3 around the corner, I will ask some most experience fellow developers the following question. There is golang, swift, rust, dlang. If you will put some energy, what language will be, and why? :)

Neither one of them is worth putting your energy into. But Go and after that Swift are important for better employment opportunities somewhere down the road.

Re: Winding down the Swift 3 release

#22

Earlier quoted context omitted.

Swift uses LLVM as backend, so as far as I understand it can generate standalone binaries. No ?

All languages add a bit of code to a binary to make the code you write runnable. Rust [1] and C add almost none, language like Swift and Go have to add their GC support code even if it's in the same binary, and jit+scripting languages generally come with an external runtime. [1] https://www.rust-lang.org/faq.html#does-rust-have-a-runtime (also mentions what's in the C runtime)

Swift doesn't have a GC and you can use it to program like C with malloc and free via UnsafeMutablePointer.

IIRC, Swift's runtime is like C++'s with v-table lookup for dispatch on functions that do not involve Objective-C objects.

Re: Winding down the Swift 3 release

#23
post #3

Now, with swift 3 around the corner, I will ask some most experience fellow developers the following question. There is golang, swift, rust, dlang. If you will put some energy, what language will be, and why? :)

I've been putting time into Rust. There will always be a need for a C-level language and I think Rust has a strong long-term future. The language as it exists today isn't going to be my all-purpose default but it might be. There are a couple major ergonomic wins coming (trait-based exception handling, impl trait) and a set of first-party language services for IDE support. I think IDE-supported Rust has the potential…

  > trait-based exception handling
I'm obligated to mention that Rust isn't growing an exceptions system, that RFC was just poorly named. :P

Re: Winding down the Swift 3 release

#24
post #10

Earlier quoted context omitted.

> Swift will also let you do everything Rust can, very low level stuff. Not quite. Swift requires a runtime, so you probably won't see people writing OS kernels in Swift.

Swift uses LLVM as backend, so as far as I understand it can generate standalone binaries. No ?

Generating standalone binaries is orthogonal to the presence of a runtime. Go also generates standalone binaries (even more standalone than Rust and Swift) though it indisputably has a runtime.

Re: Winding down the Swift 3 release

#25

Earlier quoted context omitted.

All languages add a bit of code to a binary to make the code you write runnable. Rust [1] and C add almost none, language like Swift and Go have to add their GC support code even if it's in the same binary, and jit+scripting languages generally come with an external runtime. [1] https://www.rust-lang.org/faq.html#does-rust-have-a-runtime (also mentions what's in the C runtime)

Swift doesn't have a GC and you can use it to program like C with malloc and free via UnsafeMutablePointer . IIRC, Swift's runtime is like C++'s with v-table lookup for dispatch on functions that do not involve Objective-C objects.

Swift's GC is in the form of pervasive reference counting for reference types with no automatic cycle detection. Though as we're demonstrating, calling this GC is contentious, it would be better if people weren't too lazy to type out "pervasive reference counting for reference types with no automatic cycle detection". :P

(For the record, I believe Chris Lattner is on the record as saying "yes, Swift has a runtime, let's not bother arguing that point" though I can't find the link, but I agree that Swift's runtime is less invasive than most other languages (e.g. Go).)

Re: Winding down the Swift 3 release

#26

Earlier quoted context omitted.

All languages add a bit of code to a binary to make the code you write runnable. Rust [1] and C add almost none, language like Swift and Go have to add their GC support code even if it's in the same binary, and jit+scripting languages generally come with an external runtime. [1] https://www.rust-lang.org/faq.html#does-rust-have-a-runtime (also mentions what's in the C runtime)

Swift doesn't have a GC and you can use it to program like C with malloc and free via UnsafeMutablePointer . IIRC, Swift's runtime is like C++'s with v-table lookup for dispatch on functions that do not involve Objective-C objects.

Yes, the swift runtime does stuff like heap allocation & reference counting for classes, type introspection (including `as` casts), error handling, as well as generating instances of unspecialised generic types, and dispatching (dynamic) protocol methods (and other witnesses, like computed properties).

https://github.com/apple/swift/tree/master/stdlib/public/run...

Re: Winding down the Swift 3 release

#27
post #20
post #3

Now, with swift 3 around the corner, I will ask some most experience fellow developers the following question. There is golang, swift, rust, dlang. If you will put some energy, what language will be, and why? :)

D isn't going to happen. Go is a wonderfully boring language. That's its technical strength and social downfall. Rust is the anti-Go. It's an adoption cult with a good language attached. Swift is pleasantly surprising me with its evolution and cross-platform direction. I'd recommend Rust, Swift or Go in that order. Personally I'm most interested in Go but I don't think it's the most useful intellectual exercise or ca…

can you give more details why dlang is not a good bet. I actually like the language and feature set :) I have the feeling that is to much noise on dlang, and they do not have a clear path, but still :)

Re: Winding down the Swift 3 release

#28
post #20
post #3

Now, with swift 3 around the corner, I will ask some most experience fellow developers the following question. There is golang, swift, rust, dlang. If you will put some energy, what language will be, and why? :)

D isn't going to happen. Go is a wonderfully boring language. That's its technical strength and social downfall. Rust is the anti-Go. It's an adoption cult with a good language attached. Swift is pleasantly surprising me with its evolution and cross-platform direction. I'd recommend Rust, Swift or Go in that order. Personally I'm most interested in Go but I don't think it's the most useful intellectual exercise or ca…

I think I largely agree with your assessment, though I learned Go first and am probably going to pick up Swift or Elixir next.

I work mostly with networked services though, and Rust seems to have a bit of a comparatively (vs Go, Elixir) poor concurrency/async-io story so far -- though I am sure the libraries will come eventually.

Re: Winding down the Swift 3 release

#29
post #20

Earlier quoted context omitted.

D isn't going to happen. Go is a wonderfully boring language. That's its technical strength and social downfall. Rust is the anti-Go. It's an adoption cult with a good language attached. Swift is pleasantly surprising me with its evolution and cross-platform direction. I'd recommend Rust, Swift or Go in that order. Personally I'm most interested in Go but I don't think it's the most useful intellectual exercise or ca…

can you give more details why dlang is not a good bet. I actually like the language and feature set :) I have the feeling that is to much noise on dlang, and they do not have a clear path, but still :)

Mostly because it's been going on for a decade, and while itself is not catching (much adoptions), other languages that have appeared since have already gotten much more traction, including Go and Swift -- and potentially Rust.

Re: Winding down the Swift 3 release

#30
post #5
post #3

Now, with swift 3 around the corner, I will ask some most experience fellow developers the following question. There is golang, swift, rust, dlang. If you will put some energy, what language will be, and why? :)

Swift for GUIs on OSX / iOS. Go for everything else. Haven't had much reason to play with Rust or D, but also haven't seen nearly as much of them in the wild...

Go for everything else? Swift is moving for everything too, with the cross platform support, IBM adoption, etc...
Post reply on HN