Live data from Hacker News

Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

infoq.com

281–290 of 308 posts

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#281

Earlier quoted context omitted.

A lot more emphasis on functional programming & nicer syntax around it, preference of value types over reference types and immutability by default/opt in mutability, nicer parsing with Codable, nice pattern matching and destructuring syntax, native binaries by default, more flexible memory management.

Modern C# has both destructuring and pattern matching in switchs. The memory model of swift seems obscolete, reference counting does not catch reference cycles and swift isn't faster than C# C# isn't really missing features vs swift but it might have a less modern syntax

In regards to the memory model, I am not talking about reference counting, but rather [1].

1 - https://swift.org/blog/swift-5-exclusivity

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#282
post #233

Earlier quoted context omitted.

Sounds like you describe the state of Swift at least three years ago. SourceKit just doesn't crash anymore on me anymore, ever. Compile times are quite good for me nowadays, still not as fast as Objective-C but then again you don't get compile time guarantees for free.

The exponential issue was still there in version 4 and I think 5 as well. Didn't say SourceKit crashed, but it was virtually useless because it functioned like a crap version of the language parser.

So what's particularly hard on the compiler are hard coded sets of data that have mixed types. For example a dictionary that reflects a JSON response that also has nested dictionaries.

It helps if you test declare it like:

    let json: [String: Any] = [ /** lots of fields here */ ]
String concatenation: could you give me a specific piece of code that fails? It could be that I really never write code that triggers the problem. Using the + operator to concatenate strings has some performance issues though.

I'm not telling you're crazy, I just noticed that things got so much faster in the past two years.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#283

> . It is hard to think that any Windows programmer would prefer Swift as a language over .NET languages, as many commenters pointed out on Reddit, but a port of Swift UI on Windows could be a game changer. Everybody would jump to Swift [for new projects] if it meant a cross-platform GUI framework.

I think main goal is to increase market share in server-side development for swift.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#284
post #273
post #172

Earlier quoted context omitted.

I’d say electron became popular thanks to HTML, not JavaScript. IMO HTML is by far the “easiest” to use GUI framework because it is so unconstrained. It will end up a mess, but eventually you can get the result you want. This is not the case with native frameworks which come with a larger sets of rules on how they can be used.

I beg to differ, having been doing GUI coding since a couple of decades. Guess what, what in most of them I never had any issues to center elements, or create fake UI elements out of list items. Also layout managers were already a thing back in 2000.

I did UI development for quite a while too, and in my experience having very specific layouts (and look) in HTML is easier than in frameworks I used (Gtk, Qt, UIKit...).

Main difference is that HTML has affordances to size elements "upwards" whereas in other toolkits you need to do this manually (e.g.: estimating text size is a thing, in html you don't need to care about this)

Now, this also encourages original layouts which are untrue to platforms which is not a good thing imo.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#285

Earlier quoted context omitted.

Flutter is one of the fastest growing frameworks for the past two years and therefore dart too. It most likely will succeed cause of this pace and the community growing around it. When flutter for desktop lands into beta I think it will pick up even more pace and would be very hard to ignore for a lot of companies.

IMO Flutter would have received far wider adoption now if it used Typescript instead of flogging the dead Dart horse.

But how will you give the same level of performance in a dynamic language? Typescript is only for type safety. It's still JS at the end. Dart is more modern with a VM during development and AOT compilation for production.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#287
post #228

Earlier quoted context omitted.

Swift is already way more popular than dart though. But Swift doesn't run on Android, does it?

It does. It has been able to for some time now. A team I’ve worked with used it to build a cross-platform library. Swift wasn’t the first choice but the short story was they didn’t choose C++ because they didn’t want to hire C++ devs to maintain it.

If that library is open source I'd love to take a look at it.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#288
post #270
post #241

Earlier quoted context omitted.

OCaml definitely has some weirdness that come from its age though (char==byte thing for example.)

Yeah there are some quirks, but that wasn't part of OP's request.

Well, I did specify "modern", which arguably includes sane Unicode handling.

I think a reasonable compromise is to have "char" be a 32 bit type, whereas a "string" would be UTF8.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#289

Earlier quoted context omitted.

No OP, and I don't know much about game development, but "without any change at all" is too strong. SDL only does so much, and you still need platform-specific APIs for file access, networking (if applicable), threading, etc. So you'll still need platform-specific code until someone writes those abstractions in Swift.

Swift Foundation is cross platform and provided by apple

Ah, that's great! I didn't realize Apple open sourced Foundation as well.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#290

Earlier quoted context omitted.

I'd say swift is currently probably the best languages out there. Language features, standard library, performance, memory management.

I'm curious, how do people judge this? Personally I have some significant experience with maybe 5 different languages, which is already more diverse than the average software dev as far as I know. But I still wouldn't be comfortable to judge something like this. For instance, I haven't worked with Swift, but I find it hard to believe it's much better than, say, C#, Scala, or Typescript, regarding those metrics. Do yo…

It's subjective, naturally. I don't know if I'd be that enthusiastic, but I definitely like it a lot.

My main languages are Python and C++. I've also used Java, C#, Javascript but not Typescript, among others.

In my opinion Swift does a pretty good job at striking a balance between expressiveness/usability, safety and performance. If it gets more traction under Linux (including a larger ecosystem and better tooling around it) I'd definitely consider it for projects where Python could become a bottleneck but C++-level performance is not absolutely required.

On the other hand, other languages in a similar niche - Rust, Go, even D or Nim? are already more established outside of iOS/MacOS, so I don't know. My experience with Swift has definitely made me more interested in learning Rust, which seems quite similar in some respects.

Post reply on HN