[00:00.000 --> 00:07.520] All right, cool. [00:07.520 --> 00:09.680] So again, apologies for being this late. [00:09.680 --> 00:12.880] I really don't take it out on the people that are organizing this room. [00:12.880 --> 00:14.600] It's really my fault. [00:14.600 --> 00:17.040] So I hope still you have a nice day. [00:17.040 --> 00:20.760] And I'll try to keep it short, so we stay on schedule. [00:20.760 --> 00:25.040] So this is kind of an introductory talk for people that are new to Elixir and Alang. [00:25.040 --> 00:28.960] So Elixir is a language which now already exists for 10 years. [00:28.960 --> 00:32.760] And it's built on top of the Beam virtual machine, also called the Erlang VM. [00:32.760 --> 00:37.960] So it had some of the properties that the Beam runtime has as well. [00:37.960 --> 00:42.120] And the Beam runtime is actually created for telecom systems. [00:42.120 --> 00:45.000] So it's meant to be 24-7 on. [00:45.000 --> 00:49.640] And by doing that, it has to be full torrent, so if something goes wrong, it can still heal [00:49.640 --> 00:52.640] and keep on running. [00:52.640 --> 00:57.320] And because it has to be on all the time, it also means that any code changes should [00:57.320 --> 00:58.320] be done on the fly. [00:58.320 --> 01:01.800] All the system is running without interruptions, without bringing systems down, bringing systems [01:01.800 --> 01:02.800] up. [01:02.800 --> 01:07.800] But just keep things running on and changing the code under the hood. [01:07.800 --> 01:11.800] It also needed to be concurrent, because it needed to handle a lot of incoming telephone [01:11.800 --> 01:14.160] calls at the same time. [01:14.160 --> 01:19.120] And it also needs to be distributed, because you have to connect telephone switches together [01:19.120 --> 01:23.320] and make sure that everything runs smoothly. [01:23.320 --> 01:32.520] So those are kind of the properties that Erlang also inherited from Erlang as well. [01:32.520 --> 01:39.640] So when you look at other systems, multi-threaded, OK, programming can be hard. [01:39.640 --> 01:44.200] So in theory, it should all work like we have, you know, if you want to do something concurrently, [01:44.200 --> 01:47.640] we spawn a few threads and they do their work. [01:47.640 --> 01:52.960] But in practices, because threads can actually interfere with each other's work, it actually [01:52.960 --> 01:54.240] becomes a mess. [01:54.240 --> 01:59.000] So hence the second picture. [01:59.000 --> 02:01.640] The other property that Erlang has is full torrents. [02:01.640 --> 02:08.000] So in Erlang, you set up a supervision tree in which a supervisor is actually watching, [02:08.000 --> 02:09.160] monitoring, or worker. [02:09.160 --> 02:13.440] And if one of those processes dies, then the supervisor actually makes sure that a new [02:13.440 --> 02:15.920] process is spawned in its place. [02:15.920 --> 02:20.240] And the system as a whole keeps running, even though one of the parts actually fail. [02:20.240 --> 02:27.920] And so the mantra that's very often told in Erlang is, let it crash. [02:27.920 --> 02:31.120] Nice timing, OK. [02:31.120 --> 02:35.800] Because people feel safe by, you know, if there's an exception, if your code always [02:35.800 --> 02:41.560] goes for the happy path and something goes wrong, Erlang developers tend to not care [02:41.560 --> 02:45.960] that much about it because the system, like the supervisor, will restart that process [02:45.960 --> 02:47.120] again. [02:47.120 --> 02:53.160] So very exceptional edge cases are sometimes not covered because they feel comfortable [02:53.160 --> 02:58.800] having the system pick it up from there as well. [02:58.800 --> 03:02.960] Before Alexa came around, Erlang also existed for quite some while. [03:02.960 --> 03:10.200] So Alexa also inherited some of the experience of 20 years building telecom systems, which [03:10.200 --> 03:14.640] also makes it, for example, WhatsApp had only 57 engineers working for them when they [03:14.640 --> 03:17.640] were sold to Facebook. [03:17.640 --> 03:20.080] But only about 20 of them were Erlang developers. [03:20.080 --> 03:26.560] The rest were actually mobile developers supporting Android, Windows, iOS, et cetera. [03:26.560 --> 03:33.960] And they actually could handle a lot of users while having a small team. [03:33.960 --> 03:39.240] So then the question also becomes a little bit why does Alexa exist? [03:39.240 --> 03:42.880] And when people, like, innovate when they're building new things, there are approximately [03:42.880 --> 03:46.920] three things, three ways they can go around it. [03:46.920 --> 03:52.200] So they completely build something very new, which didn't exist before. [03:52.200 --> 03:58.280] Or they try to combine the ideas from previous, from other fields, for example. [03:58.280 --> 04:02.680] Or in some cases, people just put a new label on it and say, well, this is new. [04:02.680 --> 04:04.760] This is innovation. [04:04.760 --> 04:09.640] So hence the title of my talk is, is Alexa really something new? [04:09.640 --> 04:16.800] Or is it just a new label on the existing Erlang foundation? [04:16.800 --> 04:24.280] And some other languages, they, you know, they've tried to incrementally do some innovations. [04:24.280 --> 04:28.320] But after a while, the original sources picked up those changes. [04:28.320 --> 04:33.800] In this, like, CoffeeScript is a very famous example, in which the original language picked [04:33.800 --> 04:40.680] up those changes and nowadays a lot less people actually use CoffeeScript. [04:40.680 --> 04:45.680] So how we're doing on time, okay. [04:45.680 --> 04:50.560] So the question is then also, why did Jose, kind of the creator of Alexa, why did he write [04:50.560 --> 04:52.480] a new language? [04:52.480 --> 04:56.440] And he was at a time when he wrote, Alexa was working at the Rails team. [04:56.440 --> 05:02.280] And one of the things that he faced was trying to make Rails thread safe, so making sure [05:02.280 --> 05:07.080] that several threads that were running in the Rails program weren't interfering with [05:07.080 --> 05:08.080] each other. [05:08.080 --> 05:11.920] And by doing that, he was actually looking around, how did other, like folks, how there [05:11.920 --> 05:16.400] are other problems in languages, other frameworks, how did they solve that issue? [05:16.400 --> 05:19.080] And that's when he actually stumbled upon Erlang. [05:19.080 --> 05:20.080] And he liked it. [05:20.080 --> 05:25.400] It was, you know, just the thing he needed to use. [05:25.400 --> 05:30.000] But there were also some things that he was actually missing. [05:30.000 --> 05:35.320] So for starters, the syntax stems from Prolog. [05:35.320 --> 05:37.960] So it's unfamiliar for a lot of people. [05:37.960 --> 05:42.920] So that means that new people who come to Erlang have to, you know, have a high barrier [05:42.920 --> 05:51.280] to, okay, high barrier to actually get around because they feel unfamiliar with the syntax. [05:51.280 --> 05:53.560] So he did that first. [05:53.560 --> 05:58.120] And he also introduced other new syntax, for example, the pipe operator in which, like [05:58.120 --> 06:04.760] the result of the previous expression, is piped into the next function as a first parameter. [06:04.760 --> 06:09.760] So by doing that, you can avoid having a very nested function calls by having something [06:09.760 --> 06:14.320] that's more readable, more clear to other people. [06:14.320 --> 06:22.560] He also introduced more extensibility to the language by introducing macros and protocols. [06:22.560 --> 06:24.880] And one of my favorites is actually the bottom one. [06:24.880 --> 06:29.720] I'm not sure if everybody can read it, but it's an upcase function which takes a string [06:29.720 --> 06:31.960] and upcases every letter. [06:31.960 --> 06:34.600] And it does that under the hood via a macro. [06:34.600 --> 06:42.120] So the Unicode definition, like the library definitions of characters is downloaded and [06:42.120 --> 06:45.720] actually being translated to functions under the hood. [06:45.720 --> 06:51.400] So when you call this, you're actually using, you know, some data that is transformed into [06:51.400 --> 06:54.840] functions for the language. [06:54.840 --> 06:58.200] I'll skip over this part because we don't have judgment time. [06:58.200 --> 07:01.440] And you also actually see that those macros are used everywhere. [07:01.440 --> 07:08.040] So even like, you know, defining a module is a macro, defining a function, et cetera. [07:08.040 --> 07:13.360] Everything is actually implemented through macros. [07:13.360 --> 07:17.200] The other thing that he also introduced is the build tool to make it easier for people [07:17.200 --> 07:20.880] who are, for example, new to the language. [07:20.880 --> 07:25.360] If you want to have a package manager, like before, didn't really have package management, [07:25.360 --> 07:32.000] like in the sense that you could add packages to your project, but you had to download them [07:32.000 --> 07:36.560] by yourself, put them somewhere, define it in your config, like, okay, this is the path [07:36.560 --> 07:39.600] to my library that I'm using. [07:39.600 --> 07:46.040] And with Hex and with Mixed, Alex just made it easier, but, you know, by having a list [07:46.040 --> 07:51.520] of dependencies and go download it from a central place. [07:51.520 --> 07:54.320] Documentation was also made more prominent. [07:54.320 --> 07:57.720] For example, the doc tests, which are inspired by Python. [07:57.720 --> 08:04.680] So in this case, we have a function defined, and above it is a document, a comment in which [08:04.680 --> 08:06.400] there's an example. [08:06.400 --> 08:12.800] And this example doesn't serve only for documentation, but at the same time, it's also tests. [08:12.800 --> 08:17.240] So, you know, actually, you can, if you would change the implementation, you can directly [08:17.240 --> 08:24.080] see the effect of it because the test is just above it as documentation fails. [08:24.080 --> 08:32.320] So, and, yeah, the documentation is also accessible from Rappel, from other places. [08:32.320 --> 08:34.360] And this was built before the LSP. [08:34.360 --> 08:38.640] So nowadays, you can, you know, just hover over function in your editor, and you will [08:38.640 --> 08:40.480] see the documentation. [08:40.480 --> 08:46.840] But when Elixir was created, those functionalities weren't that common, like among other languages, [08:46.840 --> 08:50.080] and that's something that's really nice to work with. [08:50.080 --> 08:55.960] And the last thing that he kind of also introduced is a different culture, a culture which is [08:55.960 --> 08:58.520] a little bit more open to newcomers. [08:58.520 --> 09:04.200] So it's not like Erlang, you know, shed away from newcomers, but it also didn't, like, [09:04.200 --> 09:15.000] make it easier for new people who are new to the language to get started with it, et cetera. [09:15.000 --> 09:21.360] So that whole, you know, like, to come back to my question, like, is Elixir in kind of [09:21.360 --> 09:24.040] new flavor on top of Erlang? [09:24.040 --> 09:28.960] I think there are kind of projects stemming from Elixir which make it more interesting [09:28.960 --> 09:30.160] and which are really new. [09:30.160 --> 09:38.880] So, for example, NX numerical Elixir is an extension which makes machine learning easy, [09:38.880 --> 09:42.800] and that's something that, you know, before Elixir, nobody actually thought would be useful [09:42.800 --> 09:47.760] to do with the beam, with the Erlang VM, because it wasn't meant for that. [09:47.760 --> 09:52.040] It wasn't meant for numerical, for number crunching. [09:52.040 --> 09:58.240] But this library, this tooling actually makes it a lot easier to do, and that's very promising. [09:58.240 --> 10:03.840] Phoenix is actually a web framework which was inspired by Rails, and now study arounds. [10:03.840 --> 10:08.840] Phoenix is now an inspiration for Rails and other frameworks to work with. [10:08.840 --> 10:14.880] And NERVs is also kind of an interesting project which makes it possible to run on smaller [10:14.880 --> 10:19.160] devices like Raspberry Pis or something like this. [10:19.160 --> 10:22.640] So to answer the question, is Elixir really different from Erlang? [10:22.640 --> 10:27.040] Is it really, you know, an innovation or is it rehashing? [10:27.040 --> 10:28.360] I would say no. [10:28.360 --> 10:38.480] I think Elixir really adds something to the whole ecosystem, which wasn't that easy before that. [10:38.480 --> 10:48.920] So with that being said, thanks for listening. [10:48.920 --> 10:49.920] Thank you. [10:49.920 --> 10:54.240] Unfortunately, we don't have any time for Q&A, but you can find, don't you? [10:54.240 --> 10:55.240] Yes. [10:55.240 --> 10:56.240] Here. [10:56.240 --> 11:01.320] Again, I usually have the handle toxified, so on Twitter, if it still works or mastered [11:01.320 --> 11:04.120] on you, you can also find me. [11:04.120 --> 11:07.680] And I'll be around, I think, for today if you have any further questions. [11:07.680 --> 11:11.160] So thanks again for listening, and apologies for being this late. [11:11.160 --> 11:12.160] Thank you again. [11:12.160 --> 11:13.160] Thank you. [11:13.160 --> 11:14.160] Thank you. [11:14.160 --> 11:15.160] Thank you. [11:15.160 --> 11:16.160] Thank you. [11:16.160 --> 11:17.160] Thank you. [11:17.160 --> 11:18.160] Thank you. [11:18.160 --> 11:19.160] Thank you. [11:19.160 --> 11:20.160] Thank you. [11:20.160 --> 11:21.160] Thank you. [11:21.160 --> 11:22.160] Thank you. [11:22.160 --> 11:23.160] Thank you. [11:23.160 --> 11:24.160] Thank you. [11:24.160 --> 11:25.160] Thank you. [11:25.160 --> 11:26.160] Thank you.