I came, i saw, i go - Cefaro and De Donato

42
GOLANGIT Italian gophers! I came, I saw, I GO! 2014 golangit meetup @

description

Slides from Giorgio Cefaro and Giulio De Donato talk @ codemotion roma 2014

Transcript of I came, i saw, i go - Cefaro and De Donato

Page 1: I came, i saw, i go - Cefaro and De Donato

GOLANGITItalian gophers!

I came, I saw, I GO!

2014 golangit meetup @

Page 2: I came, i saw, i go - Cefaro and De Donato

@giorrrgio

@liuggio

GOLANGIT

I founder

Page 3: I came, i saw, i go - Cefaro and De Donato

GOLANGIT

Nascita di un logo

original gopher by Renée French

Page 4: I came, i saw, i go - Cefaro and De Donato

GOLANGIT

Nascita di un logo

Page 5: I came, i saw, i go - Cefaro and De Donato

Creare un punto di riferimento per gli

sviluppatori GO italiani

GOLANGIT

Uno UG dedicato a GO

Page 6: I came, i saw, i go - Cefaro and De Donato

Lavorare insieme per far diffondere go nel mercato

italiano

GOLANGIT

Uno UG dedicato a GO

Page 7: I came, i saw, i go - Cefaro and De Donato

Aiutare i neofiti a crescere

GOLANGIT

Uno UG dedicato a GO

Page 8: I came, i saw, i go - Cefaro and De Donato

da dove partire?

GOLANGIT

Uno UG dedicato a GO

Page 9: I came, i saw, i go - Cefaro and De Donato

sudo apt-get install golang

GOLANGIT

Uno UG dedicato a GO

Page 10: I came, i saw, i go - Cefaro and De Donato

GOLANGIT

Uno UG dedicato a GO

Page 11: I came, i saw, i go - Cefaro and De Donato

Parlane con i tuoi amici nerd!

GOLANGIT

Uno UG dedicato a GO

Page 12: I came, i saw, i go - Cefaro and De Donato

Nella prossima soa in cui metterai mano, un

servizio go sarà il tuoapprezzatissmo easter

egg!

GOLANGIT

Uno UG dedicato a GO

Page 13: I came, i saw, i go - Cefaro and De Donato

Aspettiamo le tue PR :-)

http://golangit.github.io

GOLANGIT

Uno UG dedicato a GO

Page 14: I came, i saw, i go - Cefaro and De Donato

GOLANGIT

Perché GO?

Page 15: I came, i saw, i go - Cefaro and De Donato

Abbiamo troppi core!

GOLANGIT

Problema 1

Page 16: I came, i saw, i go - Cefaro and De Donato

Abbiamo bisogno di un linguaggio di programmazione di basso livello

che ci permetta di sfruttare efficientemente le architetture

multiprocessore

GOLANGIT

Problema 2

Page 17: I came, i saw, i go - Cefaro and De Donato

Sì, ma ...

GOLANGIT

ERLANG?

Page 18: I came, i saw, i go - Cefaro and De Donato

GOLANGIT

ERLANG?

Page 19: I came, i saw, i go - Cefaro and De Donato

GOLANGIT

ERLANG?

Page 20: I came, i saw, i go - Cefaro and De Donato

Linguaggio di basso livello per lo sviluppo su architetture

multiprocessore

GOLANGIT

GOLANG!

Page 21: I came, i saw, i go - Cefaro and De Donato

Nato con la concorrenza in mente

GOLANGIT

GOLANG!

Page 22: I came, i saw, i go - Cefaro and De Donato

Nato con la semplicitàin mente

GOLANGIT

GOLANG!

Page 23: I came, i saw, i go - Cefaro and De Donato

no type inheritanceno method or operator overloadingno circular dependencies among packagesno pointer arithmeticno assertionsno generic programming

GOLANGIT

GOLANG!

Page 24: I came, i saw, i go - Cefaro and De Donato

Scrivere software multi-thread

non è complicato

GOLANGIT

GOLANG - Goroutines e Channels

Page 25: I came, i saw, i go - Cefaro and De Donato

Non è così immediato far comunicare i thread

GOLANGIT

GOLANG - Goroutines e Channels

Page 26: I came, i saw, i go - Cefaro and De Donato

CommunicatingSequential Processes

canali di comunicazione tra thread instanziabili direttamente dai

programmi

GOLANGIT

GOLANG - Goroutines e Channels

Page 27: I came, i saw, i go - Cefaro and De Donato

Feature decisiva per lo sviluppo multi-thread:

Decidere esattamente quando distruggere un oggetto condiviso

tra più thread può diventare davvero complicato.

GOLANGIT

GOLANG - Garbage Collection

Page 28: I came, i saw, i go - Cefaro and De Donato

No virtual machine

No JIT-compiling

Compilatore statico

GOLANGIT

GOLANG - No large runtime env

Page 29: I came, i saw, i go - Cefaro and De Donato

archive, bufio, builtin, bytes, compress, container, crypto, database, debug,

encoding, errors, expvar, flag, fmt, go, hash, html, image, index, io, log, math,

mime, net, os, path, reflect, regexp, runtime, sort, strconv, strings,

suffixarray, sync, syscall, testing, text, time, unicode, unsafe

GOLANGIT

GOLANG - Standard library

Page 30: I came, i saw, i go - Cefaro and De Donato

net/http: webserver integrato

fastcgi: utilizzabile con qualsiasi webserver

GOLANGIT

GOLANG - Amico del webdev

Page 31: I came, i saw, i go - Cefaro and De Donato

Occhio: una request, una nuova goroutine

Possibilità di condivisione channel tra diverse request (e quindi

client)

GOLANGIT

GOLANG - Amico del webdev

Page 32: I came, i saw, i go - Cefaro and De Donato

HTTP CLIENTHtml parsing

Templating

GOLANGIT

GOLANG - Amico del webdev

Page 33: I came, i saw, i go - Cefaro and De Donato

Google (ma dai?) - Docker - Canonical - Heroku -

Digital Ocean - SoundCloud - Bitly - CloudFlare - BBC

World News - Nokia Siemens Networks

GOLANGIT

GOLANG - Chi usa Go

Page 34: I came, i saw, i go - Cefaro and De Donato

GOLANGIT

OH MY GO ANOTHER LANGUAGE ...

Page 35: I came, i saw, i go - Cefaro and De Donato

GOLANGIT

Go to ‘60

Page 36: I came, i saw, i go - Cefaro and De Donato

GOLANGIT

Go to ‘78

Page 37: I came, i saw, i go - Cefaro and De Donato

GOLANGIT

Go to 2007

Page 38: I came, i saw, i go - Cefaro and De Donato

GOLANGIT

GO SCALABILITY

Page 39: I came, i saw, i go - Cefaro and De Donato

GOLANGIT

GO FEATURES

Page 40: I came, i saw, i go - Cefaro and De Donato

// Java / php style

Class MyGreatService{ doSomething(\AcmeLib\LogInterface logger) { logger->info('boom'); }}

GOLANGIT

JAVA INTERFACES

Page 41: I came, i saw, i go - Cefaro and De Donato

// GO LANG

import "...\loggerFunnyLib"

type logger interface { info()}

func doSomething(log logger) { log.info('boom')}

GOLANGIT

GO INTERFACES

Page 42: I came, i saw, i go - Cefaro and De Donato

GOLANGIT

Reference

http://www.meetup.com/golangit/

https://golangit.github.io

golangit su google groups