SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
Are we ready to Go? 
Adam Dudczak 
Tomasz Jackowiak
Disclaimer
Who we are?
Why Go?
Heka? Etcd? InfluxDb? 
JuJu?
Top 10?
Not yet ;-)
Why Go?
Been there, done that 
B, C, Java, JavaScript …
• Class free, but object oriented 
• Statically-typed - with elem. of duck typing 
• Garbage collector 
• Compiled - really fast compiler 
• Open source from up to bottom (BSD license) 
• Write once, run anywhere
Show me the code!!!
package main 
! 
import "fmt" 
! 
func main() { 
fmt.Println("Hello, World") 
}
go run
package main 
! 
import "fmt" 
! 
func swap(x, y string) (string, string) { 
return y, x 
} 
! 
func main() { 
a, b := swap("hello", "world") 
fmt.Println(a, b) 
}
package main 
! 
import ( 
"fmt" 
"math" 
) 
! 
type Vertex struct { 
X, Y float64 
} 
! 
func (v *Vertex) Abs() float64 { 
return math.Sqrt(v.X*v.X + v.Y*v.Y) 
} 
! 
func main() { 
v := &Vertex{3, 4} 
fmt.Println(v.Abs()) 
}
Microservice!?!
package main 
! 
import ( 
"io" 
"net/http" 
) 
! 
func main() { 
http.HandleFunc("/", 
func(w http.ResponseWriter, r *http.Request) { 
io.WriteString(w, "hello, worldn") 
}) 
http.ListenAndServe(":8080", nil) 
}
type Quote struct { 
BookTitle string `json:"book_title"` 
Sentence string `json:"sentence"` 
} 
! 
func NewQuotes(quotesFilePath string) ([]Quote, error) { 
fileContent, _ := os.Open(quotesFilePath) 
defer fileContent.Close() 
! 
var quotes []Quote 
decoder := json.NewDecoder(fileContent) 
if err := decoder.Decode(&quotes); err != nil { 
return nil, errors.New("Failed to decode json") 
} 
return quotes, nil 
}
type TwitterClient interface { 
Tweets(screenName string) []string 
} 
! 
! 
type FakeClient struct{} 
! 
func (fake *FakeClient) Tweets(screenName string) []string { 
return []string{"test tweet"} 
} 
! 
! 
func Test_shouldCreateNewPaolo(t *testing.T) { 
twitterClient := &FakeClient{} 
paolo := NewTweetingPaolo(twitterClient) 
assert.NotNil(t, paolo) 
}
go routines
func sleepySort(number int) { 
time.Sleep(time.Duration(number)) 
fmt.Println(number) 
} 
! 
func main() { 
arrayToSort := []int{12, 14, 3, 6, 1, 2} 
for _, val := range arrayToSort { 
sleepySort(val) 
} 
}
func sleepySort(number int) { 
time.Sleep(time.Duration(number)) 
fmt.Println(number) 
} 
! 
func main() { 
arrayToSort := []int{12, 14, 3, 6, 1, 2} 
for _, val := range arrayToSort { 
sleepySort(val) 
} 
} 
output: 12, 14, 3, 6, 1, 2
func sleepySort(number int) { 
time.Sleep(time.Duration(number)) 
fmt.Println(number) 
} 
! 
func main() { 
arrayToSort := []int{12, 14, 3, 6, 1, 2} 
for _, val := range arrayToSort { 
go sleepySort(val) 
} 
}
func sleepySort(number int) { 
time.Sleep(time.Duration(number)) 
fmt.Println(number) 
} 
! 
func main() { 
arrayToSort := []int{12, 14, 3, 6, 1, 2} 
for _, val := range arrayToSort { 
go sleepySort(val) 
} 
} 
output: —
func sleepySort(number int) { 
time.Sleep(time.Duration(number)) 
fmt.Println(number) 
} 
! 
func main() { 
arrayToSort := []int{12, 14, 3, 6, 1, 2} 
for _, val := range arrayToSort { 
go sleepySort(val) 
} 
time.Sleep(1 * time.Second) 
} 
output: 1, 2, 3, 6, 12, 14
channels
func sleepySort(number int, sort chan<- int) { 
time.Sleep(time.Duration(number)) 
sort <- number 
} 
! 
func main() { 
arrayToSort := []int{12, 14, 3, 6, 1, 2} 
sort := make(chan int) 
! 
for _, val := range arrayToSort { 
go sleepySort(val, sort) 
} 
! 
for i := 0; i < len(arrayToSort); i++ { 
fmt.Println(<-sort) 
} 
}
quote := make(chan Quote) 
go func() { quote <- localPaolo.RandomQuote() }() 
go func() { quote <- twittingPaolo.RandomTweet() }() 
go func() { quote <- wisePaolo.RandomHeartQuote() }() 
! 
for i := 0; i < 3; i++ { 
fmt.Println(<-quote) 
}
go get github.com/tjackowiak/coelho
Coding standards
gofmt & co
github / Drone.io / coveralls
Are we ready to Go?
Pros 
• Standing on the shoulders of giant 
• Concise and readable - maybe even fun ;-) 
• Simple and powerful tooling (go run | install | …) 
• Really nice dependency management 
• Language spec - with promise of backward 
compatibility
Cons 
• Relatively new language 
• There is still space to improve how GC works 
• Not a JVM language
It is definately worth trying ;-)
Questions? 
@maneo, @kevorin

Weitere ähnliche Inhalte

Was ist angesagt?

Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and CEleanor McHugh
 
Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my dayTor Ivry
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2goMoriyoshi Koizumi
 
Profiling and optimization
Profiling and optimizationProfiling and optimization
Profiling and optimizationg3_nittala
 
The best of AltJava is Xtend
The best of AltJava is XtendThe best of AltJava is Xtend
The best of AltJava is Xtendtakezoe
 
4. Обработка ошибок, исключения, отладка
4. Обработка ошибок, исключения, отладка4. Обработка ошибок, исключения, отладка
4. Обработка ошибок, исключения, отладкаDEVTYPE
 
The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181Mahmoud Samir Fayed
 
TCO in Python via bytecode manipulation.
TCO in Python via bytecode manipulation.TCO in Python via bytecode manipulation.
TCO in Python via bytecode manipulation.lnikolaeva
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonakaptur
 
Short intro to the Rust language
Short intro to the Rust languageShort intro to the Rust language
Short intro to the Rust languageGines Espada
 
Diving into byte code optimization in python
Diving into byte code optimization in python Diving into byte code optimization in python
Diving into byte code optimization in python Chetan Giridhar
 
Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...
Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...
Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...akaptur
 
Exploring slides
Exploring slidesExploring slides
Exploring slidesakaptur
 

Was ist angesagt? (20)

Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and C
 
dplyr
dplyrdplyr
dplyr
 
Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my day
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
 
Profiling and optimization
Profiling and optimizationProfiling and optimization
Profiling and optimization
 
Go a crash course
Go   a crash courseGo   a crash course
Go a crash course
 
The best of AltJava is Xtend
The best of AltJava is XtendThe best of AltJava is Xtend
The best of AltJava is Xtend
 
4. Обработка ошибок, исключения, отладка
4. Обработка ошибок, исключения, отладка4. Обработка ошибок, исключения, отладка
4. Обработка ошибок, исключения, отладка
 
The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181The Ring programming language version 1.5.2 book - Part 26 of 181
The Ring programming language version 1.5.2 book - Part 26 of 181
 
Let's golang
Let's golangLet's golang
Let's golang
 
TCO in Python via bytecode manipulation.
TCO in Python via bytecode manipulation.TCO in Python via bytecode manipulation.
TCO in Python via bytecode manipulation.
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
 
Java VS Python
Java VS PythonJava VS Python
Java VS Python
 
Introduction to Go for Java Programmers
Introduction to Go for Java ProgrammersIntroduction to Go for Java Programmers
Introduction to Go for Java Programmers
 
FSE 2008
FSE 2008FSE 2008
FSE 2008
 
Short intro to the Rust language
Short intro to the Rust languageShort intro to the Rust language
Short intro to the Rust language
 
Diving into byte code optimization in python
Diving into byte code optimization in python Diving into byte code optimization in python
Diving into byte code optimization in python
 
Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...
Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...
Allison Kaptur: Bytes in the Machine: Inside the CPython interpreter, PyGotha...
 
Exploring slides
Exploring slidesExploring slides
Exploring slides
 
Why Learn Python?
Why Learn Python?Why Learn Python?
Why Learn Python?
 

Ähnlich wie Are we ready to Go?

Go: It's Not Just For Google
Go: It's Not Just For GoogleGo: It's Not Just For Google
Go: It's Not Just For GoogleEleanor McHugh
 
Nik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReactNik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReactOdessaJS Conf
 
Monadologie
MonadologieMonadologie
Monadologieleague
 
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoDeveloper Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoThe Software House
 
GE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingGE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingMuthu Vinayagam
 
Metaprogramming in Haskell
Metaprogramming in HaskellMetaprogramming in Haskell
Metaprogramming in HaskellHiromi Ishii
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript IntroductionHans Höchtl
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)Pavlo Baron
 
여자개발자모임터 6주년 개발 세미나 - Scala Language
여자개발자모임터 6주년 개발 세미나 - Scala Language여자개발자모임터 6주년 개발 세미나 - Scala Language
여자개발자모임터 6주년 개발 세미나 - Scala LanguageAshal aka JOKER
 
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?Tomasz Wrobel
 
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1Little Tukta Lita
 
Empathic Programming - How to write comprehensible code
Empathic Programming - How to write comprehensible codeEmpathic Programming - How to write comprehensible code
Empathic Programming - How to write comprehensible codeMario Gleichmann
 
Python basic
Python basic Python basic
Python basic sewoo lee
 

Ähnlich wie Are we ready to Go? (20)

Go: It's Not Just For Google
Go: It's Not Just For GoogleGo: It's Not Just For Google
Go: It's Not Just For Google
 
SDC - Einführung in Scala
SDC - Einführung in ScalaSDC - Einführung in Scala
SDC - Einführung in Scala
 
Nik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReactNik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReact
 
ddd+scala
ddd+scaladdd+scala
ddd+scala
 
Monadologie
MonadologieMonadologie
Monadologie
 
Developer Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duoDeveloper Experience i TypeScript. Najbardziej ikoniczne duo
Developer Experience i TypeScript. Najbardziej ikoniczne duo
 
GE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingGE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python Programming
 
Metaprogramming in Haskell
Metaprogramming in HaskellMetaprogramming in Haskell
Metaprogramming in Haskell
 
Go Lang Tutorial
Go Lang TutorialGo Lang Tutorial
Go Lang Tutorial
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
Music as data
Music as dataMusic as data
Music as data
 
What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)What can be done with Java, but should better be done with Erlang (@pavlobaron)
What can be done with Java, but should better be done with Erlang (@pavlobaron)
 
여자개발자모임터 6주년 개발 세미나 - Scala Language
여자개발자모임터 6주년 개발 세미나 - Scala Language여자개발자모임터 6주년 개발 세미나 - Scala Language
여자개발자모임터 6주년 개발 세미나 - Scala Language
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
โปรแกรมย่อยและฟังชั่นมาตรฐาน ม.6 1
 
Empathic Programming - How to write comprehensible code
Empathic Programming - How to write comprehensible codeEmpathic Programming - How to write comprehensible code
Empathic Programming - How to write comprehensible code
 
Python basic
Python basic Python basic
Python basic
 

Kürzlich hochgeladen

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Kürzlich hochgeladen (20)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

Are we ready to Go?

  • 1. Are we ready to Go? Adam Dudczak Tomasz Jackowiak
  • 4.
  • 5.
  • 8.
  • 12. Been there, done that B, C, Java, JavaScript …
  • 13. • Class free, but object oriented • Statically-typed - with elem. of duck typing • Garbage collector • Compiled - really fast compiler • Open source from up to bottom (BSD license) • Write once, run anywhere
  • 14. Show me the code!!!
  • 15. package main ! import "fmt" ! func main() { fmt.Println("Hello, World") }
  • 17. package main ! import "fmt" ! func swap(x, y string) (string, string) { return y, x } ! func main() { a, b := swap("hello", "world") fmt.Println(a, b) }
  • 18. package main ! import ( "fmt" "math" ) ! type Vertex struct { X, Y float64 } ! func (v *Vertex) Abs() float64 { return math.Sqrt(v.X*v.X + v.Y*v.Y) } ! func main() { v := &Vertex{3, 4} fmt.Println(v.Abs()) }
  • 20. package main ! import ( "io" "net/http" ) ! func main() { http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { io.WriteString(w, "hello, worldn") }) http.ListenAndServe(":8080", nil) }
  • 21.
  • 22.
  • 23. type Quote struct { BookTitle string `json:"book_title"` Sentence string `json:"sentence"` } ! func NewQuotes(quotesFilePath string) ([]Quote, error) { fileContent, _ := os.Open(quotesFilePath) defer fileContent.Close() ! var quotes []Quote decoder := json.NewDecoder(fileContent) if err := decoder.Decode(&quotes); err != nil { return nil, errors.New("Failed to decode json") } return quotes, nil }
  • 24. type TwitterClient interface { Tweets(screenName string) []string } ! ! type FakeClient struct{} ! func (fake *FakeClient) Tweets(screenName string) []string { return []string{"test tweet"} } ! ! func Test_shouldCreateNewPaolo(t *testing.T) { twitterClient := &FakeClient{} paolo := NewTweetingPaolo(twitterClient) assert.NotNil(t, paolo) }
  • 26. func sleepySort(number int) { time.Sleep(time.Duration(number)) fmt.Println(number) } ! func main() { arrayToSort := []int{12, 14, 3, 6, 1, 2} for _, val := range arrayToSort { sleepySort(val) } }
  • 27. func sleepySort(number int) { time.Sleep(time.Duration(number)) fmt.Println(number) } ! func main() { arrayToSort := []int{12, 14, 3, 6, 1, 2} for _, val := range arrayToSort { sleepySort(val) } } output: 12, 14, 3, 6, 1, 2
  • 28. func sleepySort(number int) { time.Sleep(time.Duration(number)) fmt.Println(number) } ! func main() { arrayToSort := []int{12, 14, 3, 6, 1, 2} for _, val := range arrayToSort { go sleepySort(val) } }
  • 29. func sleepySort(number int) { time.Sleep(time.Duration(number)) fmt.Println(number) } ! func main() { arrayToSort := []int{12, 14, 3, 6, 1, 2} for _, val := range arrayToSort { go sleepySort(val) } } output: —
  • 30. func sleepySort(number int) { time.Sleep(time.Duration(number)) fmt.Println(number) } ! func main() { arrayToSort := []int{12, 14, 3, 6, 1, 2} for _, val := range arrayToSort { go sleepySort(val) } time.Sleep(1 * time.Second) } output: 1, 2, 3, 6, 12, 14
  • 32. func sleepySort(number int, sort chan<- int) { time.Sleep(time.Duration(number)) sort <- number } ! func main() { arrayToSort := []int{12, 14, 3, 6, 1, 2} sort := make(chan int) ! for _, val := range arrayToSort { go sleepySort(val, sort) } ! for i := 0; i < len(arrayToSort); i++ { fmt.Println(<-sort) } }
  • 33. quote := make(chan Quote) go func() { quote <- localPaolo.RandomQuote() }() go func() { quote <- twittingPaolo.RandomTweet() }() go func() { quote <- wisePaolo.RandomHeartQuote() }() ! for i := 0; i < 3; i++ { fmt.Println(<-quote) }
  • 37. github / Drone.io / coveralls
  • 38. Are we ready to Go?
  • 39. Pros • Standing on the shoulders of giant • Concise and readable - maybe even fun ;-) • Simple and powerful tooling (go run | install | …) • Really nice dependency management • Language spec - with promise of backward compatibility
  • 40. Cons • Relatively new language • There is still space to improve how GC works • Not a JVM language
  • 41. It is definately worth trying ;-)