Summarized using AI

Ruby + Elixir: Polyglotting FTW!

Benjamin Tan • June 26, 2014 • Singapore • Talk

The talk titled "Ruby + Elixir: Polyglotting FTW!" presented by Benjamin Tan at the Red Dot Ruby Conference 2014 explores the integration of Ruby and Elixir, two distinct programming languages.

Main Topic:

The presentation focuses on encouraging Ruby developers to consider Elixir as a complementary language that enhances development capabilities, particularly in areas like concurrency and fault tolerance.

Key Points Discussed:

- Background on Elixir:

- Elixir is a functional language built on the Erlang virtual machine (BEAM) and is praised for its concurrency features and fault tolerance capabilities.

- Developed by José Valim, Elixir leverages Erlang's strengths while introducing a modern syntax and features appealing to Ruby developers.
- Concurrency in Elixir:

- Elixir handles concurrency through lightweight processes that are managed by the BEAM, allowing for millions of processes to run simultaneously with minimal overhead.

- Communication between processes occurs via message passing, which adds a layer of safety by preventing shared state corruption.
- Fault Tolerance:

- A core philosophy in Elixir is “let it crash,” meaning that rather than defensive programming, developers are encouraged to design processes to fail gracefully, often managed by supervisors that can restart failed processes automatically.
- Distributed Systems:

- Elixir allows for seamless interaction between nodes, enabling the development of distributed applications where processes can communicate effectively regardless of location.

- Tan provides a demonstration of a distributed system designed to find prime numbers, showcasing Elixir’s simple inter-process communication model.
- Integration with Ruby:

- The speaker illustrates how to utilize Elixir within Ruby applications, specifically through integration with Sidekiq for background job processing.

- This involves creating Elixir workers that push jobs to a queues monitored by Sidekiq, demonstrating Elixir's versatility and inter-language operability.
- Developer Experience:

- Tan emphasizes Elixir's focus on programmer happiness, likening it to Ruby’s core philosophy.

- He notes that transitioning to Elixir can enhance a developer’s ability to handle complex problems more efficiently and introduces them to new paradigms of programming.

Conclusion:

Tan concludes by encouraging Ruby developers to explore Elixir, highlighting its robust features that can complement Ruby applications without requiring a complete migration. He mentions working on a book about Elixir, inviting further exploration into its capabilities.

Ruby + Elixir: Polyglotting FTW!
Benjamin Tan • June 26, 2014 • Singapore • Talk

As developers, we know that we should use the right tool for the right job. While we may love Ruby, there are also many interesting technologies that may complement our favourite programming language.

This talk introduces Elixir, a programming language that is built on the legendary Erlang virtual machine. I will first give a quick walk through of the language, focusing on core concepts such as concurrency and fault tolerance - areas where Elixir shines.

After that, we will dive straight in to an example application to see how Ruby can exploit the powerful features of Elixir. More importantly, the audience would realise that there's more to Ruby than just Ruby.

It will be a fun ride!

Help us caption & translate this video!

http://amara.org/v/FGZC/

Red Dot Ruby Conference 2014

00:00:23.320 hello hi my name is Benjamin tan and I
00:00:26.400 work at
00:00:28.279 Neo so this guy is Tim Ori he's the same
00:00:31.800 guy behind all the oral books so he once
00:00:35.520 gave a talk titled watching the alpha
00:00:37.440 Geeks in it he said and I
00:00:40.079 quote This is How we get most of our
00:00:42.640 good ideas at Ori we look at people who
00:00:45.760 seem to be doing magic and we ask them
00:00:48.199 how they do it there always there always
00:00:51.120 seems to be people in any field that
00:00:53.039 seems to be the most clued in to the
00:00:55.120 deepest TRS who seem to be playing with
00:00:57.680 all the cooler staff and have their
00:00:59.559 finger in everything before even anyone
00:01:02.519 knows about
00:01:03.680 it that was what I was observing when I
00:01:06.400 was playing around with
00:01:08.680 Elixir so this is Jose valim you might
00:01:11.880 know him from his Ra's contributions and
00:01:14.280 gems such as
00:01:15.640 device but nowadays he's also known as
00:01:18.560 the creator of Elixir a new programming
00:01:20.479 language built on the llang virtual
00:01:24.040 machine so a couple of months ago Jose
00:01:27.079 did a pipot
00:01:28.520 screencast couple of weeks after that
00:01:30.759 books started pouring out the pragmatic
00:01:33.280 um bookshelf did a book Manning did a
00:01:35.520 book and also um the orali guys did a
00:01:39.200 book so this is Dave Thomas you might
00:01:42.399 know him he is one of the guys behind
00:01:44.799 pragmatic publishing so Dave has always
00:01:48.399 been a advocate for Ruby and for reals
00:01:51.040 in fact he's often credited as one of
00:01:53.040 the guys who brought Ruby into the
00:01:55.479 english- speaking world but nowadays
00:01:58.399 he's doing the same thing for elixir
00:02:02.000 so this is Joe Armstrong this is one of
00:02:04.360 the inventors of llang he wrote about
00:02:06.880 his onewe experience with Elixir and
00:02:09.920 suffice to say it is safe to say that he
00:02:12.440 liked it so what the heck was going on
00:02:16.599 the language hasn't even hit 1.0 yet yet
00:02:19.280 there was all these smart people raving
00:02:21.400 about this language so I decided to
00:02:24.800 investigate so the more I play with
00:02:27.040 Elixir the more I liked it I was hooked
00:02:30.760 so a polyglot is somebody who knows and
00:02:33.599 can use multiple languages similarly a
00:02:36.800 polygot programmer can use multiple
00:02:39.680 programming
00:02:41.480 languages so this talk I want to
00:02:45.239 encourage you to look Beyond Ruby I
00:02:47.319 would't try to convert you away from
00:02:48.879 Ruby because that would be a huge
00:02:50.800 mistake coming to Ruby conf and doing
00:02:52.400 that kind of
00:02:53.360 stuff but I might persuade you to add
00:02:57.040 Elixir into your tool
00:02:58.840 set so what is elixir and what exactly
00:03:02.640 makes it
00:03:03.760 special Elixir is a functional meta
00:03:07.080 programming aware language that builds
00:03:09.040 on top of the llang virtual machine it
00:03:11.400 focuses on tooling to leverage llang
00:03:13.799 capabilities to build um for tolerant
00:03:17.560 concurrent and distributed
00:03:19.920 applications so one of the reasons I was
00:03:23.080 attracted to Elixir is because of his
00:03:24.799 concurrency because it is a concurrency
00:03:27.400 oriented language so the main
00:03:30.640 concurrency primitive in Elixir is the
00:03:32.840 process the process is not like the
00:03:35.040 process we are used to in operating
00:03:36.680 systems instead that all processors in
00:03:39.840 Elixir are controlled by the llang
00:03:41.760 virtual
00:03:43.599 machine Elixir programmers create
00:03:47.080 processors just like Ruby programmers
00:03:49.040 create objects in fact a single alang
00:03:52.200 virtual machine can support up to 13
00:03:54.120 million
00:03:55.840 processors so Elixir processors can run
00:03:58.879 on a single CP U and across multiple
00:04:01.360 CPUs with very little overhead here we
00:04:04.360 have a uni processor machine with a
00:04:06.239 single Al virtual machine but if we have
00:04:09.599 multiprocessor Hardware the earling
00:04:11.400 runtime can distribute all the workload
00:04:13.680 across all the CPU costs without any
00:04:16.160 changes in the
00:04:18.120 program the only way to communicate
00:04:20.959 between processors is through sending
00:04:23.000 and receiving of messages as long as you
00:04:25.960 know the process ID you can send a
00:04:28.240 process a message and this is an
00:04:30.919 important point a process a cannot
00:04:33.400 modify the memory of process B directly
00:04:37.080 the only way to potentially do that is
00:04:39.039 to send it a
00:04:41.160 message so messages are sent
00:04:44.240 asynchronously much in a fire and forget
00:04:47.120 fashion I love
00:04:49.440 that so we'll see this in action
00:04:52.960 soon this is the eomen function the
00:04:55.639 function takes in two arguments M and N
00:04:57.720 both of which must be more than zero
00:05:00.320 the first two cases are pretty
00:05:01.520 straightforward but I would like to draw
00:05:03.000 your attention to the third case if you
00:05:05.080 look at the third case in the second
00:05:06.440 argument is a recursive call to itself
00:05:08.919 so this makes the entire computation
00:05:10.960 stack grow really quickly and makes for
00:05:12.680 a very nice and computationally
00:05:14.440 intensive
00:05:16.680 example so this is the eomen function
00:05:19.400 written in Elixir Elixir programs are
00:05:22.160 generally organized in modules and
00:05:24.479 within them are function
00:05:27.160 Clauses this is a full program
00:05:30.319 with an additional Loop function what
00:05:32.840 this Loop function does is when you
00:05:34.600 execute the loop function in a process
00:05:37.000 it enables the process to receive and
00:05:39.039 send messages let's see how we can do
00:05:42.240 that so first to create a process we use
00:05:45.120 the buildin spawn function which takes
00:05:46.919 in three arguments first the module name
00:05:49.639 the function name and then a list of
00:05:52.000 arguments so since we are not passing in
00:05:54.919 any arguments to Loop we simply pass in
00:05:57.039 an empty
00:05:58.319 list the return value of the spawn
00:06:00.800 function is a process ID which is what
00:06:03.319 how we reference a process now once we
00:06:06.800 return from here our process is ready to
00:06:08.599 send and receive
00:06:10.960 messages to send a message a process
00:06:14.160 rather to send yeah to send a message to
00:06:16.400 a process we use the buildin send
00:06:18.599 function so send takes in two arguments
00:06:21.240 the process ID and the
00:06:25.400 message the kinds of messages that a
00:06:28.280 process can handle is declared within
00:06:29.960 the receive block if the pattern of the
00:06:32.800 message matches those patterns defined
00:06:35.039 in the receive block then we execute the
00:06:37.720 body on the other hand if the message
00:06:40.880 doesn't match any pattern we will simply
00:06:43.880 try on the next pattern and so on and so
00:06:47.160 forth so in this example we are sending
00:06:50.160 a two element tle and it matches the
00:06:53.280 first case therefore the result will be
00:06:57.280 computed so once the comput ation is
00:07:00.160 done the loop function calls itself
00:07:02.319 again in a TA recursive call so in
00:07:05.240 Elixir looping is done via recursion and
00:07:07.879 it's a very common design pattern this
00:07:10.879 is needed because we want the process to
00:07:12.919 be able to receive multiple messages if
00:07:15.919 if we don't do without the loop the
00:07:17.879 process will simply exit and then will
00:07:19.759 be garbage
00:07:21.680 collected so here I want to show you how
00:07:24.720 we can run um functions directly that is
00:07:27.720 we are now not running functions in a
00:07:36.199 process so for simple computations such
00:07:39.080 as like eomen 32 it will probably return
00:07:41.960 immediately but if you try anything more
00:07:44.280 computationally intensive such as um 41
00:07:47.759 the process will be blocked for 60
00:07:49.280 seconds so in this case the Shelf is
00:07:50.960 blocked and you can't do anything for
00:07:52.479 like around a
00:07:56.360 minute so things get a little more fun
00:07:58.919 now we we're going to create a process
00:08:00.599 with
00:08:01.479 spond this time we're going to send the
00:08:03.680 process the exact same messages as we
00:08:05.360 did in the previous
00:08:11.560 example so here we have created a
00:08:13.639 process and notice that the once we send
00:08:16.919 a message over the first thing we get
00:08:18.919 back is the message and then the result
00:08:21.599 but now if we send something more
00:08:23.199 complicated we only get back the message
00:08:25.919 we still have to wait about around 60
00:08:27.840 seconds to get back the result but the
00:08:30.120 caller isn't
00:08:35.039 blocked when we send a message anything
00:08:37.719 other than a two element tle we will
00:08:39.479 fall back to the second pattern which
00:08:40.880 matches
00:08:48.160 anything so let's take things up a notch
00:08:51.320 we are going to start up four processors
00:08:53.120 and give each of these four processors a
00:08:55.040 computationally intensive task to
00:08:58.440 handle
00:09:01.880 so here we are creating four separate
00:09:04.839 processors we place them in a
00:09:08.440 list and then run each of them through a
00:09:10.800 met
00:09:16.399 function of which we send the message 43
00:09:19.399 to each of these
00:09:20.920 process so notice how the activity
00:09:23.120 monitor lights up on all four
00:09:26.880 cost so while it's run while four
00:09:29.399 processes are running in the background
00:09:30.600 we can go ahead and create another
00:09:32.000 process send it another
00:09:34.000 message but notice that if we were to
00:09:36.920 send a process to a busy message all the
00:09:39.240 messages are being
00:09:44.519 buffered so Elixir has also Bakin
00:09:47.519 features that makes it easy to build for
00:09:50.079 tolerant programs for tolerance in this
00:09:52.519 context means having the system to stay
00:09:54.680 up despite
00:09:57.399 failures so let crash is part of the
00:10:00.399 llang philosophy in general defensive
00:10:03.040 programming is frown upon you are going
00:10:05.120 to screw up eventually and your codes is
00:10:07.240 going to have bucks instead of trying to
00:10:09.560 fix all the corner cases have a
00:10:12.240 process watch over another process if
00:10:14.800 the process fails just let somebody else
00:10:16.920 take
00:10:18.880 over one of the F tolerance features of
00:10:21.760 Elixir comes in the form of Supervisors
00:10:24.360 the supervisor's only job is to monitor
00:10:26.760 child
00:10:28.320 processes so supervisors can be layered
00:10:31.320 which means that supervisors can take
00:10:33.040 care of other supervisors this allows us
00:10:35.639 to create layered architecture and so
00:10:38.639 that we can even create a bigger
00:10:40.200 supervision
00:10:42.279 tree when a child process dies the
00:10:45.399 supervisor can react in a number of ways
00:10:47.600 for example it can simply restart the
00:10:51.440 child or it can terminate all the child
00:10:54.839 processes under the tree and have it
00:10:56.720 restart all over
00:10:58.240 again
00:10:59.880 so I'm going to show you a demo here
00:11:01.839 where how to see how a supervisor
00:11:04.560 restarts a kute child
00:11:13.480 process so over here the red balls are
00:11:16.000 unnamed processors the blue balls are
00:11:18.040 named processors the green stuff you can
00:11:19.880 pretty much ignore so this is all the
00:11:22.720 processors which are start up in Elixir
00:11:28.240 system
00:11:30.800 so I've started 50 processors which are
00:11:33.320 hand which is handled by the supervisor
00:11:35.600 at the
00:11:38.360 middle so I'm going to turn off the
00:11:40.320 labels for
00:11:43.240 now and now I'm going to kill all the
00:11:45.760 workers so notice the moment I kill all
00:11:48.160 the workers the supervisor simply
00:11:49.760 restarts all the workers
00:11:55.160 again so at this point of time there are
00:11:57.360 around 200 workers
00:11:59.760 and again I'm going to issue the kill
00:12:01.240 command to every single process watch
00:12:03.240 how the supervisor restarts
00:12:20.000 everything the next thing I want to
00:12:21.760 showcase is distributed elixer which is
00:12:23.760 I think one of the more fun features the
00:12:25.839 llang virtual machine gives us the llang
00:12:28.839 VM makes connecting notes a pretty
00:12:30.440 trival
00:12:31.959 Affair processes in a cluster are set to
00:12:34.519 be location transparent this means that
00:12:36.760 sending messages between processors in a
00:12:39.399 local machine is just as easy as sending
00:12:41.920 messages on a remote
00:12:44.399 Noe so over here we have a five note
00:12:47.079 cluster consisting of one server note
00:12:49.120 and four worker noes the purpose of this
00:12:51.839 distributed system which I'm going to
00:12:53.760 demo next is to discover for prime
00:12:57.560 numbers here's an examp example of how
00:12:59.920 the messages get passed between the
00:13:01.440 worker processes and the server first
00:13:04.639 the worker will request a number to the
00:13:06.600 server the server will respond with a
00:13:09.160 number then upon receiving the number
00:13:12.120 the worker will go ahead and check to
00:13:13.720 see whether the number is prime or not
00:13:15.959 if it's prime it will reply to the
00:13:17.600 server yes this is a prime number or no
00:13:20.240 this is not a prime number the server
00:13:22.399 has two jobs the first job of the server
00:13:25.440 is to remember the highest prime number
00:13:27.279 he has discovered so far the the second
00:13:29.519 thing it should do is to respond from
00:13:32.800 the worker and hand it out a number when
00:13:34.839 the worker requests for
00:13:38.000 it so this back and forth messaging can
00:13:42.079 happen between multiple processors and
00:13:44.440 spanning multiple noes the beauty of
00:13:46.959 this is that the server and the worker
00:13:48.440 noes do not have to be on the same
00:13:50.320 computer let's see a
00:13:52.959 demo so in this example I'm going to set
00:13:55.360 up a Tre note
00:13:58.040 cluster
00:14:04.600 so as long as you know the name and IP
00:14:06.800 address of the computer is pretty easy
00:14:09.040 to set
00:14:11.639 up so here I'm going to issue a command
00:14:14.399 which allows each note to look at his
00:14:26.880 neighbors and just like that we have a
00:14:29.079 three note
00:14:31.199 cluster next I'm going to run the server
00:14:33.720 on the top left hand side and worker
00:14:35.600 processes on the remaining
00:14:51.079 notes so what you see here are the
00:14:53.399 workers already Computing for and
00:14:55.560 checking for prime numbers we can go
00:14:58.000 ahead and start a couple more processes
00:14:59.800 across both
00:15:06.079 notes so here we're going to stop one of
00:15:08.279 the note but notice that the server just
00:15:10.160 continues chugging along and and the
00:15:12.320 other worker is not even affected after
00:15:15.480 that we can go on and connect back the
00:15:17.440 note to for that note to join back the
00:15:19.839 rest of the
00:15:27.959 cluster and we can go ahead and spawn a
00:15:30.720 couple more
00:15:39.600 workers so another fun thing is I'm now
00:15:42.160 going to connect the Raspberry Pi to a
00:15:44.920 cluster and so now it can also take part
00:15:48.040 in the discovery of prime
00:15:52.120 numbers so here I'm going to SSH into
00:15:54.480 the Raspberry Pi I've already installed
00:15:56.279 a l on
00:15:57.920 it
00:16:01.480 we connect to the
00:16:17.600 cluster and on the Raspberry Pi we just
00:16:19.839 start a couple of processors basically
00:16:22.000 everything runs the same
00:16:27.920 way
00:16:35.199 so now I want to introduce to you my
00:16:37.399 all-time favorite programming operator
00:16:39.279 the pipe Jose stole the pipe from the F
00:16:42.240 people what he does is to pipe the value
00:16:44.639 of the left hand side and pipe it into
00:16:46.480 the first argument of the function on
00:16:48.079 the right hand side this operator alone
00:16:51.279 changes the way you think about
00:16:52.920 programming it encourages you to think
00:16:55.199 about programming as a series of trans
00:16:57.880 data transformation using multiple
00:16:59.880 functions let me show you an
00:17:04.079 example here's one way to write this
00:17:06.640 function over here we have a sequence of
00:17:08.880 numbers 1 to 10 we apply MEC on it
00:17:11.360 multiply by two and finally we reverse
00:17:14.439 the entire sequence but notice to
00:17:18.000 understand this function you have to
00:17:19.240 look from inside out in in order to
00:17:21.600 understand this
00:17:25.079 function here's the same function but
00:17:28.360 Express using the pipe operator we pipe
00:17:31.320 the sequence into the map function
00:17:33.679 multiply it by two and pipe the result
00:17:36.400 back into the reverse
00:17:37.880 function again data transformation in a
00:17:40.640 series of function I think that looks
00:17:42.559 way
00:17:46.679 prettier so we've come to the last bit
00:17:50.240 hopefully I've managed to convince you
00:17:51.760 that Elixir is pretty awesome and now we
00:17:54.720 are going to see how we can use elixir
00:17:56.360 in our Ruby
00:17:57.840 projects for that I'm going to use rails
00:18:00.480 and
00:18:01.159 sidekick for those who are not familiar
00:18:03.440 with sidekick it describes itself as a
00:18:05.400 simple and efficient background job
00:18:07.919 processor in for
00:18:10.559 Ruby before we start messing around with
00:18:12.919 sidekick let's try to understand a
00:18:15.400 little what goes on underneath the hood
00:18:17.880 here's a slightly simplified version of
00:18:19.520 how pyi
00:18:21.080 works so the first step is to write the
00:18:24.240 worker and stall it in the apps slw
00:18:26.039 worker
00:18:27.559 directory then we have to include the
00:18:29.720 sidekick worker module and then we
00:18:32.280 implement the perform
00:18:33.960 method to call the worker we execute the
00:18:37.080 perform acing method in your controllers
00:18:39.760 with the appropriate
00:18:41.240 arguments what the sidekick client does
00:18:43.840 is it creates a Jon hash containing
00:18:45.880 information such such as the job ID the
00:18:48.600 class the
00:18:49.960 arguments and other things this is the
00:18:53.480 information needed to execute the worker
00:18:55.720 code in a
00:18:57.320 Trad psychic has a polar which PS for
00:19:00.440 redish queue for any new jobs if there's
00:19:03.039 one it is popped off by the by the queue
00:19:06.760 or rather it is popped off the queue by
00:19:09.360 the
00:19:11.039 polar finally sidekick will then examine
00:19:14.240 the hash and execute the appropriate
00:19:15.919 worker in a
00:19:17.600 Trad but here's the thing you can really
00:19:21.039 write workers in any language as long as
00:19:23.200 you have a r client for it so let's see
00:19:26.240 how we can use Elixir for this
00:19:29.919 so now we are still in Ruby land here we
00:19:32.600 overwrite the perform acing
00:19:34.440 method which was previously defined in
00:19:36.840 the sidekick
00:19:38.720 worker the trick here is to insert a
00:19:41.640 Json hash into another que that the
00:19:43.880 sidekick polar will not look out for in
00:19:46.520 this example we are inserting it into Q
00:19:48.919 Elixir instead of the Q default but
00:19:52.159 other than that the entire Json hash
00:19:54.880 Remains the
00:19:57.080 Same we then man push the Json into the
00:20:00.480 redish que but and again this time to
00:20:02.799 the que that Sidekick is not looking out
00:20:05.840 for we invoke the worker as per
00:20:09.440 normal and now we have an Elixir polar
00:20:12.520 in the background which is looking for
00:20:14.039 jobs and they being pushed into Q
00:20:17.799 Elixir here's roughly how The Elixir
00:20:20.080 polar looks like the function pole takes
00:20:22.400 in a process ID of the Rish client and
00:20:25.559 then executes the right pop query on The
00:20:27.280 Elixir queue it then hands the job over
00:20:30.640 to the worker supervisor which will then
00:20:32.760 hand over it to a a worker it then
00:20:35.760 sleeps for a while and then repeats the
00:20:37.159 entire process of
00:20:39.280 polling the supervisor will receive a
00:20:41.520 job from The Polar and then it will
00:20:43.960 create a new supervised worker and hence
00:20:46.840 the job to
00:20:48.320 it this is how roughly how the worker
00:20:51.520 looks like the implementation is not
00:20:53.440 really important but what is important
00:20:55.360 is to see what the worker does to the
00:20:57.559 hash let's take take a closer look here
00:21:00.360 is where we perform a slide of hand we
00:21:03.039 we are modifying two things first we
00:21:05.640 modify the que so that it matches the
00:21:07.720 queue that now the psychic polar looks
00:21:09.880 for so in this case we're changing the
00:21:12.240 queue back to Q
00:21:14.559 default but more importantly the
00:21:17.520 computed result by The Elixir worker is
00:21:20.320 now sto in the a argument of the
00:21:24.080 hash finally we insert it into the pyic
00:21:27.520 Q
00:21:29.159 so the sidekick polar will now pick up
00:21:32.279 the job that we have just inserted this
00:21:34.799 will called the hard worker class with
00:21:36.679 the arguments that has been previously
00:21:38.480 computed by The Elixir worker but so
00:21:41.120 much for looking at code let me show you
00:21:42.720 a quick
00:21:45.240 demo so in this demo I'm going to have
00:21:47.400 three split screens I'll start reals
00:21:50.080 console on the top left and On The Run
00:21:52.960 side kick on the bottom left and on the
00:21:54.480 right hand side we're going to run the
00:21:55.640 Elixir polar The Elixir worker is going
00:21:58.200 to take a string upcase it and simply
00:22:00.559 just reverse a
00:22:27.520 string
00:22:29.159 so that's pretty much it now you have
00:22:31.679 Elixir workers yet neither sidekick nor
00:22:34.240 reals have to have any knowledge of it
00:22:36.960 so some people I've been speaking to
00:22:38.799 have already started replacing bits of
00:22:40.520 the reals apps with Elixir apps I've
00:22:43.039 also briefly like experimented with
00:22:45.200 creating a distributed key store and
00:22:47.159 replacing it with the real
00:22:50.880 cach there's more to programming than
00:22:53.720 web applications and I think there are
00:22:56.120 interesting things also currently being
00:22:57.919 done with and ear for example you could
00:23:00.720 fly a drone control a robot arm and
00:23:03.520 experiment with some parallel
00:23:05.120 programming but best of all you don't
00:23:07.320 have to give up Ruby Mets Made ruby to
00:23:10.480 optimize for programmer happiness and I
00:23:13.279 found that Elixir also makes me happy
00:23:15.640 and I think it can make you happy too so
00:23:18.640 I'm currently working on a book on
00:23:20.120 Elixir and if I manage to pick your
00:23:22.400 interest do check out xot book.com well
00:23:25.880 thanks for listening let's have some
00:23:27.240 questions thank you
00:23:35.880 thanks Benjamin any questions for him so
00:23:38.840 I've written a little bit of Berling
00:23:40.440 before uh and certainly coming from Ruby
00:23:43.919 at first it is an ugly syntax but you
00:23:46.880 get used to it right um so I'm just
00:23:49.960 curious given your perspective from a
00:23:52.600 ruby background what are some other
00:23:54.919 things you feel like are advantages to
00:23:57.039 Elixir versus is just learning earling
00:24:01.279 itself I think that's a great question
00:24:04.640 um syntax wise I think coming from Ruby
00:24:07.919 Elixir looks slightly more palatable but
00:24:10.799 I found myself after doing some Elixir I
00:24:13.320 have to go back to learn a lang because
00:24:16.480 there's much more documentation and it's
00:24:18.760 a more developed language and already
00:24:20.840 there are many people building things
00:24:22.720 onang so what I've been trying to do is
00:24:25.200 I'm taking some alang programs and then
00:24:27.159 converting it back to elixir
00:24:29.840 perspective wise I think the tooling
00:24:32.159 around Elixir is getting better and
00:24:34.600 elixir is also trying to learn a lot of
00:24:36.279 the mistakes that what ear
00:24:40.000 did question if I can ask is there like
00:24:43.880 a facility to use existing earling
00:24:46.679 Library code from Elixir yeah so that's
00:24:49.840 the one of the cool things in lling and
00:24:51.520 elixir is that you can call Elixir code
00:24:53.399 from llang and you can callang code from
00:24:55.279 Elixir so essentially you can use any
00:24:57.720 library in
00:25:00.279 thank
00:25:04.919 you I have a question shoot um so have
00:25:08.960 have you used a um framework like
00:25:11.880 Celluloid in Ruby how so yeah that's an
00:25:15.919 interesting question so initially I
00:25:18.000 wanted to learn concurrency stuff
00:25:20.720 because I can't write concurrent
00:25:22.880 programs
00:25:24.000 before but I found that using Ruby to
00:25:27.000 write concurrent programs is isn't
00:25:28.520 really a very good starting point I
00:25:30.480 started with Celluloid which is um in
00:25:32.440 case you know it's a actor library in
00:25:34.159 written in
00:25:35.840 Ruby but again the documentation wasn't
00:25:39.000 like very fantastic and I didn't see a
00:25:42.200 lot of people really using Celluloid so
00:25:45.120 I decided to look elsewhere to learn
00:25:48.600 concurrency
00:25:54.039 yeah so there are several other
00:25:56.360 programming languages that have been in
00:25:57.799 development recently around concurrency
00:26:00.360 so why did you choose alexir over any of
00:26:02.640 these other ones such as go or um I
00:26:05.679 believe closure just added a bunch of
00:26:07.559 conc concurrency stuff as well or yeah
00:26:12.039 so um I tried Hesco then I I realized I
00:26:15.640 wasn't that smart um I tried closure but
00:26:20.880 starting the jvm I mean doing rails
00:26:23.919 every day rail start I think enough of
00:26:26.679 waiting for the the jvm to Startup um I
00:26:32.080 I looked at go briefly but I didn't
00:26:34.559 really like the syntax and somehow when
00:26:36.559 I started with Elixir everything clicked
00:26:39.159 I tried Lang and again it didn't work
00:26:40.919 out for
00:26:42.120 me so uh I think that Jose valim has
00:26:46.919 proved himself as a really valuable
00:26:48.559 member of the Ruby Community but what
00:26:50.120 are his credentials as far as
00:26:51.760 programming language creation is
00:26:53.159 concerned that make you feel confident
00:26:55.279 as like that you know he's taking elixir
00:26:57.679 in a good direction
00:26:59.960 good question the the the truth is I
00:27:03.279 don't know but the fact is I've seen a
00:27:07.640 lot of llang people hop on board to
00:27:10.080 Elixir and they're constantly like
00:27:11.840 contributing and these guys were behind
00:27:13.880 llang like 10 years 20 years so I'm
00:27:17.360 pretty confident and the way Jose is
00:27:21.200 handling like all elixir in general he's
00:27:24.480 very open to suggestions and I think
00:27:26.279 that's really really nice
00:27:31.840 any last
00:27:34.120 questions well if not thanks Benjamin
00:27:36.960 thank
00:27:57.120 you
00:28:05.640 m
Explore all talks recorded at Red Dot Ruby Conference 2014
+20