What does Sup Forums think of Golang? Setup was really smooth and I'm enjoying the C-like syntax but I also feel like I'm selling my soul to Google.
What does Sup Forums think of Golang...
You don't need it unless you're google, in which case it's amazing language made for you.
Big binaries, int and bool are completely different types, lack of conditional operator
That's what drove me away from it but it has a nice concurrency model.
Pretty good, but the compiler is too strict. Stuff like unused imports should be warnings.
Golang bestlang
Easiest shit to make an API / server with, and doesn't have OOP bullshit or slow runtime to worry about
Read "Clean Code". That's how things should be.
Why would you want unused imports? It's sad that people are so shit that compilers have to assume they are braindead nowadays.
I looked at it but decided that I'd rather stay with writing rust and haskell where I can write code that's much nicer to work with.
What need does it fulfill anyways?
It's really fucking awful. Less power than early java, same ease of use as raw C, with the speed and flexibility of neither.
During development you might have to comment out lines that require the import, which you will reenable shortly after verifying what you're currently verifying. Why waste time commenting out 2 things instead of just 1, nevermind the fact you can't know if what you're commenting out is the only place in your code that requires the import without the compiler fucking with you first?
Docker is written in Go
it's a non-started for what I do by virtue of having anything to do with GC, but I appreciate that its 'defer' mechanism is a core part of the language.
structured state unwinding/reversal in the face of errors is virtually impossible to do in a sane way without it. RAII exception safety in C++ for example is OK if you're talking about all-or-nothing construction of individual objects but has nothing to offer when you're talking about performing a series of external mutations that may fail somewhere in the middle and need partial reversal.
Alexandrescu (AFAIK) popularized the ScopeGuard pattern in C++ almost 20 years ago, but it's one of these things like variadic template/rvals/perfect forwarding, std::unique_ptr, std::array, etc. that feel like it should have been a core part of the language from the beginning.
Go isn't perfect IMO, but at least it has some powerful fundamental semantics and didn't stumble into the pitfall that is exceptions.
>soul
You dont have any. And Google owns you anyway.
lol no generics
the turbo autist creator of go, rob "syntax highlighting is for children" pike literally admitted he made the language specifically for brainlets
“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.”
>int and bool are completely different types
implying there's anything wrong with this
>Less power than early java
interfaces are better than anything in Java, only thing it's lacking is generics
the trash man is friends with rob pike
Docker could have been more easily written in other language. Go doesn't make sense unless you run shitload of microservices handling millions of requests simultaneously.
it's almost like most modern services today are built like this
it's almost like you could be more efficient than using an entire machine word to store a binary value
active -= (ev->key == KEYLEFT) - (ev->key == KEYRIGHT);
vs
if ev.Key == KEYLEFT {
active -= 1
} else if ev.Key == KEYRIGHT {
active += 1
}
An edge case that is outweighed by the advantages of type safety in other circumstances. int and bool are conceptually very different and shouldn't be confused.
Ok restricting usefullness of go to google is too much, let's extend it to google, amazon and few other bussinesses that actually benefit from it. No way in hell will you have the need for go's features if you're not one of the tech giants, even Honeywell picked C# for their IoT platform and they handle hundreds of thousands requests per second in environment that consists of many microservices where some of them are bordering on hard-realtime (deadlines, but not in microseconds).
bools should evaluate to 1 and 0 at the very least, it's retarded to think otherwise
They should be convertible to 1/0, but not implicitly.
>No way in hell will you have the need for go's features if you're not one of the tech giants
why do you assume Go's only place is webservers? if you don't have problems with a GC, you can use it in your embedded devices. you could replace most of your embedded OS tools with a few binaries written in Go and call it a day.
Go has many more applications than simple HTTP servers/microservices/...
you can replace C/C++/Java/C# and even scripting langs with Go.
this is the dumbest post I've seen on Sup Forums all day
>why do you assume Go's only place is in webservers?
Because of the ecosystem and the way the compiler and GC works. It's obvious they're using Go mostly as a glorified router. And that's what it's been designed for.
Go packs everything into the binary, if you have two binaries using some crypto functions, you'll have two copies of those functions. You can solve this but it's a pain in the ass, definitely not worth the hassle when you have sepples and c.
It has more applications than glorified router, but the thing is nobody who matters uses it for anything else. It's mostly some toy projects that do cool stuff in Go. Just like any other language, Go has its niche and it's bloody perfect for it, but outside of that niche it's mostly a matter of hobby projects and enthusiasts.
Thank you. That's a huge achievement if you posted on Sup Forums today.
>It's obvious they're using Go mostly as a glorified router. And that's what it's been designed for.
Go has a shitton of libs. if you think the http stuff is the only thing there is, you clearly show no interest in learning anything about Go
>if you have two binaries using some crypto functions, you'll have two copies of those functions.
what would be the problem? it doesn't really matter if there is more code than what you really need, it's still machine code, and your CPU won't be affected much.
>You can solve this but it's a pain in the ass, definitely not worth the hassle when you have sepples and c.
so you would change the language your program is written in, simply because it has some redundant bytes? are you fucking retarded?
>It has more applications than glorified router, but the thing is nobody who matters uses it for anything else
>It's mostly some toy projects that do cool stuff in Go
the most relevant projects that use Go are not specialized HTTP servers..
>Just like any other language, Go has its niche and it's bloody perfect for it, but outside of that niche it's mostly a matter of hobby projects and enthusiasts.
which is it? I've seen Go being used in a wide range of areas
>Thank you. That's a huge achievement if you posted on Sup Forums today.
that an0n is right, you know. Go is not google, and you could fork Go anytime you want to.
>you clearly show no interest in learning anything about Go
I did, because we're rewriting our filesystem from haskell to go. And i encountered countless little hickups that made me say "Go is good for glorified routers, not for systems like this".
>what is the problem of bloated binaries
In embedded, you try to make your binaries as small as possible and reuse as much as you can. Making go viable in embedded space (no, rPi really isn't embedded) would turn it into something like jvm to be able to reuse the runtime, also go trashes icache surprisingly hard which doesn't translate well to embedded.
>so you would change the language of your program?
For embedded, yes.
>the most relevant
For whom? This is definitely not the case for google and others who pour money into the ecosystem.
>which is?
Glorified routers. I've seen filesystem, quite significant in fact, written in haskell (actually i see it every day), does that make haskell a good fit for writing filesystems? Probably not, even though it is being used relatively heavily and it was very comfortable to write it.
>go is not google
Who decides what features the language has? Who pours money into its ecosystem? Plenty of people are still crying about generics in go, why did nobody fork it? Let's see if go survives when google eventually abandons it.
They actually did account for this. Just import your the library to the _ name to suppress a warning (instead of commenting it out).
import _ "math"