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

You've been saying that it's just about your own use cases, but your statements in that post are much more general. For example:

> What does Go have that Python lacks? Performance, static typing.

That's a very simplistic view. Being a long term Python developer that switched to Go as the preferred language years ago, here are some of the things I appreciate on the other side of that fence:

- Performance, indeed.

- Static typing, yes.

- A simpler language specification (a big one for me, game changer for large code bases in large teams)

- Interfaces based on structural typing ("static duck typing", as some say)

- Much better control of memory layout (struct with 2 int64s takes 128 bits in memory, a list of those takes N*128bits)

- Built-in micro-threads (goroutines)

- A runtime that schedules (means, you can block, despite concurrency)

- Buffered and unbuffered channels managed by the runtime (with select, etc)

- Builds native static executables, fast (maybe you don't care, many people do)

- A much better organized standard library

- A very good http server _and_ client package in the standard library

- Good crypto packages and APIs in the standard library

- Error handling without exceptions (that's a pro for me and many, feel free to disagree)

- A very elegant system to define access control (private/public) on vars/funcs/types/fields/consts/etc.

- All names inside files that are part of a package ("directory") are part of the same namespace (allows better organizing code than with Python's file-is-a-module style)

- Code files that can see declarations out of order (improves code organization)

- gofmt! godoc! Love those.

- None of the Python 2 => 3 migration mess (people are being told to program in a pseudo-language that is neither Python 2 nor 3 in recent times)

And so on... That's not to judge your use of Python, though. By all means stick with Python if it suits your needs.

As a last point, if you're interested in Qt bindings, I've been working on this:

https://github.com/go-qml/qml

Some applications coming out of it:

http://blog.labix.org/2014/04/25/qml-contest-results



> - Performance, indeed.

I have been really disappointed and underwhelmed by Go's performance (I have not tried the gccgo yet). For such a simple, statically typed language I was expecting really an order of magnitude better performance. So, in light of Cython and Pypy the performance story is quite murky, the other points do stand.


Performance is always a hard topic to talk about. For almost any language you can optimize hotspots in the code to make it go super-fast. You can make any code run slow in any language if you are not familiar with how the language behaves.

Go has pprof which allows for profiling of your code to help find the hotspots. Without a specific case it's hard to say that Go is fast or slow compared to other languages.


That's not about how much the code might be optimized. I could always step out of Python and do a C module if I needed speed.

Instead, what's valuable in terms of the perceived performance delta is the speed of standard code as one would write intuitively and conventionally. With a reasonable understanding of how CPython compiles and interprets code, and a reasonable understanding of how the standard Go compiler suite generates binary code, one can make ballpark-style statements of performance for such code without lying too much.

Sure, there's PyPy, and there's gccgo, but that's not what most of the respective communities are using today, and it's not what we use in the projects I'm part of either.


I'm curious - why did you go with Python over Java in the first place? Many of your bulletpoints are also things that Java gives you, except for the duck-typed interfaces, goroutines, and control over memory layout.




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

Search: