News for hackers. Stuff that matters.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by ken on Saturday May 16, 2020 @12:44AM (#23200555)
That's a big if. From what I've read, SwiftUI isn't even a great Mac/iOS GUI framework yet. And Windows and Linux are drastically more different than those two.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by Diesel555 on Saturday May 16, 2020 @01:10AM (#23200664)
I really enjoy swiftUI. It appears like it tried to emulate react and succeeded on a few fronts, is better in a few fronts (child modifying parent variable), and worse in a few fronts (side effects).

That being said, my experience with SwiftUI users is that they don't like it because it is so different from the standard Mac experience (props and re-renders and state...). And the documentation is poor (IMO has been Apple standard from MapkitJS to iOS Swift documentation to SwiftUI) which leads to a negative dev experience. Try finding what causes a component to re-render in SwiftUI vs React. If you find it great and please post it, but it's not easy to find in my simple research.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by josephg on Saturday May 16, 2020 @03:27AM (#23201199)
I’ve spent the last week learning SwiftUI to see how hard it would be to reimplement Notion in a performant way. It seems really ... unfinished. Like, the default List view is really hard to style. I spent 4 hours yesterday trying to get an unstyled text Button to have a hit target bigger than the characters themselves. Adding a frame with a background worked, but if the frame had no background (or a transparent background) then the hit target would stay tiny. I ended up fixing it by just reading through every property method in swiftui and guessing. It reminds me of web development in the early days of jQuery.

If the SwiftUI code were opensource it would be much more pleasant - I could paw through the code if I needed to, file issues, and so on. But the whole experience compared to writing typescript with VS Code is shockingly bad. With the preview open Xcode sometimes stutters so much that it misses key presses - so I’ll type a function name and it’ll come out missing letters, because apparently I wasn’t typing slowly enough for my $3000 computer from 2016 to keep up.

That Xcode gets trounced in developer experience by vs code - an IDE running on electron - is really a testament to the work Microsoft has put into performance. And it should be hugely embarrassing for Apple.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by ksec on Saturday May 16, 2020 @04:01AM (#23201370)
That is the thing I dont like about the current Apple.

They used to release things where you see they put a lot of thoughts into it. Now they are half baked. This isn't so much a problem on Apps ( The Product ) where it is constantly being updated and tweaked. But with code you have the hassle to try and keep up. And the pace of improvement is very very slow. To put things into perspective, Swift UI has been development for 4 years. Not exactly the state of things I would like it to be.

Apple also isn't dogfooding much with Swift. And I think that is great. In many ways I starting to feel Swift is like Dylan [1], it is new, it is exciting, and it is fun. But somehow after nearly 6 years Objective-C stills feels better. The syntax may still be god damn awful, but it is small enough to be called elegant. While Swift felt like C++ with better Syntax.

[1] https://en.wikipedia.org/wiki/Dylan_(programming_language)

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by zapzupnz on Saturday May 16, 2020 @05:20AM (#23201852)
> Apple also isn't dogfooding much with Swift.

That's because it didn't have a stable ABI until Swift 5, released last year. Now that it does, a lot of their iOS/iPadOS apps have been rewritten, at least partially but sometimes fully, in Swift; this includes some of their Catalyst apps on Mojave and Catalina.

The only app I know for sure to be fully written in Swift, thus far, is the Apple Developer app (previously called WWDC), but I know there are others (they were mentioned in last year's WWDC sessions).

> Swift UI has been in development for 4 years

I must have missed this. Where did you hear this? I'd love to see more info about that.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by saagarjha on Saturday May 16, 2020 @07:38AM (#23202606)
The lack of a stable ABI had nothing to do with preventing Apple from shipping apps written in it.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by ksec on Saturday May 16, 2020 @09:20AM (#23203164)
>I must have missed this. Where did you hear this? I'd love to see more info about that.

Chris Lattner said in one of the pod cast, I think it was Accidental Tech, where Swift UI started before he left Apple. Since that was 3.5 years ago, Swift must have been close to 4 years of work.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by dev_tty01 on Saturday May 16, 2020 @10:05AM (#23203457)
Well, that may be, but we don't know when a concerted effort began. Just a guess, but this was probably a small team (or individual) trying some things out as an R&D project to see if it had legs. At some point there was enough promise so that the company put serious effort into it. That might have been 2 or 3 years ago. At any rate, it has company focus now.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by DagAgren on Saturday May 16, 2020 @07:02AM (#23202413)
> But somehow after nearly 6 years Objective-C stills feels better

This experience is shared by basically nobody? I used to love Objective-C, which was unusual even before Swift, but I would not in a million years switch back to using it. Swift is so much better in every single way.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by apple4ever on Saturday May 16, 2020 @02:02PM (#23205698)
I share it. I love Objective-C and feel its a far superior language over Swift. Swift is too clever by half, with its var, let, func, and the god awful question marks. Objective-C is verbose sure, but that helps readability. I'll never switch to Swift, as Objective-C is so much better in every single way.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by DagAgren on Saturday May 16, 2020 @05:43PM (#23207456)
I don't get the feeling you've really given it a fair chance, or tried to understand why it does what it does.

Swift really is much more readable than Objective-C, too.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by apple4ever on Saturday May 23, 2020 @02:20PM (#23285127)
I have on both counts. I tried it a couple times and hated it. I've read the book and others justifications for it, but disagree.

Swift is absolutely less readable than Objective-C. Objective-C is known for its verboseness, which makes it easy to read. Swift has all kinds of easy ways to make it less readable, like the question mark. There is no way one can objectively argue Swift is more readable than Objective-C.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by zapzupnz on Sunday May 17, 2020 @10:20PM (#23217546)
Your assertions aren't backed up by anything; your criticisms of Swift are superficial and reek of "I'm unfamiliar with it, therefore it's bad".
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by kitsunesoba on Saturday May 16, 2020 @12:08PM (#23204615)
Yeah. There are _aspects_ of Obj-C that are still nice, but as a whole I find Swift way better to work with on day to day basis. For that matter, I prefer it over syntactically similar languages like Kotlin too. If I could just write Swift everywhere that’d be great.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by ksec on Saturday May 16, 2020 @09:25AM (#23203188)
At least all host of Accidental Tech podcast shared similar feeling.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by cutler on Saturday May 16, 2020 @08:41AM (#23202921)
Needs to be said. Apple doesn't seem to give a toss about performance or developer experience so long as it has something to demo at its annual developer conference.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by sophiebits on Saturday May 16, 2020 @02:01AM (#23200845)
Curious to hear more about what SwiftUI does better than React… any place I can read more?
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by Diesel555 on Monday May 25, 2020 @11:53PM (#23307260)
Sorry for the late reply.

You can change state without all the annoying purely functional programming stuff ([... previousState, newValue]). Just change it.

You can change a prop passed in and even pass a new value up to the parent. So you know the pass a function down so the child can change a value in the parent? Just pass the variable you want changed down with @binding.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by doteka on Saturday May 16, 2020 @06:06AM (#23202137)
The official Apple tutorial gives you an idea what they were going for, but in practice it’s nowhere near that smooth.

In fact, most of the time I found myself staring at a “type too complex, add annotation” error. That one doesn’t actually mean your type is too complex, it just means you’re passing the wrong thing somewhere and instead of a useful error message the compiler just gave up and broke.

Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by kitsunesoba on Saturday May 16, 2020 @12:14PM (#23204678)
Errors in SwiftUI are significantly better in the recently released Swift 5.2, so this is clearly something they’re working on.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by doteka on Saturday May 16, 2020 @02:16PM (#23205814)
I certainly hope so, because this was definitely on Swift 5.2 . In general if you come in expecting a dev experience anywhere close to writing React in Typescript using VSCode, SwiftUI and Xcode both are a bit of a disappointment - it's slow, it's glitchy, autocomplete kind of sucks, never mind tooling like Prettier which I take for granted now.
Re:Swift 5.3 Will Be Supported on Windows and Additional Lin... by cutler on Saturday May 16, 2020 @08:34AM (#23202886)
Agreed. Just watched a recent tutorial on SwiftUI where changes to Hello World were taking a lifetime to update in canvas view. SwiftUI, like most of Apple's OS releases, is beta quality.