[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Go

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 61
Thread images: 3

File: images.duckduckgo.com.png (69KB, 600x600px) Image search: [Google]
images.duckduckgo.com.png
69KB, 600x600px
Is Go (golang) worth learning?

What are the pros and cons?
>>
>pros
native networking built in
>cons
all the cons of C, with none of the benefits
>>
Is the fact that it is so new going to cause any problems learning/using it?
>>
>>55085807
yes, very few people will actually advocate Go because it's too different from C and offers no real benefits over C.

Also, a proper Go book (written by the same guy who wrote the definitive C book) was only published this year.
Not even google uses it in their production systems.
>>
>>55085831
OK, thanks. I'll just go on to learn c or c++ then.

I have heard Google is switching all their servers from python over to go, though.

I have been playing with it a little bit, and it is really fast.
>>
>>55085768
>>55085831
>C
But it's not being made as an alternative to C. It's being made as an alternative to languages like C++, Java or even Node.
C will continue to be used for the low level stuff, and things that require every ounce of performance, but for anything else, there are languages better suited that won't become a pain to write.
>>
>>55085871
So does Go add anything that c++, Java, or node doesn't have?
What is the improvement on these languages?
>>
>>55085750
if you don't know why you should learn it, then don't learn it. It's that simple.
>>
>>55085954
Over Java and Node, there's speed.
Beyond that, Go is designed to be relatively simple, and that's by design.
They didn't try to innovate with Go, by throwing in feature after feature, and forcing people to use every key on your keyboard. Instead its main aim is to write straightforward and maintainable code.
>>
>>55086046
Java is fast these days. It has some weird performance characteristics, but it is not simply slow. JIT compilation makes it faster than optimized C for some tasks.

Node is really fucking fast. It's not general-purpose, but for event-driven I/O it's faster than anything else I know of.
>>
>>55086046
Java is faster than Go in most cases especially when it comes to networking. Netty, Vert.x and Undertow destroy Go's networking libraries in terms of RPS. The main advantage of Go is that memory usage is significantly lower because Java doesn't have value types (coming in Java 10).
>>
>>55085750
yes absolutely.

it's a fast, fun, and productive environment for building cross-platform, memory safe, concurrent software

the culture of the language is heavily influenced by plan9's emphasis on simple, correct software that does one thing well.

although admittedly, there's been a lot of hype these past few years and as a result a lot of awful (and deceptively popular) bad memego has been produced.

but if you read the official docs (golang.org) and heed rob pike's insights you will not regret it.
>>
Yes

Pros
Still niche but big enough to get you a job
Goroutines/channels
The standard library
Good support outside of the standard library
Fills the gap between C and Java
Dem performances
Feels nice to write

Cons
Static linking
Still not C fast
GC (constantly improving, not a problem anymore unless you're writing a game engine or something retarded like that)
>muh generics
lots of
if x == nil

lots of functions that accept interface{}, a big source of bugs
>>
>>55086087
>but for event-driven I/O it's faster than anything else I know o

It's not even remotely close to the fastest platform for async I/O. It's only fast compared to other shitty dynamically typed languages like Python and Ruby.

The plaintext and JSON serialization benchmarks at the following link are practically ideal conditions for node and it's nowhere near the fastest.

https://www.techempower.com/benchmarks/#section=data-r12&hw=peak&test=json
>>
>>55086104
>the culture of the language is heavily influenced by plan9's emphasis on simple, correct software that does one thing well.
I disagree entirely. The Plan 9 (and UNIX) philosophy is about having things that are modular and extensible. Go is just the opposite. Everything the user makes is a second-class citizen. It is not a small, simple core that makes it easy to re-use and extend code. It's a small, simple core that often makes it impossible to re-use and extend code.
>>
>pros
free ticket for the flavor-of-the-month train ride

>cons
everything else about the language
>>
File: 4L_1jhOo5qb.jpg (511KB, 1024x768px) Image search: [Google]
4L_1jhOo5qb.jpg
511KB, 1024x768px
>>55085750
Latest meme dick that fagrammers are deep throating at the moment. These same pillow-biting brokeback-keyboard cowboys will be writing op-eds about how "they are abandoning go" for medium in like a year or two.
>>
>>55086115
>lots of functions that accept interface{}, a big source of bugs

>not type checking
>>
>>55086158
The great part about the Unix philosophy is that Unix doesn't follow it.
>>
File: 1462131193746.jpg (25KB, 460x368px) Image search: [Google]
1462131193746.jpg
25KB, 460x368px
>>55085831
>Not even google uses it in their production systems.
Wrong.

Google deploys and scales their distributed systems using Kubernetes, written in go.
https://github.com/kubernetes/ kubernetes

dl.google.com was rewritten (from C++) and is now serviced using Go.
https://www.google.ca/url?sa=t&source=web&rct=j&url=https://groups.google.com/forum/m/%23!topic/golang-nuts/BNUNbKSypE0&ved=0ahUKEwisz_Tqp6nNAhUH9mMKHaPMBjMQFggaMAA&usg=AFQjCNF4ZuCA79SeCltd8kBIzArzeBbKsQ&sig2=k02SXZCGwKCzhjhqzlbnaA

Rather than link more, here's an exhaustive list showing which projects Google uses Go for in production, and other companies as well.
https://github.com/golang/go/wiki/GoUsers
>>
>>55085750
Not even Google uses this language.
>>
>>55086895
See
>>55086845
>>
>>55086115
>Cons
>Static linking
Yes, it makes the binaries heug, but I like that I can cross-compile for every device I can own, no libraries needed. One single, self-contained binary can have it all.
>>
>>55085750
It's a meme, but it's a nice meme. I enjoy working in Go since I tend to work on things in its niche (Networked programs, terminal-based utilities)

OP, fall for the Go meme. The tour on https://golang.org is quick and gives you a workable understanding of the language. Even if you don't end up liking it, the tour should only take about 30 minutes.
>>
>>55085768
>all the cons of C, with none of the benefits
it has none of the cons of C with all of the benefits, you have to be a real idiot to think you are going to end up with all the weak typing errors, pointer errors, memory allocation errors, implicit casting errors, etc, etc
>>
>>55085807
>so new
Go is over 10 years old. There are plenty of great resources for learning it.

>>55085831
>few people will actually advocate Go because it's too different from C and offers no real benefits over C.
What the fuck.
>a proper Go book ... was only published this year.
According to... you?
>Not even google uses it in their production systems.
Has your asshole and mouth switched places? I have never seen someone spew so much shit.
>>
>>55085768
>all the cons of C, with none of the benefits
>>55087189
>it has none of the cons of C with all of the benefits
Those are stupid exaggerations. Go is a GCed language with not-so-small runtime complied into every binary it produces. As such, it doesn't have the primary benefits of C (e.g., very predictable performance suitable for hard real-time) but neither does it have the main cons (memory allocations errors).
>>
>>55087418
The runtime is barely 10kb
The size you see is just static linking of the libraries
>>
>>55087545
>The runtime is barely 10kb
>barely 10kb

most micro controllers can't even hold that much
>>
>>55088149
Yeah ok if you're coding for microcontrollers the answer is typically some variant of C. Unless you feel like doing some compiler hacking or your platform's standard toolchain already supports some other language.
>>
Swift kicked the shit out of Go and a few other languages in a benchmark recently

Will see if I can find the link
>>
>>55088826
C kicks the shit out of any other language. What's your point?
>>
>>55089375
Yeah but boilerplate and shit
>>
https://medium.com/@qutheory/server-side-swift-vs-the-other-guys-2-speed-ca65b2f79505
>>
>>55089395
>C
>boilerplate
Ayyy
>>
>>55089432
I meant if you want to do something like write a restful api you WILL need to write boilerplate, don't even deny it faggot
>>
>>55089430
So Golang's SQLite driver is badly implemented then?
>>
>>55089492
Any language requires you to do that if it's not part of the standard library faggot.
>>
>>55089518
I think the abstraction layer caused the drop in performance.
>>
>>55089563
Some save you a lot more trouble than others, faggot
>>
>>55089578
You're full of shit. It depends on amount of features the standard library has. If don't care writing your own, pick some 3rd party library.
>>
>>55089613
>using a library isn't equivalent to writing boilerplate
Oh fuck you then, make your mind up you silly cunt
>>
>>55089623
So if a REST API is not part of the standard library, it's considered boilerplate? You're a nigger.
>>
>>55086115
I only started learning Go so I haven't got to use it much but why would you use interface{}?
>>
>>55089518
Probably, I wonder why they weren't testing MySQL or Postgres
>>
>>55089794
interface{} is mostly good if you want a function to be able to accept or output multiple types of variables. Thing is, you need to do some type-checking in that case.
>>
> Though they are slower, they are arguably easier to use since the same application can run on different server setups without knowing the number of cores before hand. They also don’t require any external libraries or C dependencies, as almost all operating systems have full POSIX compliance out of the box.
Did this guy really just say pure threads are easier than coroutines? Lmao
>>
>>55089794
(de)serialization of struts. See the json package.
>>
>>55086845
>Google deploys and scales their distributed systems using Kubernetes, written in go.
>https://github.com/kubernetes/ kubernetes

Wrong. They use Borg for that. Kubernetes is inspired Borg, but not even close in terms of features, stability and adoption.
>>
>>55090624
Well, they apparently use Kubernetes for SOMETHING, seeing as it's listed as one of the technologies that Google uses, written in Golang.
>>
>>55089518
Those benchmarks are pretty awful and in several cases he's running them in DEBUG mode with the hot reloading development servers. What a joke.
>>
>>55090987
Debunk with your own leddit/HN post then
>>
>>55091192
Let's look at the SQL queries being executed.

node:
select * from users where id = ?

Go:
select * from users order by random() limit 1

Java:
select * from users

Gee I wonder why Go and Java aren't performing as well as they should. The queries don't even do close to same thing.
>>
>>55091382
>throwing in a random sort for Go lang, but only return 1
>return all options for Java

Fuck, this is just blatantly dishonest
>>
>>55091509
Yeah I'm not sure if they're purposely being dishonest or they're just incredibly incompetent.
>>
>>55085768
C has no benefits
>>
>>55091524
I think they were just being incompetent.

A lot of the code examples have the same as Go, picking a random entry (which of course results in a sort, if SQL's syntax is to be believed) But then a few of them also do what the Node example does, and selects a random entry through a variable.

The end result (a random entry in the database being selected) is the same, but very clearly the two methods have vastly different performance.
>>
>>55091382
Didn't even notice that. Well then fuck that faggot who did that shitty "comparison".
>>
I'm picking up web dev, coming from making games, sysutils, mathy stuff
Golang or Elixir?
>>
>>55093528
If you like adding the following boilerplate after every single line of code, Go is for you:
result, err = func()
if err != nil {
explode()
}


Otherwise if you like venting gas to prevent explosions, Erlang and Elixir are for you.

https://www.howistart.org/posts/erlang/1
>>
>pros
It's great for networking
>cons
So many pain points it's not worth using for anything else
Thread posts: 61
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.