|
"Go is an open source programming language that makes it easy to build simple, reliable, and efficient software." Go was created by several Google employees frustrated with programming large-scale systems in Java or C++. They designed a language with features to specifically fight technical debt and complexity. Features that make programming in Go faster:
The designers strive to make a simple language with the minimal features necessary for effective development. I find this results in surprisingly concise code and a pleasant development experience. Many people coming from dynamic languages like Python and Ruby find it expressive and comfortable. Contributing to the language is very easy, with a well-funded and responsive core team at Google making daily improvements. Resources: A Tour Of Go is an excellent interactive tutorial. Effective Go is a more in-depth introduction. Documentation index Negatives:
Previous Go thread
|
# ? Mar 28, 2014 00:50 |
|
|
# ? Mar 29, 2024 15:05 |
|
How is Go for game dev? I've found a couple of bindings, but nobody seems to support SDL2 yet. I seemed to have the impression that even though it's now 1.0, there's not a whole lot of use, but it may be more server-oriented which I'm not really looking at.
|
# ? Mar 28, 2014 01:25 |
|
Can't have a thread on Go without starting it off with On Go. I've dabbled in it a bit. I've found it to be mostly disappointing. They still seem to believe that dynamic linking is the devil, so it's hard to write a solid Go library. Interfacing with legacy C with bindings and such is also quite a bit more painful than need be.
|
# ? Mar 28, 2014 01:49 |
|
Suspicious Dish posted:Can't have a thread on Go without starting it off with On Go. Is it? I've dabbled with cgo (http://golang.org/cmd/cgo/) a few times and it wasn't too bad. Go has been making some steady progress as of late and if you haven't checked it out since 2009 it might be a fun weekend project to code some personal stuff in it over a weekend or two. Coming from a python webdev background I'm really enjoying it.
|
# ? Mar 28, 2014 04:17 |
|
spongeh posted:How is Go for game dev? I've found a couple of bindings, but nobody seems to support SDL2 yet. I seemed to have the impression that even though it's now 1.0, there's not a whole lot of use, but it may be more server-oriented which I'm not really looking at. Haunts was an attempt to make a game in Go, but the developer was contracted for a year, and had development troubles after that. One of the updates blames Go's poor dependency management.
|
# ? Mar 28, 2014 06:10 |
|
So I've been writing a raytracer in Go. Here are some quick thoughts: - Go is a nice middle ground between C++ (good performance, but difficult and error-prone) and higher-level languages like Javascript and Python (easy to work with, but slow as poo poo). The easy handling of concurrency is a nice win, too. - Go's standard library made it convenient to, e.g. read in JSON files for configs and output PNG files for the rendered image. Support for an HDR format (like OpenEXR) doesn't exist yet, though, but probably not too difficult to write. - It's a pain in the rear end to debug Go code with GDB, especially with the default settings that make it impossible to peek at the values of some local variables. I've basically resorted to printf-style debugging (better for raytracers, anyway). - The only C++ feature I really miss is operator overloading (so that I can add/subtract vectors, etc.). The dearth of built-in data structures (hashtable / vector) is annoying, but it hasn't been a serious problem yet. - OS X support lags -- profiling support is buggy/nonexistent, and gcc-go doesn't support Darwin.
|
# ? Mar 28, 2014 18:55 |
|
Suspicious Dish posted:They still seem to believe that dynamic linking is the devil, so it's hard to write a solid Go library. I don't follow, how does not having dynamic linking make it hard to write a good library? And besides, dynamic linking is coming eventually, it's just not that important to the go team because of what they use it for.
|
# ? Mar 29, 2014 19:27 |
|
SavageMessiah posted:I don't follow, how does not having dynamic linking make it hard to write a good library? Because a heck of a lot of library writing for new languages is about bindings for tried and tested existing C libs. Has someone got a SWIG thinger working for GO yet? edit: TOOT TOOT http://www.swig.org/Doc2.0/Go.html TOOT TOOT
|
# ? Mar 30, 2014 21:52 |
|
cgo dynamically links to existing C libraries. You just can't create Go libraries that can themselves be dynamically linked†. The statement remains a non sequitur, without further explanation. Though, presumably, it refers either to distribution or being able to dynamically load plugins to applications/libraries. † Ian Lance Taylor recently said that he would like to make this a priority for Go 1.4 on the dev mailing list.
|
# ? Mar 30, 2014 22:12 |
|
Go rules and my company moved to an exclusively Go backend from some old Python and it's been great. Slightly better performance than Python, much easier deployment, static typing, first class testing, good docs, solid std lib. If it had not horrible package management and fewer bugs on OS X I'd recommend it unreservedly. Oh, and generics.
|
# ? Apr 22, 2014 03:00 |
|
I have been looking for a new language to try, and I'm on Go now after trying D. I'm stuck on this bit of code:code:
code:
|
# ? Apr 27, 2014 21:36 |
|
Interestingly it panics in the go playground (http://play.golang.org/p/wH-StrUZcT) but runs correctly locally edit: well, no, misread the code. It doesn't print did something, but it doesn't panic. edit2: the code didn't copy paste into vim correctly, panics locally as well. Having a fabulous day.
|
# ? Apr 27, 2014 22:33 |
|
it was something simple: Master{} needs to be &Master{} as the execute method isn't defined on values of master and reflection unlike go proper doesn't automatically take the pointer. http://play.golang.org/p/SLTLkRn7dk
|
# ? Apr 27, 2014 22:45 |
|
Wow, nice catch. Thanks for that.
|
# ? Apr 27, 2014 22:53 |
|
Been using Go professionally for over a year now. Love it. Here's a fancy Riak database driver I wrote: https://github.com/riaken/riaken-core
|
# ? Apr 28, 2014 01:43 |
|
Another oddity: http://play.golang.org/p/BMtgxj-0Af Unmarshaling any number always gives me a float64 Is there a way to force encoding/decoding an integer? I'm reading the json encoder but not seeing it.
|
# ? Apr 29, 2014 03:00 |
|
Azazel posted:Been using Go professionally for over a year now. Love it. What kind of projects do you use it for? I love the philosophy of Go, but what has always kept me from putting the effort into learning it was thinking that I wouldn't get much mileage out of it in my day-to-day life. Just so you know where I'm coming from, I use Ruby a lot to automate workplace tasks. Most of the code I write is imperative, but I do take advantage of the methods that come with the standard classes.
|
# ? Apr 29, 2014 03:06 |
|
If you don't give it anything more specific to encode into, that's what you're going to get. http://play.golang.org/p/Vauuun8fRP This is documented: http://golang.org/pkg/encoding/json/#Unmarshal
|
# ? Apr 29, 2014 04:21 |
|
Copland posted:What kind of projects do you use it for? I love the philosophy of Go, but what has always kept me from putting the effort into learning it was thinking that I wouldn't get much mileage out of it in my day-to-day life. Standard boring work stuff has been along the lines of RESTful microservice APIs using net/http, gorilla/mux, etc. No more wasting time with web frameworks, configuring web servers, unicorns, or rainbows. I've tinkered with realtime game servers communicating over TCP and/or my cgo ENet wrapper (buggy!) quite a bit recently. The standard library is so small and easy to remember, I'm more inclined to write one off scripts in Go than a scripting language these days.
|
# ? Apr 29, 2014 06:37 |
|
Copland posted:What kind of projects do you use it for? I love the philosophy of Go, but what has always kept me from putting the effort into learning it was thinking that I wouldn't get much mileage out of it in my day-to-day life. I use Go a bit at my job as well. I tend to reach for it for things where I previously used ruby - to write little development tools and scripts. The fact that it produces statically-linked executables makes it much easier for me to hand them out to other folks who might not have the same stuff installed. I've been doing a lot of development on a device that runs a very stripped down linux on ARM and it's really nice to be able to easily make tools or scripts to try poo poo out in a rational language (not sh) and then trivially cross-compile them. EDIT: Also, for those not in the know - Gophercon was last week. Apparently videos of the talks should be up in 2-3 weeks. SavageMessiah fucked around with this message at 16:47 on Apr 29, 2014 |
# ? Apr 29, 2014 16:40 |
|
SavageMessiah posted:The fact that it produces statically-linked executables makes it much easier for me to hand them out to other folks who might not have the same stuff installed. Between this and the simple standard library mentioned by Azazel, I think I will give it a try. It really does sound right up my alley. I just hope that I don't run into too many frustrations with it on the Mac.
|
# ? Apr 29, 2014 18:52 |
|
Copland posted:Between this and the simple standard library mentioned by Azazel, I think I will give it a try. It really does sound right up my alley. I do pretty much all of my personal programming on a Mac and haven't run into any bugs or problems with Go there.
|
# ? Apr 29, 2014 20:26 |
|
My Rhythmic Crotch posted:Another oddity: http://play.golang.org/p/BMtgxj-0Af json doesn't have the concept of other number types. http://golang.org/pkg/encoding/json/#Unmarshal You can, however, force it to use Numbers. http://golang.org/pkg/encoding/json/#Decoder.UseNumber
|
# ? Apr 30, 2014 01:13 |
|
Copland posted:I just hope that I don't run into too many frustrations with it on the Mac. I develop exclusively on Mac, cross-compiling my linux server builds with zero problems. You'll be fine. Save yourself some trouble when you setup your environment by reading this: https://code.google.com/p/go-wiki/wiki/GOPATH
|
# ? Apr 30, 2014 08:09 |
|
I've got to say that I'm really loving this language. It is simple enough to follow easily (particularly coming from Scala) and the std lib is just a fantastic learning tool.
|
# ? May 1, 2014 16:33 |
|
If you're going to write Go code, please do read the language specification: http://golang.org/ref/spec. It is simple and straightforward. Also, stop trying to write code from your pet language in Go syntax. EDIT: Another thing not mentioned in the OP. ALWAYS use gofmt to format your code before uploading it anywhere or w/e. Most of the popular editors have support for doing this on save. Also, you probably won't run into any problems with Go on Mac, given that Rob Pike and Robert Griesemer exclusively develop Go on macbooks. Coffee Mugshot fucked around with this message at 23:03 on May 1, 2014 |
# ? May 1, 2014 23:00 |
|
a weird thing about go is that it uses its own linker and calling convention which is bizarre for a language that wants to replace c++ theres an ok ffi though
|
# ? May 2, 2014 17:35 |
|
The talks from Gophercon are starting to come online here: http://confreaks.com/events/gophercon2014
|
# ? May 7, 2014 15:38 |
|
Voted Worst Mom posted:If you're going to write Go code, please do read the language specification: http://golang.org/ref/spec. It is simple and straightforward. Also, stop trying to write code from your pet language in Go syntax. For the love of all that is sweet and holy, please do this. If other popular languages had a tool (from inception of the language) like this then my eyes would not have to bleed every time I had to look at the source of something. Sometimes it's so bad that it triggers a "context switch" in my head.
|
# ? May 7, 2014 17:26 |
|
SavageMessiah posted:The talks from Gophercon are starting to come online here: http://confreaks.com/events/gophercon2014 Rob Pike(Keynote) posted:Larry Page suggestion "function" be spelled "func". Scaevolus fucked around with this message at 21:34 on May 7, 2014 |
# ? May 7, 2014 21:32 |
|
This thread ought to "go" ... back to GBS that is! etcetera08 posted:json doesn't have the concept of other number types. http://golang.org/pkg/encoding/json/#Unmarshal JSON's only concern with numbers is their parse; their representation upon deserialization is an implementation decision. An implementation typically uses 64-bit floats only for compatibility with the lowest common denominator prosumer of JSON: Javascript. Deus Rex fucked around with this message at 22:24 on May 7, 2014 |
# ? May 7, 2014 22:20 |
|
Deus Rex posted:This thread ought to "go" ... back to GBS that is! OBVIOUSLY I meant "encoding/json" when I said "json," hence the proceeding link. Thanks for the clarification.
|
# ? May 7, 2014 22:33 |
|
Huragok posted:For the love of all that is sweet and holy, please do this. If other popular languages had a tool (from inception of the language) like this then my eyes would not have to bleed every time I had to look at the source of something. Sometimes it's so bad that it triggers a "context switch" in my head. I find it very difficult to read both BNF and the arch lexicon used in these and other language specs. It's great as an implementation reference but as something supposed to teach me idiomatic Go it's just about the last thing I want to sit down and read.
|
# ? May 7, 2014 23:59 |
|
I am starting to suspect that the real reason they chose the name "go" was because it would allow an infinite number of puns
|
# ? May 8, 2014 03:57 |
|
Arachnamus posted:It's great as an implementation reference but as something supposed to teach me idiomatic Go it's just about the last thing I want to sit down and read. Well, nothing about the specification really teaches you how to write idiomatic Go so that's warranted. The best way to learn that is probably reading Effective Go and literally reading through parts of the standard library you find interesting. It's just profound to me that I can even sit down and scarf down a language specification without necessarily learning a whole new set of paradigms. Anyways, I think the post you quoted was referring to using the `gofmt` tool to format your code.
|
# ? May 9, 2014 05:29 |
|
So, I wrote up a function which takes a channel, and returns a new interface which can replay the values in the original channel, and only pulls values from the original channel lazily. Maybe some of you have some suggestions / criticisms of it? I wrote it after some guy on the go-nuts irc channel said it wasn't possible, gently caress that guy. actually, this is so much better: http://play.golang.org/p/H4awi7EmSY Bozart fucked around with this message at 05:52 on May 13, 2014 |
# ? May 11, 2014 05:15 |
|
Voted Worst Mom posted:Well, nothing about the specification really teaches you how to write idiomatic Go so that's warranted. The best way to learn that is probably reading Effective Go and literally reading through parts of the standard library you find interesting. It's just profound to me that I can even sit down and scarf down a language specification without necessarily learning a whole new set of paradigms. Ah. They didn't quote that bit in their quote. Now it makes more sense.
|
# ? May 11, 2014 09:44 |
|
For shame, Go thread. 1.3 was just released and there's no post?
|
# ? Jun 19, 2014 23:30 |
|
The new analysis features in godoc are awesome.
|
# ? Jun 20, 2014 01:35 |
|
|
# ? Mar 29, 2024 15:05 |
|
Mr. Glass posted:The new analysis features in godoc are awesome. In particular, channel peer annotations are fantastic.
|
# ? Jun 20, 2014 03:42 |