4 ms·
Just move to Elixir. Phoenix is Rails-like enough and the platform is excellent for parallelisation, clustering in specific hardware and so on.
by cess11 2y ago
Just move to Elixir. Phoenix is Rails-like enough and the platform is excellent for parallelisation, clustering in specific hardware and so on.
- arrowsmith 2y agoAnd if you want to make the move, I know a great resource: http://PhoenixOnRails.com http://PhoenixOnRails.com </shamelessselfplug>
- freedomben 2y agoNormally "switch languages" isn't great advice, but in this case I think it's worth considering. I have heard people coming from Django and Rails background describe Elixir as "a love child between python and ruby". Personally I love it
- aragilar 2y agoBut does Elixir come with a whole scientific computing ecosystem?
- aloha2436 2y agoNot to the same degree that Python does (then again no other general-purpose language does!), but it does have the start of one and it's fairly cohesive. https://github.com/elixir-nx https://github.com/elixir-nx
- aragilar 2y agoFortran? R? C? C++? Even Java may occasionally make a good showing here (depending on what you are doing). Having seen... things... unless it's written by people with the right skillset (and with funding and the right environment), that it exists doesn't mean you should use it (and the phrase "it's a trap" comes to mind sadly). https://scicomp.stackexchange.com/a/10923/1437 https://scicomp.stackexchange.com/a/10923/1437 applies (and note I still wouldn't call Julia mainstream yet), so while I'm not saying people shouldn't try, the phrase "don't roll your own crypto" applies just as much to the numeric and scientific computing fields.
- the_gastropod 2y agoI'm not super tuned into the scientific computing ecosystem, so not sure if this is what you mean. But maybe? Elixir's Numerical Elixir projects seem very relevant for scientific computing. Check 'em out: https://github.com/elixir-nx https://github.com/elixir-nx Edit: Hah! aloha2436 beat me to the answer. Sorry for the repetition.
- goosejuice 2y agoMust your statistical computing ecosystem comingle with your web interface?
- aragilar 2y agoYou can split it off and have your Python code be an API you call, but now you have at least two languages involved (Python+Elixir, plus JS somewhere, plus the possible mix of C/C++/Fortran/Rust(maybe?)). Given Ruby on Rails was mentioned, just using Django seems similarly like the least risky thing to do (this all assumes you are doing numerical stuff, not just a standard CRUD app).
- grncdr 2y agoTo add to what others mentioned, there’s also https://github.com/livebook-dev/pythonx https://github.com/livebook-dev/pythonx which embeds a Python interpreter into your elixir program.
- seneca 2y agoI personally think Elixir is a great language, but the jump from ruby to functional programming is big enough that I'm not sure it's useful general advice.
- vlunkr 2y agoAlso, the size of the elixir community and the libraries available is completely dwarfed by rails. Elixir, Phoenix, all the core stuff is really high quality, but in many cases you might doing more work that you could have just pulled from a gem in Ruby. It's unfortunate IMO. It's an underrated language.
- pythonaut_16 2y agoVery much this. I think the community tends to overestimate the ecosystem’s maturity which is one of the big things holding it back, both because it blinds the community to areas that need improvement and leads to bigger shocks when newcomers do unexpectedly run into the rough edges.
- arrowsmith 2y agoThis is true, but AI is closing the gap. "Take this Ruby gem and write the equivalent functionality in Elixir" is something that LLMs are very good at.
- weatherlite 2y agoThat's over simplifying things ... no, complex gems cannot simply be transformed to Elixir with ChatGPT. You'd have to have an expert in both languages fixing all the bugs.
- cess11 2y agoDo you have some examples?
- paradox460 2y agoAnd the switch is rather easy. I've been writing elixir for nearly 10 years, rails before that, and have overseen the "conversion" of several engineers from one to the other. Generally I'd say any senior rails dev, given the right task, can write decent elixir code on their first day. There are a lot fewer foot guns in elixir and Phoenix, and so other than language ergonomics (a simple rule that doesn't stretch far but works at the beginning is use pipe instead of dot), there's minimal barriers
- troad 2y agoHonest question from someone working on a non-negligible Rails codebase: what would be my gains, were I to switch to Elixir? I've watched Elixir with much interest from afar, I even recently cracked open the book on it, but I feel like my biggest pain points with Ruby are performance and lack of gradual typing (and consequent lack of static analysis, painful refactoring, etc), and it doesn't really seem like Elixir has much to offer on those. What does Elixir solve, that Ruby struggles on?
- paradox460 2y agoPerformance is a complex story. Elixir is very good at massive amounts of parallel computing, and uses this to handle each request (or socket) in it's own contained manner, which nets you some simplicity in designing systems and scaling. However it's not very good at single threaded off-the-block performance (but neither is Ruby) Typing is coming, some is already here, and if you're impatient you can use dialyzer to get half way there. But in my experience you need it less than you'd think. Elixir primitives are rather expressive, and due to the functional nature there really isn't any "new" data structure that isn't easy to dive into. And with each function head being easy to pattern match in, you can dictate the shape of data flow through your application much as you'd do in a typed language. The ide story isn't great, but it's getting better. There are a few LSPs out there, and an official one coming soon. And I'd say all of them beat solargraph handily But most of all I'd say that, since it's a bit more strict, elixir saves you and your coworkers from yourselves and each other. There are still several ways to do something, like Ruby, but going out of your way to write very cutesy code that the next programmer will loathe is more difficult. Not impossible, but harder. And with the rock stable concurrency systems in place, a lot of the impetus to come up with clever solutions isn't there