11 ms·
Changelog for Elixir v1.11
- unvs 6y agoIt's not out yet, for anyone who got excited (like me)
- mercer 6y agoIf you (like me) can't wait for the official release, use asdf to install the master branch. I've been using Elixir 1.11 for a while now and haven't run into any issues!
- beck5 6y agoThanks for the great work, I am a big Elixir and Phoenix fan. Although I don't think it will ever hit the heights of ruby or node in terms of popularity, I believe elixir and phoneix are very good long term bets. The improved Compiler checks are a great step in the right direction. I know elixir language isn't going to change much (if at all?) now, so putting more time into things like safety and developer productivity will be warmly welcomed.
- brobdingnagians 6y agoI was just thinking that a language not changing much can be a sign of a very good initial design. Having to change things all the time is often a sign that there is a major flaw in the foundation. Good to see a language that is very active, but refining rather than ripping out the floors.
- mrjoelkemp 6y agoA talk in ElixirConf this year showed that the pipe operator in Elixir is just a macro. A Code BEAM V conf Q&A with Jose had a (playful, trolling) question about implementing right handed assigns and Jose said that you can just write a macro if you want it. That all reinforces that the core lang doesn't need to change really; it's extensible enough to let you do whatever you want on top. Pretty cool.
- phasnox 6y agoI have used Rails and Django extensively in the past, and I tell you there is no way I'm coming back after using Phoenix and Elixir. For me, is not just the concurrency primitives that I now take for granted, but also the fact that you can write beautiful maintainable code.
- noneeeed 6y agoWhat do you think it is about Elixir that leads to beautiful/maintainable code? I keep thinking about giving it a try.
- slindz 6y agoMy mind instantly darts to the combination of piping + pattern matching. Edge cases can live as two line adjustments in ways I don't know how to do in any other language.
- PaulStatezny 6y agoCouldn't have answered the question better/more succinctly myself. When I'm working on the JavaScript (front end) side of an Elixir project, I repeatedly get into these positions where I'm thinking, "Man, I could express this so succinctly and elegantly in Elixir. There's no way in JavaScript that doesn't feel clunky in contrast."
- enraged_camel 6y agoWorth noting that the concepts of piping and pattern matching don't just exist in the language itself, but also in an architectural level. Plugs, for example, allow you to "pipe" entire web requests in a very elegant and logical fashion.
- noneeeed 6y agoThat makes sense. For a period of my career I did some Prolog and always liked the way pattern matching allowed you to write extremely descriptive code. Funnily enough, I think pattern matching is one of the most exciting things to happen in Ruby for a long time. While it isn't on a par with functional pattern matching it's still going to be incredibly useful.
- thejosh 6y agoWith this and change for JIT, Elixir/Erlang is looking super exciting lately.
- cultofmetatron 6y agojump in! I've been working with it for my startup for the last year and its been a breath of fresh air. 1: phoenix is fast and almost as expressive as ruby (15 ms response times) 2: weird timing bugs don't show up in my code. 3: the tooling is fantastic, a close second second only to rails 4: Ecto beats active record and is easily the best data mapping layer I've worked with. All the nodejs orms I've used in the past felt like clunky toys by comparison. 5: websockets via channels is second to none. seriously, django channels and rails action cable directly copied it but they are not as performant. you can scale a single machine to handle a few thousand connections out of the box and it supports multicluster and long polling to boot. 6: absinthe is great for graphql. 7: live view, think turbolinks on steroids. you can send down updates to the client dom over websockets.
- thejosh 6y agoI've been using Elixir extensively and as my primary language since since 2016, and love it. :-) Agreed about all the points, but the tooling could be slightly improved, but that's being done a lot now. Agreed about all points :-)
- aloukissas 6y agoAgreed! On frontend, Phoenix is missing support for component-driven development. LiveView is going that direction, borrowing some react concepts, so I wouldn't be surprised if we saw something like this soon.
- davydog187 6y agoYou might be interested in Surface then https://elixirforum.com/t/surface-a-component-based-library-for-phoenix-liveview/27671 https://elixirforum.com/t/surface-a-component-based-library-...
- izietto 6y agoI'd be curious to know if WhatsApp engineers evaluated using Elixir, if they are using Elixir only partially or not at all, and which are the reasoning behind that
- cultofmetatron 6y agoI don't think elixir existed when they were first creating whatsapp
- dmitriid 6y agoWhatsApp predates Elixir by several years. And they are using Erlang (Elixir runs on top of Erlang VM).
- dnautics 6y agomy understanding is that they are not using elixir at all, but that is secondhand knowledge.
- princevegeta89 6y agoIncredible. Been using this stack for an year and I'm super excited for the future. Lately I also do see multiple new companies picking it up for different workflows and applications. Though it may not reach Ruby levels of popularity, it's still just fine. Learning curve is favorable, performance is stellar, and the toolkit that comes with the language is quite featureful. I see other languages borrowing elements from Elixir - especially LiveView and Pattern Matching. The only hiccups I faced where when I had to roll out my own solutions for a few things (a background job processor, error manager, a mocking module for unit tests, etc.) Even with all this, I'd still say Elixir is worth it, given the performance gain and the patterns it enforces. It all just makes the code easy and understandable.
- pselbert 6y agoRolling your own tools is an irreplaceable way to learn things thoroughly. That said, HN readers from outside the Elixir should know there are great libraries for all of those use cases. Point in case is background job processors—we have plenty of options, though I’m especially fond of Oban[0] (full disclosure, I’m the author). [0] https://github.com/sorentwo/oban https://github.com/sorentwo/oban
- princevegeta89 6y agoI got into it before Oban was ever released. However, it seems like a solid solution. I've looked at Faktory as another great option as well: https://github.com/contribsys/faktory/ https://github.com/contribsys/faktory/
- dnautics 6y agohaha, yeah the annoying thing about elixir is that sometimes, you give up, roll your own solution (because it's not terribly hard to do), and then right after you're done, some team has built a slightly better solution (because it's not terribly hard to do).
- AlchemistCamp 6y ago> Rolling your own tools is an irreplaceable way to learn things thoroughly. I completely agree. It's also a great way to avoid complexity you don't need. There are limits, but especially while learning I like to err on the side of fewer dependencies. BTW, I just now saw that getoban.pro was a thing. It looks great!
- dmitriid 6y agoI keep being drawn back to Elixir because of the error messages alone. Just look at that beauty.
- ch4s3 6y agoThe calendar improvement is small, but nice. Calendar.strftime/3 will make Timex less necessary in some apps.
- PaulStatezny 6y agoThere are a lot of cool improvements in 1.11, but I admit this is probably my favorite! Timex is great but I'm looking forward to having one less dependency on basically every project. ^_^
- deltron3030 6y agoIs anybody working on (VR/AR) telepresence/fpv stuff with Elixir? (Think of the new Nintendo toys where you control an RC car through an UI on another device). Elixir and a combination of Nerves and Phoenix seems like a good fit for applications like this..
- ch4s3 6y agoI don't personally, but Teladoc[1] uses Elixir for telepresence in healthcare. [1] https://www.teladoc.com/ https://www.teladoc.com/
- deltron3030 6y agoThanks!
- jatins 6y agoElixir looks pretty interesting however lack of static types has held me off from picking it up. Curious what the experience of people with typespecs and Dialyzer has been: 1. How close do you think it comes to static types? 2. Does it have good IDE plugins providing type errors as you code?
- g5becks 6y agoIt comes nowhere close, if you are used to programming in languages with static types, the devx is just not on the same level. That being said, pattern matching is very powerful, and gives you a lot of what static types gives you in terms of safety. I’m just to spoiled by the level of productivity I get from editors when using a languages with static types at this point and using elixir full time would feel like taking a step backwards.
- Touche 6y agoBy contrast I'd rather not go back to meticulously decorating source files to add types where they aren't needed, so Elixir seems like the perfect language to me.
- dugmartin 6y agoIf you squint sideways pattern matching on structs plus guards is sort of like type checking (but not really). The map checking mentioned in the changelog will be a nice addition. I've been doing both a lot of TypeScript (for work) and Elixir (for personal projects) for the last few years and I do get a stronger sense of safety from TypeScript (especially during refactoring) but Elixir feels much more concise and fun to work in and the Phoenix event ticketing app I've been running for the last 3 years has been rock solid. btw I've been programming for 30+ years with all sorts of untyped, dynamically typed and statically typed languages. I still haven't found "the one true language". Something like strongly typed CoffeeScript that runs on BEAM would be close (I've been watching Gleam for a while and I plan to play with it after it matures a bit more).
- vendiddy 6y ago
- abiro 6y agoHow does a typical Elixir deployment on AWS look like? Anyone got a CloudFormation or Terraform config to share?
- dugmartin 6y agoIf you want to host a Phoenix app on AWS I would use a Docker release and then point the DB at RDS. You can run Docker under ECS/Fargate or Elastic Beanstalk. Here is a nice intro to Phoenix Docker releases: https://hexdocs.pm/phoenix/releases.html#containers https://hexdocs.pm/phoenix/releases.html#containers
- Touche 6y agoThere's also Gigalixir which runs on top of AWS and gives you a Heroku like experience.
- freedomben 6y agoGigalixir is a great experience. Like Heroku you'll pay for it as you scale however. But if you don't want to hire a devops person, it's still probably cheaper than the alternatives.
- freedomben 6y agoSeconded. This is what I do, the only exception being that it goes to K8s/OpenShift instead of AWS-specific CaaS offerings. You can easily treat a Phoenix app like you would a rails app, or you can go full on into releases and ship it like a binary. It's all up to you and whether you value easy production debuggability or simplicity, etc.
- jpittis 6y agoIs Elixir really the general purpose productivity tool that comments here (and on other HN posts) make it out to be? I've loved playing with Erlang and Elixir. The concurrency model and approach to failure are fascinating and clearly powerful for certain problems. Elixir's Pheonix feels as productive as Rails. I've read most of Joe Armstrong's books and watched most of his talks. However, I feel like I can throw my daily driver programming languages including Go, Ruby, Rust... even Haskell at any problem and give or take performance, come out the other end with high quality software at scale. When I last wrote Elixir, it felt great when I was doing basic Rails shaped work or lower level concurrency heavy networking (I was playing with TUN/TAP interfaces), but I really can't imagine it as a general purpose programming language. For example I can't imagine scripting in Elixir, but I can and do in the other languages mentioned above. Also I remember trying to write a parser library and it felt way more verbose and unmaintainable than the equivalent Haskell or Rust. This is hand wavy, but does anyone feel what I'm getting at? Any thoughts?
- slindz 6y agoElixir has been my daily driver for four years, I came from a brief stint in Ruby. It's true that most problems are largely manageable by most/all languages. What I've come to appreciate is how often Elixir has made me a better programmer with its conventions. Their choices have steered me away from a lot of foot guns and forced me to learn better ways to do things.
- bcrosby95 6y agoI don't think Elixir aims to be a general purpose scripting language. I only use it for hobby stuff, but lately I've been writing my scripts in a few languages to compare their characteristics: performance, lines of code, and delta code change when making a single threaded script into multi threaded. I find that Elixir code for these tasks tends to be a bit longer than standard scripting languages, a bit shorter than Go/Java, with performance around Go and slightly better than Java. One of the interesting things I find though is that with the Flow library, bringing it from single to multiple threads tends to require fewer changes - generally I just have to change some uses of Stream to Flow and I'm up and running with a solution that's using all my cores.
- jswny 6y agoFor most people, the standout change here will be the addition of `config/runtime.exs`, which is SUPER exciting! Before, runtime configuration was only available in “releases”, which is Elixir’s packaged tarball for deployments. All other configuration was compile time only. However, running your app locally in a development environment through `mix` would technically compile the app, so even though you didn’t have runtime config, it “felt” like runtime. Because of this special feature of releases which had their own (and the only) runtime config, you often had to duplicate your config in the runtime config file and the regular compile time config file (for outside releases). Now, with this new addition, there’s one unified place where ALL runtime config is defined, and which supports runtime config in ALL the different ways you run your app. To me, this is a huge UX improvement for Elixir devs!
- thomasfortes 6y ago> To me, this is a huge UX improvement for Elixir devs! That's awesome, I have a module that is a helper to inject data in a socket to use with liveview but the data that I need isn't present in the dev environment and mocking it is annoying because if I use Mix.env the code in the release breaks, being able to pass an ENV var and just check it to decide to mock it or not will simplify a good amount of code.
- Kaze404 6y agoI've been writing Elixir professionally for a couple months now and I find it fascinating how many tools Elixir gives you to play with. However, I started a toy project in it and immediately ran into trouble due to its dynamic nature. Printing function arguments to see what they are, runtime errors... Is there a way to get around this besides adding spec tags on everything?
- jswny 6y agoIt depends on what you are struggling with. If you want formal type documentation and some decent type checking, Dialyzer is pretty good. That’s really the only solution for Elixir. If you want full static type checking, there is https://gleam.run/ https://gleam.run/ which is a new language, and there’s also something that seems like a full static type checker for Erlang which is going to be released by Facebook soon (they use it internally). See this: https://elixirforum.com/t/facebook-is-writing-a-new-statically-typed-language-to-run-on-the-beam/29829 https://elixirforum.com/t/facebook-is-writing-a-new-statical.... I, for one, am hoping that the Facebook solution allows us to implement something in Elixir to interface with it so that we can take advantage of it in Elixir, but that is yet to be seen.
- Kaze404 6y agoI've been using Dialyzer and it works well enough most of the time. Maybe the Elm compiler spoiled me, but when Dialyzer tells me "this pattern will never match" and not offer me tools to fix it, it's very frustrating. I'm not sure if it's possible, but it would be nice to have an action to autocomplete missing patterns like in Elm / Rust. That said, I'll take a look at Gleam. Thank you
- jswny 6y agoYeah the big problems with Dialyzer are that it can be slow at times and that the error messages are not great. However, a lot of the error messages are the same esoteric messages, and you can get used to debugging them when you know what they are trying to call out.
- 6y ago
- dfischer 6y agoThis is awesome. I’ve been using Elixir for a long time and the abstractions with BEAM/OTP make it quite a powerful platform. Great additions to the ecosystem. As an aside, I’ve been playing with Factor recently and it’s been quite the learning experience with concatenative paradigms. I mention it because I was surprised it had erlang-like concurrency models in it (actor, and more). Fun!
- AlchemistCamp 6y agoThe JIT looks exciting, though to be honest I've never encountered any significant performance issues with Elixir in four years of use. Probably the even bigger quality of life improvement for me will be the improvements in recompliation. Greatly reducing the files to be recompiled when a file is touched should be a nice dev experience improvement when working on projects with large numbers of files.
- losvedir 6y agoOh, a lot of good stuff in this release! I'm especially excited to be able to pass a map to Logger and have it print `key1=value1 key2=value2`. I thought Jose had said earlier that Elixir was basically "done" a version or two ago, which I was impressed by; how often is software ever finished? But it looks like we're still getting some juicy functionality nuggets.
- bradgessler 6y agoWhen I compared Elixir/Phoenix vs Ruby/Rails to build a web application a few years back, I ultimately stopped using Elixir because the third party libraries superficially seemed to be more immature and not as well maintained. Most semi-popular RubyGems are in v1.0+, have contributions and bug fixes within the past few months, and have a feeling of community around them. There’s even huge companies like GitHub, Shopify, and Basecamp behind some libs. Elixir mix packages felt abandoned. Most were in the low digits 0.0.x, no commits for over 6 months, and the docs seemed to have a lot of notes in them that it’s early, not maintained, don’t use in production, etc. Has this changed recently? Can anybody speak to why the Elixir ecosystem feels more empty?
- jerryluk 6y agoElixir/Phoenix feels like Rails back in 2008 when we built one of the largest Rails app. It will take time for the community to develop. That being said, my company has been using Elixir/Phoenix for three years and while many times there isn't a library for Elixir, often times there is already a stable Erlang library we can use. https://github.com/h4cc/awesome-elixir https://github.com/h4cc/awesome-elixir is a great source. We have also changed our habit from looking for third-party libraries to either building our own module which we discovered they are fairly easier to build than we thought, or coming up with alternate solutions that built on top of the powerful Elixir/Erlang technology (e.g. OTP).