News for hackers. Stuff that matters.
Re:Swift Static Linux SDK by christophilus on Tuesday June 11, 2024 @05:15PM (#40651582)
How’s the compilation speed?If it’s going to replace Go, that’s gotta be sub second for a medium sized project on my clunky old laptop.
Re:Swift Static Linux SDK by jkelleyrtp on Tuesday June 11, 2024 @05:19PM (#40651630)
Supposedly faster in Swift 6 but I don't have any big swift projects to throw at it. It uses LLVM so it's not going to be as fast as Go's.

In Swift 6 they:

- Improved parallelism via compilation pipelining (ie top-level object files are referencing not-yet-compiled symbols but can still proceed while those compile in the background)

- Parallelized and pipelined debug symbol generation (lazy debug symbols)

Re:Swift Static Linux SDK by josephg on Tuesday June 11, 2024 @05:24PM (#40651682)
Assuming my experience with Swift 5 is still accurate, compilation speed is at least an order of magnitude slower than Go.

It’s a much more powerful language. In my opinion slower compilation is worth it for all of its great features. (Does Go even have parametric enums?). But its definitely a trade off.

Re:Swift Static Linux SDK by MBCook on Tuesday June 11, 2024 @06:57PM (#40652628)
That’s the one big loss from moving off Objective-C. Because the language was so stupidly simple to parse and didn’t have a lot of “we’ll figure that out for you from what you wrote” it could be compiled incredibly quick on today’s machines.

I know they’re working on improving it. I’m glad they are. But that speed is something I definitely miss.

Re:Swift Static Linux SDK by christophilus on Wednesday June 12, 2024 @06:38PM (#40663968)
Ocaml makes me wonder if we really do need the trade off. It’s a fairly advanced language, and compiles super fast. I wonder why it’s such an outlier among advanced languages?
Re:Swift Static Linux SDK by coldtea on Tuesday June 11, 2024 @05:19PM (#40651629)
Why, would you care if it's a full second or even 5 seconds?

Go hyped their compilation speed a lot in its early years, but unless it's C++ templates level slugginess it's not like it's that big of deal.

Re:Swift Static Linux SDK by square_usual on Tuesday June 11, 2024 @05:27PM (#40651720)
Compiling fast has ripple effects throughout your workflow. Having your iteration time go from 1s to 5s is a massive difference: it can mean you break out of the flow state when you restart your server to test your code.
Re:Swift Static Linux SDK by manmal on Tuesday June 11, 2024 @06:17PM (#40652274)
As someone dealing with Swift everyday (and, before that, faster langs like Elixir and Typescript), I can only agree. Sometimes my incremental builds take 20-30 seconds and it feels like a huge toll. Waiting on the CI (which is a weak machine) is up to 25 minutes until the test suite has passed - a large chunk of that being compilation time. Releases take 5-10 minutes.

I really like Swift, but I’d highly appreciate faster compilation times.

Re:Swift Static Linux SDK by plorkyeran on Tuesday June 11, 2024 @07:36PM (#40652909)
Swift compilation is slower than C++.
Re:Swift Static Linux SDK by coldtea on Tuesday June 11, 2024 @08:21PM (#40653172)
C++ with heavy template use or C++ as glorified C-with-classes?
Re:Swift Static Linux SDK by plorkyeran on Tuesday June 11, 2024 @10:12PM (#40653797)
C++ with heavy template use.
Re:Swift Static Linux SDK by iainmerrick on Tuesday June 11, 2024 @07:03PM (#40652670)
Once you use a language where compile times are essentially invisible, it’s hard to go back.