News for hackers. Stuff that matters.
Re:Iris: Fast back-end web framework for Go by ngrilly on Wednesday June 22, 2016 @06:58AM (#11952781)
> By not having a JIT, Go loses some important optimizations that are very helpful for making virtual-heavy languages like Go faster.

How does Rust work in this regard? By avoiding virtualization, and compiling each function to many specialized variants corresponding to each possible permutation of input and output types?

Re:Iris: Fast back-end web framework for Go by eddyb on Wednesday June 22, 2016 @08:16AM (#11953249)
With generics, yes, like C++ templates: each combination of parameters results in one instance.

However, you can opt into using trait objects instead, which do use virtual calls.

Re:Iris: Fast back-end web framework for Go by ngrilly on Wednesday June 22, 2016 @04:46PM (#11956871)
Is pcwalton saying that a JIT compiler is more adequate for a "virtual-heavy" language like Go (to use devirtualization with inline caching and bailout), and an AOT compiler is more adequate for languages like Rust and C++ that mostly use code specialization?
Re:Iris: Fast back-end web framework for Go by kibwen on Thursday June 23, 2016 @12:53AM (#11958918)
It's not quite as clean-cut as that, though it is self-evident that optimizing at runtime (e.g. JIT) is the only recourse for optimizations that are otherwise reliant on runtime information (e.g. dynamic dispatch/virtual calls). Go does have an advantage over Java in that it prefers static semantics (pcwalton's assertion that Go is "virtual heavy" should likely be taken as relative to Rust/C++), so has less to benefit from devirtualization, and thus less of an argument to go the JIT route (which would take monumental engineering effort).

I believe pcwalton's points are that 1) running in a virtual machine does not imply that a language is slow (though I bet he'd agree with you that JIT introduces substantial memory overhead), and 2) Java, specifically, is not slow, thanks to a highly-tuned JIT.

Re:Iris: Fast back-end web framework for Go by ngrilly on Thursday June 23, 2016 @03:07AM (#11959346)
Thanks! That's exactly what I wanted to know.