Golang nuts (by Nii Nai at DevCongress 2013)


Published on

A tech talk on Golang nuts, delivered by Nii Nai at DevCongress 2013.

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Golang nuts (by Nii Nai at DevCongress 2013)

  1. 1. Golang-nuts Nii Nai Esoko
  2. 2. Introduction
  3. 3. Who? Rob Pike Robert Griesemer Ken Thompson
  4. 4. What is Go? Unix philosophy + Systems Language = Statically-typed language that feels dynamic, reads simple and is clean
  5. 5. Axioms
  6. 6. Simple Clean, concise syntax. Lightweight type system makes for fun. Have your cake and eat it. Who says you can't?
  7. 7. Orthogonal A few orthogonal features works better than a lot of overlapping ones. No bloat.
  8. 8. Readable Source code should make sense with little context.
  9. 9. Fast builds Achieves really fast build time by explicitly specifying dependencies.
  10. 10. Features
  11. 11. ● Statically-typed ● Compiled ● Type-safe and memory-safe ● Garbage collected ● Concurrent from inception ● Built for the web ● Support for functional programming ● Object oriented ● Explicit dependency
  12. 12. Demo: hello world
  13. 13. I Loves
  14. 14. Simple type system Go is statically-typed, but inference saves a lot of repetition.
  15. 15. Date Working with dates was a different and awe inspiring experience. Talk about simple All you have to do: ● specify incoming format ● call Parse
  16. 16. Multiple returns Used heavily in the go standard library to return error states for error checking.
  17. 17. Packaging Go code lives in packages. Packages contain type, function, variable, and constant declarations. Case determines visibility: Foo is exported, foo is not.
  18. 18. Duck typing Walks like a duck and swims like a duck and quacks like a duck, I call that a duck.
  19. 19. Stuttering ... I don’t miss this, not at all.
  20. 20. argsv Working with command line arguments just got easy.
  21. 21. Concurrency primitives *nix: find ~/sources/weather | grep loc.go | xargs wc -l Go equivalent: goroutines connected by channels Philosophy: “Don’t communicate by sharing memory. Instead, share memory by communicating.”
  22. 22. Killer tools ● gofmt ● godoc ● present ● play ● go get ● gofix
  23. 23. Eccentric Simply put idol worshipping on my part.
  24. 24. And Go has pointers
  25. 25. Esoko & Go
  26. 26. Weather Our weather forecast service powered by Go.
  27. 27. Check_sms A nagios plugin to check for delivery of Alerts and Price requests powered by Go.
  28. 28. Api_benchmark Our Go tool to make requests to the Esoko API checking for status and also providing benchmarking of transactions powered by Go.
  29. 29. More information
  30. 30. Tour and Tutorials Do not take my word for it, take the tour of Go ● golang.org ● tour.golang.org
  31. 31. Tour and tutorials … continued You may find other talks by the Google Go team interesting ● go get code.google.com/p/go.talks ● go get code.google.com/p/go.talks/present And more and more youtube videos
  32. 32. Tour and tutorials … continued Join the Go community ● golang-nuts google group ● Go+ on Google+ ● @go_nuts at Twitter Check out the Go Blog ● blog.golang.org
  33. 33. Thank you Nii Nai Esoko http://www.esoko.com @ttousai