3 ms·
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.
by christophilus 2y ago
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.
- coldtea 2y agoWhy, 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.
- square_usual 2y agoCompiling 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.
- manmal 2y agoAs 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.
- iainmerrick 2y agoOnce you use a language where compile times are essentially invisible, it’s hard to go back.
- plorkyeran 2y agoSwift compilation is slower than C++.
- coldtea 2y agoC++ with heavy template use or C++ as glorified C-with-classes?
- plorkyeran 2y agoC++ with heavy template use.
- jkelleyrtp 2y agoSupposedly 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)
- josephg 2y agoAssuming 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.
- MBCook 2y agoThat’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.
- christophilus 2y agoOcaml 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?