It depends on what you're trying to do with the parallelism. Generally speaking heavy parallelism comes up most in numerics, which for which go is a bad choice of language. On the other hand if you've just got some work you'd like to spread across multiple processors that's easy enough to do with go. I'm not the biggest fan of go but I find it's concurrency model better than most. Eela6 fucked around with this message at 18:08 on Jun 30, 2017 |
|
# ¿ Jun 30, 2017 18:05 |
|
|
# ¿ May 5, 2024 17:48 |
Furism posted:I finally have some time and a project idea to learn Go. I want to make a True Random Number Generator by reading raw files from a webcam aimed at a nearby tree. I figure I could diff images, hash that, etc.. This probably exists already but oh well. Go is a bad language for numerics. That said, it's as good a project as any to learn Go with; if it's what you want to do, go for it.
|
|
# ¿ Sep 7, 2017 17:30 |
Furism posted:Well honestly the other contender is Rust, but it seemed exceedingly complicated for an amateur like myself. Go is easy, I've been told. Go is probably the easiest C-family language to pick up. If you want to pick up another statically typed, compiled language, Go is a good choice. Go's biggest advantages are easy compilation to native machine code, better-than-usual concurrency model, and a programming model focused on simplicity: it's lightweight syntax, lack of exceptions, & extremely rigid typing help enforce that what 'what you see is what you get'. Go's biggest disadvantages are it's lack of generics, it's limited syntax, it's almost complete lack of syntactic sugar, and it's incredibly anemic handling of numerics (the math standard library is almost a joke). As such, Go tends to excel in highly-concurrent, 'simple' backend work that needs to be deployed across many different environments. It tends to be weakest in scientific & mathematical computing. Coffee Mugshot posted:Go and Rust are fine for making some amateur TRNG. Try it out and report back.
|
|
# ¿ Sep 7, 2017 18:25 |
Walked posted:So I've been using go a lot lately for toolmaking and it's been pretty great for that. My coworkers and I are split pretty evenly between vscode, atom, and gogland. VsCode is my personal favorite of the three, at least for now. I find gogland to be a little slow and buggy for now, though it seems to be rapidly improving.
|
|
# ¿ Oct 27, 2017 22:57 |
I'm working with an API that serves JSON in response to GET requests. Great! The problem is, it represents true as "T" and false as "N". Go code:
JavaScript code:
The logic I want is basically this, but I'm not so good with the json package Go code:
|
|
# ¿ Dec 21, 2017 21:59 |
rt4 posted:In Java-like languages, I'm accustomed to catching exceptions, then throwing a new exception in a "chain" so that I get information about every level of the stack trace. Does Go have this capability? I haven't found one, so I've created this pattern in my modules instead: Sort of. The traditional golang way is to use fmt.Errorf for the same purpose, so you don't gave to call err.Error() Eg, code:
You still have to build your trace manually, though.
|
|
# ¿ Jan 15, 2018 16:41 |
homercles posted:I'm building a tool that does a lot of computation through lots of goroutines, and pipelining chunks of work in N:M relations. Before I start optimising, I want to know, for each goroutine: Sounds like you want to use go test -blockprofile . The following might be helpful: https://golang.org/cmd/go/#hdr-Description_of_testing_flags https://software.intel.com/en-us/blogs/2014/05/10/debugging-performance-issues-in-go-programs https://golang.org/pkg/runtime/pprof/
|
|
# ¿ Jan 17, 2018 19:16 |
Small White Dragon posted:I'm new to GO, and working through the tutorial. I noticed that you can do: You can't have multiple right hand arguments that return multiple values. This removes the ambiguity at the expense of expressiveness, which is very go, fwiw. Try it yourself at the go playground
|
|
# ¿ Aug 24, 2018 20:39 |
rt4 posted:Are there any tools available to automatically generate a module file for an existing project? I'd really like to ditch this GOPATH stuff, but I also don't feel like enumerating my dependencies by hand. If you're using modules, `go build` will do what you want automatically https://github.com/golang/go/wiki/Modules posted:Version Selection
|
|
# ¿ Sep 7, 2018 15:15 |
|
|
# ¿ May 5, 2024 17:48 |
rt4 posted:Oh, I just need a go.mod and the compiler handles the rest? That's lovely Let me know your experience. At {CORPORATION} we're still using `dep` and go 1.10, so I haven't played around with it myself.
|
|
# ¿ Sep 7, 2018 23:47 |