8 ms·
Joy of Elixir (2020)
- tiffanyh 4y agoFast loading site. I appreciate the effort they went through to make this site so performant.
- quickthrower2 4y agoMaybe they use Phoenix :-)
- WaffleIronMaker 4y ago> This book is written in HTML + CSS and is compiled with Jekyll. https://github.com/radar/joyofelixir https://github.com/radar/joyofelixir
- auraham 4y agoIt was the first book I read to learn Elixir. Definitely one of the best resources to get started with the language. After reading that book, I suggest the Pragmatic Studio Elixir course [1], and anything that Dave Thomas [2] and Sasa Juric [3] write. [1] https://pragmaticstudio.com/elixir https://pragmaticstudio.com/elixir [2] https://codestool.coding-gnome.com/ https://codestool.coding-gnome.com/ [3] https://www.manning.com/books/elixir-in-action https://www.manning.com/books/elixir-in-action
- arrowsmith 4y agoThe Pragmatic Studio courses are great - I highly recommend them. If you're coming to Elixir from a Rails background and you want to learn Phoenix, I think the course Phoenix on Rails is good (although I'm biased, since I created it). http://phoenixonrails.com http://phoenixonrails.com
- mccorrinall 4y agoI recently had to deal with Elixir for my very first time. All I wanted was to dump a db from the ErlangVMs built-in mnesia, and it was so awful if you only know SQL, Firebase and friends. Took me and a friend over two hours to find out that you can only read and restore a mnesia dump if the user@node is 1:1 the same as the original. I most likely won’t touch it again except if I get a job at some telecommunication provider. The experience was too awful.
- toast0 4y agoYour frustration is understandable, but if you end up in the same spot again... You're not really expected to copy a mnesia dump to another node that way, the expectation is you would add the other node to the dist cluster, then add that dist connected node to the shared mnesia schema (each node can only be in one mnesia schema, but you can have multiple schemas in your dist cluster), and then add table copies for the tables you want, with the storage you want on that mode. You could probably fiddle with the schema directly before starting mnesia to make it work though. That aside, the data files are accessible via the underlying storage modules, disc_only_copies tables use dets and have .DAT extensions (you'll likely have schema.DAT), and disc_copies use disk log and you'll have .DCD and probably .DCL, LATEST.LOG and PREVIOUS.LOG may exist as well. File type informtion is in the documentation with a pretty reasonable chapter title https://www.erlang.org/doc/apps/mnesia/mnesia_chap7#startup-files,-log-file,-and-data-files https://www.erlang.org/doc/apps/mnesia/mnesia_chap7#startup-...
- mccorrinall 4y agoWell, it was an old database and we actually just wanted to browse the records to see if there is anything important in them. If I had an old sql backup laying around and want to check whether we will need any of this data in the future the experience is much more straight forward. The path of mnesia was not so easy and intuitive. :X
- throwawaymaths 4y agoWho the heck is using mnesia? I've never used an elixir codebase that uses it, and it's (I believe) considered to "not be best practices".. not the least of which is because it's well known that mnesia can lose data irrecoverably.
- WaffleIronMaker 4y agoAt a high level, starting with "what is a variable" and then going to "now we're talking about maps" seems like it misses some important pedagogical context. If the reader is really unaware of what a variable is, they are probably going to want to learn about things like if statements and functions to understand the value of variables before they start moving on to data structures. Talking about the structure of data only makes sense once you have an understanding of the data you want to structure. For a reader still grappling with programming, I could anticipate this chapter order to be unnecessarily challenging. But, overall, good work! I think the playful tone makes the technical content more easily digestible, and this is certainly better than having no book on Elixir. I would just focus on ordering the content in a way that lets concepts gradually interact, rather than having them be completely separate.
- auraham 4y agoI do not think Elixir is a good fit for learning programming for the first time. On the other hand, I considered that "Joy of Elixir" is suitable for people that have programmed in other languages, like Python. Therefore, the gap between "what is a variable" and "maps" is not that big.
- quickthrower2 4y agoGenuine question. It has been a long time since I was a beginner programmer. Does all the cutesy "slow introduction" stuff appeal to novice programmers? I am kind of impatient, so it seems a bit annoying to me. If I were learning something technical that I am new to, say flying a plane, or biology I would prefer just to get stuck in. I would expect a pedagogical approach of course to easy me into it. But the cutesy stuff would feel like unnecessary slowing me down.
- pdimitar 4y agoAs a guy who swears by Elixir, I completely support you. I'd wish somebody to sell Elixir to me with transparent parallelism, demonstrating that it's literally 2-3 extra lines of code (compared to other languages where the extra code you have to write is significant). Pepper it with pattern matching and preemptive concurrency and I'm sold in 5 minutes. I wish people stopped evangelizing.
- sph 4y ago(I guess it's time to post this video again.) Saša Jurić - The Soul of Erlang and Elixir: https://youtu.be/JvBT4XBdoUE https://youtu.be/JvBT4XBdoUE This is in my opinion the best demo of Elixir, the BEAM, OTP and any programming language, ever. If this doesn't pique your interest, nothing will.
- srikz 4y agoI was already fascinated by Elixir, but this video drove the nail home. It's a great presentation and I don't think I have watched any conference talks (on YouTube) without taking a break except this one.
- whalesalad 4y agoI didn’t want cutesy shit either so I went with the Dave Thomas course and it was solid. https://codestool.coding-gnome.com/ https://codestool.coding-gnome.com/
- pdimitar 4y agoI love Elixir and I bet the last 6.5 years of my career on it (and Rust) and I don't regret it for a minute. And exactly as a guy like that, I would prefer intros be much more technical, cold, even robotic -- and elevator-pitch-like. Yes, even those in books, although I'll admit that it's expected that you have sought such an intro by yourself before reading the book. Still, if I was writing a book I'd include an elevator pitch right at the start. I attended EuRoKo 2016 where Jose Valim made a lightning talk about Elixir. He did sell Elixir to me in 10 minutes indeed, for which I am extremely grateful. He showed right there and then how you can have two nodes (computers, VMs, even two separate shells on the same machine) distribute work to each other. Demo-ed a few other features and I got immediately interested. Furthermore, trying to act cute or informal in such a material is a turn off for me. Let's keep it professional, folks. --- Even with that, I recommend Elixir to anyone who doesn't need beastly speed in their programs and for whom the lack of strict static typing is not a problem. It offers a number of advantages that 99% of all other languages out there don't -- like almost completely transparent parallelization, preemptive scheduling and fault tolerance.
- travisgriggs 4y ago> He did sell Elixir to me in 10 minutes indeed, for which I am extremely grateful. Could you elaborate on this more? Elixir’s an interesting beast. On one hand, it’s just Erlang by another name. And yet Elixir also brings some merits of its own. How much of Jose’s pitch was for Elixir-the-alter-Erlang? And how much was for something other than Erlang?
- pdimitar 4y agoWell I have no experience in Erlang -- only checked it out a few times and I like that Elixir removes some of the more manual aspects of Erlang (like manually exporting functions from a module). So, why Elixir (and partially why Erlang): - (Erlang + Elixir) Transparent parallelism. This is not a joke. You're a function + closure away from multiplexing stuff on all your CPU cores (or even more e.g. it's OK to have a limit of a worker pool be 100+ for e.g. network workers). - (Elixir-specific) A lot of tools around fault tolerance and supervision trees. You can have static hierarchies and you can have dynamic ones (spawn children, have them do work, have them shut down). You can register green threads by name and enforce limits on how many of them are around, you can also load-balance work between several nodes. - (Elixir-specific) Macros: you can generate code at compile-time which is extremely useful if you want to limit the set of values that you'd work with at run-time. Example: the Unicode functionality of Elixir is actually generated by macros that basically do a `for` loop of all codepoints / graphemes and utilizes pattern-matching on each value. Super tedious by hand, extremely trivial with macros / code-generation. Useful in many other scenarios as well e.g. you can inject code in a receiver module with macros. - (Erlang + Elixir) Pattern matching. While the languages sadly have no static strong typing, pattern-matching helps a ton e.g. interacting with remote APIs you can match on several expected responses and report everything else to your monitoring system, leading to very effective and prototype-friendly development process. - (Elixir-specific I think) Flow control. You can basically make pipes of functions exactly like all the classic UNIX tools allow you to. I've heard devs scoff at that a good amount of times... same devs were like "OMG how did I live without this so far?!" a few days later. :D It makes for extremely elegant and readable code that allows near-instant onboarding (or reminding oneself of the code they wrote a while ago). - (Erlang + Elixir) Built-in in-memory cache. The ability to not care about Redis / memcached is a much bigger deal than many suspect. Granted it's a single-node only but honestly? Never mattered in my practice. --- There are others but this comment became huge already. Main selling point for me as a senior backender and aspiring sysadmin is the extremely easy parallelism and very terse code (that's owed by the piping mechanism of Elixir). The ability to structure your app as a tree of supevisors and workers (that get auto-restarted on failure nonetheless) is a very close third. Elixir absolutely isn't a silver bullet -- f.ex. it sucks for CLI apps because the VM takes no less than 0.5s to start -- but for a ton of server apps it's up there in the top 5-10 with Rust and Golang.
- systems 4y agohumble bundle have a nice bundle for elixir https://www.humblebundle.com/books/elixir-programming-pragmatic-programmers-books https://www.humblebundle.com/books/elixir-programming-pragma... 19 books for around 18 us dollars (at the time of this comment it had 9 days left)
- auraham 4y agoWonder how they can offer a bunch of book for a low price.
- eddof13 4y agoI'm not an elixir programmer but I saw that and decided to pick it up
- dharamgollapudi 4y agoWhile most of these resources could be still valuable, to avoid buyer's remorse, pay attention to the publishing dates, as some of them are very dated: 2022 - $18.95 - Build a Weather Station with Elixir and Nerves 2022 - $18.95 - Build a Binary Clock with Elixir and Nerves 2022 - $15.00 - Programmer Passport: OTP 2022 - $15.00 - Programmer Passport: Elixir 2021 - $27.95 - Testing Elixir 2021 - $26.95 - Concurrent Data Processing in Elixir 2021 - $22.95 - Genetic Algorithms in Elixir 2020 - $27.95 - Real-Time Phoenix 2019 - $26.95 - Programming Ecto 2019 - $28.95 - Programming Phoenix 1.4 (Current version is 1.6) 2019 - $26.95 - Property-Based Testing with PropEr, Erlang, and Elixir 2019 - $24.95 - Designing Elixir Systems with OTP 2018 - $27.95 - Programming Elixir 1.6 (Current version is 1.14) 2018 - $27.95 - Craft GraphQL APIs in Elixir with Absinthe 2018 - $26.95 - Functional Web Development with Elixir, OTP, and Phoenix 2018 - $24.95 - Learn Functional Programming with Elixir 2018 - $24.95 - Adopting Elixir 2015 - $11.00 - Metaprogramming Elixir 2014 - $27.95 - Seven More Languages in Seven Weeks
- travisgriggs 4y agoLast year, I needed to build an MQTT-HTTP bridge. Lots of concurrent long lived stateful connections. Elixir’s “we ain’t never seen a thread count that scared us” attitude was intriguing. So I took a chance. If you want a paradigm shift for a change, Elixir is fun. It will probably be a bumpier uphill climb than your run-of-the-mill-syntax-populism-mainstream languages that vie for your engagement now days. I had never realized before how much of my code in the Algol-wearing-the-ObjectOriented-vestry[1] languages is just there to navigate to code that does something. Half of the code is just to determine where the code goes next. Go around? Leave now? This way or that? How bout a three way! Goto! Jump! Elixir doesn’t solve these problems in the traditional way, and it kind of messes with your brain. A bit like the Grinch standing atop Mount Crumpit: “They code it without loops, without (traditional) if blocks, without switches. And even without return statements, of all things!” The Elixir slack group is one of my favorite. They helped me out a lot. The Dave Thomas book was OK; I haven’t tried any others yet. The system runs pretty solid. It was a 6 month or so project. It uses OpenAPI, Bandit (http server), Finch (send http), and Tortoise (MQTT). Other than the library names, which I think the community draws out of a magic and random hat somewhere, it’s pretty straightforward. It’s the least of the worries in our petty varied stack. And it’s lived up to my hopes regarding its threading story. If there’s a thing that worries me about Elixir, it is that—like the Ruby/Rails community that it draws a lot of individuals from—it’s sort of a one trick pony right now. It’s a backend web tech. That’s obviously where the money is. I just don’t/can’t use it for a desktop app (realistically), or mobile development, or front end web, or command line tools (yes there’s the escript thing, but I don’t see a big execute-in-Elixir movement) or embedded (yes there’s Nerves). All the job posts I see in the Elixir slack channel are for web stuff. I’d guess 95% equate Elixir and Phoenix together. Still, if someone offered me a job furthering the use of Elixir in something other than “come help us change the world with yet another novel web service”, I’d probably be really tempted. -1. My dis her is not OO itself, but on the crappy job many mainstream languages have done of executing it. A sort of “I invented the term OO and this isn’t what I had in mind” channeling.
- AlchemistCamp 4y ago> It will probably be a bumpier uphill climb than your run-of-the-mill-syntax-populism-mainstream languages that vie for your engagement now days. What makes you believe that? IMO, the immutability and pattern matching eliminate a huge class of common frustrations that beginners usually have with the most popular half dozen programming languages. I think all of them, especially JavaScript, PHP and C are harder to learn than Elixir, unless you already know another similar language.
- cercatrova 4y agoI like the BEAM and philosophy of Elixir, but there's just...no static typing. As someone coming from TypeScript and Rust, this makes it a very hard sell when I can write web servers with either language just fine and have the compiler catch the many errors I've made. I suppose there is Gleam but the more esoteric the language (or technology in general), the harder it is to debug, so I don't want to be stuck with that kind of situation for a production environment.
- hdra 4y agoagreed. while not a deal breaker for me, i just wish the type hinting system is a more integrated part of the language rather than the awkward annotation-like system that it is right now
- gregors 4y agoIt's the chocolate ice cream vs vanilla ice cream argument. There isn't an accounting for taste. If static typing if your thing it's never going to taste the right way to you. I'm just the opposite, I greatly appreciate dynamic languages and if Elixir had been static I wouldn't be using it. That's probably from my Ruby experiences. My own stylistic tastes change from year to year but that's where my current taste is set. I keep seeing dynamic languages add type hints or bolt on static checkers. I personally just don't get it. I'd much rather just use Rust, Crystal, Golang, Java or Haskell if that's what I wanted.
- cercatrova 4y ago> I keep seeing dynamic languages add type hints or bolt on static checkers. I personally just don't get it. I believe it's because at scale, like Ruby at Stripe or Shopify or GitHub, it gets very difficult to change things without other stuff breaking, which a static type system ameliorates. Personally that's why I like static typing over dynamic, as I've initially started with dynamic languages like Python and JS and moved over to static variants because of all the frustrating mistakes I made which a compiler could have caught.
- 9gagceo 4y agoFWIW there is an ongoing PhD scholarship for researching and developing a type system powered by set-theoretic types for Elixir. [0] [0]: https://twitter.com/josevalim/status/1535008937640181760 https://twitter.com/josevalim/status/1535008937640181760