27 ms·
10 years-ish of Elixir
- josevalim 6y agoAuthor here! The article was published earlier this week and I have a quick addendum: regarding Erlang/Elixir, my goal has always been to bring new developers to the platform. After all, Erlang developers already have the most important part of Elixir, which is the Erlang runtime! There are also key people in both communities working hard to make sure the tooling is consistent across all languages. A lot of this effort happens under the Erlang Ecosystem Foundation (https://erlef.org/ https://erlef.org/) too. All to say, regardless if you pick Erlang or Elixir (or Gleam, LFE, etc.), I hope you will fall in love with the platform as much as I did 10 years ago!
- deleted 6y ago[deleted]
- jon-wood 6y agoI'm going to shamelessly take advantage of your being here with a question if that's ok. Do you have any recommendations for reading material that covers Phoenix as it's used today? Back in the early 0.x days I read the Phoenix book, which was a great introduction to building an application and using Ecto, but trying to pick it up again recently I found that nothing really seems to cover using Contexts in the real world.
- bennyp101 6y agoNot Jose (obviously), but I have a copy of https://pragprog.com/titles/phoenix14/programming-phoenix-1-4/ https://pragprog.com/titles/phoenix14/programming-phoenix-1-... which I think is still fairly relevant. Of course, there is always https://elixirforum.com https://elixirforum.com and a good search :)
- mwcampbell 6y agoThe book Programming Ecto [1] also has a chapter on application design which talks about contexts. [1]: https://pragprog.com/titles/wmecto/programming-ecto/ https://pragprog.com/titles/wmecto/programming-ecto/
- freedomben 6y agoI have that book too and it's great. Will have to check out that specific section. I mostly used it to see examples and explanations of how to do things in the Ecto DSL (which it is great for).
- strzibny 6y agoYes, I read and can recommend that book as well. I wanted to get the little OTP guide too, but people say it's outdated. Apart from books and forum though, there are many posts online! You can check ElixirStatus[0] or a new initiative called Beam Bloggers Webring[1]. [0] https://elixirstatus.com/ https://elixirstatus.com/ [0] https://beambloggers.com/ https://beambloggers.com/
- josevalim 6y agoThis may be a non-answer answer, but given you are versed on the Phoenix front, may I suggest a book on the design aspect of things? For example, Domain Driven Design Quickly: https://www.infoq.com/minibooks/domain-driven-design-quickly/ https://www.infoq.com/minibooks/domain-driven-design-quickly... It has been a while since I have read it, so it may be dated, but hopefully others can provide suggestions too!
- jon-wood 6y agoThanks :) I started reading the original DDD several years ago, but bailed out due to quite how dense it is, hopefully this summary will be a little more approachable.
- 1_player 6y agoYou probably have seen it already, but recent Phoenix docs have a section on contexts and what is their intended use case: https://hexdocs.pm/phoenix/contexts.html https://hexdocs.pm/phoenix/contexts.html The way I see it, context are just the public API to access your data model. Your Ecto schema is a piece of data, which in a functional language has no behaviour attached. The (business) logic to deal with this piece of data lives in the context. That's it. It's nothing particular and specific about Ecto or Phoenix, it's just a good design practice that's applicable and recommended in any language. Gary Bernhardt at https://www.destroyallsoftware.com https://www.destroyallsoftware.com has a few screencasts and talks about this very topic.
- freedomben 6y agoThanks, I'm not GP but have the same questions. What about access control? That's often directly tied into business logic, but it's so elegant and convenient to do it in the controllers or even the router using the pipelines. In fact a ton of the examples (I think even the Chris McCord Phoenix book) does exactly this, presumably for that reason. However I did that with an app and haven't been very happy with it because while the bulk can easily be done in the router/controllers, there are things that are totally inappropriate to do there and so it ends up in the context. Then your logic is distributed and messy, which is awful. But putting all access control in the context also bloats and complicates a ton of otherwise very clean, elegant API functions. I try to keep the Repo query building code clean and separate but that often leads to inefficiencies (such as filtering fields in the caller instead of in the generated SQL, which is vastly preferred for obvious reasons). Anyway, interested in thoughts on that.
- andy_ppp 6y agoThere’s already an article on this you can find here: https://dashbit.co/blog/a-new-authentication-solution-for-phoenix https://dashbit.co/blog/a-new-authentication-solution-for-ph... The GitHub for the generator is here: https://github.com/aaronrenner/phx_gen_auth https://github.com/aaronrenner/phx_gen_auth Basically if you need something different it might be worth forking the generator. I might look at passwordless login at some point.
- Storm-Bringer 6y agoHave a look at this - https://pragmaticstudio.com https://pragmaticstudio.com They have courses on Elixir, Phoenix and today have just released a LiveView course.
- acoustep 6y agoJust to add to your comment: I've been running through the free LiveView course and it's been really great. I'm excited to finish it and continue with the pro one!
- abrookewood 6y agoJust adding that I found those courses really helpful as well.
- deleted 6y ago[deleted]
- sodapopcan 6y agoContexts are loosely (maybe a little more than loosely) based on the Bounded Context concept in Domain Driven Design. As a good introduction, I would recommend reading Domain-Driven Design Distilled by Vaughn Vernon. It's sort of like the Cole's Notes version of the full Domain Driven Design which is a monster of a book.
- rglover 6y agoCongratulations on the anniversary and thank you for all of your efforts and contributions, Jose.
- samgranieri 6y agoThank you very much fir creating Elixir! It’s an absolute joy to program in and it’s something I foresee using for a very long time.
- Kototama 6y agoThanks for creating Elixir. Before using it and going through the website and docs I thought it would be good but once I started to use it, I discovered it is excellent.
- frakkingcylons 6y agoJust wanted to say thanks for your work on Elixir. It’s been very useful and fun to use for my home grown projects.
- rekoros 6y agoI started with Elixir last year, after ten years of Erlang - definitely an upgrade! My favorite improvement is the existence of Ecto - what an amazing piece of software. Thanks for all your work and vision!
- AlchemistCamp 6y agoI've also realized in this past year that the first thing I miss when going back to Node or another stack is Ecto. That doesn't diminish anything about the Elixir language, either. In many languages, Ecto's DSL wouldn't be performant, practical or even possible.
- d3ckard 6y agoThanks from me as well. It’s been more than 5 years since switching from Ruby and I have never regretted it. You did and continue to do great work(and whole team as well). Can’t wait for the big thing at Lambda Days!
- crad 6y agoGreat Post José! I remember early presentations on Elixir (I think first at Erlang DC in 2011 or 12?) and it's been great to watch Elixir mature and develop. While I'm strongly in the Erlang camp, I do appreciate the work you and the contributors to Elixir have done for the ecosystem as a whole.
- ArcMex 6y agoThanks for Elixir and to the team as well for the work you put. I'm new to Elixir, had to learn it at work and it's been an interesting way to solve problems. I'm looking forward to deploying a few prototypes this year using Elixir. Thanks.
- kuiro5 6y agoThank you Jose for your relentless dedication to the language and community. The last year of full-time Elixir/Phoenix has been my favorite of my career, and I'm really looking forward to future of the ecosystem.
- raytracer 6y agoThank you for your work on adding user registration and authorization to Phoenix! I'm setting up a new Phoenix app for a side project this weekend and have just run Arron Renner's auth generator[1]. Having user registration out of the box will save a big chunk of time and energy! 1: https://github.com/aaronrenner/phx_gen_auth https://github.com/aaronrenner/phx_gen_auth
- blackrock 6y agoHow has the book sales been doing?
- cyberpunk 6y agoCongratulations to José and the entire elixir team, I find elixir to be a language which makes me incredibly happy as a developer, and I look forward to using it for another 10 years. clinks glass
- s3cur3 6y agoHappy Elixir user here. At work we have a use case that isn't covered by José's high-level overview of the domains Elixir's used in: we run a massive multiplayer game server on it. This is actually a really good fit. (It kind of rhymes with the original use of Erlang, being telecoms infrastructure.) We get outstanding concurrency support, high reliability, and really efficient development times. I can't imagine shipping this feature with a server written in C++ (the language I'm most comfortable in), and I can't imagine scaling it the way we need to if we'd gone for a traditional web language like Node, PHP, etc. If you're interested, you can see the RakNet (game networking protocol) implementation we use on the server here: https://github.com/X-Plane/elixir-raknet https://github.com/X-Plane/elixir-raknet The README gives a good overview of the full MMO server's architecture, too: each client connection is a stateful Elixir process (not to be confused with a heavy-weight OS process!), acting asynchronously on a client state struct; clients then asynchronously schedule themselves to send updates back to the user.
- AlchemistCamp 6y agoI'd love to learn more about this! Have you been involved in the project from the start?
- s3cur3 6y agoYep! I was actually the sole dev working on it, both server- and client-side. I'm working on a post for our public dev blog talking about why I chose Elixir and what my experience has been. It'll eventually be available here: https://developer.x-plane.com/blog/ https://developer.x-plane.com/blog/
- stevbov 6y agoDo you use it for server side game logic too? It's not as ambitious as an MMO, but I like to use MUDs to learn new languages. I've been (slowly) working on one to learn Elixir and I'm actually finding the concurrency model somewhat difficult to use for the MUD - especially the single world that every player connects to. I ended up writing my own kind of software transactional memory library to help me out: https://github.com/stevbov/stm_agent https://github.com/stevbov/stm_agent But altogether my design feels fairly un-Elixir-like. It seems like the language would shine more in a problem space with more process isolation. When it comes to the game world, pretty much any process could potentially depend upon any other process. Especially once you get into scripting NPCs.
- supernintendo 6y agoNice little retrospective. I’ve been using Elixir and Phoenix both for personal projects and in production at Househappy since 2015. It’s been nothing short of wonderful and to this day it remains my favorite programming language and ecosystem to work in. Congratulations to José and the rest of the core Elixir team for this milestone!
- strzibny 6y agoSometimes I think to myself, why bother to submit things to HN? Everytime I submit something (and recheck twice I am first), nothing happens... until someone else resubmits the same thing. I submitted this one 2 days ago when it was fresh. Can anyone tell me how this works here?
- conradfr 6y agoLuck, timing, friends...
- Kototama 6y agoYou need to submit when california takes its breakfast!
- 1_player 6y ago(I'm the submitter) There is an art to it, and I just got lucky. I saw someone had posted it yesterday and it got no attention. I reposted it in case it went better and it did. Usually HN doesn't let you repost, but in some cases it does if the original article flew under the radar and didn't get much attention. As an Elixir fan, I wanted this important milestone for the language to get more than a couple points.
- news_to_me 6y agoCongrats to José and the team! Elixir was a wonderful discovery for me a year or two ago — it's the closest I've found to my "ideal" language. You can tell, from the documentation and by using the language, how much thought went into each design choice. Good luck on the next ten :)
- 40four 6y agoLearning Elixir and starting to use is in projects is at the top of my TODO list for 2021. I tried to get into a while back, but being unfamiliar with functional programming concepts at the time really got me. Learning a new language and trying to grep FP at the same time was too much for me :) Now, I'm more well versed in FP in general, and I'm excited to give it another go! Everyone I've talked to who uses Elixir on a regular basis or professionally absolutely gushes with excitement and joy when they talk about it! Well done, and thank you Jose!
- ch4s3 6y agoCome by and check out https://elixirforum.com/ https://elixirforum.com/ and slack https://elixir-slackin.herokuapp.com/ https://elixir-slackin.herokuapp.com/ everyone is super friendly and helpful. * edit: fixed link
- mcintyre1994 6y agoI'm getting an error on that Slack link - https://elixir-lang.org/ https://elixir-lang.org/ links to https://elixir-slackin.herokuapp.com/ https://elixir-slackin.herokuapp.com/ which I think is the right one?
- ch4s3 6y agoThe one from https://elixir-lang.org https://elixir-lang.org. I think I incorrectly copied it from slack.
- 40four 6y agoCool I’ll check it out thanks
- sysashi 6y agoI've picked up Elixir in 2016 and have started freelance work around 2017 doing Elixir and Phoenix exclusively. For me it is the best platform for web development and I'm very grateful to everyone involved (erlang/otp, elixir, ecto, phoenix teams and everyone else). Happy Birth Day Elixir!
- chasers 6y agoThanks Jose! I picked up Elixir as my first language and have really enjoyed it.
- nudpiedo 6y agoit looks really awesome! Can someone point out the negative sides (or drawbacks of any kind) ? What about finding elixir experts/freelancers? What about integration with .Net and the xamarin forms ecosystem?
- lawik 6y agoI've been involved in interviewing for Elixir positions and found that we got more senior candidates than I've ever seen before. Part of it might have been pandemic displacement. But I'm not seeing a lack of work in my freelancing and I'm not seeing any particular skill shortage. .Net and Xamarin integration. No clue. Samr as for any other non-.Net language I imagine.
- adsfoiu1 6y agoI have been using it for the past ~1yr and really like some aspects, but these are some negatives that come to mind: - I really wish it had type safety. - The ecosystem isn't as mature as other languages. - IDE tooling in particular seems like it has a ways to go from my experience.
- cactus2093 6y agoDrawbacks I see are: 1. no static typing. With typescript having taken off, and now even python and ruby becoming more and more feasible to use in production with static typing, switching to a new dynamic language is a hard sell for me. 2. limited ability to take full advantage of some of its unique features in many cases. The runtime and the included OTP library/paradigm has some really cool features with its approach to processes and concurrency with the actor model, and features like hot code reload. But IMO the industry and popular best practices have evolved in a different direction that make these things less compelling. Code deploys are a solved problem in any of the major vm/container runtimes, with blue/green deploys, canary builds, feature flags, etc. all quite easy to use, so hot code reloading isn't that compelling as a language feature anymore. There are tons of ways to orchestrate multiple instances of a services from Heroku to Kubernetes, and APIs built on Protobuf and GRPC, GraphQL, or json REST APIs, are now pretty standard for communicating between different services, or using message queues, kafka, cloud pub/sub, etc. Also the paradigm most developers are familiar with is stateless app servers that store any state in database or cache layers, which has a lot of benefits. Erlang and OTP seem to kind of mix all of these paradigms together, and if you use all of its built-in ways of doing things you are really striking out on your own from the common "best practices" that more developers these days will be familiar with. A lot of common tooling and cloud hosting providers don't support Erlang OTP style programming natively. It can certainly be used successfully, I believe Whatsapp as one famous example was originally all written in Erlang, but I personally don't see a whole lot of justification for most apps to do this. Of course you don't have to use any of these features, but then why use a language if you're not going to lean into its unique strengths?
- mattcantstop 6y agoElixir's tooling is so good. The documentation is readable by a human, you can jump in and get information at any time. They focus on the developer experience, and it's one of the most compelling reasons why I love the language/ecosystem so much.
- borski 6y agoElixir was largely the reason our API scanner is not only super robust and fast, but also super fun to work on.
- sodapopcan 6y agoI'm building my first non-toy app in LiveView. I'm blown away by how quickly I can move with it and love how Phoenix encourages DDD practices. I'm a bit saddened that Elixir isn't bigger than it is. It's such a great entry into the world of BEAM and functional programming yet I've read more than once that people aren't interested because "it looks like Ruby and I don't like Ruby". There are some more legit reasons as well like it's dynamic, but I wish people would stop getting so hung up on syntax and actually focus on what the technology can do.
- Areading314 6y agoWhat turned me off about elixir was not the syntax, it was the flexibility in designing new syntax. It felt like each library had its own idioms and syntax rules, which just adds a huge amount of variety and difficulty in a codebase. It was hard to have consistent architectural patterns across a team. I've seen an elixir/phoenix backend rewritten completely in python/django and it was a big improvement in developer productivity. I think elixir may work better for small teams. The learning curve and the "consistency enforcement" of languages really does make a difference on big teams.
- sodapopcan 6y agoAs in the whole project was rewritten in Django or some kind of transpiration going on there? I haven't gotten to the point where I'm adding a lot of libs yet and certainly can't speak to using it in a big team. In terms of syntax flexibility, Ruby has a similar issue where a lot of popular libs implement their own DSLs. I've never fully bought that that is a problem—a library is going to have an API that will require reading documentation. Maybe the one example that goes off the wire is RSpec (I'm really used to it now but I'm really enjoying going back to good ol' `assert` in `ExUnit`). In terms of keeping it idiomatic with the business logic, library can (and in my opinion always should) be wrapped. I may be missing the point or being reductive here, though, and I would be interested to hear more about your particular pain if you're willing to share! ...and of course if you are talking about using meta-programming to write business logic, that's not a thing anyone should ever do for any reason ever, period (IMO). For me the raw speed of writing a highly interactive app in LiveView is unlike anything I've ever experienced. My primary experience is with Rails and React.
- hbiden2020 6y agoHunter Biden is a child rapist and deserves to be shot in the fucking head!
- rrosztoczy 6y agoCongratulations on the anniversary, and thank you for such a wonderful language and community!
- jpbutler 6y agoCongratulations to José and the whole core team! I've been working exclusively with Elixir and Phoenix for the past four years, and it's been a delight.
- enraged_camel 6y agoSame here. Our Phoenix backend and VueJS frontend have been a magic combo for us.
- likortera 6y agoMeanwhile te company I work for is moving away from it. We cannot find enough people with enough knowledge to be already productive in it. Not many want to learn it because it is considered pretty niche, and the ones willing to learn will need many months or years to be productive and build with some level of quality, and once they learn they move away to bigger companies which pay more. We end up paying to people to learn to then "graduate" and we end up with a platform built by people that were learning. Some people here say the tooling is great. Compared to what? The editor plugins are terrible, slow, and blow away your CPU doing god knows what kind of indexing. Compilation is slow and takes a lot of time (in CI for example). Libraries for things you give for granted in other platforms (java, javascript, python, ruby) are non existent, implemented in erlang, unmantained, poorly documented, not popular enough, or a combination of these. People are using it for creating traditional CRUD apps, and it is totally overkill. Something you would do in a day with django or ruby on rails takes a lot of time. Ok, you have tons of concurrency and scaling and.....but... unless you are facebook or google or amazon you won't need this anyway. Probably all of these things will be solved in the future, but at this moment, using Elixir for real production code in product focused companies is just a terrible mistake in my opinion. Certainly the ideas, the technology, and the BEAM are awesome...and it is technically superior to everything I've seen out there. But from a business perspective, it makes no sense to use it unless you're building the next whatsapp or similar.
- cpursley 6y ago> once they learn they move away to bigger companies which pay more Maybe consider paying your people more or moving to a better company?
- likortera 6y ago> Maybe consider paying your people more Salaries are actually pretty good. Not facebook salaries, but good enough and certainly above average. The company can already get very proefficient, experienced developers in Ruby and JavaScript. > moving to a better company? I certainly could. But how does this solve the business problem I'm talking about? The reason I'm not moving to another place and instead helping transition back to normality is because I actually like the company, and my coworkers, and I like to focus on building our product and solve the real problems the company was created for. Elixir can be a great tech (the best) for certain kind of problems. In our case (and any other "CRUD" like web application like 80% of the internet) is an expensive, distracting toy.
- syamilmj 6y agoCelebrating my sixth year with Elixir! The adoption rates here is still quite low (Malaysia) but I'm glad to say that onboarding new Elixir developers has always been a breeze.
- jbhatab 6y agoGreat post, Elixir has come a long way but more importantly had a great foundation to build on out of the gate. One of the best maintainer communities I've seen for a language + framework in a while. Such a strong + clear open source vision set on building a flexible and robust platform/language. Ty Jose + Chris!!! Very proud to have been using Phoenix + Elixir for our startup, https://www.distru.com https://www.distru.com, since day 1 and it was one of our best stack decisions. The language is so pleasent to code in, brings functional programming concepts, can do powerful things with GenServer, has great default performance, and enables us to tackle concurrency problems in a way rails just wasn't built for. Not to mention the constant surprises from Elixir!! There's a built in scalable nosql database in the VM (https://elixirschool.com/en/lessons/specifics/mnesia/ https://elixirschool.com/en/lessons/specifics/mnesia/)!?!? And a key value store (https://elixirschool.com/en/lessons/specifics/ets/ https://elixirschool.com/en/lessons/specifics/ets/)?!? It's so fun to experiment with! Can't wait to continue meeting great Elixir devs as we grow :). If any devs are interested in working on a cannabis startup built on Elixir since day one, I'd love to talk. blaine@distru.com
- tg3 6y agoGreat read. Two days I wrote about my own experience learning Elixir to build Xkit[1]. As I wrote there, the language guide is one of the best I've ever seen and is pretty much all you need to get started. There are drawbacks of course (typing, deployment) but the pros far outweigh the cons for me so far. Here's to the next ten years! [1] https://xkit.co/post/pivoting-with-elixir-how-i-learned-a-language-and-launched-a-product-in-60-days https://xkit.co/post/pivoting-with-elixir-how-i-learned-a-la...
- emerongi 6y agoLast year, I deployed a system consisting of 4 Elixir applications, and recently added a new one built with LiveView, which took 2 days to write (1 of which was more of a learning day). I also built some helper services that are used in other projects. Phoenix nicely fits the microservice as well as the full-stack use-case. LiveView is a bit of a game-breaker for me. Most of my job is writing CRUD apps and you just can't beat LiveView on that turf. Unless you have some super complex interactivity in your app or are a unicorn planning to scale to infinity, I don't see a reason to use another stack. If the web weren't so terrible and just plain old, we could have even better solutions, but this is the best for now.
- kuzee 6y agoElixir is a fantastic language. I wrote an app several years ago and haven't had to update or do any maintenance on it since and it has happily served several million requests a month without errors. Actually the only reason I've touched it is to upgrade the Heroku stack it is on. The best part is I actually had a lot of fun writing the app and even writing the docs. So much of my preference for Elixir is in the developer experience and how quickly I can ship changes with high confidence; all of the amazing performance and distributed aspects I may never need for my projects.
- deallocator 6y agoI've been loving Elixir for the past 2 years now (off-and-on). I try to build most of my personal projects in it (as I'm still trying to get better at it) My latest project is a Discord bot library written in Elixir, seemed like a good fit as the Discord backend is written in Elixir as well My only complaint is IDE support, though VS Code works well enough for me (and for HTML I use Webstorm, as I find the Jetbrains Elixir plugin is a little better for EEx)