Live data from Hacker News

Swift Programming Language Evolution

github.com

31–40 of 181 posts

Re: Swift Programming Language Evolution

#31

The removal of prefix and postfix ++ and -- operators and the removal of C-style for loops are mistakes, IMO.

As a C++14 programmer, I disagree. for..in syntax is so much clearer and being able to simply specify the range without having to manually increment makes more sense to me. I would love to see something like Swift's stride in C++.

Re: Swift Programming Language Evolution

#32
post #27

I've never understood the fascination with Swift. What's wrong with Objective C?

Swift is much more type-safe (and modern overall). Also its OO-model similar to C++ with direct method calls instead of sending messages which results to better performance.

Re: Swift Programming Language Evolution

#33
post #21

Earlier quoted context omitted.

I'd put Go at the top of the languages to compare it to. Maybe Java as well. The ecosystem still needs some time, but Swift's potential on the server is excellent: - It is incredibly fast compared to current interpreted languages (i. e. factor 30+ vs. Python, possibly faster than C) - Linux & OS X, open source - Typed, safe People like node.js mostly b/c it allows some code to be written once and run on both the serv…

Every new language has someone claim it's faster than C. I'll believe it when I see it.

Lots of languages ARE faster than C, including older languages than C, like Fortran and Forth.

Being faster than C is not anything special in itself.

Most things being equal (typed, optimized, compiled, no runtime etc) C is mostly faster when it does something with a lower overhead than some other language (e.g. a specially written hashmap algorithm targeted to some program vs C++ std map type), not because of its primitives being faster.

Re: Swift Programming Language Evolution

#34
post #8

So Swift has been out awhile, what do people think of it? What other language would you compare it to (e.g. C#, C, C++, etc)? What about the libraries are they well laid out?

My favorite thing about Swift is that is seems to get out of the way - and when it gets in the way it's usually with a nifty language feature (like the { $0 + $1 } closure syntax). I'm very excited for the future - between Go and Swift we now have two compiled fast languages that are almost as expressive as their slower dynamic/interpreted cousins. As an aside, I like that Apple is betting the farm on ARC. I wish I c…

Me too. Is something similar available in Rust? I'm familiar with smart pointers in C++ but I love that Swift manages a lot of that mess for me.

Re: Swift Programming Language Evolution

#35
post #6

So Swift has been out awhile, what do people think of it? What other language would you compare it to (e.g. C#, C, C++, etc)? What about the libraries are they well laid out?

I'm a big fan. I love the statically inferred type system, generics, & optionals. Also really like a lot of the functional programming concepts + value types but still enjoy being able to fall back on OOP. It feels like the best of both worlds. I can't wait till we have language native concurrency techniques, so I can start writing swift in backend code.

I was disappointed to see that concurrency support won't be in Swift 3.0.

Re: Swift Programming Language Evolution

#37
post #33
post #21

Earlier quoted context omitted.

Every new language has someone claim it's faster than C. I'll believe it when I see it.

Lots of languages ARE faster than C, including older languages than C, like Fortran and Forth. Being faster than C is not anything special in itself. Most things being equal (typed, optimized, compiled, no runtime etc) C is mostly faster when it does something with a lower overhead than some other language (e.g. a specially written hashmap algorithm targeted to some program vs C++ std map type), not because of its pr…

Fortran especially. Forth seems to depend on processor characteristics. I seem to remember that Ada compilers routinely produce faster code than C compilers.

Re: Swift Programming Language Evolution

#38

Earlier quoted context omitted.

I'd put Go at the top of the languages to compare it to. Maybe Java as well. The ecosystem still needs some time, but Swift's potential on the server is excellent: - It is incredibly fast compared to current interpreted languages (i. e. factor 30+ vs. Python, possibly faster than C) - Linux & OS X, open source - Typed, safe People like node.js mostly b/c it allows some code to be written once and run on both the serv…

Do you have a link to some benchmarks at hand? Your "possibly faster than C" claim sounds too good to be true without a source, but I'd very much like to be proven wrong :)

Obviously keep in mind the various caveats that come with benchmarks, but it seems that Swift is at least capable of achieving C-like performance[1] in some circumstances.

[1]: https://benchmarksgame.alioth.debian.org/u64q/compare.php?la...

Re: Swift Programming Language Evolution

#39
post #8

Earlier quoted context omitted.

My favorite thing about Swift is that is seems to get out of the way - and when it gets in the way it's usually with a nifty language feature (like the { $0 + $1 } closure syntax). I'm very excited for the future - between Go and Swift we now have two compiled fast languages that are almost as expressive as their slower dynamic/interpreted cousins. As an aside, I like that Apple is betting the farm on ARC. I wish I c…

Me too. Is something similar available in Rust? I'm familiar with smart pointers in C++ but I love that Swift manages a lot of that mess for me.

Generally data lifetime in rust is fully deterministic and the borrow checker can statically determine when data should be deallocated. If for whatever reason you do need reference counted semantics there are options in the stdlib (alloc::rc).

Re: Swift Programming Language Evolution

#40
post #19

So Swift has been out awhile, what do people think of it? What other language would you compare it to (e.g. C#, C, C++, etc)? What about the libraries are they well laid out?

I tried it an pretty quickly went back to C#. The Apple-only nature was the major downside to me, so maybe these kinds of changes will help (assuming it sees wide adoption outside of Apple-land). Check your local job boards, but if sell yourself as a Swift dev you're likely to be pigeon-holed into Apple-centric development for the foreseeable future. With Apple sales and market share dropping like a rock in the last…

>With Apple sales and market share dropping like a rock in the last 12 months, that might not be the best position to put yourself in long term, career-wise.

Like "a rock"? Where exactly did you see that?

Apple STILL sold 50M frigging iPhones in its "failed" quarter -- and had more profits and revenues that 3 next competitors combined.

And that with supply constraints for mobiles, Intel dragging its feet with laptop/desktop CPUs, and an atypical extraordinary last year-over-year quarter to compare to.

Here's the relevant chart: http://www.statista.com/statistics/263426/apples-global-reve...

Post reply on HN