Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>Writing in a fast compiled language is not premature optimization.

If the fast compiled language is equally expressive and equally fast to write then no.

Those things are rarely (if ever) the case, though. It's certainly not true in this case. Go appears to be about 30% less expressive.



Another way to look at it is that Go expresses additional things that you can't express with Python.


In Go it's impossible to make for...range support user-defined types, and you have to write out every loop the hard way (and rewrite any loop that was using a builtin type). In Python you just define __iter__. That's what's meant by expressive, you can write what you mean instead of having to explain yet again how it should be implemented.


Of course they're different on that level of detail. In go, if you want programmable iteration behavior, you would create a channel that is fed values by a coroutine. Then you can range over it. It's not a new type, but that distinction seems a bit picky.

What I am talking about is the static type system. You can't express that in Python, despite how much more convenient some of its features are.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: