I’m coming from Golang as my main daily driver and I’ve messed around with Erlang for a while. Recently built a server in it with Cowboy and most of what I wrote was Erlang and OTP modules.
When I look at Phoenix it sprawled out a huge web app and I’m just wondering if I need to build something in Elixir first to understand what everything is or can I just jump in? I’m possibly being brought onto a fresh mobile app platform as CTO and most of it’s sweat eq, so I would like to make the DevEx enjoyable.
One thing I got a good laugh out of was during my time building an Erlang app. I kept thinking about how deployment with kubernetes would work, then I kept having to remind myself how resilient the BEAM is, and I would like to continue exploring it’s strength. Golang is great but you really have to lean into subsystems to support your fault-tolerance. The concurrency tools are sweet and I think the language is down-right genius; however, I can’t help but notice the shift of web platforms going more towards something like the BEAM and Phoenix.
The server is just an API so I won’t be using liveview and I have a decent handle on pids, gen otp tools, etc. My main goal is to find employment in the space and I think launching a successful product would help. How ready am I to just jump in? I’m also not using chatGPT, reading docs and searching like old school times.
If one already has a programming background, I don’t think jumping straight into Phoenix is necessarily a problem. You are bound to pick up a lot of the language just by building things and bumping into inevitable problems along the way
That being said, I’m generally of the opinion that understanding the programming language underneath your framework is a long-term win. Phoenix is just Elixir after all, and the more you know Elixir, the more efficient you’ll be when dealing with those speed bumps. Skipping the initial language learning step can feel like a time saver at first, but my experience suggests that gaps in Elixir knowledge usually come back as slowdowns later on. One common friction point I’ve observed is Phoenix’s use of macros, for example.
My personal journey started with the book “Programming Elixir 1.3” before moving on to “Programming Phoenix”, and I believe that worked for me quite nicely.
With all that being said though, just go for it (if you don’t have a solid reason not to)!. Jump in and build stuff in whatever order (and depth of knowledge) feels most natural to you. You’re bound to notice where your knowledge is thin over time, and can then take corrective measures in your process as needed.
I don’t know enough about your employment history or the mobile app platform role you mentioned, so I’ve not commented with those in mind. If you’re operating in the capacity of a company rather than as an individual, things can be different, of course. But yes, building and launching things can also generally be a positive thing career-wise
You might also want to search around this forum. There are a couple of other threads discussing the same question from different angles, so you might get more opinions that way, too
Thanks, I appreciate that, it’s definitely better to know the language, but I’m familiar with a lot of the concepts from Erlang and there’s a lot of niceties coming from that space. My main concern was Phoenix being too large where cowboy is quite a small tool chain compared to it; however, it seems the modules are all opt-in based so that fits my use case. I went through Grox.io in 2023 but most of it’s been invalidated out of the ol’ head cache; however, it’s easy to remember some of the bigger ideas.
In terms of the start-up, I would be partnering with someone that has released some books and writes blogs, but needs a platform/app for the other websites to market her stuff. We’re sending video to the device so I wanted something that has streaming capabilities but isn’t intense like rust or c. That part is more Elixir utilizing ffmpeg which I’ve heard is a great combo. In terms of releasing, I would be the sole technocrat in the org and everything would be built by myself initially.
I wanted to avoid k8s, fargate, etc. and have something that I could coordinate some CAP stuff with. Erlang is really sexy and I liked the experience developing my last server in it, but it’s rough to read the code, so I’m hoping that Phoenix/Elixir gives me the DX I’m looking for. Otherwise, I could just whip out Go and call it a day.
My guess is you’d be fine just jumping in considering your experience with Erlang. I imagine you’d pick things up quickly. It’d probably be worth doing a quick review of the syntax basics. Generally, the hex docs are pretty good if you stumble across something that you’re not sure about.
Elixir in Action is a pretty good book if you like that method of learning.
Phoenix does tend to create a huge scaffold out of the box. I’m sure there are good reasons for it but you can also throw most of it away if you want. The things that are probably worth keeping are the accounts authentication so you don’t need to hand roll and the router file. Otherwise it’s pretty much up to you on how you want to structure your app.
@thismustbekirk I started learning Elixir by just creating a new Phoenix LiveView project since I’m a web dev and that’s how I learn every new language. For me, Phoenix seemed really massive and confusing at first, but everything is composable, and I’ve since broken my site down and am not using most of the “opinionated” patterns that the generators foist on you at the start. I strongly recommend this blog post by Sasa Juric explaining exactly how phoenix can be broken down: The Erlangelist - Phoenix is modular Also, Sasa’s series on macros will help a lot with elixir-specific metaprogramming, which Phoenix makes heavy use of as others in this thread have mentioned: The Erlangelist - Understanding macros, part 1
Really, Sasa’s blog is a treasure trove of understanding for Elixir, so definitely bookmark it.
I can’t really give too much other advice since I’m still learning a lot myself, but I will say that I came into Elixir from primarily Python, JS/TS, and C++, so the ruby-like syntax and BEAM concepts like OTP and process communication were the biggest hurdles for me. If you have a good foundation in OTP/BEAM concepts from Erlang, the syntax in Elixir should be easy to pick up over time, and breaking down a Phoenix project into simpler pieces is a great way to get a deeper understanding of the ecosystem and tooling, which will be important for handling the network infrastructure if you’re using the BEAM in place of K8s and off-the-shelf load balancers.
Thanks I appreciate the help, understanding OTP is the main reason I went the hard route with Erlang since Elixir has apis over some of the gen stuff. Messaging processes and managing state in gen_servers is really fun to just see stuff work. I appreciate the medium article because I’m definitely running the BEAM then stacking everything on top. I’m finding the job search to be impossible so if I’m learning skills then I would rather do weird stuff that’s interesting versus ABC technology stack.
It also seems that Elixir solves the netsplit problem so I would probably have a cluster deployable through terraform, and maybe use some aws tools to create redundancy across regions for the main prod if we scale to that need.
I think the most difficult solution is what to do with the database, I had mnesia with riak for state management, but it seems like that’s not the best option and that postgres is the way to go. I was required to create pools over a custom psql connector in erlang and it was contrived and forced vs the mnesia route. The biggest piece of advice I’m getting is that fact that macros are a hurdle to get past, so I’m going to dive into those aspects first but Phoenix is great to work with. Reminds me of laravel so yea excited to see what the stack has to offer.
Yeah, there aren’t as many companies using Elixir as Go, but it’s definitely a fun language to explore and experiment with. Macro war-crimes are also really fun as long as its not code you need to maintain for anything important. And they are pretty useful for production code too if used sparingly. I just wrote a small library for LiveView that manages computed properties for me, and it’s almost all macro-magic. I love that Elixir macros are AST-based and not just string substitution like C macros.
Anyway, lots to love about the Elixir ecosystem. Good luck and have fun!