6 ms·
Anyone care to share their experience writing something in go? I've toyed with it but not built anything in production. FWIW, the go dashboard (https://godash
by mace 15y ago
Anyone care to share their experience writing something in go? I've toyed with it but not built anything in production.
FWIW, the go dashboard (https://godashboard.appspot.com/ https://godashboard.appspot.com/) has a number of interesting projects.
- micro_cam 15y agoWe used it to write our own simple distributed computing software after realizing hadoop was too complicated (and thus bug prone) for our embarrassingly parallel needs. It took us less time to get the system written, stable and up and running then it had to get hadoop setup (different developers so not a fair comparison but still). It feels like python with the good parts of C on linux (most things are file like object) and I plan on using it more and more as the ecosystem of available libraries matures.
- fizx 15y agoSounds like a hell of a blog article. I hope you write it.
- Morcane 15y agoYea, I agree, blog needs to be written. I would love to see one, since we're in the same boat (deciding between Hadoop or a bit of homegrown stuff for our simple needs). And I'm really curious about Go in general. The vibe seems really positive, kind of Java-vibe like back in the 90ies.
- peregrine 15y agoI've been putting together a small blogging application with Go just for fun on the side to pick up the language and work on my web design. Its a great language, I'm not using it for half of its capabilities but it very much feels well thought out and the community is very helpful. Key pieces: -My code isn't much more complex than my ruby or python. -The stdlib is pretty fantastic. -Right now tutorials and 'blogs' are all over the place with compatibility for go, rule of thumb if it says "goinstall" in the guide probably a good sign its an older guide. -All network communications use epoll in the backend so you get lots of the fun things you would normally get from something like node.js without callback soup. Ideally go would probably work for a web service or building some backend networked code, or even a simple command line utility. Right now there is not much in the way of GUI code outside of websites which is unfortunate cause I'd like to use the goroutines with some graphics ideas I've had.
- lhnn 15y agoDo you know of any recent tutorials on writing web applications in Golang? I saw a slideshow from two years ago, but the content seemed to be fairly abstract for a framework.
- canop_fr 15y agoIt really depends on your needs and the type of application you're making. For example my applications, apart serving a few static html, css and js files, just answer to JSON or JSONP queries. That can be done in a dozen lines of code, all the remaining code will be related to your application logic. So you just need to look at the net/http API, and at a few code samples. I cannot find the the old golang wiki codelab sample (has it gone away with Go1 ?), so here's an example of a JSONP server that you can reduce to a few lines if you remove the specific application logic and the profiling hook : https://github.com/Canop/braldop/blob/master/go/src/braldopserver/BraldopServer.go https://github.com/Canop/braldop/blob/master/go/src/braldops... EDIT : I found an example on the golang site. If you're not interested in JSON, it will be more suited to your need : http://golang.org/doc/effective_go.html#web_server http://golang.org/doc/effective_go.html#web_server
- canop_fr 15y agoI made a few web application servers (mostly for games) and it's been a real pleasure, not to mention that my programs run for months handling millions of queries (mostly json) without the slightest problem. Using the go tool to get libraries, build, compile, test, benchmark, is like a dream. An example of what I found kind of marvelous : I had sometimes queries leading to the call to a function updating a lot of things in a kind of specific database. That is the browser had to wait about 1 second because there was in the query handling code something like this : for _, ami := range amis { bra.EnrichitCouchePNG(ms.répertoireCartesBraldun(ami.IdBraldun, ami.Mdpr), couche, PNG_CACHE_SIZE) } I just made a tiny change and the work was done after the answer was sent to the browser : for _, ami := range amis { go bra.EnrichitCouchePNG(ms.répertoireCartesBraldun(ami.IdBraldun, ami.Mdpr), couche, PNG_CACHE_SIZE) } This small go was the only needed thing (the "database" being yet protected by a mutex)
- huhtenberg 15y agorépertoire Never gave much thought to Go's UTF8 support, but this makes me think that it might've been better limited just to the string literals. The last thing I want is to patch other person's code by copy-pasting original variable and function names, because all I have is a standard US keyboard locale.
- maaku 15y agoLearn how to use your ALT-keys.
- huhtenberg 15y agoDo tell how I would enter Ж with my Alt-keys. Or better yet, tell me how to tell apart 'e' and 'е' (one of them being a Cyrillic letter.)
- krasin 15y agoA popular Russian CRM (1С) has a scripting language where the code looks like: СпрСотр = СоздатьОбъект("Справочник.Сотрудники"); СпрСотр.Новый(); СпрСотр.Наименование = ФИО; СпрСотр.Должность = Должность; СпрСотр.Оклад = Оклад; СпрСотр.ДатаПриема = ДатаПриема; СпрСотр.Записать(); It's not surprising they were not able to expand to the Europe market.
- kaitari 15y agoAs someone with no formal training or experience with compiled languages, I really like Go (as compared to trying to teach myself C recently). Months ago, when I first checked out the language, I was able to write a simple bot that sits in an IRC channel and responds to its name. It took me a little over an hour to write, using the online docs as a reference (https://gist.github.com/1123352 https://gist.github.com/1123352).
- supersillyus 15y agoI've written a few relatively small (a few K LOC) Go projects, and my experience has been quite positive. The libraries are really well designed and impressively complete. With goroutines and the fact that most things work with io.Reader/io.Writer, plugging different components together and having them work efficiently is pretty easy. I love gofmt (sweet sweet consistency), and despite some early reservations, I'm quite happy with what the go tool provides. The couple servers I have written in Go have been great, in that they were pretty easy to write in a straightforward way, and they ended up impressively fast. The speed is actually somewhat seductive; I've been unnecessarily microoptimizing some things, just because I see what sort of speed is possible without leaving the language. I also find that due to gofmt, the constraints of the language, and the aesthetic leadership of the Go team (along with, likely, a self-selection in those writing Go right now), third party Go libraries are very readable. When I'm trying to understand a data structure or a protocol, I often look for source code; python used to be my preference, but in part thanks to types, I now find Go to be my first choice. I do wish the Thrift support was as good as the protocol buffer support, though. :)
- dlsspy 15y agogo1 has been my goto language for a while now. I don't even understand why, but everything makes a lot of sense. It compiles about as fast as python and I have an easy time making quite efficient code. Concurrency is obviously very good and that extends to parallelism quite easily. For example, I wrote go-heatmap ( https://github.com/dustin/go-heatmap https://github.com/dustin/go-heatmap ) and found I could shave a few seconds off of the colorization phase of a fairly large image I generate hourly by running every column (or row, I forget which) in parallel on my 4 core atom box. The build/packaging system is everything maven wishes it could be. It's practical to create, publish and use small third-party things (such as my humanize package: https://github.com/dustin/go-humanize https://github.com/dustin/go-humanize ) because the build system just deals with the dependency for you (even transitively) just based on import statements. "go list -json" in a source directory (or pointed to a namespace) will tell you all kinds of things about what your code uses, including transitive dependencies. I deploy go code I use every day on OS X and Linux, 386, 64 and ARM. I can build all of these programs from any one of these systems so quickly and easily you wouldn't think they're native binaries. In fact, it just took me 20s to build a Windows cross compiler and all of the standard library (with which I built my kmz_example program from go-heatmap on OS X in .49s and now I've got a kmz_example.exe I don't know what to do with).
- fmstephe 15y agoI built a location service that allows people to play games with people who are nearby. I built a small geo-location service and a messaging server for the games. The servers are tiny and fairly simple. The games themselves are written in Javascript. Good times. https://github.com/fmstephe/location_server https://github.com/fmstephe/location_server
- lolcraft 15y agoI have written a bit of Go. It strikes me as sort of the Unix of programming languages. It's very opinionated, takes some overarching concepts, mostly channels and interfaces, then proceeds to thoroughly not care what you think about it: refuses to have generics, lambdas and tail-call recursion like a pro. The polar opposite of design by committee. It even enforces a True Brace Style to keep the parser simple! Technically, it looks good to me. The toolchain is excellent. It looks ready for production. Programming in it is fun. It fixes most issues of compiled languages. Go has mostly replaced Haskell, for me.
- eurleif 15y agoGo does have lambdas: foo := func() { ... }
- ootachi 15y agoWhy would you move from Haskell to Go? There's a night-and-day difference between them. I don't understand why you'd switch to a language because of the features it's lacking, unless you think those features are a bad thing (and I have yet to see a reason why generics and TCO are a bad thing).
- anacrolix 15y agoIt's because of implementation. Both Haskell and Go give you limitless concurrency, and you can break out bits of code really easily (due to FP/sparks, and corresponding interfaces/goroutines). Of course Haskell also has much stronger typing, but Go is much easier.
- lolcraft 15y agoOf course they are not a bad thing. It's just that Go has character. It doesn't have generics or C++-style classes just because every other language has them. I respect that.
- ootachi 15y agoGo has C++-style classes. Anonymous fields are just C++ multiple inheritance with a different name (and without virtual functions or downcasts).
- darsenault 15y agoI've built a production entity resolution system using 100% Go. It implements a map/reduce model with many workers and multiple (for failover) masters. All data is held in memory for speed purposes. Things that are amazing about go: fun and fast to develop in; beautifully designed (rockstart founding team, than you!); RPC, net channels, and maps and strings, to name a few. The ability to quickly create servers to host business logic. Interfaces and "inheritance" model are both very elegant and clean. Compile times rock. Everything was built with the standard Go (pre 1) install; not a single other package was needed--the very complete standard lib is a blessing. Two "could be better" points. Go has a hard memory limit per instance of ~ 15 GB; bad when you want to pin lots of data in memory. Russ says this issue is being tracked (2142) and will get fixed after Go 1 gets out the door. So patience will fix this one. Second, there needs to be more examples of Go code out int the wild for others to share and look at. Using the template package got me stuck, for example, and seeing code cleared up my issue but that was hard to find. This we can all help with by using Go and talking about it. Again patience takes care of this issue as well. Other than these items, do yourself a favor and start using the magic that is Go!
- luriel 15y agoJust a note: The Go distribution itself is full of great examples of Go code, including several uses of the template package, for example in godoc. Don't be afraid to read the code in the stdlib, is very readable.
- ajstarks 15y agoI created SVGo, a Go package for generating SVG. (http://github.com/ajstarks/svgo http://github.com/ajstarks/svgo) I use it for programming visualizations, and other creative coding tasks. For example, I use the goplay command and a browser, to "sketch with code", showing the code and resulting picture in one view -- I make a change, hit a keystroke and immediately see the result. (http://www.flickr.com/photos/ajstarks/6198774781/in/set-72157623441699483 http://www.flickr.com/photos/ajstarks/6198774781/in/set-7215...) SVGo paper from SVG Open 2011: (https://www.svgopen.org/2011/papers/34-SVGo_a_Go_Library_for_SVG_generation/ https://www.svgopen.org/2011/papers/34-SVGo_a_Go_Library_for...) Samples: (http://www.flickr.com/photos/ajstarks/sets/72157623441699483/ http://www.flickr.com/photos/ajstarks/sets/72157623441699483...)
- kaib 15y agoTinkercad, http://tinkercad.com http://tinkercad.com, a cloud based solid CAD runs Go for the cluster component. We have a dozen or so different services running in the cluster. Most are distributed for performance and fault tolerance. All the distributed code is written in Go, there is some C for performance critical inner loops.
- singular 15y agoI have been (slowly) developing a chess engine in go [1] (still a long way to go, no pun intended!) What I like most about go is its simplicity and cleanness while still allowing you to program somewhat close to the metal. In fact, it often feels considerably more like a higher level language than a systems language. The go tool is quite fantastic too. My chess engine project folder contains 41 go files, including a number of files containing tests (named XXX_test.go) which contain functions named TestXXX. My entire test + build process is:- ~/gocode/src/weak$ go test ./... && go build Go is like a very delicious trifle - the further into it you go, the more delicious things you find. The quality is clear throughout. Go is very unassuming. You start by wondering what the big deal is + getting annoyed with the minor differences from other C-syntax languages before slowly progressing towards quite liking it, then eventually once you grok how simple + elegant and well engineered it is you come to love it. [1]:https://github.com/lorenzo-stoakes/weak https://github.com/lorenzo-stoakes/weak