4 ms·
> Go isn't big on the "optimization" part. Care to elaborate?
by fredrikholm 6y ago
> Go isn't big on the "optimization" part.
Care to elaborate?
- jerf 6y agoIt's true. Go prioritizes compile speed over a ton of optimization. It does fast ones, but it doesn't do the expensive ones. I don't know whether the Go compiler never does tail-call optimization, but I do know it is never something you can count on. (There's two kinds of tail call optimization... there's the one where the compiler may choose to do it as an optimization step, but you can't ever count on it because at any time for any reason it may stop, so you have to assume it didn't happen. Then there's the kind you can absolutely count on, and program tail-call-based algorithms secure in the knowledge that they won't blow out the stack. I'm pretty sure Go doesn't have the latter.)
- fredrikholm 6y agoThank you for clarifying. Does this apply to procedural code as well? Go not implementing TCO makes sense as the language is _very_ Wirthian.