I'm currently building a video course hosting platform with Elixir / Phoenix and all I can really say is this has been the nicest tech stack I've ever used in 20 years of web development.
IMO it really does feel like you get the best of everything (developer productivity, developer happiness, great language for creating maintainable code, OTP and the BEAM bring a lot to the table, it's memory efficient, tracing code without a ton of experience is very doable, it's fast as balls and Phoenix channels / LiveView is a great abstraction on websockets). I find myself fist pumping all over the place as I make progress towards this app while learning as I go.
I don't think I've liked a technology this much ever and I'm honestly surprised it's not already more popular than it already is. I've been around for the release of a lot of major frameworks and technologies (Rails / Django, Node, Go, etc.). Nothing has impressed me this much. It truly feels like it's a zero compromise environment to write code in and I hope I can still be using it in 10+ years.
I love hearing stories like yours. I wonder how Elixir would compare to Clojure, which I've used and liked for web development for many years. I hear nothing but good things about Elixir but I wonder if it would bring something new to the table for me in the "really liking it" category.
> I don't think I've liked a technology this much ever and I'm honestly surprised it's not already more popular than it already is.
I think a big part of it has been a lack of learning resources. A major part of why I started my site and YT channel was the frustration I had learning Elixir in 2016. Phoenix was even tougher. At that time, even the paid resources were mostly out of date. I found about 70% of everything I came across (books, videos, blog posts) wouldn't compile on Elixir version > 1.0! The changes in Phoenix 1.2 and 1.3 were a similar story.
The one exception to this was Dave Thomas's Programming Elixir book. I bought version 1.2 and he religiously updated it (for free!) all the way through its current version. I never found anything in it that didn't work on the current version of the language. Well done, Dave!
is the one that's in production and doing its work. Most developers including me, get bored of doing something in x,y,z framework, and we gladly go try something else for a while.
I have a good friend, that jumped on the band wagon of elixir. he openly now admits, he wish he just used python.
I hate band wagoners.. no language , no framework is the cure all.
My current side project is in Elixir/Phoenix and it's sweet. Currently on 1.8.
I'm hoping to move to 1.9. The language just fit my ideology better, Jose Valim just stated that the language is mostly complete. All major planned features are completed unless something come up. The language isn't bloated, it's small and sweet, and it doesn't go out of the way to add random unnecessary features to the core.
I was fullstack since ~2008 and it is becoming pretty hard to be fullstack when frontend moves too dang fast for me. So the pace of Elixir and Phoenix is amazing. I know these two technology are relatively new but compare to its peers it's boring tech; as in it's battle proven and it's not going to radically change that often (at least not for the sake of hype or reinventing the wheel).
The community over at elixirforum is nice. There seems to be quite a few camps. The ones that stands out to me are the web dev and embedded camps.
The important thing to add here is that since it has powerful, hygienic, macros, there is nothing stopping you (or library writers) from adding new constructs and abstractions with zero runtime performance hit.
My startup uses Phoenix, along with a Vue front-end. The combo is an absolute joy to use. The benefit that has had the most business impact for us so far is developer productivity.
A couple of months ago we met with a prospective client to discuss their use cases and conduct requirements gathering. They really liked what we showed them, but the CFO wanted a dashboard that displayed the data in the app in a specific way. We shook hands, told them we would contact them soon, and parted ways. It was around 9 AM when we stepped outside the client's office and got back in our cars.
By 5 PM that evening, we had a stunning, fully functional dashboard built and deployed to the demo environment. It utilized a few new database tables that aggregated data, some data processing done by Elixir, passing that data to the Vue front-end and displaying it using Charts.js and a few other UI libraries.
I sent a quick email to the CFO with the URL. He responded ten minutes later with, "holy cow, why didn't you show this during our meeting if you had it already?!" :)
We are meeting with them again later this month, hopefully to sign them on as a client.
(For reference, I've used Rails and ASP.NET with C# before Elixir, along with JQuery back in the day, and then a bit of React. Can't speak about other frameworks and languages.)
Same experience here, it truly is an absolute joy. In the front-end, we are using TypeScript with vue-property-decorator [1], it made me like Vue even more. I wasn't much of a fan of developing frontends before, but I actually have been having fun using TypeScript + Vue + Tailwind CSS. I'd also like to try out Svelte in the future.
I'm also doing an startup -- we've been working on the product for only two weeks and we just released access for our first pilot customer, with an initial feature set we are very happy with. Apart from the productivity, it's been a long time since I loved programming. Keep in mind I was doing embedded C development for a few years, so my web-fu is a bit rusty lately.
The only thing I miss sometimes is types, especially when refactoring. Java with IntelliJ will spoil you, I guess. I was thinking about going with Kotlin because of this, but I was really digging the Phoenix project structure and I love Ecto.
Great story, and best of luck! BTW, if you haven't tried it yet, the new Phoenix Live View makes those one-off dashboards a joy to make in my mind. Vue is fantastic but it still ends up with two layers which need data piping.
FWIW, I feel like I he this kind of productivity with server-side rendered ASP.NET Core web apps.
Something that is great about .NET is the available tooling - the debuggers in both Visual Studio and Rider are amazing, and it's difficult to imagine living without them.
AFAIK, you're relegated to rather primitive "println debugging" with Elixir - has this been an issue for you in practice?
I just finished writing my own in-house static site builder in Elixir. I come from the Ruby land. If you thought Ruby was awesome, then you would LOVE Elixir. I was hesitant at first, thinking "not another language.." but once I gave it a shot, I stopped looking back.
I'm an individual consultant with a very small team. Without Elixir, many projects that I've finished in weeks would have taken me months. This is a seriously under-rated language that would make you wonder why didn't you give it a shot earlier. It's that good.
My static site is now way faster than Jekyll or Middleman. I didn't re-write it for speed, speed was just a nice side-effect. I wrote it mostly for the language's flexibility.
With Ruby, which Middleman and Jekyll both use, you need to think in the traditional OOP way and sooner or later, you will hit the limits of the language itself. Whereas, with Elixir, everything is taken care of by guards. This is really one of the nicest codebases I've ever written in a while. This is in comparison to my earlier codebase which was written in Ruby, and I had to do all sorts of things like install a library to make the language more scalable. That was the ugliest hack I've ever done. [1]
Imagine, a Wordpress clone, only it runs on your computer and generates static files (this was my goal) but, written in less than a month by one person, working a full time job, with the same fit and finish of Wordpress.
We are building a sales automation app using Elixir and Vue.
Our dev team seem really happy with this tech stack.
Productivity is awesome - we are four months in and already have similar functionality to a (sort of) competitor that has spent several years on their dev. This is the first dev project I have experienced where we are ahead of our planned milestones. Got to find some more features to quickly add!
My original concern was getting hold of developers as Elixir lacks the pure numbers of people that other server environments enjoy, but this has not been an issue. If anything we have got more senior devs then we would otherwise be able to get as they are excited to be able to use Elixir. Oskar in Poland and Dan in London, hats off, you are awesome!
Not sure if I agree with others that the broader environment is underdeveloped - yes there may be less versions of the same thing compared to a large JavaScript framework, but what is there is absolute quality.
Only (small) gripe is that Elixir is not a fast language. At one stage I thought this was going to be a real issue, but great support from the community and improved understanding on how to do things the Elixir way (let it fail!) seems to have resolved this for us.
> Only (small) gripe is that Elixir is not a fast language.
Which is interesting because Elixir isn't well known for being super fast when it comes to CPU bound tasks, but for a lot of semi-CPU intensive things you'd end up doing in a web app, it's still very very efficient.
For example I wanted to generate 5,000x 19 random character discount codes and my first attempt took 730ms to generate the codes while being a complete newbie to the language and cobbling together Enum.reduce / Enum.random while concatenating strings. Within an hour of asking if someone had a better way of doing it, I got multiple solutions from community members that were able to produce the same results in 25ms while still having very readable code (arguably more readable than my original implementation), and even one person came up with a solution to do it in 3ms.
It's almost hard to imagine being in a position in a web app where 3ms would be considered too slow to generate 5,000 unique discount codes with a custom character set.
The Elixir ecosystem offers a lot of interesting things. I'd like to underline those:
- LiveView (which I use in production & have recommended for upcoming projects too) is a complete game changer, not because it allows to remove javascript, but because it removes a boundary (between the client & the server), making development & maintenance much faster since you only have one layer, and also making very rich features easier, because you can remain stateful during the processing (if you have interactive rich UIs with e.g. file upload & processing then live reporting as you process the file, this will remind you of desktop programming, in a good way)
- While the initial setup of apps can be a bit cumbersome to my taste (like the SwitchTower period of Rails - e.g. you'll need a build server or a Docker image typically), the mental model of programming is quite simple in a lot of cases afterwards. I would say that junior developers can be onboarded quite easily (I'm starting to train some), and maintenance is quite sweet at this point.
I can't tell what your description of LiveView is suggesting, I will need to read about it, sounds interesting. Is it like a codebase that is implicitly split on a back-end and a browser, without the need to write JavaScript?
All the backend code for my current startup is in Elixir (switched from Ruby, my previous love).
Elixir/Phoenix/Ecto are an absolute joy.
It took a bit to get used to immutability and FP but it feels so "cozy", for lack of a better word, to know exactly what my code is doing and to not be bit by obscured mutability and magic anymore.
From your comment I gather you're new to FP. Same here, but with around 20 years of OO experience, I really struggle to understand what idiomatic FP code should look like - was wondering how you'd coped on that front?
Coming from Ruby and Python and a bit of node, Elixir encourages a really convenient mental model for thinking about small and large parts of your app in the same way. Net result is fewer bugs created, easier to write tests so you write more, and easy to debug when they do happen. And because of the fault tolerance, most production bugs are so transient they're not causing problems. I've run several small webapps with a few thousand users and the maintenance is minimal because of how solid the language is.
Elixir is great. It's the most fun I've had programming. I wrote Erlang for a little more than a year, and I grew to like the idea, but found it hard to work with. Elixir is bringing me back around.
My experience with Elixir has been great but one area of improvement is debugging. Maybe it's because I'm so used to using something like Chrome's developer tools, but I wish there was something as easy to use for setting breakpoints and inspecting the environment. Would love to know how others are debugging currently!
During a recent developer meetup in my country, I went to an elixir workshop where the host (an independent consultant) confided in us that several of her main clients had asked her to not reveal that they use elixir - they're apparently so happy with their choice that they treat it as a competitive advantage and claim to use a different stack when asked by competitors.
I can't know for sure if she was bluffing, but the idea really was interesting enough to make me wonder.
Edit: sorry, this was supposed to be a top level comment.
I'm surprised there are so many comments surrounding debugging in this thread. Did you use `require IEx; IEx.pry()` in your code at all? This gives you almost the exact same experience as calling `debugger;` within javascript. If so what was lacking with that experience?
Has anyone who previously preferred static typing converted (at least for certain projects) to using Elixir? I won't even put plain Node into production anymore, TypeScript at the minimum, but otherwise OCaml or Go.
Elixir is a language that I can very productive in day one. Only Ruby+Go enable me to be productive like that. Lot of people get turn down by so many thing in Elixir like OTP and other cool stuff that you never used and think it's complex.
I literally learn it on the job.
Lack of typing is the biggest issue for me, but pattern matching enable to get the shape of object and to a certain extent and I'm quite sasitify with it.
Where are people getting their documentation for Phoenix? The stuff on the website is awful for grasping the bigger picture and how the parts of Phoenix combine. It gave me the impression of being an immature version of Rails when I tried it recently which doesn’t gel with the attitude people seem to have of it.
But I'd suggest reading through "Phoenix In Action" to get a feel for how everything composes together, but its surface area is much smaller than Rails (though I haven't used Rails in a decade)
Phoenix only deals with the web framework component. If you want to talk with databases, the official library is Ecto. For GraphQL there's Absinthe.
I would say Phoenix doesn't attempt to be quite as magical as Rails and Django-style frameworks. It is a bit more explicit and as such hopefully easier to follow. The goal doesn't seem to be Rails for Elixir but rather that every new backend language needs a good web framework or it may be dead in the water.
As someone suggested, check out the Hex docs. That is where you get the better in-depth stuff and API reference. I've found the Getting started-stuff very helpful but also a bit limited in scope.
For the bigger picture I would say grab the Programming Phoenix 1.4 book. It was written by the authors of Elixir and Phoenix.
It focuses on building a web app and shows how everything fits together while solving real issues, which is a much better learning experience than the documentation IMO. If you come at it with a Rails background you'll probably walk away with a completely different impression.
I'm currently working on my side project the backend for which I've chosen elixir to go with. Looking at performance and long term maintainability, it doesn't seem to be a sucker like rails.
No magic, no hacky patterns. No mess like the one you see with Node. For what it does the platform
is hella stable. I drifted towards Go for a little bit but man, code in Go felt too verbose with weird patterns. Go is a solid platform as well. But it's not just my cup of tea for web apps right now.
Scalability is in reach if you need it. Hell, even if you need ridiculous background job processing power, use OTP already.
And I forgot, liveView is also rock solid. Honestly, if anyone would ask me what the best platform for web apps right now is, I'd just say Phoenix/Elixir.
I really, really enjoyed Rails when I discovered it and I still like it for some quick prototypes. Since finding Elixir, I haven't ever wanted to maintain a Rails app again, though.
The immutability and the lack of magic you mention are probably the two main reasons Elixir projects are easier to jump into. Even when macros are involved, you can still scroll to the top of the file, look at line with "use" or "using" in it and know exactly what is affecting your module.
With a lot of other languages, it's completely unknowable from inside one file to know where or if external metaprogramming is affecting your module.
The most interesting part of Nerves for me isn't rpi/embedded/resource-limited environments, but rather the ability to remove most/all of the security surface area of the userspace (say, in the cloud).
Oh yeah, that is an interesting thought. I've considered that too. Didn't cover it in the post because it isn't quite the focus of Nerves and I already had a lot to say.
I've seen a few different nerves-systems targeting AWS EC2. Have you tried doing anything in particular with it?
Great language and importing other technologies though NiF to integrate c and rust (wrapping c or not) with Elixir. My old company build many systems on it and hope another will in the future.
Elixir is an absolute joy to use. I love to use it whenever I can and coming from Erlang, boy its a step up!
It's just the Phoenix framework for which the initial setup of the project generator feels so opinionated. You have no options, no way to make a template for the generator. Phoenix's LiveView is a great feature and I want to use it. It's just Phoenix itself that feels off for me, not as straightforward as it should be. Does anyone else get this feeling?
whereas in elixir you have to do something like the following in order to avoid the nesting of doom:
with {ok, foo} <- func() |> Error.or({:error, "bad"}),
{ok, bah} <- func2(foo) |> Error.or({:error, "blah"}), do
bah
end
like the with blocks kind of work until you have to transform the errors you receive then you need helper functions. if you are just doing static transforms like above it is not too bad but it starts to get hairy if you want to transform based on the returned error or variables in the function. whereas the imperative style you can inline your error handling logic nicely into the function.
for example what if i want to log something on the error path that includes some contextual information and custom formatting. probably, the easiest way is going to be to use with() and pipe to a custom function that triggers on the error path to do the logging because the code is going to start getting really messy. whereas if i was writing it imperatively i could just inline the logging statement most of the time because it is just a few lines of code.
The idiomatic way to do that is to match errors in the else branch of the with statement.
I've been using Elixir and Phoenix for a customer for a couple of years. It's ok to great, especially when spawning jobs, with some stains.
I'm not a great fan of the with syntax. I wish they implemented it as a native statement of the language instead of as a macro. In that way they probably could let us write the same code inside and outside a with, instead of having to transform = into <- and add a comma.
But the worst offenders are GenServers. They should really have the syntax of OO classes instead of the incomprehensible handle* functions. After all that's what they are, objects with their own CPU. (Remember Armstrong about Erlang being the only true OO language?)
By the way, that would make it easier to code, to understand and to migrate people from imperative languages.
with {:user_created?, {:ok, user}} <- create_user do
# do something with `user`.
else
{:user_created?, {:error, errors}} ->
# something
_ ->
# some unhandled error
end
And so on, use an atom on the fly to identify branches and error conditions. But honestly most of the time you worry about happy paths and Let It Crash.
You also have to consider that the whole BEAM philosophy is "let it crash".
On a "normal" language you have to deal with all error paths or your app goes down. On the BEAM you handle the happy case and common and unexceptional errors. Otherwise, let it crash.
Example: if your app depends on a database that once in a blue moon is unreachable, don't test for connection errors. Just assume the connection was successful, and if it wasn't, most of the time once the process restarts everything is fine.
I have an Elixir app in production, I get Sentry errors once in a while about some weird state outside my control (we work with external APIs) that caused a process to crash, I just ignore them and go on with my life.
Not sure I understand completely your problem and I apologize if this is a stupid question, but can’t you just pattern match the errors in with’s else block?
[+] [-] nickjj|6 years ago|reply
IMO it really does feel like you get the best of everything (developer productivity, developer happiness, great language for creating maintainable code, OTP and the BEAM bring a lot to the table, it's memory efficient, tracing code without a ton of experience is very doable, it's fast as balls and Phoenix channels / LiveView is a great abstraction on websockets). I find myself fist pumping all over the place as I make progress towards this app while learning as I go.
I don't think I've liked a technology this much ever and I'm honestly surprised it's not already more popular than it already is. I've been around for the release of a lot of major frameworks and technologies (Rails / Django, Node, Go, etc.). Nothing has impressed me this much. It truly feels like it's a zero compromise environment to write code in and I hope I can still be using it in 10+ years.
[+] [-] jb1991|6 years ago|reply
[+] [-] keithnoizu|6 years ago|reply
[+] [-] AlchemistCamp|6 years ago|reply
I think a big part of it has been a lack of learning resources. A major part of why I started my site and YT channel was the frustration I had learning Elixir in 2016. Phoenix was even tougher. At that time, even the paid resources were mostly out of date. I found about 70% of everything I came across (books, videos, blog posts) wouldn't compile on Elixir version > 1.0! The changes in Phoenix 1.2 and 1.3 were a similar story.
The one exception to this was Dave Thomas's Programming Elixir book. I bought version 1.2 and he religiously updated it (for free!) all the way through its current version. I never found anything in it that didn't work on the current version of the language. Well done, Dave!
[+] [-] oftenwrong|6 years ago|reply
[+] [-] enraged_camel|6 years ago|reply
To be honest, this can probably be almost 100% attributed to the fact that it is not backed and heavily promoted by a tech giant.
[+] [-] golemiprague|6 years ago|reply
[deleted]
[+] [-] JediPig|6 years ago|reply
is the one that's in production and doing its work. Most developers including me, get bored of doing something in x,y,z framework, and we gladly go try something else for a while.
I have a good friend, that jumped on the band wagon of elixir. he openly now admits, he wish he just used python.
I hate band wagoners.. no language , no framework is the cure all.
[+] [-] anthony_doan|6 years ago|reply
I'm hoping to move to 1.9. The language just fit my ideology better, Jose Valim just stated that the language is mostly complete. All major planned features are completed unless something come up. The language isn't bloated, it's small and sweet, and it doesn't go out of the way to add random unnecessary features to the core.
I was fullstack since ~2008 and it is becoming pretty hard to be fullstack when frontend moves too dang fast for me. So the pace of Elixir and Phoenix is amazing. I know these two technology are relatively new but compare to its peers it's boring tech; as in it's battle proven and it's not going to radically change that often (at least not for the sake of hype or reinventing the wheel).
The community over at elixirforum is nice. There seems to be quite a few camps. The ones that stands out to me are the web dev and embedded camps.
[+] [-] TylerE|6 years ago|reply
[+] [-] enraged_camel|6 years ago|reply
A couple of months ago we met with a prospective client to discuss their use cases and conduct requirements gathering. They really liked what we showed them, but the CFO wanted a dashboard that displayed the data in the app in a specific way. We shook hands, told them we would contact them soon, and parted ways. It was around 9 AM when we stepped outside the client's office and got back in our cars.
By 5 PM that evening, we had a stunning, fully functional dashboard built and deployed to the demo environment. It utilized a few new database tables that aggregated data, some data processing done by Elixir, passing that data to the Vue front-end and displaying it using Charts.js and a few other UI libraries.
I sent a quick email to the CFO with the URL. He responded ten minutes later with, "holy cow, why didn't you show this during our meeting if you had it already?!" :)
We are meeting with them again later this month, hopefully to sign them on as a client.
(For reference, I've used Rails and ASP.NET with C# before Elixir, along with JQuery back in the day, and then a bit of React. Can't speak about other frameworks and languages.)
[+] [-] durub|6 years ago|reply
I'm also doing an startup -- we've been working on the product for only two weeks and we just released access for our first pilot customer, with an initial feature set we are very happy with. Apart from the productivity, it's been a long time since I loved programming. Keep in mind I was doing embedded C development for a few years, so my web-fu is a bit rusty lately.
The only thing I miss sometimes is types, especially when refactoring. Java with IntelliJ will spoil you, I guess. I was thinking about going with Kotlin because of this, but I was really digging the Phoenix project structure and I love Ecto.
All in all, a great experience.
[1]: https://github.com/kaorun343/vue-property-decorator
[+] [-] elcritch|6 years ago|reply
[+] [-] GordonS|6 years ago|reply
Something that is great about .NET is the available tooling - the debuggers in both Visual Studio and Rider are amazing, and it's difficult to imagine living without them.
AFAIK, you're relegated to rather primitive "println debugging" with Elixir - has this been an issue for you in practice?
[+] [-] neya|6 years ago|reply
I'm an individual consultant with a very small team. Without Elixir, many projects that I've finished in weeks would have taken me months. This is a seriously under-rated language that would make you wonder why didn't you give it a shot earlier. It's that good.
My static site is now way faster than Jekyll or Middleman. I didn't re-write it for speed, speed was just a nice side-effect. I wrote it mostly for the language's flexibility.
With Ruby, which Middleman and Jekyll both use, you need to think in the traditional OOP way and sooner or later, you will hit the limits of the language itself. Whereas, with Elixir, everything is taken care of by guards. This is really one of the nicest codebases I've ever written in a while. This is in comparison to my earlier codebase which was written in Ruby, and I had to do all sorts of things like install a library to make the language more scalable. That was the ugliest hack I've ever done. [1]
Imagine, a Wordpress clone, only it runs on your computer and generates static files (this was my goal) but, written in less than a month by one person, working a full time job, with the same fit and finish of Wordpress.
Elixir is amazing.
[1] https://github.com/aetherknight/recursive-open-struct
[+] [-] js2|6 years ago|reply
What? You mean the generation step is faster?
[+] [-] winrid|6 years ago|reply
[+] [-] c4po|6 years ago|reply
Our dev team seem really happy with this tech stack.
Productivity is awesome - we are four months in and already have similar functionality to a (sort of) competitor that has spent several years on their dev. This is the first dev project I have experienced where we are ahead of our planned milestones. Got to find some more features to quickly add!
My original concern was getting hold of developers as Elixir lacks the pure numbers of people that other server environments enjoy, but this has not been an issue. If anything we have got more senior devs then we would otherwise be able to get as they are excited to be able to use Elixir. Oskar in Poland and Dan in London, hats off, you are awesome!
Not sure if I agree with others that the broader environment is underdeveloped - yes there may be less versions of the same thing compared to a large JavaScript framework, but what is there is absolute quality.
Only (small) gripe is that Elixir is not a fast language. At one stage I thought this was going to be a real issue, but great support from the community and improved understanding on how to do things the Elixir way (let it fail!) seems to have resolved this for us.
[+] [-] nickjj|6 years ago|reply
Which is interesting because Elixir isn't well known for being super fast when it comes to CPU bound tasks, but for a lot of semi-CPU intensive things you'd end up doing in a web app, it's still very very efficient.
For example I wanted to generate 5,000x 19 random character discount codes and my first attempt took 730ms to generate the codes while being a complete newbie to the language and cobbling together Enum.reduce / Enum.random while concatenating strings. Within an hour of asking if someone had a better way of doing it, I got multiple solutions from community members that were able to produce the same results in 25ms while still having very readable code (arguably more readable than my original implementation), and even one person came up with a solution to do it in 3ms.
It's almost hard to imagine being in a position in a web app where 3ms would be considered too slow to generate 5,000 unique discount codes with a custom character set.
[+] [-] thibaut_barrere|6 years ago|reply
- LiveView (which I use in production & have recommended for upcoming projects too) is a complete game changer, not because it allows to remove javascript, but because it removes a boundary (between the client & the server), making development & maintenance much faster since you only have one layer, and also making very rich features easier, because you can remain stateful during the processing (if you have interactive rich UIs with e.g. file upload & processing then live reporting as you process the file, this will remind you of desktop programming, in a good way)
- While the initial setup of apps can be a bit cumbersome to my taste (like the SwitchTower period of Rails - e.g. you'll need a build server or a Docker image typically), the mental model of programming is quite simple in a lot of cases afterwards. I would say that junior developers can be onboarded quite easily (I'm starting to train some), and maintenance is quite sweet at this point.
I can warmly encourage you to try Elixir out (a nice way to get started by the way is to code ExUnit tests to try out the language, see https://github.com/thbar/elixir-playground/blob/master/test/... as a boilerplate to get started).
[+] [-] hellofunk|6 years ago|reply
[+] [-] dkulchenko|6 years ago|reply
Elixir/Phoenix/Ecto are an absolute joy.
It took a bit to get used to immutability and FP but it feels so "cozy", for lack of a better word, to know exactly what my code is doing and to not be bit by obscured mutability and magic anymore.
[+] [-] GordonS|6 years ago|reply
[+] [-] kuzee|6 years ago|reply
[+] [-] SLIB53|6 years ago|reply
[+] [-] wmock|6 years ago|reply
[+] [-] kace91|6 years ago|reply
I can't know for sure if she was bluffing, but the idea really was interesting enough to make me wonder.
Edit: sorry, this was supposed to be a top level comment.
[+] [-] pg_bot|6 years ago|reply
[+] [-] olikas|6 years ago|reply
[+] [-] innocentoldguy|6 years ago|reply
[+] [-] spraak|6 years ago|reply
[+] [-] kureikain|6 years ago|reply
I literally learn it on the job.
Lack of typing is the biggest issue for me, but pattern matching enable to get the shape of object and to a certain extent and I'm quite sasitify with it.
[+] [-] colinramsay|6 years ago|reply
[+] [-] 1_player|6 years ago|reply
But I'd suggest reading through "Phoenix In Action" to get a feel for how everything composes together, but its surface area is much smaller than Rails (though I haven't used Rails in a decade)
Phoenix only deals with the web framework component. If you want to talk with databases, the official library is Ecto. For GraphQL there's Absinthe.
[+] [-] lawik|6 years ago|reply
As someone suggested, check out the Hex docs. That is where you get the better in-depth stuff and API reference. I've found the Getting started-stuff very helpful but also a bit limited in scope.
[+] [-] nickjj|6 years ago|reply
It focuses on building a web app and shows how everything fits together while solving real issues, which is a much better learning experience than the documentation IMO. If you come at it with a Rails background you'll probably walk away with a completely different impression.
[+] [-] prodiguy89|6 years ago|reply
No magic, no hacky patterns. No mess like the one you see with Node. For what it does the platform is hella stable. I drifted towards Go for a little bit but man, code in Go felt too verbose with weird patterns. Go is a solid platform as well. But it's not just my cup of tea for web apps right now.
Scalability is in reach if you need it. Hell, even if you need ridiculous background job processing power, use OTP already. And I forgot, liveView is also rock solid. Honestly, if anyone would ask me what the best platform for web apps right now is, I'd just say Phoenix/Elixir.
[+] [-] AlchemistCamp|6 years ago|reply
The immutability and the lack of magic you mention are probably the two main reasons Elixir projects are easier to jump into. Even when macros are involved, you can still scroll to the top of the file, look at line with "use" or "using" in it and know exactly what is affecting your module.
With a lot of other languages, it's completely unknowable from inside one file to know where or if external metaprogramming is affecting your module.
[+] [-] philsnow|6 years ago|reply
[+] [-] lawik|6 years ago|reply
I've seen a few different nerves-systems targeting AWS EC2. Have you tried doing anything in particular with it?
[+] [-] anm89|6 years ago|reply
[+] [-] SteveMorin|6 years ago|reply
[+] [-] xutopia|6 years ago|reply
[+] [-] SMFloris|6 years ago|reply
It's just the Phoenix framework for which the initial setup of the project generator feels so opinionated. You have no options, no way to make a template for the generator. Phoenix's LiveView is a great feature and I want to use it. It's just Phoenix itself that feels off for me, not as straightforward as it should be. Does anyone else get this feeling?
[+] [-] narrowtux|6 years ago|reply
I agree though that phoenix feels almost a little too heavy and opinionated.
[+] [-] benmmurphy|6 years ago|reply
the with syntax is nice and helps to deal with early exit on errors but still feels a bit awkward compared to imperative control flow.
like you can do something like this in an imperative language:
whereas in elixir you have to do something like the following in order to avoid the nesting of doom: like the with blocks kind of work until you have to transform the errors you receive then you need helper functions. if you are just doing static transforms like above it is not too bad but it starts to get hairy if you want to transform based on the returned error or variables in the function. whereas the imperative style you can inline your error handling logic nicely into the function.for example what if i want to log something on the error path that includes some contextual information and custom formatting. probably, the easiest way is going to be to use with() and pipe to a custom function that triggers on the error path to do the logging because the code is going to start getting really messy. whereas if i was writing it imperatively i could just inline the logging statement most of the time because it is just a few lines of code.
like i feel this is a bit messy but maybe it is actually not that bad:[+] [-] pmontra|6 years ago|reply
I've been using Elixir and Phoenix for a customer for a couple of years. It's ok to great, especially when spawning jobs, with some stains.
I'm not a great fan of the with syntax. I wish they implemented it as a native statement of the language instead of as a macro. In that way they probably could let us write the same code inside and outside a with, instead of having to transform = into <- and add a comma.
But the worst offenders are GenServers. They should really have the syntax of OO classes instead of the incomprehensible handle* functions. After all that's what they are, objects with their own CPU. (Remember Armstrong about Erlang being the only true OO language?)
By the way, that would make it easier to code, to understand and to migrate people from imperative languages.
[+] [-] sergiotapia|6 years ago|reply
[+] [-] 1_player|6 years ago|reply
On a "normal" language you have to deal with all error paths or your app goes down. On the BEAM you handle the happy case and common and unexceptional errors. Otherwise, let it crash.
Example: if your app depends on a database that once in a blue moon is unreachable, don't test for connection errors. Just assume the connection was successful, and if it wasn't, most of the time once the process restarts everything is fine.
I have an Elixir app in production, I get Sentry errors once in a while about some weird state outside my control (we work with external APIs) that caused a process to crash, I just ignore them and go on with my life.
EDIT: I highly recommend this video from Saša Jurić: https://www.youtube.com/watch?v=JvBT4XBdoUE
[+] [-] zeitg3ist|6 years ago|reply