News for hackers. Stuff that matters.
Re:Lightweight API Design in Swift by mojuba on Tuesday November 26, 2019 @04:56AM (#21636899)
Absolutely. One of the things I hate most is this thinking "run-time is more important than compile-time".

Well the compiler and the IDE are runtimes too, we developers are users too, we sometimes work on our laptops unplugged and we do want our software to be fast and efficient!

Re:Lightweight API Design in Swift by skohan on Tuesday November 26, 2019 @05:43AM (#21637116)
> "run-time is more important than compile-time"

This is a pitfall of Rust as well. I suppose there will always be a tradeoff between stronger static analysis and compilation time, and I'm firmly in the camp that I want my compiler to catch more issues so I don't have unexpected runtime failures, but iteration time matters too, and I'm hopeful improvements can be made in this area.

Re:Lightweight API Design in Swift by mojuba on Tuesday November 26, 2019 @07:31AM (#21637683)
Sometimes you introduce certain restrictions in the language just for the sake of simplifying the compiler. This is allowed, valid and will be understood by the developers.

For example, for decades most static languages required a symbol to be defined before its first usage. Removing this restiction seemed like a nice little cute convenience but the outcome of it is this horrific slowdown of the build process. Personally I would agree to the restriction if I knew the compiler could be 5x faster which is pretty realistic to achieve, it seems.

Re:Lightweight API Design in Swift by skohan on Tuesday November 26, 2019 @08:29AM (#21638066)
Those kinds of restrictions can have their own productivity pitfalls. For instance, it might be the case that requiring declaration prior to usage explicitly will speed up the compiler, but it might also mean that you can't move blocks of code around without paying careful attention to the order of declaration. I think having a permissive compiler, but also being able to profile the compilation process is a reasonable compromise.
Re:Lightweight API Design in Swift by mojuba on Tuesday November 26, 2019 @08:36AM (#21638113)
Possibly, but there are other kinds of compromises such as allowing arbitrary order only within a class, the C++ way. Or another one: the first (quick) pass treats all function and reference type definitions as forward declarations and skips the details. This way the compiler might be able to do more permissive compilation though not 100% accurate like Swift currently does.
Re:Lightweight API Design in Swift by ajconway on Tuesday November 26, 2019 @05:45AM (#21637127)
But run-time is more important, isn't that why we compile stuff with optimizations that take ages to process when building products for the end users?

Compilers are hard, compiler bugs can have a devastating effect on one's software, so it's understandable that developers may prefer to take things slow but safe.

Re:Lightweight API Design in Swift by Gibbon1 on Tuesday November 26, 2019 @06:14AM (#21637280)
My half joke is the optimizations slow down compilers. So people then try to make the compilers faster by increasing the levels of optimization. Which means they have to work harder. So they are slower.
Re:Lightweight API Design in Swift by skohan on Tuesday November 26, 2019 @05:50AM (#21637152)
I guess ideally this should be a tradeoff in the hands of the developer right? I should be able to produce debug builds quickly so that I can iterate quickly, and if I want a super-optimal release build it's fine if it takes longer.