an introduction to_golang.avi
TRANSCRIPT
An Introduction to GolangSeongJae Park <[email protected]>
This work by SeongJae Park is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To
view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/.
These slides were presented during 16th TechTalk@Pangyo
(https://www.facebook.com/events/1674282256125660/1674377356116150/)
Disclaimer
I am not professional Gopher
I respect other languages
Golang: Programming Language
● “Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.”, http://golang.org
http://blog.golang.org/5years/gophers5th.jpg
Why They Are Developing Golang?
● So many pains without perfect solution in currently available system languages
○ Computers are being faster, but development speed is not○ Dependency management is hard; It makes build task slower○ Dynamically typed languages are dangerous and slow○ Garbage collection is not supported well○ Number of cores per computer is growing
Why They Are Developing Golang?
● So many pains without perfect solution in currently available system languages
○ Computers are being faster, but development speed is not○ Dependency management is hard; It makes build task slower○ Dynamically typed languages are dangerous and slow○ Garbage collection is not supported well○ Number of cores per computer is growing
● Sometimes, restarting is the solution○ Use package concept for simpler dependency management○ Typed language with syntax that is easy to type like dynamically typed languages○ Garbage collection based (garbage collection optimization is going on)○ CSP based concurrency support
Live Coding Now...
I will program a web server now, at here
The program is inspired from the outyet(https://github.com/golang/example/tree/master/outyet)
Live Coding Now...
● Now, you understand…○ Package system (helps dependency management)○ Function (Consistent syntax)○ Variable declaration with explicit / implicit type declaration
https://github.com/sjp38/techtalk_outyet/blob/ebd4f1f70a47aacb18d92fe1db4f407eac7980d5/main.go
Live Coding Now...
● Now, you understand…○ Package system (helps dependency management)○ Function (Consistent syntax)○ Variable declaration with explicit / implicit type declaration○ Struct, type, method, and interface (Composition, not inheritance)
https://github.com/sjp38/techtalk_outyet/blob/e03ce235be9ef99e46297f53139189a9b76e391b/main.go
Live Coding Now...
● Now, you understand…○ Package system (helps dependency management)○ Function (Consistent syntax)○ Variable declaration with explicit / implicit type declaration○ Struct, type, method, and interface (Composition, not inheritance)○ Concurrency using goroutine (Not thread, not co-routine)
https://github.com/sjp38/techtalk_outyet/blob/d6d0d7ed1503a1697356cee54b503b47462c9398/main.go
Live Coding Now...
● Now, you understand…○ Package system (helps dependency management)○ Function (Consistent syntax)○ Variable declaration with explicit / implicit type declaration○ Struct, type, method, and interface (Composition, not inheritance)○ Concurrency using goroutine (Not thread, not co-routine)○ Communication between goroutine using channel
https://github.com/sjp38/techtalk_outyet/blob/8248c6fd2bc524e991fa18448ca99bb30d288b18/main.go
What Makes Golang So Special on Multicore?
I will explain about that with Dave Chenny’s OSCON’15 presentation (not mine)
http://cdn.oreillystatic.com/en/assets/1/event/129/High%20performance%20servers%20without%20the%20event%20loop%20Presentation.pdf
Thank You
http://jeancharpentier.files.wordpress.com/2012/02/capture-plein-c3a9cran-01022012-230955.jpg