SlideShare a Scribd company logo
Golang from	
  Scala	
  
developer’s	
  perspective
About	
  me
Svetlana	
  Bozhko
Backend	
  Scala	
  Developer	
  @	
  Adform
The	
  goal
Is	
  Go	
  really	
  so	
  bad imperative?
Content
Short	
  intro	
  into	
  Go
Tooling	
  
FP	
  vs.	
  Go
IMHO
Usage
https://github.com/golang/go/wiki/GoUsers
Golang from Scala developer’s perspective
How	
  to	
  start?
http://tour.golang.org/
http://golangshow.com/
Go
Good	
  parts
Go	
  is	
  actually	
  a	
  pretty	
  
simple	
  language!
Even	
  too	
  simple	
  for	
  2015
Golang from Scala developer’s perspective
Advanced	
  GC
“Build	
  time	
  matters	
  more	
  
than	
  anything	
  else”	
  -­‐ Rob	
  Pike
gofmt
Quite	
  good	
  tools
build-­‐in	
  (version,	
  get,	
  build,	
  …)
editors	
  (vim,	
  intellij,	
  sublime,	
  …)
Concurrency
• Channels
send	
  data	
  between	
  threads	
  easily,	
  
asynchronously	
  or	
  synchronously
• GoRoutines
spin	
  up	
  another	
  thread,	
  just	
  like	
  that!
No	
  Language	
  Is	
  Perfect...
Go	
  Mentality
• Smallest	
  possible	
  feature	
  set
• It’s	
  okay	
  to	
  copy	
  some	
  code	
  
• Productivity	
  instead	
  of	
  hyper-­‐elegant	
  code
Let’s	
  get	
  rid	
  of
• Implicit	
  numeric	
  conversion	
  (int !=	
  int32)
• ‘Implements’	
  keyword
• ‘Classes’
• Constructor/destructor
• Function	
  overloading
• Pointer	
  arithmetic	
  
• Exceptions	
  and	
  try/catch
• Generics
• …
Strict	
  compiler
which	
  interrupts	
  you	
  sometimes
Wait,	
  Go	
  has	
  ‘goto’?
Wait,	
  how	
  to	
  debug?
GDB,	
  but	
  it’s	
  not	
  very	
  good	
  way
Dependency	
  
management
vendor	
  (since	
  1.5)	
  
FP	
  vs.	
  Go
Wikipedia:
“Functional	
  programming is	
  a programming	
  paradigm	
  
— a	
  style	
  of	
  building	
  the	
  structure	
  and	
  elements	
  of	
  
computer	
  programs	
  — that	
  treats computation as	
  the	
  
evaluation	
  of mathematical	
  functions and	
  avoids	
  
changing-­‐state and mutable data.”	
  
What	
  it	
  means?
No	
  mutable	
  data	
  (no	
  side	
  effect)
No	
  mutable	
  state	
  (no	
  implicit,	
  hidden	
  state)
Same	
  result	
  returned	
  by	
  functions	
  called	
  with	
  the	
  same	
  inputs
Functions	
  are	
  pure	
  functions	
  in	
  the	
  mathematical	
  sense
Advantages?
Cleaner	
  code
Referential	
  transparency
Referential	
  transparency
Memoization
Cache	
  results
Idempotence
Modularization
We	
  have	
  no	
  state
Ease	
  of	
  debugging
Functions	
  are	
  isolated	
  and	
  very	
  easy	
  to	
  debug
Referential	
  transparency
Parallelization
Functions	
  calls	
  are	
  independent	
  
We	
  can	
  parallelize	
  in	
  different	
  process/CPUs/computers/...	
  
res	
  =	
  func1(a,	
  b)	
  +	
  func2(a,	
  c)
Referential	
  transparency
With	
  no	
  shared	
  data,	
  concurrencygets	
  a	
  lot	
  simpler:
No	
  semaphores
No	
  monitors	
  
No	
  locks
No	
  race-­‐conditions
No	
  dead-­‐locks
Nonetheless
Golang has	
  built-­‐in	
  “sync”	
  package	
  with	
  mutexes
Don’t	
  Update,	
  Create!
String
Arrays
Maps
Higher	
  order	
  functions
FP	
  libraries
https://github.com/yanatan16/itertools
https://github.com/tobyhede/go-­‐underscore
Higher	
  order	
  functions
Map
Filter
Reduce
Closures
Currying	
  and	
  Partial	
  
Functions
Eager	
  vs	
  Lazy	
  Evaluation
Golang channels	
  and	
  goroutines enable	
  the	
  
creation	
  of	
  generators	
  that	
  could	
  be	
  a	
  way	
  to	
  have	
  
lazy	
  evaluation
Recursion
FP	
  &	
  OOP
It	
  is	
  possible	
  do	
  FP	
  in	
  OOP?	
  
Yes	
  it	
  is!
OOP	
  is	
  orthogonal	
  to	
  FP.	
  At	
  least	
  in	
  theory…
Exercise!
What	
  is	
  the	
  sum	
  of	
  the	
  first	
  10	
  natural	
  number	
  
whose	
  square	
  value	
  is	
  divisible	
  by	
  2?
Exercise!
Imperative Functional
Learn	
  at	
  least	
  one	
  
functional	
  language
It	
  will	
  open	
  your	
  mind	
  to	
  a	
  new	
  paradigm	
  
becoming	
  you	
  a	
  better	
  programmer
Conclusion
Technologies	
  are	
  awesome!	
  
The	
  problem	
  is	
  people how	
  we	
  use	
  them.
Thank	
  you!
Questions?
Svetlana	
  Bozhko aka	
  @SBozhko
http://devzen.ru/
svt.bozhko@gmail.com
Links
https://golang-­‐ru.slack.com/messages
https://www.youtube.com/watch?list=PLPHSBhlVt
TyfwIKn7r_a5xkzzMu-­‐iey-­‐w&v=cGXorQkw3JE

More Related Content

PPTX
Wonders of Golang
PDF
GoLang Introduction
PPTX
PPTX
Golang - Overview of Go (golang) Language
PDF
Building Command Line Tools with Golang
PPT
A First Look at Google's Go Programming Language
PDF
An introduction to go programming language
PPTX
Introduction to GoLang
Wonders of Golang
GoLang Introduction
Golang - Overview of Go (golang) Language
Building Command Line Tools with Golang
A First Look at Google's Go Programming Language
An introduction to go programming language
Introduction to GoLang

What's hot (20)

PDF
Coding with golang
PDF
Go Programming Language by Google
PDF
The Go programming language - Intro by MyLittleAdventure
PDF
Go language presentation
PDF
Golang #5: To Go or not to Go
PPTX
Optimizing and Profiling Golang Rest Api
PPTX
Introduction to go lang
PDF
PPT
Come With Golang
PDF
Why you should care about Go (Golang)
PDF
Inroduction to golang
PPTX
Go Programming language, golang
PDF
Dependency management in golang
PDF
[INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
PDF
Understanding how concurrency work in os
PPTX
PDF
welcome to gopherlabs - why go (golang)?
PPTX
ATO 2014 - So You Think You Know 'Go'? The Go Programming Language
PDF
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
Coding with golang
Go Programming Language by Google
The Go programming language - Intro by MyLittleAdventure
Go language presentation
Golang #5: To Go or not to Go
Optimizing and Profiling Golang Rest Api
Introduction to go lang
Come With Golang
Why you should care about Go (Golang)
Inroduction to golang
Go Programming language, golang
Dependency management in golang
[INNOVATUBE] Tech Talk #3: Golang - Takaaki Mizuno
Understanding how concurrency work in os
welcome to gopherlabs - why go (golang)?
ATO 2014 - So You Think You Know 'Go'? The Go Programming Language
Mphasis Digital - Use Go (gloang) for system programming, distributed systems...
Ad

Similar to Golang from Scala developer’s perspective (20)

PDF
Functional go
KEY
Google Go Overview
PDF
Functional Go
PPTX
Golang 101 (Concurrency vs Parallelism)
PDF
Introduction to functional programming
PDF
Go Lang Tutorial
PDF
Introduction to Programming in Go
PPTX
Go fundamentals
PPTX
Why functional programming in C# & F#
PPTX
PDF
Concurrent Programming in Go basics and programming
ODP
Ready to go
PPTX
Intro f# functional_programming
KEY
Beauty and Power of Go
PDF
Geeks Anonymes - Le langage Go
PPTX
The GO Language : From Beginners to Gophers
PPTX
Functional Programming Fundamentals
PDF
Go introduction
PPTX
go language- haseeb.pptx
PDF
Introduction to Functional Programming
Functional go
Google Go Overview
Functional Go
Golang 101 (Concurrency vs Parallelism)
Introduction to functional programming
Go Lang Tutorial
Introduction to Programming in Go
Go fundamentals
Why functional programming in C# & F#
Concurrent Programming in Go basics and programming
Ready to go
Intro f# functional_programming
Beauty and Power of Go
Geeks Anonymes - Le langage Go
The GO Language : From Beginners to Gophers
Functional Programming Fundamentals
Go introduction
go language- haseeb.pptx
Introduction to Functional Programming
Ad

Recently uploaded (20)

PDF
Sensors and Actuators in IoT Systems using pdf
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Electronic commerce courselecture one. Pdf
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
KodekX | Application Modernization Development
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Transforming Manufacturing operations through Intelligent Integrations
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Cloud computing and distributed systems.
Sensors and Actuators in IoT Systems using pdf
GamePlan Trading System Review: Professional Trader's Honest Take
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Dropbox Q2 2025 Financial Results & Investor Presentation
Electronic commerce courselecture one. Pdf
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
KodekX | Application Modernization Development
Spectral efficient network and resource selection model in 5G networks
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
NewMind AI Monthly Chronicles - July 2025
Big Data Technologies - Introduction.pptx
Understanding_Digital_Forensics_Presentation.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Transforming Manufacturing operations through Intelligent Integrations
Diabetes mellitus diagnosis method based random forest with bat algorithm
Chapter 3 Spatial Domain Image Processing.pdf
Cloud computing and distributed systems.

Golang from Scala developer’s perspective