top | item 44885435

(no title)

alrs | 6 months ago

I feel that it's hard to be mad at Go if you look at it as "python 4.0."

discuss

order

stared|6 months ago

Not sure if "Python 4.0" is the best comparison.

Go is compiled, Python - interpreted. Go focuses on concurrency, Python on making it easy to do things with code.

Many things that are a one-liner in Python (but itself or with a library), in Go take quite a lot of lines or boilerplate. For example, there is no built-in string templates in Go.

9rx|6 months ago

> Not sure if "Python 4.0" is the best comparison.

Or is it Python that is not best compared to "Python 4.0"? Python doesn't live up to the guiding principles of Python, such as preferring only one obvious way to do something. Go is, in many ways, more Python than Python.

> Many things that are a one-liner in Python

Case in point. Many of those one-liners are just as obviously expressed as multi-liners (e.g. list comprehension vs. traditional 'for' loop).

> no built-in string templates in Go.

Another good example. There is no special syntax, but the standard library provides. Special syntax would give two obvious ways to do it.

pjmlp|6 months ago

Hardly, given that it isn't as expressive as Python, that role belongs to Mojo.

The only reason so many folks leave Python for Go, is the usual problem of writing C libraries instead of finally having a proper JIT in CPython, and having PyPy being largely ignored by the community.

whizzter|6 months ago

Go's structural typing allows for quite a lot of flexibility often otherwise only found in scripting languages (I would suspect that this was the single biggest reason as to why the TypeScript folks started to move to Go for the ported compiler rather than something like dotnet based like C#).

justin66|6 months ago

> Hardly, given that it isn't as expressive as Python, that role belongs to Mojo.

Such a strange thing to write. Mojo doesn't even have classes yet.