Intro to GO
Bangkok GO Meetup 2014
English>?
Still learning thai
My Level of thai
Survey the Audience
● Who a hip language, Ruby / Javascript
● Who uses Java / C#
● Has anyone played with GO?
Whats this talk about
● Instant Messenger Server in GO
● Why we chose go
● Basics about go
● How to get started with GO
Who am I ?
Small consulting firm Hyperworks
*Built Bloomberg.com
*Real time ad servers
*Ecommerce sites (gucci,reebok etc)...
What we’re we using
● Instant Messaging Server / Client
● Backend 100% GO
● 300k user base of financial traders!
● 20 Mega...
Why GO?
C++
● Dying
● Hard to hire people
● Nothing new happening
● Not cool
Java
● Slow to code
● Very verbose
● Need a much larger team
C#
● Hate windows on a server
GO
● Lightweight concurrency
● Fast development cycle
● Hip with the kids
About GO
●
●
●
●
●
●

Google’s programming language
Garbage collected
Author is Rob Pike (Inventor of unix)
Fast Compilati...
Go is like C/C#/Java
Hello World (Aka a webserver)
import (
"fmt"
"http"
)
func handler(c *http.Conn, r *http.Request) {
f...
Lambdas
For javascript/ruby devs
valueToCloseOver := "My name is HAL."
anon := func(s string) string {
return "Hiya, " + n...
Go Routines
● Lightweight threads
● Easy concurrency
● Like Erlang, communicate instead of sharing
memory
Channels
● Container for messages between go routines
● Concorrent safe
Code samples
c := make(chan int) // Allocate a channel.
// Start the sort in a goroutine; when it completes, signal on the...
No inheritance
● Interfaces over inheritance
● Duck typing
● Composition
Example interface code
type Stringer interface {
String() string
}
var value interface{} // Value provided by caller.
swit...
Things not so good
● Windows support
● Small number of libraries
● Community still small but growing
How to get started
● http://play.golang.org/
● http://golang.org/doc/
Q/A
Thanks!

Btw We’re Hiring !
Intro to GO (Bangkok Launchpad 2014)
Intro to GO (Bangkok Launchpad 2014)
Intro to GO (Bangkok Launchpad 2014)
Intro to GO (Bangkok Launchpad 2014)
Upcoming SlideShare
Loading in …5
×

Intro to GO (Bangkok Launchpad 2014)

585 views

Published on

Introduction to GO programming language done in Bangkok at Launchpad

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
585
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Intro to GO (Bangkok Launchpad 2014)

  1. 1. Intro to GO Bangkok GO Meetup 2014
  2. 2. English>? Still learning thai
  3. 3. My Level of thai
  4. 4. Survey the Audience ● Who a hip language, Ruby / Javascript ● Who uses Java / C# ● Has anyone played with GO?
  5. 5. Whats this talk about ● Instant Messenger Server in GO ● Why we chose go ● Basics about go ● How to get started with GO
  6. 6. Who am I ? Small consulting firm Hyperworks *Built Bloomberg.com *Real time ad servers *Ecommerce sites (gucci,reebok etc) *Thomson Reuters Messenger Client/Server
  7. 7. What we’re we using ● Instant Messaging Server / Client ● Backend 100% GO ● 300k user base of financial traders! ● 20 Megabits of sustained traffic
  8. 8. Why GO?
  9. 9. C++ ● Dying ● Hard to hire people ● Nothing new happening ● Not cool
  10. 10. Java ● Slow to code ● Very verbose ● Need a much larger team
  11. 11. C# ● Hate windows on a server
  12. 12. GO ● Lightweight concurrency ● Fast development cycle ● Hip with the kids
  13. 13. About GO ● ● ● ● ● ● Google’s programming language Garbage collected Author is Rob Pike (Inventor of unix) Fast Compilations Fast Runtime Easy to learn
  14. 14. Go is like C/C#/Java Hello World (Aka a webserver) import ( "fmt" "http" ) func handler(c *http.Conn, r *http.Request) { fmt.Fprintf(c, "Hello, %s.n", r.URL.Path[1:]) } func main() { http.ListenAndServe(":8080", http.HandlerFunc(handler)) }
  15. 15. Lambdas For javascript/ruby devs valueToCloseOver := "My name is HAL." anon := func(s string) string { return "Hiya, " + name + ". " + valueToCloseOver } anotherFunction(anon)
  16. 16. Go Routines ● Lightweight threads ● Easy concurrency ● Like Erlang, communicate instead of sharing memory
  17. 17. Channels ● Container for messages between go routines ● Concorrent safe
  18. 18. Code samples c := make(chan int) // Allocate a channel. // Start the sort in a goroutine; when it completes, signal on the channel. go func() { list.Sort() c <- 1 // Send a signal; value does not matter. }() doSomethingForAWhile() <-c // Wait for sort to finish; discard sent value.
  19. 19. No inheritance ● Interfaces over inheritance ● Duck typing ● Composition
  20. 20. Example interface code type Stringer interface { String() string } var value interface{} // Value provided by caller. switch str := value.(type) { case string: return str case Stringer: return str.String() }
  21. 21. Things not so good ● Windows support ● Small number of libraries ● Community still small but growing
  22. 22. How to get started ● http://play.golang.org/ ● http://golang.org/doc/
  23. 23. Q/A
  24. 24. Thanks! Btw We’re Hiring !

×