Let's Go(Lang) !

by @yrezgui

Who am I ?

 

Yacine Rezgui — @yrezgui

French-Tunisian

Developer Evangelist

IBM Watson

#TrollMoment

#TrollMoment

Which one?

PHP

  • Huge community
  • All CMS are using it
  • Big pool of talents
  • Hosting
  • Lot of security issues
  • Apache is a black box
  • Language design

Node.JS

  • Everyone knows JavaScript
  • Big hype
  • Fast and simple
  • Lot of tools
  • Callback hell
  • Instability with community packages
  • Not typed (need TypeScript or Flow)

Java

  • Performant
  • Good for heavy tasks
  • Verbose
  • Resource consumption
  • Good standard library

Python

  • Simple to start
  • Native support on Unix system
  • Good for scripting and analytics
  • Python 2/3 problem

Current languages are not good...Solution ?

What about Go ?

Golang feels like a scripting language, but with the elegance and speed of C.

Golang

  • Designed at Google in 2007
  • Open Sourced in 2009
  • Stable since 2012
  • Designed to scale to 10⁶⁺ machines
  • Statically typed
  • Scalable to large systems

Simplified language

  • No classes
  • No inheritance
  • No constructors
  • No final
  • No exceptions
  • No annotations

You can choose between Script or binary

Projects created with Go

  • Docker
  • Kubernetes
  • Etcd
  • Fleet
  • InfluxDB
  • CockroachDB
  • Cayley
  • Ngrok
  • Websocketd
  • Git-lfs
  • Tile38
  • Parse CLI
  • Heroku CLI

Who use it ?

  • Aerospike
  • BBC Worldwide
  • Bitbucket
  • Booking.com
  • Cloudflare
  • Datadog
  • Digital Ocean
  • Dropbox
  • Facebook
  • Getty Images
  • GitHub
  • Shutterfly
  • SmugMug
  • SoundCloud
  • SpaceX
  • Square
  • Stack Exchange
  • Tumblr
  • Twitch
  • Twitter
  • Uber
  • VMWare
  • GOV.UK
  • Heroku
  • IBM
  • Intel
  • Iron.io
  • Medium
  • Mozilla services
  • Netflix
  • New York Times
  • pool.ntp.org
  • Rackspace

Our first script

package main

import "fmt"

const g string = "constant"

func main() {

    var a string = "initial"
    fmt.Println(a)

    var b, c int = 1, 2
    fmt.Println(b, c)

    var d = true
    fmt.Println(d)

    var e int
    fmt.Println(e)

    f := "short"
    fmt.Println(f + " " + g)
}

Time for serious business...

IBM Watson

Cognitive APIs

Create BlueMix ACCOUNT

Create a Watson Translation instance

Create a Watson Text to Speech instance

Live coding time!

Read more

@yrezgui

Follow me on Twitter

Hands on with Golang

By Yacine Rezgui

Hands on with Golang

  • 1,726