Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Adopting Elixir in a 10 year old codebase

584 views

Published on

A short talk on Elixir adoption in RabbitMQ, a multi-protocol open source messaging broker: the motivation, how it compares to Erlang for our needs, and what we've learnt about 1 year into it.

Published in: Technology
  • Be the first to comment

Adopting Elixir in a 10 year old codebase

  1. 1. Adopting Elixir in a 10 Year Old Codebase Michael Klishin, Pivotal Software Inc.
  2. 2. Who am I?
  3. 3. Who am I? • Yada Yada Yada Staff Software Engineer at Pivotal
  4. 4. Who am I? • Yada Yada Yada Staff Software Engineer at Pivotal • RabbitMQ core team member
  5. 5. About this talk
  6. 6. About this talk • This is an experience report
  7. 7. About this talk • This is an experience report • Some arguments may be subjective or team- specific, YMMV
  8. 8. What's the Project?
  9. 9. What's the Project? • RabbitMQ
  10. 10. What's the Project? • RabbitMQ • Started in 2006, before Elixir (Rebar, Lager, Cowboy, Ranch, dinosaurs, …) existed
  11. 11. 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
  12. 12. 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
  13. 13. What's the Project? • 7 engineers + ~ 3 active contributors, all kinds of backgrounds (Erlang, Java, C#/F#, C, …)
  14. 14. 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
  15. 15. 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
  16. 16. How do we use Elixir?
  17. 17. How do we use Elixir? • All core CLI tools as of 3.7.0
  18. 18. How do we use Elixir? • All core CLI tools as of 3.7.0 • Experimental plugins
  19. 19. How do we use Elixir? • All core CLI tools as of 3.7.0 • Experimental plugins • Future tools and plugins
  20. 20. 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) 😂
  21. 21. Why Elixir?
  22. 22. Why new CLI tools? • Homegrown CLI option parser is meh
  23. 23. Why new CLI tools? • Homegrown CLI option parser is meh • CLI tools are too tied to the server, non- extensible
  24. 24. 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
  25. 25. Why Elixir?
  26. 26. Why Elixir? • Elixir's OptionParser seems to be inspired by Ruby & Python ones
  27. 27. 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
  28. 28. 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
  29. 29. 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
  30. 30. Why Elixir • Unicode is not an afterthought
  31. 31. Why Elixir • Unicode is not an afterthought • More approachable to other teams
  32. 32. Why Elixir • Unicode is not an afterthought • More approachable to other teams • A very low risk endeavour for products already running on BEAM
  33. 33. How did it go?
  34. 34. How did it go? • Next feature release will include the new CLI tools in Elixir
  35. 35. 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
  36. 36. 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, …
  37. 37. 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 👍
  38. 38. How did it go?
  39. 39. How did it go? • Quickly adopted by folks without prior Elixir and virtually no Erlang experience 👍
  40. 40. How did it go? • Quickly adopted by folks without prior Elixir and virtually no Erlang experience 👍 • Very decent standard library 👍
  41. 41. 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 👍
  42. 42. 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 👍
  43. 43. How did it go? • Tooling and dependency management from this century 👍
  44. 44. How did it go? • Tooling and dependency management from this century 👍 • Upgrading between Elixir versions was very easy 😍
  45. 45. 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 🐼
  46. 46. How did it go?
  47. 47. How did it go? • Integration with erlang.mk 😣
  48. 48. How did it go? • Integration with erlang.mk 😣 • Confusing to those spending too much time with Erlang 😕
  49. 49. How did it go? • Integration with erlang.mk 😣 • Confusing to those spending too much time with Erlang 😕 • Elixir/Erlang data type mismatches 😣
  50. 50. 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 🤞
  51. 51. 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 🤞
  52. 52. Cool Elixir features our code uses
  53. 53. Cool Elixir features our code uses • Functions
  54. 54. Cool Elixir features our code uses • Functions • Modules
  55. 55. Cool Elixir features our code uses • Functions • Modules • Standard library
  56. 56. Cool Elixir features our code uses • Functions • Modules • Standard library • Streams
  57. 57. Cool Elixir features our code uses • Functions • Modules • Standard library • Streams • Macros? Nope.
  58. 58. Cool Elixir features our code uses • Functions • Modules • Standard library • Streams • Macros? Nope. • Agents? Nope.
  59. 59. Cool Elixir features our code uses • Tasks? No.
  60. 60. Cool Elixir features our code uses • Tasks? No. • Sweet frameworks? Nooooooooo.
  61. 61. Could we build the same thing in Erlang?
  62. 62. Could we build the same thing in Erlang? • Technically, absolutely
  63. 63. Could we build the same thing in Erlang? • Technically, absolutely • In terms of perception by potential contributors, probably not
  64. 64. Where do we go from here?
  65. 65. Where do we go from here? • Moar Elixir
  66. 66. Where do we go from here? • Moar Elixir • Moar Erlang
  67. 67. Where do we go from here? • Moar Elixir • Moar Erlang • Fewer unnecessarily reinvented wheels 🙏
  68. 68. @michaelklishin
  69. 69. Questions?

×