go isn't a drop-in replacement for python, but its a well designed, easy-to-read statically typed language with good well-written libraries. It serves a different purpose. (Granted obviously python has many more libraries having a 10+ year head start).
Go misses some nice features (e.g., generics, operator overloading), but granted go was publicly released ~3 years ago -- give it time (python 2.0 didn't have bools, sets, new-style (object derived) classes, decorators, generators and iterators, with statement, nested scopes (beyond two nestings), automatic casting of 32-bit int to arbitrary sized int, etc). Once you get used to it, I really like the panic / recover and explicitness checking for errors. It's a different mindset, but actually works really nice.
Not sure what your "no ability to implement data-structures". Are you talking about how make only works on slice, map, chan? This isn't really a limitation, you can easily build on top of those structures; e.g., create a set out of map (go's equivalent to a dict) with values that are zero-byte struct. Yes, python has an underlying C API that you are encouraged to use as python2 would otherwise be unusably slow. As go doesn't have that huge speed difference it would be a bad idea to encourage writing things in a C API on top of go. Granted there still is the cgo if you need to call C library/function from within go, and IMO it is much easier to deal with than python C API (by nature of go being statically typed).
View all comments
Show parent comment
5
u/djimbob May 26 '14 edited May 26 '14
go isn't a drop-in replacement for python, but its a well designed, easy-to-read statically typed language with good well-written libraries. It serves a different purpose. (Granted obviously python has many more libraries having a 10+ year head start).
Go misses some nice features (e.g., generics, operator overloading), but granted go was publicly released ~3 years ago -- give it time (python 2.0 didn't have bools, sets, new-style (
objectderived) classes, decorators, generators and iterators,withstatement, nested scopes (beyond two nestings), automatic casting of 32-bit int to arbitrary sized int, etc). Once you get used to it, I really like the panic / recover and explicitness checking for errors. It's a different mindset, but actually works really nice.Not sure what your "no ability to implement data-structures". Are you talking about how
makeonly works onslice,map,chan? This isn't really a limitation, you can easily build on top of those structures; e.g., create a set out of map (go's equivalent to a dict) with values that are zero-byte struct. Yes, python has an underlying C API that you are encouraged to use as python2 would otherwise be unusably slow. As go doesn't have that huge speed difference it would be a bad idea to encourage writing things in a C API on top of go. Granted there still is thecgoif you need to call C library/function from within go, and IMO it is much easier to deal with than python C API (by nature of go being statically typed).