Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Let's Get Going!

Let's Get Going!

A quick introduction to the Go programming language!

Avatar for Abu Ashraf Masnun

Abu Ashraf Masnun

November 26, 2016
Tweet

More Decks by Abu Ashraf Masnun

Other Decks in Programming

Transcript

  1. QUICK INTRODUCTION • Developed at Google • Ken Thompson, Rob

    Pike, Robert Griesemer • Started as an experiment in 2007, Announced in 2009 and 1.0 came in 2012 • Replacement for C++ but now attracts people from all sorts of languages • Easy to learn, reason about, statically compiled yet productive
  2. WHY I LIKE IT? • Tooling & stdlib • Simple

    & Easy to Learn • Very very fast & Low memory foot print • Built for system programming / Networking • Concurrency • Single Binary & Cross Compilation • Dependencies from VCS
  3. TOOLING • go run • go build • go install

    • go fmt • go get • go test • and others
  4. STANDARD LIBRARY • Batteries included (almost) • Many packages for

    common tasks • Modern day stdlib for a modern day language • System, networking, web development well covered
  5. SIMPLICITY • Intentionally kept less expressive • The language is

    relatively small • Less memorization • Easier to read & Maintain
  6. EASY TO LEARN • Designed for new, fresh graduates •

    The official specification is less than 40 pages • Very small number of built in keywords • One type of loop • The documentation is very detailed • “Effective Go” • Friendly community
  7. FAST & LIGHTWEIGHT • Destroys the dynamically typed languages •

    Surpasses Java easily (and consumes far less memory) • Sometimes beats C/C++
  8. SYSTEM / NETWORK PROGRAMMING • You can easily build low

    level systems • The GC can be a problem • Excellent support for network programming
  9. CONCURRENCY • Why is Concurrency Important? • Go routines •

    Low overhead • Easy to Spawn • M:N Scheduling • Channels • Bi directional communication • select
  10. SINGLE BINARY & CROSS COMPILATION • You can generate a

    single binary executable. • You can embed resources into it easily (packing). • Cross compile on major platforms. • Cross compilation would not work on CGO.
  11. VCS & DEPENDENCY MANAGEMENT • You can directly install packages

    from git / hg • Does not scale well for teams • Vendoring is introduced • I use “Glide” • New solutions are coming
  12. LEARNING RESOURCES • Go Tour (comes as command line tool,

    too!) • Effective Go • Go By Example • Go Documentation