Go, el lenguaje de Google
description
Transcript of Go, el lenguaje de Google
![Page 1: Go, el lenguaje de Google](https://reader034.fdocuments.mx/reader034/viewer/2022042814/55616da7d8b42a5f4b8b579a/html5/thumbnails/1.jpg)
Go: El lenguaje de GoogleLa flexibilidad de Python con la rapidez del
código máquina
@jmrobles
2012-05-17T06:21:13.598Z
![Page 2: Go, el lenguaje de Google](https://reader034.fdocuments.mx/reader034/viewer/2022042814/55616da7d8b42a5f4b8b579a/html5/thumbnails/2.jpg)
README.txt- ¿Por qué?- Primeros pasos, Go go go!- Vistazo rápido- Paquetes para todo- Marchando un webserver!- ¿Quién usa esto?- No todo es tan bonito- ¡Me lo quedo!- The 6W
![Page 3: Go, el lenguaje de Google](https://reader034.fdocuments.mx/reader034/viewer/2022042814/55616da7d8b42a5f4b8b579a/html5/thumbnails/3.jpg)
¿Por qué?
-
- = +
simplicidad / flexibilidad / RAD eficiencia
11/2009 2010
2011
2012
03/2012
Go 0 Go 1
BSD License
![Page 4: Go, el lenguaje de Google](https://reader034.fdocuments.mx/reader034/viewer/2022042814/55616da7d8b42a5f4b8b579a/html5/thumbnails/4.jpg)
Primeros pasos, Go go go!
- Benchmark* servidor web
VS- Apache Benchmark % ab -n 40000 -c 8 http://localhost:port/
Go fue un 119% más rápido que Python
![Page 5: Go, el lenguaje de Google](https://reader034.fdocuments.mx/reader034/viewer/2022042814/55616da7d8b42a5f4b8b579a/html5/thumbnails/5.jpg)
Vistazo rápido
- "Sintaxis conocida"if , for, switch, package
- ... pero peculiar: var i int
for i = 0; i < n ; i++ {
fmt.Println(i)
}
- Go es concurrente: CSPmiCanal := make(chan string)
go func() {
miCanal <- "desde el hilo"
}()
fmt.Println(<- miCanal)
pthreadC/C++
threadingPython
![Page 6: Go, el lenguaje de Google](https://reader034.fdocuments.mx/reader034/viewer/2022042814/55616da7d8b42a5f4b8b579a/html5/thumbnails/6.jpg)
Paquetes para todo
- Nativo - Comunidad
compress/gzip
image/jpeg
encoding/json
crypto/aes
os/exec
reflect
unicode
net/http
runtime
net/mail
math/big
html/template
gosqlite3 gomysql
gl
pulsego
go-python
Rocket
gomongo
yaml
web.gogooauth mustache.go
go-curl
pdfreader
Cgo
![Page 7: Go, el lenguaje de Google](https://reader034.fdocuments.mx/reader034/viewer/2022042814/55616da7d8b42a5f4b8b579a/html5/thumbnails/7.jpg)
Marchando un webserver!Pasos: 1. Instalar Go (descomprimir un zip)2. Establecer variables de entorno GOROOT y PATH3. Abrir shell y copiar el ejemplo4. Obtener dependencias % go get 5. Compilar % go build6. Voilá!
¡46 líneas!
![Page 8: Go, el lenguaje de Google](https://reader034.fdocuments.mx/reader034/viewer/2022042814/55616da7d8b42a5f4b8b579a/html5/thumbnails/8.jpg)
¿Quién usa esto?
- - - Stat Hat- Airbrake- Canonical- Novartis- ...
MapReduce
![Page 9: Go, el lenguaje de Google](https://reader034.fdocuments.mx/reader034/viewer/2022042814/55616da7d8b42a5f4b8b579a/html5/thumbnails/9.jpg)
No todo es tan bonito- Binarios gordos - "Alergia" - Garbage collector - Generics
interface{}
3,4 MB
![Page 10: Go, el lenguaje de Google](https://reader034.fdocuments.mx/reader034/viewer/2022042814/55616da7d8b42a5f4b8b579a/html5/thumbnails/10.jpg)
¡Me lo quedo!- Quiero empezar con Go
golang.org
play.golang.org
Download , install & go tour
groups.google.com/groups/golang-nuts
godashboard.appspot.com/project & Cgo
developers.google.com/appengine/doc/go/overview
Sólo
juga
r un
poco
Inicia
rme
Estar al día
En la nubePortar mi librería favorita*
x86
gnu/linux windows mac osx
x86_64 arm
![Page 11: Go, el lenguaje de Google](https://reader034.fdocuments.mx/reader034/viewer/2022042814/55616da7d8b42a5f4b8b579a/html5/thumbnails/11.jpg)
The 6W- ¿Qué? Lenguaje flexible como Python con la eficiencia de C- ¿Quién? Google y la comunidad de SL- ¿Donde? golang.org- ¿Cómo? Compilando y optimizando el código - ¿Cuándo? Go 1, Marzo 2012- ¿Por qué? Desarrollar más rápido, ejecutar con menos recursos
![Page 12: Go, el lenguaje de Google](https://reader034.fdocuments.mx/reader034/viewer/2022042814/55616da7d8b42a5f4b8b579a/html5/thumbnails/12.jpg)
¡Muchas gracias a todxs!
Presentación QR-disponible+ Info:
@jmrobles robleshermoso.wordpress.com