Go vs Python

Adrian Morales
Adrian Morales

Pros vs cons of Golang vs Python?

Whats your pick?

All urls found in this thread:
http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=go&lang2=python3
https://opensource.googleblog.com/2017/01/grumpy-go-running-python.html
https://www.techempower.com/benchmarks/#section=data-r13&hw=ph&test=plaintext&l=3vtypr&a=2
https://www.python.org/dev/peps/pep-3146/
http://talks.golang.org/2012/splash.article
Jayden Cox
Jayden Cox

go is faster
python is more fun
their both shit

Leo Smith
Leo Smith

go is made by google
expect it to live 5 years and then abandoned

Noah Foster
Noah Foster

go is faster
Proofs?

Andrew Torres
Andrew Torres

http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=go&lang2=python3

Now fuck off.

Christopher Thompson
Christopher Thompson

Just learn C++

Colton Smith
Colton Smith

How are these two comparable in the slightest?

Christopher Turner
Christopher Turner

Isn't Go supposed to be a C competitor? Comparing it to Python is stupid, because they're different tools used for different purposes. Go/C is for when you want to get more performance, and Python is for when you want to make something quickly.

Luis Fisher
Luis Fisher

I used to be really like the idea of Python until I actually started using it. Python is not easy not learn like many will make you believe, rather it is forgiving therefor easy to dive in, but in reality hard to master.

Python advantages over Go
- richer ecosystem
- better tooling
- bigger community
- better support for GUI programming
- faster prototyping

Go is a very unique language, it is high abstraction language, but still compiles to native executable and also has garbage collection (sub-ms pauses). The language by itself is very simple & opinionated, meaning that there is always a preferred way of doing things. There is no Java-like OOP, there is not high functional programming features. Some may say that's bad, but I personally love that about Go. I love reading other people's Go code.

Go advantages over Python
- native executable by default
- faster
- better garbage collector
- easier to master
- sane language design without OOP insanity and functional programming cancer

There you go. Even though if you are beginner I would advice not learning ether of those two. If you're studying CS, study concepts and get to know the basics of the language they teach in. If you're self thought then just focus on one platform you want to work in.

Android -> learn Java
iOS -> learn Swift
web frontend -> learn HTML, CSS, JavaScript, jQuery...
web backend -> learn PHP or Python or Ruby or NodeJS
Windows applications -> learn C#
embedded devices -> learn C
game development -> learn C++ (don't actually learn self tough game development)

Leo Howard
Leo Howard

Are you retarded? Go was released in 2009, now it is 2017. 2017-2009 = 8 years (actually more like 7 if you account for months).

Go is not a consumer product, but a developer one. Google discontinues their projects because they can't monetize the specific platform.

They are slowly rewriting all their legacy Python 2.7 codebase to Go.

Dominic Taylor
Dominic Taylor

gophers pls *go*

Jordan Moore
Jordan Moore

gophers pls *go*

Bentley Lopez
Bentley Lopez

Fucks up sage
Doesn't know how to bold text

Carter Wright
Carter Wright

I have said it here before and I'll say it again: Go is perfect for what it was designed for: server programs.

No, it's supposed to replace Java and C++ for server programs.

Not only that.
Google has written a new Python runtime in Go that transpiles Python to Go code:
https://opensource.googleblog.com/2017/01/grumpy-go-running-python.html

Jack Ramirez
Jack Ramirez

I have not seen pedobear in years.

Charles Richardson
Charles Richardson

web backend -> learn Rust
Windows applications -> learn Rust
embedded devices -> learn Rust
game development -> learn Rust
fixd

Eli Hughes
Eli Hughes

Python:

Very high level
Very well designed
Supports OOP and FP
20-30 times slower than C
Mature, no big changes expected in the foreseeable future
Widely used in industry
Outstanding third-party libraries
Arguably wider scope of application
Community is somewhat fragmented
Main competitors: Perl, Ruby, Lua, JavaScript, PHP
You can actually get paid to write Python code

Go:

Lower level than Python, higher level than C
Lots of design choices are questionable and have caused much controversy
Largely a procedural language
2-3 times slower than C
Go 2.0 will break everything (and either make Go a smashing success or sink the ship)
Niche language used by a handful
Not that many libraries available yet
Arguably suitable only for certain use cases
Not much fragmentation in Go's community
Main competitors: C, C++, D, Rust, Java
Finding a job may be challenging (but will pay better)

Mason Taylor
Mason Taylor

Being white
Getting paid to write code in any language

Jaxson Sullivan
Jaxson Sullivan

CHECKMATE ATHEISTS

Jackson Miller
Jackson Miller

Lots of design choices are questionable and have caused much controversy

DAE LIKE GENERICS LE REDDIT ARMIE, pls go

C and Go are the only sanely designed languages.

I wish Scala-tier pajeets would stop ruining programming.

Xavier Peterson
Xavier Peterson

Isn't go explicitly designed as a pajeet-friendly language?

Parker Ward
Parker Ward

Explicitly designed? I don't think so. Pajeet-friendly? Yeah it is.

Go is antithesis to what modern programming has become.

Jeremiah Wood
Jeremiah Wood

In a previous golang thread, someone posted a quote from one of Google's devs explaining that go was designed to accommodate brainless, thoughtless programming for their interns/outsourced coders. I'm sure they anti-go folks will be happy to repost it.

Owen Cooper
Owen Cooper

Explicitly designed? I don't think so.
Some people would want you believe that Go was made by Google to employ more pajeets. But reality is that Go is far from just being Google's toy project. There was a recent controversy where Google wanted to add a feature to Go that would make easier for them to maintain certain projects, but it was a half-baked solution. Community complained and Go developers immediately dropped the feature.

Go is controversial because it is very good for niche programming fields like servers and cli utilities, but doesn't excel at everything.

The key point here is our programmers are Googlers, they’re not researchers. They’re typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They’re not capable of understanding a brilliant language but we want to use them to build good software. So, the language that we give them has to be easy for them to understand and easy to adopt.
t. Rob Pike

This is how Rob Pike sold the idea to Google to get resources. Go is nowhere near Pajeet-friendly as Java or Python for example.

Lucas Sullivan
Lucas Sullivan

garbage collector
How is that an advantage?

Asher King
Asher King

sub-ms garbage collector

Ethan Peterson
Ethan Peterson

Let me reiterate for you:
garbage collector
How is that an advantage?

Adam Kelly
Adam Kelly

Not using Cython
no u

Daniel Lopez
Daniel Lopez

The point is not freeing you from the hassle of remembering to "free" your memory, but consenting you to share memory between "threads" without the hassle of maintaining a owner that must free it when all the other users have stopped using it. In fact the latter part of my last sentence describes a gc, and in that context is mandatory (in lot of simple cases you can come up with an ad hoc solution that is probably better then a generic gc, but in the end the gc is fucking convenient and simplifies even those cases)
Even with channels, for performance sake, you want to share memory; channels maintain their second purprose: synchronization

Hunter Flores
Hunter Flores

Look on yt "static void main" from Pike. They designed the language to be ergonomic for them (unix patriarchs). Incidentally a well written language is good even for pajeets and that's how even I would sold a similar project to management.

Landon Flores
Landon Flores

Go is pratically usable everywhere.
Nobody has never said a shit about 2.0
Go has lots of things that you would consider "functional", but sometimes has preferred different compromises (like multivalued return and for cycles instead of tail recursion). Those choices are not mindless given how easy it is to read other people go code (which is shockingly one of the best language features), and that Turing machines are still the basic model for computation at the hardware level and not lamba calculus (inb4: derp, von Neumann, lamba calculus cannot).
The rest is less inaccurate.

Jace Murphy
Jace Murphy

Too much readability is not good too. Code should have a barrier against those who are too dumb and must not be allowed to touch it.

Chase Murphy
Chase Murphy

What constitutes a barrier to changing code that does not belongs to you is your own ignorance: specifically of the application domain, not of the code. If one is so stupid to change code that don't know why is there, he won't be stopped by simply don't understanding the code itself.
The right solution for the problema is not creating unreadable languages, but setting permissions on repositories...

Nicholas Myers
Nicholas Myers

This is Poe's law tier.

Juan Wood
Juan Wood

What kind of shit argument is this? Holy shit.

Matthew Fisher
Matthew Fisher

Rust is purely a fad. At least Go is out of beta and will still be around in a couple years.

Henry Butler
Henry Butler

Rust will suffer from the same problems of C++ because the design principles are nearly the same (from runtime cost free abstraction but not so programmer /compile time friendly, to a preference for having always the right functionality at hand instead of minimalism and orthogonality, passing for the usual love for simple interface even at cost of complex implementation instead of full stack simplicity).
It is only updated to the state of the art of what that community (lot of times rightfully) thinks are best programming practices right now.

Ayden Morgan
Ayden Morgan

I don't know how people stand Rust syntax.

Oliver Bailey
Oliver Bailey

Too much readability is not good too.

Samuel White
Samuel White

I really don't mind, if it becomes as complex as C++, as long as three things eventually are all true:
- the compiler proves that the complex code I've written is safe
- the compiler optimises the abstractions down to C++ performance in almost all use cases
- the compiler compiles at least as fast as modern C++ compilers

Currently only the first one is true. Waiting for Rust to mature. It's a good concept, but all software written right now hinges on the assumption that Rust will eventually become a safe C++.

Luke Sanders
Luke Sanders

Rust isn't forced to carry a massive cinderblock in the name of backwards compatibility.
It also won't suffer from the same problems of C++, because the design principles are not the same. Take a look at how Rust implemented RC/Mutex for dynamic enforcement of alias rules.
Without such enforcement, Stroustrup's model for type/resource safety is fucking useless. It all relies on being able to statically proven to not alias on function entry.
Protip: you can't do that with all mutable references in modern C++, with shared_ptr for example.

Andrew Mitchell
Andrew Mitchell

Im slowly learning Python and enjoying it without having any prior real knowledge of programming or scripting.

Fight me.

Justin Powell
Justin Powell

Python is a pretty good language, it would've been infinitely better if it used curly brackets and semicolons instead of whitespace though

Adam Campbell
Adam Campbell

What about various devices used in conjunction for a robot?

Landon Sanchez
Landon Sanchez

python would be a good language with do blocks instead of braces

Cooper Edwards
Cooper Edwards

C competitor
Doubtful. It was designed to replace C++ in most applications, but using it in place of Python is perfectly acceptable too, considering Go's focus on readability.

Zachary Morris
Zachary Morris

Why? You'll end up indenting in any case if you value readability, so why mark code structure twice (in ways that don't necessarily agree with each other) when you could do it once? Seems unnecessarily complex.

Tyler Russell
Tyler Russell

The design principles are instead nearly the same I repeat.
The features will be simply more polished, updated, and better working. Lot of shit won't be there. But in the end it will suffer from the same problem, namely complexity and on the long run deprecated things or more way to do the same things.
That community is willing to accept the trade offs like but not all programmers feel the same.

Grayson Diaz
Grayson Diaz

More on the current state of Rust vs Go/C++:
- The compiler is nowhere near as optimising as it should be. Currently some code will be faster than both C and C++, some will be on par, but the majority will be Go-Java speed.
- The compiler is not even multithreaded. The final compilation step, which I assume to be linking and optimisation, can take extremely long and all on a single core.
- Libraries, or, more importantly - high performance libraries, are lacking. As an example Go's standard library's HTTP server is ~16 times faster than Mozilla's Hyper HTTP server ( https://www.techempower.com/benchmarks/#section=data-r13&hw=ph&test=plaintext&l=3vtypr&a=2 ) and it even drops some of the requests in the benchmark. I am comparing the goto fully-featured servers, not some stripped down special purpose libraries. Work is underway to make Hyper use nonblocking I/O and such, but is not yet there.
- Rust is still changing. Go is a relatively mature language. It's had plenty of time to accumulate backwards compatible improvements, but Rust is only a year old since 1.0. A lot of important features are still in development and many libraries rely on the nightly compiler to even work.

tl;dr: Rust needs another 4-5 years to become usable in mainstream production.

Carter Gray
Carter Gray

In fact, what I don't understand of Rust (in reality of every language) are the zealots.

Tyler Morris
Tyler Morris

Brand identity or, in more severe cases - religion. This has existed among humans for millennia.

Hudson Peterson
Hudson Peterson

tl;dr: Rust needs another 4-5 years to become usable in mainstream production.
It will not survive that long. In short order it will be surpassed, abandoned, and forgotten, like Clay.

Generic programming was a mistake.

John Richardson
John Richardson

It will only go under, if Mozilla goes under. But the inverse is also true. If Mozilla does not fix all their memory leaks and data races with Servo, they are pretty much dead.

Maybe I should learn Ada.

Nathan Phillips
Nathan Phillips

No one's really a zealot here, it's just fun to watch you sperg out over simple facts or a bit of sarcasm. So much so retards like you ramble about "marketers" and such.

Camden Harris
Camden Harris

hurr

Gabriel Young
Gabriel Young

Lexing and parsing (and interpretano in the sense of interpreter) simplicity.
The possible strabism of indentation can be cured with a tool like gofmt (which works due to go extremly regular grammar)

Joshua King
Joshua King

If you cannot write lexer and parser for indent-based language, it doesn't mean that it is hard.

Charles Nguyen
Charles Nguyen

What's so complicated about parsing indentation? I get that it's slightly harder than parcing curly brackets, but only very slightly - not enough to factor into decisions about syntax. It's not tricky.

Liam Bailey
Liam Bailey

Python's fun. Once you get a grasp on it I would suggest looking through all the what's new in python docs to see some shit you probably wouldn't have found on your own and the reason they were put in.

Nicholas Miller
Nicholas Miller

If you can it doesn't mean that you should.
In a scale of complexity that goes from regular to recursively enumerable, Python grammar is context-sensitive especially because of semantic indentation (to be fair the scale is not discrete and the step to be context-free is little). The greatest part of the programming languages grammars are at least context-free.
Go is one of the few to be almost regular. This simplicity make the life easy to anyone that wants to write a tool to do something with the code, like formatting it, check that it respect some constraint, inspect it, generating anew etc. The compiler good performance is due even to this property of the language.
This is for the "complexity" part of the problem.

Now comes the controversial part: semantic indentation is prone to introduce subtle bugs, that are especially hard to find on large code bases not written by you. Think of a line that should be outside an if block, but instead stay on that indenation level for some reason (these kind of problems happens more with these languages). Maybe it causes a bug that will only happens sometimes in production and you will cry for nothing. And you will need to understand the entire surrounding code to understand the problem.

I said that this point is controversial because your experience may vary (it depends maybe by how many pajeets you must bear at work), but the first point is a clear win for the go grammar, while the advantages of semantic indentation (less parens?) are negligible.

Eli Sanchez
Eli Sanchez

They are slowly rewriting all their legacy Python 2.7 codebase to Go.

That's retarded. They should have gone Python 3 + Cython if needed.

Google has written a new Python runtime in Go that transpiles Python to Go code:
this is interesting, however transpiled code usually sucks dicks (not really good for subsequent reading/editing by humans) and compiling it the Cython way is already tried&tested thing.

Kevin Russell
Kevin Russell

Parsing Python is really fast in practice.

the advantages of semantic indentation (less parens?) are negligible
there is no such thing as improperly indented code in Python. isn't it neat?

Think of a line that should be outside an if block, but instead stay on that indenation level for some reason
Are you trying to say that this won't be obvious?
Like in-your-face obvious.
If a project is being done by such incompetent monkeys, it's doomed to fail regardless of language used.

Tyler Brown
Tyler Brown

using a million functions to avoid nested ifs
not being pajeet tier
do you also separate every function into it's own file

Zachary Roberts
Zachary Roberts

I'm not sure what you mean. Do you mean that Python doesn't let you use a gorillion layers of if-statements without getting really long lines? If so,
if you need more than 3 levels of indentation, you're screwed anyway, and should fix your program
-- Linus Torvalds

Jonathan Nguyen
Jonathan Nguyen

Google apparently tried to modify Cython for their needs or do an extension and were rejected, so they're just going to make their legacy code fast this way.

Joshua Fisher
Joshua Fisher

Also, here's what they were trying to do:
https://www.python.org/dev/peps/pep-3146/

Xavier Flores
Xavier Flores

They tried to modify CPython (which is the standard implementation, while Cython is a Python superset which lets you mix in C), and they were not rejected - instead, they retracted the proposal when their own interest in it dropped for various reasons. Did you read that page?

Isaiah Walker
Isaiah Walker

It's not only a question of parsing but of creating tools that do static code analysis or modifications/refactoring, work on the code in a simpler way with tools like regexp, generating easly go code (this last one is really underrappreciated)...

Semantic indentation issues are well known, for some programmers that's not a problem, for others it is.

Jaxon Wright
Jaxon Wright

Here the semi official reason for not using indentation to declare block:

http://talks.golang.org/2012/splash.article

"As a simple, self-contained example, consider the representation of program structure. Some observers objected to Go's C-like block structure with braces, preferring the use of spaces for indentation, in the style of Python or Haskell. However, we have had extensive experience tracking down build and test failures caused by cross-language builds where a Python snippet embedded in another language, for instance through a SWIG invocation, is subtly and invisibly broken by a change in the indentation of the surrounding code. Our position is therefore that, although spaces for indentation is nice for small programs, it doesn't scale well, and the bigger and more heterogeneous the code base, the more trouble it can cause. It is better to forgo convenience for safety and dependability, so Go has brace-bounded blocks. "

Chase Moore
Chase Moore

It is better to forgo convenience for safety and dependability
This is the kind of thinking that got us Rust.

I'm using indentation-bounded syntax from now on.

Blake Walker
Blake Walker

gophers pls *go*

Jordan Miller
Jordan Miller

work on the code in a simpler way with tools like regexp
Are you dumb or what?

Disable AdBlock to view this page

Disable AdBlock to view this page