15
An Introduction to Golang SeongJae Park <[email protected]>

An introduction to_golang.avi

Embed Size (px)

Citation preview

Page 1: An introduction to_golang.avi

An Introduction to GolangSeongJae Park <[email protected]>

Page 2: An introduction to_golang.avi

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/.

Page 3: An introduction to_golang.avi

These slides were presented during 16th TechTalk@Pangyo

(https://www.facebook.com/events/1674282256125660/1674377356116150/)

Page 4: An introduction to_golang.avi

Nice To Meet You

SeongJae Park

[email protected]

golang newbie programmer

Page 5: An introduction to_golang.avi

Disclaimer

I am not professional Gopher

I respect other languages

Page 6: An introduction to_golang.avi

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

Page 7: An introduction to_golang.avi

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

Page 8: An introduction to_golang.avi

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

Page 9: An introduction to_golang.avi

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)

Page 10: An introduction to_golang.avi

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

Page 11: An introduction to_golang.avi

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

Page 12: An introduction to_golang.avi

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

Page 13: An introduction to_golang.avi

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

Page 14: An introduction to_golang.avi

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

Page 15: An introduction to_golang.avi

Thank You

http://jeancharpentier.files.wordpress.com/2012/02/capture-plein-c3a9cran-01022012-230955.jpg