News for hackers. Stuff that matters.
Re:We built an interpreter for Swift (a compiled language) by jacobx on Thursday September 04, 2025 @05:15PM (#45132292)
There's definitely a cost: everything is type-erased and there's a lot more indirection than there would be if the code was compiled. But you usually don't hit performance issues because most app code (especially in the UI) is just a thin layer calling into the OS frameworks. The framework code does the heavy lifting and is all compiled.

The places you can hit performance issues are things like when the app itself has a tight loop that's doing a lot of work.

Re:We built an interpreter for Swift (a compiled language) by flykespice on Thursday September 04, 2025 @06:23PM (#45132914)
You could do the same thing CPython does: compile common patterns of code into specialized macro-instructions to reduce the interpreter's penalty.