7 ms·
Would love to have you elaborate on that more. What problem domains will Elixir add substantial power for? What use cases do you think it will be a game change
by nemild 10y ago
Would love to have you elaborate on that more.
What problem domains will Elixir add substantial power for? What use cases do you think it will be a game changer for? Would you consider the difference in the future between Elixir and JS in terms of productivity/power the difference in the 90s between Lisp/Python and Java/C?
- jbhatab 10y agohighly concurrent apps like chat based apps at the very least.
- gamache 10y agoJust one example: With Elixir and the Phoenix Channels library[1], soft real time, bidirectional pub-sub communication is incredibly simple. Startlingly easy, in fact. If this describes "the tricky part" of an application, Elixir is a substantially better choice than other languages right now. Comparing Elixir to JS isn't fair. Even ES6 is still kind of a shitty language with shitty concurrency primitives. The main reason JS enjoys the popularity it has on the server-side is because lots of people are afraid of learning a new language and everyone knows it from the browser, not because JS is a particularly expressive, fast, elegant, or concurrency-ready language. [1] http://www.phoenixframework.org/docs/channels http://www.phoenixframework.org/docs/channels
- qaq 10y agoJS enjoys popularity among other things because people don't want to write code twice. SPAs at a minimum need server side rendering for SEO and faster initial delivery for better customer experience. To be honest ES6 and TypeScript is very far from shitty. If you take a close look at people who are pushing node adoption in major projects they are anything but "people who are afraid of learning a new language".
- andrewingram 10y agoFor my personal project, my web client is written in React (with Relay), talking to an Elixir-based GraphQL server. I'm still learning the language (Elixir), but i'm much more productive than I am with my Relay-based project at work which is using the JavaScript implementation of GraphQL.
- qaq 10y agoThat very well might be true and will work well until you need to support server side rendering for SEO :)
- andrewingram 10y agoSorry, I didn't explain well. When I say client I also mean server-side rendering since it's basically the same code.
- rcaught 10y agoYou have to write code twice, otherwise you are trusting everything the client sends.
- qaq 10y agoHmm don't really follow your argument. The only extra thing I need to write are checks to exclude code that should not be executed server side. Thats a long way from effort required to implement same thing in 2 languages.
- davidw 10y ago> soft real time That's basically meaningless in the presence of the internet. I'd say "low latency".
- andy_ppp 10y agoIt's actually better at pretty much everything because it's functional and not OO. And because it's designed for dealing with errors and crashes. And because it has a world class standard library that's fast and totally consistent. And because you can't tack on mutable state everywhere. And because who wants to spend time assigning variables manually when you have amazing pattern matching. And blocking works just fine with zero performance penalty. And because it's made me a better programmer having learned it. And because of OTP/Beam/concurrency|>. And because the first program I wrote in it (a scraper) was so fast it crashed the site I was scraping and I had to start pooling connections.
- nilkn 10y ago> It's actually better at pretty much everything because it's functional and not OO. Just a bit of a funny comment/aside, but the actor-based message-passing concurrency of Erlang/OTP and Elixir is actually pretty similar to the classic object-oriented programming of Smalltalk, etc.
- pmontra 10y agoIndeed. I quote Joe Armstrong: "I might think, though I'm not quite sure if I believe this or not, but Erlang might be the only object oriented language because the 3 tenets of object oriented programming are that it's based on message passing, that you have isolation between objects and have polymorphism." http://www.infoq.com/interviews/johnson-armstrong-oop http://www.infoq.com/interviews/johnson-armstrong-oop
- andy_ppp 10y agoYes, I hear you. It's strange how OOP got completely bastardised by the industry - anyone know what the process for this was; in my head I'm tempted to blaim C++ and then Java but I think there are probably other culprits that led us away from the path to enlightenment :-)
- jimbokun 10y ago
- smitherfield 10y agoIt's far from the only use case, but my impression from using the Phoenix framework is that anything Node can do Elixir does better (cue Annie Get Your Gun soundtrack). Elixir is to Node as Ruby on Rails was to PHP in the 'oughts. It's highly productive, especially at scale, relatively bug-free and easy to test (being a pure functional language with immutable data), designed for (and makes almost trivially easy) extreme concurrency without blocking (even by GC), minimizes the risk of crashes due to errors (YMMV of course), nudges the programmer in the direction of sound and productive architectural decisions, is fast "enough" for most non-number crunching uses (much faster than the 90s dynamic languages, slower than Java/C#/Go/Swift), and, although the ecosystem is still small, it makes up for it with probably the best standard library there is in the form of OTP. I'd say its problem domain lies in the area of large (large codebase and/or large userbase) realtime apps. Or, more generally, it offers its best productivity relative to the competition for applications where most computations are not particularly complex and/or are repeated, but they may need to be performed at a very high throughput. An excellent server/networking language.
- jhgg 10y agoWe use Elixir/Erlang at scale at Discord. For building distributed, massively scalable soft-realtime systems, it's been amazing.