News for hackers. Stuff that matters.
Re:Swift 5.2 by ashton314 on Tuesday March 24, 2020 @07:54PM (#22680374)
Looks like a solid update on first glance. I nearly tore my hair out last month building a SwiftUI app. The error messages were terrible—I had never seen such poor error messages. I'm so glad they're addressing that.
Re:Swift 5.2 by SkyPuncher on Tuesday March 24, 2020 @08:53PM (#22680833)
Swift is one of my favorite languages. Until I hit a fucking error. Then I just want to be done with it.
Re:Swift 5.2 by hombre_fatal on Tuesday March 24, 2020 @10:33PM (#22681488)
The errors are so bad that it trains me to never write more than a few lines at a time without compiling/running it.

The runtime errors can be comically bad, bucking you into a screen of assembly for the simplest of mistakes.

Re:Swift 5.2 by saagarjha on Wednesday March 25, 2020 @03:14AM (#22682592)
Perhaps you have debug symbols disabled?
Re:Swift 5.2 by fctorial on Wednesday March 25, 2020 @01:56AM (#22682308)
How do they compare to cpp template errors?
Re:Swift 5.2 by saagarjha on Wednesday March 25, 2020 @03:15AM (#22682597)
Less verbose, and usually (but not always) more understandable. I think it’s probably similar to what C++ errors will be with concepts.
Re:Swift 5.2 by dpeck on Tuesday March 24, 2020 @08:12PM (#22680503)
No kidding. I really like swiftui, the declarative model is great and it’s so much less of a pain than React-native, but trying to decipher the error messages for it while I was learning swift was comically bad at times.
Re:Swift 5.2 by hugozap on Tuesday March 24, 2020 @08:39PM (#22680741)
I'm curious about the major pains with React-native you experienced. Is it because of the toolchain for RN? or some specific scenario?
Re:Swift 5.2 by ericlewis on Tuesday March 24, 2020 @08:48PM (#22680795)
As a contributor to RN and someone who loves SwiftUI just as much: it’s mostly the toolchain. You have an unbelievably vertically integrated framework with SwiftUI.
Re:Swift 5.2 by rauchp on Wednesday March 25, 2020 @01:40AM (#22682241)
Do you think SwiftUI is still too experimental to build out a production-ready app? I'm a RN dev leading the app development at our startup, but every time I check on SwiftUI I LOVE what I see. Sadly it looks like the final results are mostly tech demos rather than fully integrated apps.

Thinking maybe we have to wait for a behemoth's adoption (like AirBnB & React Native) to take the ecosystem to the next level.

Re:Swift 5.2 by jamil7 on Wednesday March 25, 2020 @04:39AM (#22682914)
I've shipped a small app in it and am collaborating on another currently. If you're looking to use it on your team I'd wait for this years online WWDC, see whats announced and evaluate from there.
Re:Swift 5.2 by ericlewis on Wednesday March 25, 2020 @01:47AM (#22682270)
I would say it just depends, which I know isn't satisfying as an answer. I shipped an app named Eggy which is all SwiftUI- but it isn't super complex exactly. There are still plenty of simple problems that are hard to get around. But you can definitely use it to replace pieces of an app.
Re:Swift 5.2 by acarrera94 on Wednesday March 25, 2020 @04:04AM (#22682782)
I also shipped an app for a client called Droplii. I definitely believe you can use it for production level apps. Productivity is through the roof. There are just a few small quirks, but I believe the pros out weigh the cons here.
Re:Swift 5.2 by dpeck on Tuesday March 24, 2020 @08:55PM (#22680846)
Sibling comment here mostly covered it, toolchain is kind of all over the place and build times are way faster with swiftui on my 2015 MacBook.

Also with Combine and associated bits there is a lot less boilerplate around state that doesn’t have to be written.

Also the disk space for the js ecosystem is beyond crazy and really bothers me.

Re:Swift 5.2 by jamil7 on Wednesday March 25, 2020 @04:46AM (#22682947)
Compared to native development the toolchain and dependencies are out of control and I'm unsure how it can really be improved, Expo does a decent job of abstracting some of it but you lose so much from the managed workflow that it makes me question the purpose of building a native app at all. I think the real threat that PWAs bring is to frameworks like React Native and Cordova rather than fully native apps which will likely always have specific use cases.
Re:Swift 5.2 by novok on Tuesday March 24, 2020 @08:55PM (#22680845)
I've learned you wait a couple of years before you start trying to use new major apple developer tech. Same thing with swift, it was better to wait until swift 3 or 4 before adopting it.
Re:Swift 5.2 by auggierose on Wednesday March 25, 2020 @02:15AM (#22682376)
Yeah, also for the DSL's you build yourself with the new 5.1 features, really bad error messages. If that would get better in 5.2, it would help a lot.
Re:Swift 5.2 by xscott on Tuesday March 24, 2020 @10:52PM (#22681574)
Has anyone had good luck getting Swift running on Linux? Many versions ago, I had it working under Ubuntu, and it seemed really nice. I particularly liked having a REPL for this style of language.

However since then, I've had very limited success under Ubuntu, CentOS, and Arch. Different failures on each. Every few releases or so I give it a go, but something always fails and I go back to working on some other pet project.

Re:Swift 5.2 by saagarjha on Tuesday March 24, 2020 @11:22PM (#22681689)
Are the prebuilt toolchains (https://swift.org/download/) giving you trouble?
Re:Swift 5.2 by pjmlp on Wednesday March 25, 2020 @03:23AM (#22682619)
The Ubuntu ones are well known for having linker issues on LTS distributions.
Re:Swift 5.2 by xscott on Wednesday March 25, 2020 @12:11AM (#22681875)
I'm currently using Arch, so I don't think the prebuilt Ubuntu ones are going to work.
Re:Swift 5.2 by resist_futility on Wednesday March 25, 2020 @12:19AM (#22681906)
Maybe just use the Docker builds?
Re:Swift 5.2 by xscott on Wednesday March 25, 2020 @12:42AM (#22681990)
I know I'm out of fashion :-), but I don't really use containers for anything. I think Swift looks really nice, but when I check out other languages (such as Go, Rust, or any of the gazillion others), I don't have to jump through any hoops other than using the system package manager or something like "./configure; make install". I wish Swift was in this camp.
Re:Swift 5.2 by pcr910303 on Wednesday March 25, 2020 @01:07AM (#22682087)
> I don't have to jump through any hoops other than using the system package manager

Wouldn't that be something the package manager should include?

If you're using Arch, I'm pretty sure AUR have you covered... [0]

[0] https://aur.archlinux.org/packages/swift/

Re:Swift 5.2 by xscott on Wednesday March 25, 2020 @01:18AM (#22682137)
The last time I tried, it didn't go well. When the AUR package for swift or swift-bin goes to 5.2, I'll probably try again.

> If you're using Arch, I'm pretty sure AUR have you covered...

Have you gotten it working with Arch?

There are user comments on the page you linked indicating other people have had problems too.

Re:Swift 5.2 by rnantes on Tuesday March 24, 2020 @09:54PM (#22681272)
A great update to a safe and ergonomic language. The best is still yet to come with Swift on Windows and Android, SPM Resources, and of course Async/Await.
Re:Swift 5.2 by hiitechk on Wednesday March 25, 2020 @12:19AM (#22681907)
Is Swift on Windows on the roadmap?
Re:Swift 5.2 by jurip on Wednesday March 25, 2020 @01:17AM (#22682129)
Ted Kremenek listed in his "On the road to Swift 6" post on the forums "Expand the number of platforms where Swift is available and supported" as the first item. (https://forums.swift.org/t/on-the-road-to-swift-6/32862)

Saleem Abdulrasool, who has been working on Swift on Windows, was also recently added to the core team.

So I don't know if it's actually on the roadmap, if one exists, but official support doesn't seem impossible.

Re:Swift 5.2 by jurip on Friday March 27, 2020 @12:39AM (#22700478)
Not impossible indeed. Swift 5.3 will officially support Windows: https://swift.org/blog/5-3-release-process/
Re:Swift 5.2 by armadsen on Wednesday March 25, 2020 @06:03PM (#22688900)
Yes! Swift 5.3 is planned to introduce official Windows support, led by Saleem Abdulrasool who has done a bunch of work on it.

https://swift.org/blog/5-3-release-process/

Re:Swift 5.2 by dklend122 on Wednesday March 25, 2020 @07:04PM (#22689268)
How about swift Android?
Re:Swift 5.2 by hashbig on Tuesday March 24, 2020 @09:57PM (#22681291)
All I want is official Swift support for an http server, and a web frontend framework using SwiftUI.
Re:Swift 5.2 by the_gipsy on Wednesday March 25, 2020 @07:49AM (#22683687)
AFAIK SwiftUI is derived from or inspired by The Elm Architecture.

In any case for me, Elm has been extremely enjoyable, as a web frontend framework and language combo.

Re:Swift 5.2 by hashbig on Thursday March 26, 2020 @09:18PM (#22699686)
I am a huge Elm fan, and I have used it in many contexts. It is fair to say that in the last 10 years React has most influenced the way we write our UI and Elm has most influenced the way we manage our state on the frontend.
Re:Swift 5.2 by skavi on Wednesday March 25, 2020 @12:44AM (#22681997)
An alternative would be Dart/Flutter, though I’ve heard web UI perf is awful atm.
Re:Swift 5.2 by pjmlp on Wednesday March 25, 2020 @03:25AM (#22682628)
So import Glibc is still a thing?
Re:Swift 5.2 by hiq on Wednesday March 25, 2020 @04:41AM (#22682924)
Can you expand on this?
Re:Swift 5.2 by pjmlp on Wednesday March 25, 2020 @05:15AM (#22683047)
Swift still doesn't have a mature standard library implementation that works across all platforms.

So you have to do OS specific imports directly, for basic stuff like calling a random number generator or handling IO.

It is even done so on the introduction pages, https://swift.org/getting-started/

Foundation outside Apple platforms is pretty much WIP.

Re:Swift 5.2 by zerr on Wednesday March 25, 2020 @05:50AM (#22683187)
Interesting, although, at least they have a cross-platform random now (Int.random, Float.random, ...).
Re:Swift 5.2 by abjecton on Wednesday March 25, 2020 @03:25AM (#22682626)
I see some huge changes there, including the error messages!
Re:Swift 5.2 by elpakal on Tuesday March 24, 2020 @09:55PM (#22681276)
looking forward to the improved build times!