SlideShare a Scribd company logo
1 of 13
Getting started with Go
8/7/2023 #golang 2
Ben Jones
Language invented by:
Rob Pike Ken Thompson
8/7/2023 #golang 3
Rob Pike wrote books like…
8/7/2023 #golang 4
Ken Thompson wrote operating
systems like…
8/7/2023 #golang 5
All the cool new stuff is go...
8/7/2023 #golang 6
golang features
• Keep most of expressiveness of dynamic
languages, gain speed
• C-like, statically linked, garbage collected
• Fast compilation
• Nice build / compile tools
• A reaction to C++ but won converts from
python/ruby devs
8/7/2023 #golang 7
Nice dev environment
• go get libraries
$ go get github.com/mefellows/muxy
$ ls $GOPATH/src/github.com/mefellows/muxy
LICENSE README.md examples main.go
muxy scripts version.go Makefile
command log middleware protocol
symptom wercker.yml
8/7/2023 #golang 8
No unused stuff
8/7/2023 #golang 9
http://tour.golang.org
http://play.golang.org
Run everywhere
• X-Compile is trivial
$ GOOS=windows GOARCH=386 go build -o egroupexpand.exe
egroupexpand.go
$ ls -l
total 19344
-rwxr-xr-x 1 ben staff 5445348 Aug 27 10:33 egroupexpand
-rwxr-xr-x 1 ben staff 4449792 Sep 29 10:44
egroupexpand.exe
-rw-r--r-- 1 ben staff 3075 Aug 27 10:33
egroupexpand.go
• No worrying about dependency versions:
[bejones@aiadm060 ~]$ python -V
Python 2.6.6
8/7/2023 #golang 10
OO without loads of cruft
• types and values instead of classes and
objects
• methods on any user-defined type
• polymorphism with interfaces
• namespacing with exports
• no inheritance
• can extend types by embedding
8/7/2023 #golang 11
Concurrency
• concurrency not parallelism (though
GOMAXPROCS can help with latter)
• “Do not communicate by sharing memory;
instead share memory by communicating”
• Goroutines: function executing concurrently
with other goroutines in same address space
• created by prefixing func or method call with “go”
• Channels - pipes that connect goroutines
8/7/2023 #golang 12
learning resources
• http://tour.golang.org
• https://golang.org/doc/effective_go.html
• https://golang-for-python-
programmers.readthedocs.org/en/latest/
• http://blog.golang.org/concurrency-is-not-
parallelism
• http://www.youtube.com/watch?v=jgVhBThJ
dXc
• https://www.golang-book.com
8/7/2023 #golang 13

More Related Content

Similar to lightning_go.pptx

Similar to lightning_go.pptx (20)

A First Look at Google's Go Programming Language
A First Look at Google's Go Programming LanguageA First Look at Google's Go Programming Language
A First Look at Google's Go Programming Language
 
Golang taipei #45 10th birthday
Golang taipei #45 10th birthdayGolang taipei #45 10th birthday
Golang taipei #45 10th birthday
 
Modern PHP
Modern PHPModern PHP
Modern PHP
 
Comparing C and Go
Comparing C and GoComparing C and Go
Comparing C and Go
 
Gomobile: gophers in the land of Android
Gomobile: gophers in the land of AndroidGomobile: gophers in the land of Android
Gomobile: gophers in the land of Android
 
welcome to gopherlabs - why go (golang)?
welcome to gopherlabs - why go (golang)?welcome to gopherlabs - why go (golang)?
welcome to gopherlabs - why go (golang)?
 
Google GO
Google GOGoogle GO
Google GO
 
An introduction to go programming language
An introduction to go programming languageAn introduction to go programming language
An introduction to go programming language
 
Introduction to Go
Introduction to GoIntroduction to Go
Introduction to Go
 
Write microservice in golang
Write microservice in golangWrite microservice in golang
Write microservice in golang
 
The Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventureThe Go programming language - Intro by MyLittleAdventure
The Go programming language - Intro by MyLittleAdventure
 
Go programing language
Go programing languageGo programing language
Go programing language
 
Getting started with Go - Florin Patan - Codemotion Rome 2017
Getting started with Go - Florin Patan - Codemotion Rome 2017Getting started with Go - Florin Patan - Codemotion Rome 2017
Getting started with Go - Florin Patan - Codemotion Rome 2017
 
Why and what is go
Why and what is goWhy and what is go
Why and what is go
 
Golang skills session1: introduction
Golang skills session1: introductionGolang skills session1: introduction
Golang skills session1: introduction
 
Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3
 
Beginning development in go
Beginning development in goBeginning development in go
Beginning development in go
 
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
 
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
Daniele Esposti - Evolution or stagnation programming languages - Codemotion ...
 
AddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based ProgrammingAddisDev Meetup ii: Golang and Flow-based Programming
AddisDev Meetup ii: Golang and Flow-based Programming
 

More from ssuser4ca1eb (8)

go.ppt
go.pptgo.ppt
go.ppt
 
Von Neuman vs Harward.docx
Von Neuman vs Harward.docxVon Neuman vs Harward.docx
Von Neuman vs Harward.docx
 
UNIT I_Introduction.pptx
UNIT I_Introduction.pptxUNIT I_Introduction.pptx
UNIT I_Introduction.pptx
 
12429908.ppt
12429908.ppt12429908.ppt
12429908.ppt
 
13009690.ppt
13009690.ppt13009690.ppt
13009690.ppt
 
UNIT 3.pptx
UNIT 3.pptxUNIT 3.pptx
UNIT 3.pptx
 
Ch01_Intro_to_Embedded_Systems.pptx
Ch01_Intro_to_Embedded_Systems.pptxCh01_Intro_to_Embedded_Systems.pptx
Ch01_Intro_to_Embedded_Systems.pptx
 
Lec01_Course_Overview.ppt
Lec01_Course_Overview.pptLec01_Course_Overview.ppt
Lec01_Course_Overview.ppt
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
httgc7rh9c
 

Recently uploaded (20)

What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

lightning_go.pptx

  • 1.
  • 2. Getting started with Go 8/7/2023 #golang 2 Ben Jones
  • 3. Language invented by: Rob Pike Ken Thompson 8/7/2023 #golang 3
  • 4. Rob Pike wrote books like… 8/7/2023 #golang 4
  • 5. Ken Thompson wrote operating systems like… 8/7/2023 #golang 5
  • 6. All the cool new stuff is go... 8/7/2023 #golang 6
  • 7. golang features • Keep most of expressiveness of dynamic languages, gain speed • C-like, statically linked, garbage collected • Fast compilation • Nice build / compile tools • A reaction to C++ but won converts from python/ruby devs 8/7/2023 #golang 7
  • 8. Nice dev environment • go get libraries $ go get github.com/mefellows/muxy $ ls $GOPATH/src/github.com/mefellows/muxy LICENSE README.md examples main.go muxy scripts version.go Makefile command log middleware protocol symptom wercker.yml 8/7/2023 #golang 8
  • 9. No unused stuff 8/7/2023 #golang 9 http://tour.golang.org http://play.golang.org
  • 10. Run everywhere • X-Compile is trivial $ GOOS=windows GOARCH=386 go build -o egroupexpand.exe egroupexpand.go $ ls -l total 19344 -rwxr-xr-x 1 ben staff 5445348 Aug 27 10:33 egroupexpand -rwxr-xr-x 1 ben staff 4449792 Sep 29 10:44 egroupexpand.exe -rw-r--r-- 1 ben staff 3075 Aug 27 10:33 egroupexpand.go • No worrying about dependency versions: [bejones@aiadm060 ~]$ python -V Python 2.6.6 8/7/2023 #golang 10
  • 11. OO without loads of cruft • types and values instead of classes and objects • methods on any user-defined type • polymorphism with interfaces • namespacing with exports • no inheritance • can extend types by embedding 8/7/2023 #golang 11
  • 12. Concurrency • concurrency not parallelism (though GOMAXPROCS can help with latter) • “Do not communicate by sharing memory; instead share memory by communicating” • Goroutines: function executing concurrently with other goroutines in same address space • created by prefixing func or method call with “go” • Channels - pipes that connect goroutines 8/7/2023 #golang 12
  • 13. learning resources • http://tour.golang.org • https://golang.org/doc/effective_go.html • https://golang-for-python- programmers.readthedocs.org/en/latest/ • http://blog.golang.org/concurrency-is-not- parallelism • http://www.youtube.com/watch?v=jgVhBThJ dXc • https://www.golang-book.com 8/7/2023 #golang 13