Thoughts on Go?

Thoughts on Go?

Other urls found in this thread:

freepascal.org/
wiki.freepascal.org/Unit
github.com/openbsd/src/tree/master/bin
homepages.inf.ed.ac.uk/dts/pm/Papers/nasa-c-style.pdf
archive.fosdem.org/2016/schedule/event/ada_memory/.
en.wikipedia.org/wiki/Paul_Graham_(computer_programmer)#Blub
twitter.com/SFWRedditVideos

shit

shit

retard

D is better.

good enough for mundane stuff like web backends

A very nice language that made programming fun again:
>concurrency
>static linking
>no inheritance
>packages
>tools

So basically... C.

Unless you need to program for 1000 cores; which you don't. Get over it, Go serves no purpose outside of its niche.

>C
Yeah, you should just use C instead of this garbage collected language or vice versa. Sure.

C is inherently broken:
>the way include works
>separate c and h files
>no tooling - hard to (create and) distribute libraries
>no methods on structs
>no interfaces
>no namespaces/packages (I prefer the latter solution)
Also all programs should be written with concurrency in mind. It will not always make them faster but it is conceptually easy to write many things thanks to it - channels are great. It is time to let C die, lets face it

>No methods on structs
Pajeet, have you heard of objects yet?

>garbage collection
>good

>memory leaks
>good

inb4 not in the correctly written programs -
show me one then

>>separate c and h files
Why do people dislike this? It makes C/C++ code so much more readable. Besides you don't have to do it.

- Great standard library
- Fast
- Static linking has its benefits
but
- Poor type system
- Poor dependency management
- Pretty verbose
What Go offers may be worth it for large teams, especially if they use a single big Google-style repository for everything. For small teams and solo developers, however, I hope something more expressive like Swift or Crystal becomes a viable, mainstream alternative. Rust takes more effort to write. I used to have hopes for Nim, but it is kind of a mess.

>Why do people dislike this? It makes C/C++ code so much more readable.
If you're a faggot and don't know how to use your IDE.

pretty much this

yet another language that has significant white space
into the garbage it goes

freepascal.org/
>It makes C/C++ code so much more readable
wiki.freepascal.org/Unit is as readable without introducing the kind of compilation overhead .h files do.

Sure. That's how you C: github.com/openbsd/src/tree/master/bin

Unfortunately the "programming is easy" meme has ruined CS and now shit like garbage collection has become the norm. It's good when you're a fucking moron who needs the programming language to save you from fucking shit up. It's a massive hindrance when you're actually worthy of your title and can follow the most basic memory management best practices.

TL;DR: git gud

You sound like a bitter person who realized that programmers are just glorified plumbers and there is nothing magical about their jobs. Well guess what you are not special.

I'm an engineer; programming is just one of the many skills I need to excel at.

It seems to me you're the one who got stuck as the glorified plumber / code monkey, while the rest of us kept climbing the ladder. God bless.

GO stands for GarbageOriented

I really doubt that you sincerely hold this kind of sentiment or that you are an experienced programmer, but your acting isn't entirely unconvincing, so I'll explain the problem in the earnest.

If "that's how you C" every piece of software, not just security-critical low-level infrastructure, your time to market becomes shit and your company crashes and burns. Sure, good programmers following something like homepages.inf.ed.ac.uk/dts/pm/Papers/nasa-c-style.pdf with a strict code review and Valgrinding it to death can avoid most memory errors or even all if your codebase is small enough. The matter is that most of the software you use daily wouldn't exist if they did that because it would make no economic sense for companies to develop it and it would be too much time and effort for hobbyists. If you want usable, secure software developed fast, you can't use manual memory management. Tracing garbage collectors with their usual pauses and excessive memory usage aren't the only alternative to it, either.

>The matter is that most of the software you use daily wouldn't exist if they did that because it would make no economic sense for companies to develop it and it would be too much time and effort for hobbyists. If you want usable, secure software developed fast, you can't use manual memory management. Tracing garbage collectors with their usual pauses and excessive memory usage aren't the only alternative to it, either.

That's cool and all, and that's why Java exists.

What problem does Go solve? We already have a language for rapid and large-scale software development, with garbage collection, yes. Now just what Go strives to be that warrants garbage collection? Nothing. It's a highly concurrent language that can't be used in systems programming because GC stands in the way. Because of that it gets relegated to only being good for its own very small niche of problems. Go is not the language of the future, and fuck no, it won't replace C.

I wasn't talking about Go in my post, but I'll respond.
>What problem does Go solve?
Go is a language made for Rob Pike's underlings at Google. Its design and features are chosen to make them produce good-enough network services faster. Everything outside this niche is merely a happy bonus.

Go is a great general purpose language.

Go > C > Python > JS > D > Rust > C++ > Java

>general purpose language
No such thing.
>Go > C > Python > JS > D > Rust > C++ > Java
Is your ">" meant to be transitive?

The thread is about "thoughts on Go", though. I'm just tired of seeing it being recommended as C alternative, as a web dev language, or whatever the fuck people are trying to use Go for these days.

At least we can agree it's a language tailor-made for Google's problems and useless for anyone else.

what are some useful things you can do with it? serious question

life is more enjoyable when you aren't pissed off all the time, user.

>The thread is about "thoughts on Go", though
Obviously, but the post I was replying to was about C, or more precisely, about manual memory management in C. I thought I refuted it without suggesting that I liked Go. My point about tracing garbage collectors was to that end.
>I'm just tired of seeing it being recommended as C alternative
It's no alternative to C except if what you were going to write in C was something that is rarely justified to write in C today, like a simple command line utility or a network service.
>useless for anyone else
I'm hardly a fan of Go, but I wouldn't go that far. A lot of companies have problems to solve that kind of sort of look like Google's except on a much smaller scale. They can write their network services in Go instead of a JVM language if they need those RAM-saving value types. Many of them will, of course, choose Go over Java or even Erlang for the wrong reasons.

>but the post I was replying to was about C, or more precisely, about manual memory management in C.
If by that you mean that garbage collection on C would somehow be a good idea, then I don't know what else to tell you.

C is supposed to be fast and give absolute control to the programmer. Of course that doesn't come without a consequence. If you want blazing fast programs, you have to give up on garbage collection. If you want to have absolute control over every bit of memory, then you must know how to do it without breaking things; i.e. you must learn how to C. If you can't handle that, then don't use C.

Manual memory management on C is a feature, not a bug. The good thing is that a good C programmer knows how to use that to his advantage to manage memory to optimize performance while taking care of possible leaks, to produce elegant, safe and efficient programs. The bad thing is that for every good C programmer there are dozens of awful C programmers.

But that's not a problem with C, but with whomever uses it. What has to stop is the attitude that C is an easy language, or a beginner's language, or a "general purpose" language to write all your software in, or that you can get away with rushing stuff in C like you can do on Java or Python. That's not how it works, and it takes a lot more effort and thinking to write good C code, hence the "that's how you C". Companies who need to put out software to the market fast and can't afford to cater to the code the way C demands should just use another language that better suits those needs.

Anything that requires concurrency and high throughput.

For example, you might want to query a stock API, but since there are thousands of stocks and you want to update them live, it would make more sense to query all the stocks at the same time instead of consecutively.

Go is built to do things like this.

Using the language is like using a more c-like python.

It's like a really fast, concurrency oriented, c-like python.

It doesn't have the same amount of third party libraries because python is much older, but there is basically no reason to use python over Go.

The only reason to use C instead of go is if you need extremely high performance that you can only get by manually managing memory allocation.

Java and C++ are cuck languages that are a convoluted mess and not really worth learning completely. You're best learning C or Go, then only writing C++ and Java when you need to. C++ and Java aren't languages that are worth spending time learning.

>If by that you mean that garbage collection on C would somehow be a good idea, then I don't know what else to tell you.
No. Why on Earth would I mean that? Either I am less clear than usual, or you keep reading into my posts what isn't there. If it's the latter, seriously, no GC diehards are out to get you, man, and I am not even one.
>If you want blazing fast programs, you have to give up on garbage collection.
That is true, but it seems somewhat misleading. Because garbage collection defers freeing memory, programs with GC can achieve better raw throughput than those using free() naively. The core issue is not the GC itself, but dynamic memory allocation, and the cure, if you want top performance, is to minimize it.
>Manual memory management on C is a feature, not a bug.
Duh.
>What has to stop is the attitude that C is ... a "general purpose" language
That's what I am saying as well. C is a systems programming language in a sense in which Go just plainly isn't. This is not to say I think C is an especially good systems programming language. There is a lot a language can do to prevent at compile time the kind of errors that C happily lets through. But C is popular and right now it has the best tooling.

Watch archive.fosdem.org/2016/schedule/event/ada_memory/. I'd be willing to bet money that in 15-20 years every new project with low-level code will seriously consider a language that is neither C nor C++ before C and C++.

>objects
>C

It's shit made for retards.

>he think you can't do oop in c because c++ for dummies said so

If ken thompson made it it's probably good

C is obsolete. YouTube switched from C to Go.

If you like writing tons of boilerplate code but you're too scared to write C cause you're too dumb to manage memory, then sure.

Why do people keep comparing C and Go?
Go was never meant to replace C; at best it's a replacement for Java and C++, which were judged as being too bloated.
Google still uses C for anything that requires high-speed performance, such as their codecs.

Go is a thought-terminating cliché

en.wikipedia.org/wiki/Paul_Graham_(computer_programmer)#Blub

>go
>more like stop

Not trying to excuse half of the braindead posts in this thread, but it's largely the creators' fault; from the beginning they kept marketing it as "systems programming language" without clarifying they were using the obsolete 70s definition meaning "anything lower level than a shell script".

Name a better language for concurrency

haskell erlang rust

Every language for the Erlang VM, Pony, arguably Clojure.

Autism, literally who, SJWlang
dude JVM lisp lmao

Hookshit

>second-hand opinions
If Rust had been designed by Stalin himself its management of variable lifetimes would have still been a valuable innovation.

>what is unique_ptr
>what is RAII
you need to be 18+ to post here

>you need to be 18+ to post here
Indeed. You'd think someone who understands RAII would be able to do his own research to find out how it differs from Rust's lifetimes.

>Python and Javascript are better than Rust and D
LOL

what if you enjoy being pissed off tho?

You should work on a brain-computer interface to hook up your brain directly to Sup Forums. It would be better than wireheading for you.

We use it on my team at work for our APIs and it's fantastic for exactly that. I think if I wanted to do much more than handling HTTP calls and reading/writing to databases I'd prefer something else though.

Dプログラミング言語はGolangよりずっと優れています。

The only way D has surpassed Go is in the number of years it's floundered without any substantial user uptake.

Also you're not Japanese and no one able to read your simple declarative sentences is prone to being impressed so stop being a faggot.

fucking C babies who don't know shit about programming just spouting their memes.

> oh this language has those things? I guess it's exactly like C!
> also I read somewhere that GC is bad, I better point that out!

>implying C doesn't have automatic cleanup of certain variable scopes
>implying you don't implement your own garbage collection methods when using dynamic allocation outside of those scopes
I'm not trying to anger Grace but I think the 3 nanoseconds in performance difference between your own cleanup vs a general one is negligible in most cases, in the situations where it's not you're probably not writing in C anyway.

Go is shit get over it
also getting this triggered over a joke lol