Diving into Erlang is a one-way ticket (@pavlobaron)

2,163 views

Published on

The talk I gave at Erlang Factory Lite Munich 2013

Published in: Technology
1 Comment
7 Likes
Statistics
Notes
No Downloads
Views
Total views
2,163
On SlideShare
0
From Embeds
0
Number of Embeds
251
Actions
Shares
0
Downloads
0
Comments
1
Likes
7
Embeds 0
No embeds

No notes for slide

Diving into Erlang is a one-way ticket (@pavlobaron)

  1. 1. The almost zero-slide story of my journey into Erlang, and why I’ll never be the same again Pavlo Baron, codecentricWednesday, February 20, 13
  2. 2. Pavlo Baron @pavlobaronWednesday, February 20, 13
  3. 3. it began in the 70s, as I learned to tinker...Wednesday, February 20, 13
  4. 4. natural speaking wasn’t really mine, so some time later I discovered the most expressive language aroundWednesday, February 20, 13
  5. 5. x86 assemblyWednesday, February 20, 13
  6. 6. At some point, I realized that there is C (guess it was about growing up or something).Wednesday, February 20, 13
  7. 7. So I started coding in C: while (abc) {} asm { push bx push es mov bx, 9 mov ax, 0 ...Wednesday, February 20, 13
  8. 8. But puberty was over (I was like 18), and I had to do some higher level programming. So I discovered C++Wednesday, February 20, 13
  9. 9. The golden age of my C++ coding: OO thinking, abstractions, objects: long SomeClass::getFoo() { _asm { mov eax,dword ptr[ecx] } } ...Wednesday, February 20, 13
  10. 10. But (enterprise) Java’s advance was unstoppable. I had to jump in for some money.Wednesday, February 20, 13
  11. 11. I loved coding Java - finally patterns and real abstract thinking: package com.stuff.jni; public class Magic { static { System.loadLibrary("strlen"); } public static native int strlen(String s); } ...Wednesday, February 20, 13
  12. 12. Out of nowhere, someone came along and asked me to write a tiny-footprint database for these weird Palm-PDAs.Wednesday, February 20, 13
  13. 13. And I found myself coding for memory maximum of 64kB yet again.Wednesday, February 20, 13
  14. 14. But (enterprise) Java was where the money lived (fun lived in nightly hacks).Wednesday, February 20, 13
  15. 15. oh, look, an interest calculator that’s perfect for us! Let’s buy it for our Java platform!!!Wednesday, February 20, 13
  16. 16. What, it’s written in C??? What, it can’t do parallel calculation?????Wednesday, February 20, 13
  17. 17. How parallelize this thing in our enterprise Java stack? Threads? EJB doesn’t like threads. Machines through message-driven beans, JMS, whatever?..Wednesday, February 20, 13
  18. 18. Now, the bullshit part of the slides is over. Here is where Erlang kicks in.Wednesday, February 20, 13
  19. 19. I spent 3 months of my life researching how Erlang can help parallelize this weird piece of C code.Wednesday, February 20, 13
  20. 20. It could help. It really could. On one machine, on several machines.Wednesday, February 20, 13
  21. 21. But their ops guys said it’s not Java. So they won’t take it (as if they knew what real serious Java is).Wednesday, February 20, 13
  22. 22. And what happened? I just used every chance to play more with Erlang. This is what happened.Wednesday, February 20, 13
  23. 23. I decided to write a book only to learn this thing a lot deeper. Took 2.5 years of my life, worth every single minute.Wednesday, February 20, 13
  24. 24. I toured through Germany with an Erlang live hacking session for Java user groups. And yes, they (mostly) liked it.Wednesday, February 20, 13
  25. 25. My Java code started looking like this (and, man, why didn’t it compile?): public void doit(String s) -> ...Wednesday, February 20, 13
  26. 26. I don’t even want to touch a language not having list comprehensions and lambdas. Tooth grinding about those that don’t have pattern matchingWednesday, February 20, 13
  27. 27. Erlang made my code better in any language I use. I don’t reassign variables. I work with deep copies. I sometimes use recursion instead of loops. I cut code into tiny, parallelizable functionsWednesday, February 20, 13
  28. 28. I judge every platform by the fact if I can spawn 2^27 actors on it and pass asynchronous messages between themWednesday, February 20, 13
  29. 29. I am questioning every home-brewed non-Erlang distributed system or programming framework with a simple question: why reinvent the wheel?Wednesday, February 20, 13
  30. 30. For specific use cases such as messaging or distributed data management, an Erlang- based technology has automatic credit of trust when I look at itWednesday, February 20, 13
  31. 31. I met some of the smartest people I ever met who are directly or indirectly related to ErlangWednesday, February 20, 13
  32. 32. No, Erlang is not perfect.Wednesday, February 20, 13
  33. 33. But to be honest, nothing is. Erlang is just the only considerable platform to solve some specific problems.Wednesday, February 20, 13
  34. 34. I have it in my toolbox. It’s a precise machine, very sensitive to doing things wrong. But I’m glad I learned to use it.Wednesday, February 20, 13
  35. 35. You should, too.Wednesday, February 20, 13
  36. 36. The End. Thanks to the WWW for helping out with some code snippets. I lost my own ones during a house movingWednesday, February 20, 13

×