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

Go init() - An initial introduction to the lang...

Go init() - An initial introduction to the language!

Part of workshop in Developer Circle Casablanca

Go is #1 programming language developers want to learn this year (*hackerrank) 😎, for those of you who share this urge, we have you backed with a special event, where you will get some solid knowledge to help you start with this fabulous PL, from the

Avatar for mohamed ez-zarghili

mohamed ez-zarghili

February 16, 2019

More Decks by mohamed ez-zarghili

Other Decks in Programming

Transcript

  1. #devc #golang #goinit Go init() An initial introduction to the

    language Some techs developed using Go:
  2. Mohamed Ez-zarghili Chief Everything Officer https://xor.ma Training Projects management VPS

    hosting Gitlab CE hosting Events Management ... AIDC $ whoami | echo "@$(xargs)" → @ezzarghili
  3. @ezzarghili “Everyone you will ever meet will know something you

    don’t.” - Bill Nye • Procedural vs OOP vs FP vs CSP • Compiled vs interpreted • Static vs dynamic typing Learn Why?
  4. @ezzarghili “I not only use all the brains that I

    have, but all that I can borrow.” - Woodrow Wilson • Syntax • CSP concepts • Duck typing • Tooling concepts Borrow Why?
  5. @ezzarghili “The ability to simplify means to eliminate the unnecessary

    so that the necessary may speak.” - Hans Hofmann • No overloading • No type hierarchy • No exceptions • Wait for generics Drop Why?
  6. Why? @ezzarghili “If I seen further it is by standing

    on the shoulders of giants.” - Issac Newton • Ultrafast Compilation • Errors are values • Composition/strong duck typing • stdlib a.k.a included batteries • Integrated tools • Compatibility promise • Lightweight CSP Concurrency with goroutines Improve
  7. Identifiers & Keywords @ezzarghili Identifiers Unicode Standard 8.0 letters and

    digits No composed characters MixedCace mixedCace 25 keywords
  8. Object-based @ezzarghili Duck typing → “if it quacks like a

    duck it’s a duck” duck test Everything is interface{} “interface{} says nothing*” Type Composition → Oriented Object’s like capabilities * Rob Pike’s https://go-proverbs.github.io/
  9. Functional @ezzarghili Higher order functions → Use wherever you can

    use expressions + Currying and Partial Functions Eager vs Lazy Evaluation → Eager Evaluation, goroutine and channels to emulate laziness Tail-call optimization → No, For performance reasons
  10. Concurrent @ezzarghili Concurrency ≠ Parallelism Core #1 Core #2 Core

    #1 Work Groups “sync” Select Statement goroutine channel Mutex CSP
  11. Scratch for docker @ezzarghili “To get a slim docker image

    base off scratch, if using Client over https/tls ca-certificates are required”