4 ms·
Having used Elixir for multiple years on something other than a server application, I disagree with calling Elixir a general purpose programming language. It’s
by rickcarlino 1y ago
Having used Elixir for multiple years on something other than a server application, I disagree with calling Elixir a general purpose programming language. It’s really good for writing servers, I’ll give it that, but for stuff that isn’t an always-on network application, I felt the OTP way of doing things was designed for something I wasn’t building. Elixir makes it very easy to build servers, but the language and community are very biased towards client/server use cases. It certainly can be used for things other than server, much like I could build a web app using QBasic or Excel. The focus of the language, its history and the community around Elixir has always been server apps. To me, that’s the biggest indicator that it’s a specialized language rather than a general purpose language.
- borromakot 1y agoIt having strengths and weaknesses doesn't make it not general purpose language.
- drekipus 1y agoIn your mind, what distinguishes a language as "general" or "specific" purpose? I'd argue the community and focus of the language.
- rickcarlino 1y agoOr, to your point, the historic design considerations that led to the creation of the language in the first place. In the case of BEAM, it was very specific.
- borromakot 1y agoWhat I mean is that, you can write CLIs in Elixir. I have. You can write games in Elixir (others have, I haven't). They come with pros & cons. The Elixir community advances on many of those fronts regularly. I could write a web application in C, but I wouldn't.
- Capricorn2481 1y agoI would honestly have a much easier time writing a web app in C than a game in Elixir.
- borromakot 1y agoYou are probably right
- HappMacDonald 1y agoI'm curious which use cases you're reaching for that aren't client server? Not to suggest that those don't exist or anything, just that there are so many dimensions available there that knowing more about which dimensions you'd most value having reach in might be enlightening. :) Like: Video games? Desktop apps? Mobile apps? Embedded? Systems-level programming like OS or hardware drivers? Or one of a thousand other directions I can't think of just off the top of my head?
- phinnaeus 1y agoI am a huge Elixir fan and I would basically never reach for it to build a CLI.
- rickcarlino 1y agoIn my case it was a non-resource constrained embedded system (several GB of RAM, gigabytes of storage not unlike a set top box application). The tooling was OK, but in retrospect, the community and language felt too biased towards server-client applications. Every time you search for a question, you inevitably bump into answers that assume you are building a Web app and don’t apply to more general use cases. Or OTP ends up getting in your way because you are trying to do something simple that does not require massively parallel scaleability. For a lot of these situations, I walked away from the language feeling like it would’ve been easier to just do it in Python, JS or some other general purpose language. All of the BEAM languages make heavy trade-offs in the name of concurrency, and in cases where concurrency is not a main concern, the gains just weren’t there compared to mainstream languages.
- pdimitar 1y agoThanks for sharing. I would reach for Golang or even Rust if I was you. I work with Elixir for 9 years now (& love it) and I agree what you describe is not a good fit for it. Elixir is a general-purpose language in the meaning of Turing-completeness. I never once felt tempted to write a CLI tool with it though.
- bryanrasmussen 1y ago
- gchamonlive 1y agoIf your application doesn't need GenServer you shouldn't use GenServer. Elixir is definitely not a language to write games in, but it's totally viable to write stuff that doesn't fit into the OTP model.
- rickcarlino 1y agoWhat are some examples of large scale production systems written in Elixir that do not use OTP?
- gchamonlive 1y agoI don't know and it's tangential to the question of whether "elixir is a general purpose language". Might be important for you, but it's irrelevant for my comment.
- rickcarlino 1y agoMy main point is that a language’s historic design considerations, community and ecosystem play a huge part in determining its applicability to a particular domain. Years of personal anecdote, coupled with the history of the project, and what people are building with it in practice (rather than what could be built in theory) drive my conclusion that it is not a general purpose language. That doesn’t mean it’s not a good language for what it was historically intended for.
- gchamonlive 1y agoBut in the process you are redefining general purpose language to general applicable language and making everybody confused. Why not adhere to the general convention and accept that Elixir is totally a general purpose language but has limited applicability depending on the domain.
- lawik 1y agoI think it is very accurate and should be uncontroversial to say that Elixir/Erlang/OTP are very angled towards building services. I'd say service rather than server because I don't think it is necessarily about client/server as much as doing a long-running job. Which very often is a server but I've done bots, workers and whatnots that I wouldn't necessarily think of as servers. I think the language and ecosystem are fairly general-purpose but there are definitely a lot more general ecosystems. I think some of the big wins both Erlang and Rails have achieved (that Elixir build off of) have been about constraining the problem to be "a service" or "a web app with a database". So you are spot on there. One of the things I've found Elixir to be surprisingly nice for is as a replacement to my Python and Bash scripting. Shelling out is occasionally awkward but Mix.install is glorious and Task.async_stream is hilarious.
- westoque 1y agoCame here to say this. What makes a great general purpose language is not only in the programming part but also in transportability. I think Go takes the cake here. If only Elixir apps could be compiled and transported as a binary to similar systems and it works, then it would make it a great general purpose language. Until then, it's really only a good client/server language as it was intended to be.
- borromakot 1y agohttps://github.com/burrito-elixir/burrito https://github.com/burrito-elixir/burrito
- bcrosby95 1y agoI like it for scripting because with the Flow module, concurrent code looks mostly like non concurrent code. You can also pull in dependencies right in the file. I did a small experiment with a few different languages and Elixir had the fewest changes going from single threaded to parallel. Clojure was the lowest loc in general.
- schultzer 1y agoI disagree, it’s wonderful for writing compilers in as well https://github.com/elixir-dbvisor/sql https://github.com/elixir-dbvisor/sql I would go so far as to say superior to a lot of other languages that do not have advanced pattern matching.
- pjmlp 1y agoSo is any ML or Lisp descendent.
- greybox 1y ago> I disagree with calling Elixir a general purpose programming language. I was going to comment this seperately, I'm glad someone pointed this out. +1