We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

Elixir - Old wine in new casks

00:00

Formal Metadata

Title
Elixir - Old wine in new casks
Subtitle
Intro talk about Elixir/Erlang
Title of Series
Number of Parts
542
Author
License
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
Introductory talk about Elixir, elaborating on how it relates to Erlang. Is it really a new language or just an older idea in disguise? Let's talk about the key differences and what Elixir brings to the BEAM/Erlang ecosystem.
14
15
43
87
Thumbnail
26:29
146
Thumbnail
18:05
199
207
Thumbnail
22:17
264
278
Thumbnail
30:52
293
Thumbnail
15:53
341
Thumbnail
31:01
354
359
410
Distribution (mathematics)Concurrency (computer science)Data modelSystem programmingTelecommunicationErlang distributionCodeComputer programmingGoogolFacebookJava appletMobile WebComputer fontFrame problemProduct (business)Source codeFunctional (mathematics)TorusPhysical systemSystem callMathematicsSource codeRun time (program lifecycle phase)CodeErlang distributionCombinational logicBitThread (computing)Connected spaceComputer programmingMultiplication signTheoryCategory of beingNetwork topologyProcess (computing)Formal languageTelecommunicationVirtualizationFacebookCASE <Informatik>Software developerMereologyDiagramComputer animation
Operator (mathematics)Digital filterSummierbarkeitTelephone number mappingLevel (video gaming)Streaming mediaMacro (computer science)Communications protocolString (computer science)Block (periodic table)Kernel (computing)BuildingParameter (computer programming)Software testingBoolean algebraEnumerated typeFunction (mathematics)Principal ideal domainInteractive televisionTerm (mathematics)AlgorithmModule (mathematics)TensorExponential functionSmoothingArmErlang distributionLibrary (computing)NumberModule (mathematics)String (computer science)Extension (kinesiology)Projective planeMacro (computer science)Virtual machineHacker (term)Functional (mathematics)System callParameter (computer programming)Text editorSoftware frameworkCommunications protocolMultiplication signBitFormal languageExpressionVapor barrierResultantSoftware testingElectronic mailing listWeb 2.0Sound effectNeuroinformatikBookmark (World Wide Web)Computer animation
Game controllerModule (mathematics)Radio-frequency identificationProgram flowchart
Transcript: English(auto-generated)
Alright, cool. So again, apologies for being this late. I really don't take it out on the people that are organizing this room. It's really my fault. So I hope still you have a nice day and I'll try to keep it short so we stay on schedule. So this is kind
of an introductory talk for people that are new to Elixir and Erlang. So Elixir is a language which now already exists for 10 years and it's built on top of the Beam virtual machine, also called the Erlang VM. So it inherits some of the properties that the Beam runtime has as well. And Beam runtime is actually created for telecom systems. So it's meant to be 24-7 on and by doing that it has to be full
tolerant, so if something goes wrong it can still heal and keep on running. And because it has to be on all the time, that also means that any code changes should be done on the fly while the system is running without interruptions, without bringing systems down, bringing systems up, but
just keep things running on and changing the code under the hood. It also needed to be concurrent because it needed to handle a lot of incoming telephone calls at the same time and it also needs to be distributed because you have to connect telephone switches together and make
sure that everything runs smoothly. So those are kind of the properties that that Erlang also inherited from Erlang as well. So when you look at other systems, multi-threaded... Okay, programming can be hard, so in theory it should all work like we have
you know if you want to do something concurrently we spawn a few threads and they do their work, but in practice because threads can actually interfere with each other's work, it actually becomes a mess. So hence the second picture. The other property that Erlang has is full tolerance.
So in Erlang you set up a supervision tree in which a supervisor is actually watching, monitoring or worker and if one of those processes dies then the supervisor actually makes sure that a new process is spawned in its place and the system as a whole keeps running even though one of the parts actually fail. Hence also the mantra that's very often told in Erlang is let it crash.
Nice timing, okay. Because people feel safe by, you know, if there's an exception, if your code always goes for the happy path and something goes wrong, Erlang developers tend to not care that
much about it because the supervisor will restart that process again. So very exceptional. Edge cases are sometimes not covered because they feel comfortable having the system pick it up from there as well. Before Elixir came around, Erlang also existed for quite some while.
So Elixir also inherited some of the kind of the experience of 20 years building telecom systems which also makes it, for example, WhatsApp had only 57 engineers working for them when they sold to Facebook. But only about 20 of them were Erlang developers.
The rest were actually mobile developers supporting Androids, Windows, iOS, etc. And actually could handle a lot of users while having a small team. So then the question also comes a little bit why does Elixir exist? And when people innovate and build new things, there are approximately three things,
three ways they can go around it. So they completely build something very new, which didn't exist before, or they try to combine ideas from previous, from other fields, for example. Or in some cases, people just, you know, put a new label on it and say,
well, this is new, you know, this is innovation. So my, hence the title of my talk, is Elixir really something new? Or is it just a new label on the existing Erlang foundation? And some other languages, they, you know, they've tried to incrementally do some innovations.
But after a while, the original sources picked up those changes in this, like CoffeeScript is a very famous example, in which the original language picked up those changes, and nowadays a lot less people actually use CoffeeScript.
So, how are we doing on time? Okay. So the question is then also why did, Jose is kind of the creator of Elixir, why did he write a new language? And he was at a time when he wrote Elixir, he was working at Rails team, and one of the things that he faced was trying to make Rails thread safe.
So making sure that several threads that were running in the Rails program weren't interfering with each other. And by doing that, he was actually looking around, how did other folks, how did other programming languages, other frameworks, how did they solve that issue? And that's when he actually stumbled upon Erlang, and he liked it. It was, you know, just the thing he needed to use.
But there were also some things that he was actually missing. So, for starters, the syntax stems from Prolog, so it's unfamiliar for a lot of people. So that means that new people who come to Erlang have to, you know,
have a high barrier to actually get around, because they feel unfamiliar with the syntax. So he did that first, and he also introduced other new syntax, for example, the pipe operator, in which, like the result of the previous expression is piped into the next function as the first parameter.
So by doing that, you can avoid having a very nested function calls by having something that's more readable, more clear to other people. He also introduced more extensibility to the language by introducing macros and protocols.
And one of my favorites is actually the bottom one. I'm not sure if everybody can read it, but it's an upcase function, which takes a string and upcases every letter. And it does that under the hood via a macro, so the Unicode definition, like the library definitions of characters is downloaded,
and actually being translated to functions under the hood. So when you call this, you're actually using, you know, some data that is transformed into functions for the language. I'll skip over this part, because we don't have Dutchman time. And you also actually see that those macros are used everywhere.
So even like, you know, defining module is a macro, defining a function, etc., everything is actually implemented through macros. The other thing that he also introduced is the build tool, to make it easier for people who are, for example, new to the language.
If you want to have a package manager, before didn't really have package management, like in the sense that you could add packages to your project, but you had to download them by yourself, put them somewhere, define it in your config, like, okay, this is the path to my library that I'm using. And with hacks and with mix, Alex just made it easier,
by, you know, by having a list of dependencies and go download it from a central place. The computation was also made more prominent. For example, the doc tests, which are inspired by Python. So in this case, we have a function defined,
and above it is a document, a comment, in which there is an example. And this example doesn't serve only for documentation, but in the same time, it's also a test. So, you know, actually, if you would change the implementation, you can directly see the effect of it, because the test is just above it, as documentation fails.
So, and, yeah, the documentation is also accessible from REPL, from other places, and this was built before the LSP. So nowadays, you can, you know, just hover over a function in your editor and you will see the documentation. But when Elixir was created, those functionalities weren't that common,
like among other languages, and that's something that's really nice to work with. And the last thing that he kind of also introduced is a different culture, a culture which is a little bit more open to newcomers. So it's not like Erlang, you know, shed away from newcomers,
but it also didn't, like, make it easier for new people to, who are new to the language, to get started with it, et cetera. So that whole, you know, like, to come back to my question, like, is Elixir a kind of new flavor on top of Erlang?
I think there are kind of projects stemming from Elixir which make it more interesting and which are really new. So, for example, NX Numerical Elixir is an extension which makes machine learning easy, and that's something that, you know, before Elixir,
nobody actually thought would be useful to do with the Beam, with the Erlang VM, because it wasn't not meant for that. It wasn't meant for numerical, for number crunching. But this library, this tooling actually makes it a lot easier to do, and that's very promising. Phoenix is actually a web framework which was inspired by Rails,
and now, so you worry around, Phoenix is now an inspiration for Rails and other frameworks to work with. And NURBS is also kind of an interesting project which makes it possible to run on smaller devices like Raspberry Pis or something like this. So, to answer the question, is Elixir really different from Erlang?
Is it really, you know, an innovation or is it rehashing? I would say no. I think Elixir really adds something to the whole ecosystem which wasn't that easy before that. So, with that being said, thanks for listening.
Thank you. Unfortunately, we don't have any time for Q&A, but you can find it here. So, if you're looking for me online, I usually have the handle Toxified, so on Twitter, if it still works,
or Mastodon, you can also find me. And I'll be around, I think, for today if you have any further questions. So, thanks again for listening, and apologies for being this late. Thank you again.