Adopting Elixir in a 10
Year Old Codebase
Michael Klishin, Pivotal Software Inc.
Who am I?
Who am I?
• Yada Yada Yada Staff Software Engineer at
Pivotal
Who am I?
• Yada Yada Yada Staff Software Engineer at
Pivotal
• RabbitMQ core team member
About this talk
About this talk
• This is an experience report
About this talk
• This is an experience report
• Some arguments may be subjective or team-
specific, YMMV
What's the Project?
What's the Project?
• RabbitMQ
What's the Project?
• RabbitMQ
• Started in 2006, before Elixir (Rebar, Lager,
Cowboy, Ranch, dinosaurs, …) existed
What's the Project?
• RabbitMQ
• Started in 2006, before Elixir (Rebar, Lager,
Cowboy, Ranch, dinosaurs, …) existed
• Lots of wheels invented, some are not very round
What's the Project?
• RabbitMQ
• Started in 2006, before Elixir (Rebar, Lager,
Cowboy, Ranch, dinosaurs, …) existed
• Lots of wheels invented, some are not very round
• New team with a new perspective on things in
the last ~ 2 years
What's the Project?
• 7 engineers + ~ 3 active contributors, all kinds of
backgrounds (Erlang, Java, C#/F#, C, …)
What's the Project?
• 7 engineers + ~ 3 active contributors, all kinds of
backgrounds (Erlang, Java, C#/F#, C, …)
• Includes several client libraries we maintain, lots
of plugins
What's the Project?
• 7 engineers + ~ 3 active contributors, all kinds of
backgrounds (Erlang, Java, C#/F#, C, …)
• Includes several client libraries we maintain, lots
of plugins
• There are projects at Pivotal that depend on what
we do
How do we use Elixir?
How do we use Elixir?
• All core CLI tools as of 3.7.0
How do we use Elixir?
• All core CLI tools as of 3.7.0
• Experimental plugins
How do we use Elixir?
• All core CLI tools as of 3.7.0
• Experimental plugins
• Future tools and plugins
How do we use Elixir?
• All core CLI tools as of 3.7.0
• Experimental plugins
• Future tools and plugins
• Recruitment honey pot (discovered accidentally)
😂
Why Elixir?
Why new CLI tools?
• Homegrown CLI option parser is meh
Why new CLI tools?
• Homegrown CLI option parser is meh
• CLI tools are too tied to the server, non-
extensible
Why new CLI tools?
• Homegrown CLI option parser is meh
• CLI tools are too tied to the server, non-
extensible
• A project-within-a-project
Why Elixir?
Why Elixir?
• Elixir's OptionParser seems to be inspired by
Ruby & Python ones
Why Elixir?
• Elixir's OptionParser seems to be inspired by
Ruby & Python ones
• Associative data structures in Elixir are a solid
improvement over Erlang's
Why Elixir?
• Elixir's OptionParser seems to be inspired by
Ruby & Python ones
• Associative data structures in Elixir are a solid
improvement over Erlang's
• Interoperability with Erlang makes it very easy to
try
Why Elixir?
• Elixir's OptionParser seems to be inspired by Ruby
& Python ones
• Associative data structures in Elixir are a solid
improvement over Erlang's
• Interoperability with Erlang makes it very easy to
try
• We had over 50 repos already, one more wouldn't
hurt
Why Elixir
• Unicode is not an afterthought
Why Elixir
• Unicode is not an afterthought
• More approachable to other teams
Why Elixir
• Unicode is not an afterthought
• More approachable to other teams
• A very low risk endeavour for products already
running on BEAM
How did it go?
How did it go?
• Next feature release will include the new CLI
tools in Elixir
How did it go?
• Next feature release will include the new CLI
tools in Elixir
• Close to 70 commands, ~ 750 tests, ~ 8K lines of
code
How did it go?
• Next feature release will include the new CLI
tools in Elixir
• Close to 70 commands, ~ 750 tests, ~ 8K lines of
code
• New features: extensibility from plugins, result
set streaming for listing commands, much better
argument validation, …
How did it go?
• Next feature release will include the new CLI tools
in Elixir
• Close to 70 commands, ~ 750 tests, ~ 8K lines of
code
• New features: extensibility from plugins, result set
streaming for listing commands, much better
argument validation, …
• Well received by other teams at Pivotal 👍
How did it go?
How did it go?
• Quickly adopted by folks without prior Elixir and
virtually no Erlang experience 👍
How did it go?
• Quickly adopted by folks without prior Elixir and
virtually no Erlang experience 👍
• Very decent standard library 👍
How did it go?
• Quickly adopted by folks without prior Elixir and
virtually no Erlang experience 👍
• Very decent standard library 👍
• ExUnit is up there with Spock, RSpec 👍
How did it go?
• Quickly adopted by folks without prior Elixir and
virtually no Erlang experience 👍
• Very decent standard library 👍
• ExUnit is up there with Spock, RSpec 👍
• Error messages in Elixir are more sensible 👍
How did it go?
• Tooling and dependency management from this
century 👍
How did it go?
• Tooling and dependency management from this
century 👍
• Upgrading between Elixir versions was very easy
😍
How did it go?
• Tooling and dependency management from this
century 👍
• Upgrading between Elixir versions was very easy
😍
• Some Elixir libraries are better than their Erlang
alternatives 🐼
How did it go?
How did it go?
• Integration with erlang.mk 😣
How did it go?
• Integration with erlang.mk 😣
• Confusing to those spending too much time with
Erlang 😕
How did it go?
• Integration with erlang.mk 😣
• Confusing to those spending too much time with
Erlang 😕
• Elixir/Erlang data type mismatches 😣
How did it go?
• Integration with erlang.mk 😣
• Confusing to those spending too much time with
Erlang 😕
• Elixir/Erlang data type mismatches 😣
• Some Elixir libraries are a one man show 🤞
How did it go?
• Integration with erlang.mk 😣
• Confusing to those spending too much time with
Erlang 😕
• Elixir/Erlang data type mismatches 😣
• Some Elixir libraries are a one man show 🤞
• Elixir skeptics in the community 🤞
Cool Elixir features our code
uses
Cool Elixir features our code
uses
• Functions
Cool Elixir features our code
uses
• Functions
• Modules
Cool Elixir features our code
uses
• Functions
• Modules
• Standard library
Cool Elixir features our code
uses
• Functions
• Modules
• Standard library
• Streams
Cool Elixir features our code
uses
• Functions
• Modules
• Standard library
• Streams
• Macros? Nope.
Cool Elixir features our code
uses
• Functions
• Modules
• Standard library
• Streams
• Macros? Nope.
• Agents? Nope.
Cool Elixir features our code
uses
• Tasks? No.
Cool Elixir features our code
uses
• Tasks? No.
• Sweet frameworks? Nooooooooo.
Could we build the same
thing in Erlang?
Could we build the same
thing in Erlang?
• Technically, absolutely
Could we build the same
thing in Erlang?
• Technically, absolutely
• In terms of perception by potential contributors,
probably not
Where do we go from here?
Where do we go from here?
• Moar Elixir
Where do we go from here?
• Moar Elixir
• Moar Erlang
Where do we go from here?
• Moar Elixir
• Moar Erlang
• Fewer unnecessarily reinvented wheels 🙏
@michaelklishin
Questions?

Adopting Elixir in a 10 year old codebase

  • 1.
    Adopting Elixir ina 10 Year Old Codebase Michael Klishin, Pivotal Software Inc.
  • 2.
  • 3.
    Who am I? •Yada Yada Yada Staff Software Engineer at Pivotal
  • 4.
    Who am I? •Yada Yada Yada Staff Software Engineer at Pivotal • RabbitMQ core team member
  • 6.
  • 7.
    About this talk •This is an experience report
  • 8.
    About this talk •This is an experience report • Some arguments may be subjective or team- specific, YMMV
  • 10.
  • 11.
  • 12.
    What's the Project? •RabbitMQ • Started in 2006, before Elixir (Rebar, Lager, Cowboy, Ranch, dinosaurs, …) existed
  • 13.
    What's the Project? •RabbitMQ • Started in 2006, before Elixir (Rebar, Lager, Cowboy, Ranch, dinosaurs, …) existed • Lots of wheels invented, some are not very round
  • 14.
    What's the Project? •RabbitMQ • Started in 2006, before Elixir (Rebar, Lager, Cowboy, Ranch, dinosaurs, …) existed • Lots of wheels invented, some are not very round • New team with a new perspective on things in the last ~ 2 years
  • 15.
    What's the Project? •7 engineers + ~ 3 active contributors, all kinds of backgrounds (Erlang, Java, C#/F#, C, …)
  • 16.
    What's the Project? •7 engineers + ~ 3 active contributors, all kinds of backgrounds (Erlang, Java, C#/F#, C, …) • Includes several client libraries we maintain, lots of plugins
  • 17.
    What's the Project? •7 engineers + ~ 3 active contributors, all kinds of backgrounds (Erlang, Java, C#/F#, C, …) • Includes several client libraries we maintain, lots of plugins • There are projects at Pivotal that depend on what we do
  • 19.
    How do weuse Elixir?
  • 20.
    How do weuse Elixir? • All core CLI tools as of 3.7.0
  • 21.
    How do weuse Elixir? • All core CLI tools as of 3.7.0 • Experimental plugins
  • 22.
    How do weuse Elixir? • All core CLI tools as of 3.7.0 • Experimental plugins • Future tools and plugins
  • 23.
    How do weuse Elixir? • All core CLI tools as of 3.7.0 • Experimental plugins • Future tools and plugins • Recruitment honey pot (discovered accidentally) 😂
  • 25.
  • 26.
    Why new CLItools? • Homegrown CLI option parser is meh
  • 27.
    Why new CLItools? • Homegrown CLI option parser is meh • CLI tools are too tied to the server, non- extensible
  • 28.
    Why new CLItools? • Homegrown CLI option parser is meh • CLI tools are too tied to the server, non- extensible • A project-within-a-project
  • 29.
  • 30.
    Why Elixir? • Elixir'sOptionParser seems to be inspired by Ruby & Python ones
  • 31.
    Why Elixir? • Elixir'sOptionParser seems to be inspired by Ruby & Python ones • Associative data structures in Elixir are a solid improvement over Erlang's
  • 32.
    Why Elixir? • Elixir'sOptionParser seems to be inspired by Ruby & Python ones • Associative data structures in Elixir are a solid improvement over Erlang's • Interoperability with Erlang makes it very easy to try
  • 33.
    Why Elixir? • Elixir'sOptionParser seems to be inspired by Ruby & Python ones • Associative data structures in Elixir are a solid improvement over Erlang's • Interoperability with Erlang makes it very easy to try • We had over 50 repos already, one more wouldn't hurt
  • 34.
    Why Elixir • Unicodeis not an afterthought
  • 35.
    Why Elixir • Unicodeis not an afterthought • More approachable to other teams
  • 36.
    Why Elixir • Unicodeis not an afterthought • More approachable to other teams • A very low risk endeavour for products already running on BEAM
  • 38.
  • 39.
    How did itgo? • Next feature release will include the new CLI tools in Elixir
  • 40.
    How did itgo? • Next feature release will include the new CLI tools in Elixir • Close to 70 commands, ~ 750 tests, ~ 8K lines of code
  • 41.
    How did itgo? • Next feature release will include the new CLI tools in Elixir • Close to 70 commands, ~ 750 tests, ~ 8K lines of code • New features: extensibility from plugins, result set streaming for listing commands, much better argument validation, …
  • 42.
    How did itgo? • Next feature release will include the new CLI tools in Elixir • Close to 70 commands, ~ 750 tests, ~ 8K lines of code • New features: extensibility from plugins, result set streaming for listing commands, much better argument validation, … • Well received by other teams at Pivotal 👍
  • 43.
  • 44.
    How did itgo? • Quickly adopted by folks without prior Elixir and virtually no Erlang experience 👍
  • 45.
    How did itgo? • Quickly adopted by folks without prior Elixir and virtually no Erlang experience 👍 • Very decent standard library 👍
  • 46.
    How did itgo? • Quickly adopted by folks without prior Elixir and virtually no Erlang experience 👍 • Very decent standard library 👍 • ExUnit is up there with Spock, RSpec 👍
  • 47.
    How did itgo? • Quickly adopted by folks without prior Elixir and virtually no Erlang experience 👍 • Very decent standard library 👍 • ExUnit is up there with Spock, RSpec 👍 • Error messages in Elixir are more sensible 👍
  • 48.
    How did itgo? • Tooling and dependency management from this century 👍
  • 49.
    How did itgo? • Tooling and dependency management from this century 👍 • Upgrading between Elixir versions was very easy 😍
  • 50.
    How did itgo? • Tooling and dependency management from this century 👍 • Upgrading between Elixir versions was very easy 😍 • Some Elixir libraries are better than their Erlang alternatives 🐼
  • 52.
  • 53.
    How did itgo? • Integration with erlang.mk 😣
  • 54.
    How did itgo? • Integration with erlang.mk 😣 • Confusing to those spending too much time with Erlang 😕
  • 55.
    How did itgo? • Integration with erlang.mk 😣 • Confusing to those spending too much time with Erlang 😕 • Elixir/Erlang data type mismatches 😣
  • 56.
    How did itgo? • Integration with erlang.mk 😣 • Confusing to those spending too much time with Erlang 😕 • Elixir/Erlang data type mismatches 😣 • Some Elixir libraries are a one man show 🤞
  • 57.
    How did itgo? • Integration with erlang.mk 😣 • Confusing to those spending too much time with Erlang 😕 • Elixir/Erlang data type mismatches 😣 • Some Elixir libraries are a one man show 🤞 • Elixir skeptics in the community 🤞
  • 59.
    Cool Elixir featuresour code uses
  • 60.
    Cool Elixir featuresour code uses • Functions
  • 61.
    Cool Elixir featuresour code uses • Functions • Modules
  • 62.
    Cool Elixir featuresour code uses • Functions • Modules • Standard library
  • 63.
    Cool Elixir featuresour code uses • Functions • Modules • Standard library • Streams
  • 64.
    Cool Elixir featuresour code uses • Functions • Modules • Standard library • Streams • Macros? Nope.
  • 65.
    Cool Elixir featuresour code uses • Functions • Modules • Standard library • Streams • Macros? Nope. • Agents? Nope.
  • 66.
    Cool Elixir featuresour code uses • Tasks? No.
  • 67.
    Cool Elixir featuresour code uses • Tasks? No. • Sweet frameworks? Nooooooooo.
  • 69.
    Could we buildthe same thing in Erlang?
  • 70.
    Could we buildthe same thing in Erlang? • Technically, absolutely
  • 71.
    Could we buildthe same thing in Erlang? • Technically, absolutely • In terms of perception by potential contributors, probably not
  • 73.
    Where do wego from here?
  • 74.
    Where do wego from here? • Moar Elixir
  • 75.
    Where do wego from here? • Moar Elixir • Moar Erlang
  • 76.
    Where do wego from here? • Moar Elixir • Moar Erlang • Fewer unnecessarily reinvented wheels 🙏
  • 78.
  • 79.