Golang

Now that the dust has settled, what's the consensus on Go?

Attached: go.png (490x490, 110K)

Other urls found in this thread:

youtube.com/watch?v=YEKjSzIwAdA
weblog.bulknews.net/ghq-peco-percol-b6be7828dc1b
serde.rs/
github.com/serde-rs/serde
gopkg.in
github.com/golang/go/wiki/Modules
news.ycombinator.com/item?id=4159672
golang.org/doc/faq#exceptions
go.googlesource.com/proposal/ /master/design/go2draft-generics-overview.md
vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/
twitter.com/SFWRedditImages

The ultimate pleb filter.

a low pass filter

lets me think about the program rather than programming itself

A neat language that would be neat if it would get out of its own way.

It's a great language if you actually take the time to learn it and understand the design.

Attached: 516R4ZoMqBL._SX402_BO1 204 203 200_.jpg (404x500, 28K)

Having done so, the design seems to hamstring nearly any expressiveness to cater to lowest-common-denominator pajeets in an attempt to prevent them from fucking up.

We didn't need another pajeet language. Java has that niche filled.

The dust hasn't settled. Please check again in 5 years.

You're just parroting what other people have said on Jow Forums and haven't truly done the legwork to understand Go. Try reading pic related.

Attached: 20190423_215606.jpg (4160x2080, 1.98M)

Based book. I've been working through this at least an hour a day for two months and still am not done (hope I will be someday--less than 60 pages left). Really hard exercises, in my opinion, but maybe I'm just a brainlet.

For others reading this thread, same author as pic related

Attached: 41gHB8KelXL._SX377_BO1,204,203,200_.jpg (379x499, 27K)

Lol no generics

Keep going. Still the best programming book I've read.

Not only have I read it, I own it. I stand by my judgment.

Or perhaps a more powerful meta-programming language instead.

Let me suggest a follow up.

Attached: Programming In Haskell.jpg (1012x1345, 965K)

Difficulty: Go is actually used in the real world to do real work.. Haskell.. less so, unless you're an academia faggot.

Literally just works. Just import go files from random projects of github and integrate them into my project. No need to reinvent the wheel.

Best programming language for web applications. Nothing comes close. Libraries from Cloudflare, Google, Docker, Kubernetes, so much support from major players that actually matter. Shit for everything else.

>Oh this book might be good
>Check the first chapter
>Hello world
gopl.io/ch1/helloworld
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}


Yeah that's a hard pass for me

You can apply everything you learn from Haskell to any other language because it will change how you think about computation.

Haskell is used at Facebook for filtering spam; it is the best language for writing a parser with; and it's used in the back of many trading and banking systems because it has first-class concurrency and parallelism and is easier to write correct code in.

I've got 3 weeks of golang under my belt, but I have 15 years of professional programming before that in various languages.

My impressions:
- deliberately small-brained and imperative
- capitalization is the opposite of what I've come to expect in many cases, but I can live with it.
- its special sauce is goroutines, and they're kinda fun.
- knowing how to use them may not be immediately obvious, but if you have a simple data pipeline that you need to make async, it works pretty well.
- I like having concurrency primitives built in.
- It doesn't like to do local importts of libraries, but there are various workarounds.
- I find that awkward, but they're not going to budge on that decision so, I need to learn to live with that decision.
- It's way easier than Rust, but Rust is cooler.


I think if you're going to specialize in Rust, you should really master goroutines, because that's the only thing that sets it apart from other languages. Having CSP-styled concurrency baked into the language makes certain tasks kinda comfy, and that's what's going to let a Golang problem shine.

youtube.com/watch?v=YEKjSzIwAdA

Prove it then lol

Pajeets and other immigrants will fuck up whatever they touch UNLESS they try to understand what they're doing. Only a few will.

Why learn and understand when you can just copy and paste for the same(ish) result?

Programming is mainly the domain of whites and select east aryans.

Attached: ARYANS.jpg (534x467, 43K)

That's what sets a human apart from an NPC.

>Why learn and understand

...because fuck being a 3rd world nothing.

Pretty good summary

>specialize in Rust
I meant specialize in Go

Thanks. I tried to be fair.

This but also in regard to tools too.
I want a program. I might not even want to write the program, I want the result. Go is easily the fastest and most consistent way to do that.
write "main.go", run `go build`, static binary is there.

Meanwhile in C
>I hope you're familiar with with the Unix shell and make files, and know how to resolve dependencies for every platform you wish to support just to maybe produce something out of the files written in your language

Go's greatest strength is having actual standards that ship with it, and not just de-facto ones that you bring yourself.

Attached: gopher-doc.8bpp.png (75x100, 7K)

Having done way too much Javascript the past 6 years, it was refreshing to just `go build`.

The tool chain is sane and simple and easy.

>gopath
>sane

Yeah except for the vendoring shit, that stuff is fucking stupid

>You can apply everything you learn from Haskell to any other language because it will change how you think about computation.
Not really? All Haskell has is a correct type system, pure functional programming (which isn't really exclusive to Haskell), and monads. Lisp has much more interesting computational concepts like delimited continuations and hygienic macros.

Need a hotter mascot.

GOPATH is going away already.

Long before I programmed in go, I started using a tool called ghq which was written in go. I use it to clone git repositories off of github like this:

ghq get user/project


If it's my own project, I'll do:
ghq get -p g-gundam/yotsubAPI


The first will clone over https and the latter will clone over ssh. With GOPATH=$HOME the git repos will be cloned into:

$HOME/src/github.com/$user/$project

What makes it even sweeter is using peco + zsh to cd into git repos with a press of a hotkey.

weblog.bulknews.net/ghq-peco-percol-b6be7828dc1b


...so what's your problem with GOPATH?

Send me a link to a discussion from the leadership on GOPATH going away. I want to see.

It’s not bad as a language. I don’t think it’s as cool as Rust or Crystal or whatever other meme you want, but I prefer working in it over C# & Java, and it’s a nice break from all the C work I do.

I was referring more to the benefits of writing pure functions, lazy evaluation, and expressions vs statements.
Haskell actually does have delimited continuations. It doesn't have macros, but it does have the rules pragma which allows library writers to implement their own optimization rules for GHC.

I don't like Go. I thought it would be good because Ken Thompson is in on it, but it's just not. I'll keep my C and C++, where we have generics, and pointer arithmetic, and greater portability, and an ecosystem that's not backed by a single company.

This is just like generics, it's "any day now" levels of denial.

If you want generics and type-based polymorphism, use Rust. It's a hard language to learn, but it's satisfying once you get proficient.

>If you want generics and type-based polymorphism, use C++. It's a hard language to learn, but it's satisfying once you get proficient.
ftfy

It's a bullshit enforcement of a single way to structure not just projects (which would be fine) but your whole work environment.

Have you tried to vendor any non trivial fucking Go code? It's such bullshit somer people are using makefiles to do it.

The idea that all the go code I want to run on my machine is necessarily in this one directory with this specific directory structure is shortsighted at best and completely retarded at worst.

How are workspaces not sane?
Languages should ship with tools that manage files of the language. It makes 0 sense for me to be installing source code packages via the OS, or even manually. You can't have dependency resolution as part of the language tools if you don't have a language standard source layout. And it makes a whole lot more sense for the language to provide these than expecting every fucking distro's maintainer to do it (wrong) for you.

I'm not impressed by it. It does the exact opposite of this for me. It's clunky, inflexible, and inexpressive imo
Pic related, on the other hand, has been a joy to use even though the ecosystem is tiny.

Attached: nim_in_action_cover.jpg (767x964, 79K)

That's literally what I do.

I'd like a nice GC language for when it makes sense, like a good Java alternative. And Go promised me that but never delivered.

build tools alleviate this, but it is much easier in go, cargo, etc.

That's such a strawman. People don't hate that there is a package manager, the user experience is just complete garbage.

I mean compare cargo, hackage or even fucking npm.

Are there a lot of people that don't go through the small trouble of setting GOPATH?

My GOPATH was set before i wrote one line of Go code, but I was surprised that my coworkers didn't have GOPATH set even though they've been doing Go longer than I have.

It makes no sense for the default configuration to expect you to dump all your libraries and binaries into folders shared by all of your other projects. It makes too many assumptions about how I want to structure my projects which are wrong and potentially harmful.
Sane systems keep each project isolated and allow me to choose where I want everything and are helpful. They don't require me to work around their bullshit before I can start working.

A small ecosystem is a real probelm though. I have equal (but short) exposure to both Go and Rust -- about 3 weeks. Even though I find Rust cooler, Go's ecosystem is more mature. There's more hackiness in Rust, and I feel like it's because the learning curve is way steeper in Rust.

I don't really give a shit that you have to set an environment value, although the intherent irreproducibility of the environment is complete tat. But i don't want to have to deal with a mess of directories because Kernhigan thinks his way of managing projects is the only one that makes sense.

If you've ever tried to compile stuff with different library sets, compiler options and library versions you'll know what pain is. Whereas with Cargo it's literally adding a couple of lines to a config file.

>There's more hackiness in Rust
How so? From what I've seen I would have expressed the opposite.

Attached: that's just like your programming man.jpg (600x453, 137K)

Sometimes, I go shopping around for libraries, and they look like little hobby projects that won't be maintained 2 years into the future.

Last I used Rust, I was thoroughly unimpressed with Rust's ecosystem, even though its tooling (i.e. cargo) was great. Nim is in a similar situation but I think it has potential to beat out Rust just because Rust has such a high learning curve for little perceivable gain.

Why is every Go thread a guaranteed flame war?

Attached: 1555454505351.jpg (610x357, 40K)

Literally every thread on Jow Forums starts a flame war

Testosterone

it's a great language if you have a double digit IQ

To counter myself, I'm super impressed with serde. I've never seen a serialization/deserialization framework as beautiful as serde. Moving back and forth between JSON and strongly typed Rust structs is a fucking joy with Rust because of serde.

serde.rs/
github.com/serde-rs/serde

It's brilliant.

the ones about fucking your sister are usually civil

>If you've ever tried to compile stuff with different library sets, compiler options and library versions you'll know what pain is.
What are you on about.
With Go you literally just tell it what you want.
>dvcspath
>[email protected]
>dvcspath@dvcsreference
with git this gives you master, tag v1.2.3, or the specific commit.

>compiler options
Shouldn't even be a thing end developers need to worry about. If they do, it's missing the mark of being a portable development language.

>dvcspath
are you saying I have to set the path for each individual library and its remote location every time I want to build?

No. When you decide you want a dependency, you just add it to the project.
>go get gay.com/me/myrepo@some-sha
That's it.

Do you ever use gopkg.in ?

gopkg.in

I use Go modules.

so can it cache multiple versions of the same library?
last time I used go it was a mess.

You're a mess.

good to know gofers need Google to keep their projects clean, very progressive

edgy

> Literally just works. Just import go files from random projects of github and integrate them into my project. No need to reinvent the wheel.
This so much. Great stdlib, dependency shits are out of the door with go mod, and it's easy to reason with and read other people's code because based go fmt

This is new to me. I will look into go modules.

github.com/golang/go/wiki/Modules

This is why I love to use Go as well. The language itself isn't all that great but it literally just werks anywhere.

I consider Go a mixture of Python, C and JavaScript.

You have repetitive ugly and verbose code snippets - just like Python.
You have no powerful language features like generics and have to come up with everything yourself - just like C.
You have a community who knows everybody is looking down on them but still prostitute themselves because it's easy money.

> like a good Java alternative
And why would do you need an alternative to java or c#?

>like a good Java alternative
C#

Haskell. It’s unirionically an amazing general purpose language in both performance and capability.

Because Java sucks?

Attached: DtBDy0SUwAAv1_S.jpg (1200x900, 164K)

haha good one

this but ironically

Attached: 1549053028398.png (800x800, 1.5M)

hahah you say that like you believe it's real so it's funny because it's totally the opposite

a decent extension of C for userland apps that require reliable concurrency.

Significant overhead, but what are you trying to do concurrently that can't afford a relatively tiny bit of overhead in exchange for safety.

Still retarded tier, designer for brainlets who ain't expected to know shit

Somebody explain to me how you do a bulk check a la:
def fuck(whatev):
try:
user = sanitise(whatev['user'])
pwd = sanitise(whatev['pass'])
...
except:
# abort


Do you literally have an if err after each variable or what?

Hackiness wasn't the right word. There are quite a few incomplete libraries I run into though. One recent example is GRPC libraties. Look at the golang offering which is very mature, and compare it with whatever you can find for Rust.

We can't all be as awesome as you are

Yes, and that was on purpose.
news.ycombinator.com/item?id=4159672

We believe that coupling exceptions to a control structure, as in the try-catch-finally idiom, results in convoluted code. It also tends to encourage programmers to label too many ordinary errors, such as failing to open a file, as exceptional.

Go takes a different approach. For plain error handling, Go's multi-value returns make it easy to report an error without overloading the return value. A canonical error type, coupled with Go's other features, makes error handling pleasant but quite different from that in other languages.

Go also has a couple of built-in functions to signal and recover from truly exceptional conditions. The recovery mechanism is executed only as part of a function's state being torn down after an error, which is sufficient to handle catastrophe but requires no extra control structures and, when used well, can result in clean error-handling code.

See the Defer, Panic, and Recover article for details. Also, the Errors are values blog post describes one approach to handling errors cleanly in Go by demonstrating that, since errors are just values, the full power of Go can deployed in error handling.

golang.org/doc/faq#exceptions

They will find a way to do generics / parametric polymorphism.
go.googlesource.com/proposal/ /master/design/go2draft-generics-overview.md

Go isn't even a programming language, much less a systems programming language.

I use it, and like it, but I really want generics.

I contribute to the go compiler, AMA.

>it's used in the back of many trading and banking systems because it has first-class concurrency and parallelism and is easier to write correct code in.
It isn't. Jane Street "hires haskell programmers" but then they actually use caml. The combination of garbage collection and lazy evaluation makes haskell program performance so unpredictable that it's almost impossible to use it for any serious work.

Modules shipped in Go 1.11 back in september and you can work outside of GOPATH since.

>lowest-common-denominator
Who's the pajeet again?

Considered harmful:
vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/

Attached: 2016-04-19-832-Glue.png (1020x377, 469K)

>literally who thinks the way literally everybody does concurrency is wrong and his unproven idea is right
ok