Hacker News new | ask | show | jobs
by lobster_johnson 3508 days ago
Isn't the "scripting" part just automatically compiling behind the scenes before running? It's not an interpreter or a VM. So the code runs just as fast as the compiled version, it's just that you pay a startup cost.
1 comments

That's true between a debug build and just running it as a script I believe. But a release version will be optimized, I imagine if they compared a debug build to the scripted version they'd perform similarly.
Can confirm, Debug build runs in similar time to script.
Difference is that Release builds do whole-module optimization in Swift 3.

That allows for more aggressive code specialization and inlining and can remove more reference count updates (https://swift.org/blog/whole-module-optimizations/)