restack_oslo

restack_oslo

Elixir vs. Java, Ruby, and PHP - Seeking case studies or an interview with a community member

Hello,

Please pardon me for any faux paux. I am 46 and this is my first time on a forum of any kind. I wanted to to get answers from those in the know.

I am a new business analyst and delivery manager, researching Elixir - Phoenix. I came accross this language, commissioning the work for my startup out to a developer who suggested this technology. I saw many comparisons between Ruby and Elixir but not so much for the other languages (Java and PHP). I have already reached out to several authors and developers but with no luck.

Specifically, I wanted to build a matrix illustrating when I would choose Elixir over or stay with Java, PHP, and Ruby. I am looking for an answer in the form of situational examples or specific criteria. Case studies would be a real plus. Any help would be appreciated. I will cite you as a source in my prose as well as link to your site.

Thank you,

Alex.

First Post!

mkaszubowski

mkaszubowski

There’s a quite recent story about migrating from PHP to Elixir which might interest you: http://engineering.teacherspayteachers.com/2017/06/05/challenges-faced-while-scaling-to-serve-millions-of-views-per-day.html

Most Liked

DianaOlympos

DianaOlympos

Ok so, kinda hard to find a case study, but here are my point of view

Java

++ Easy to find devs
++ Easy to find “known practices”
++ Easy to sell to company
++ JVM is quite good at computational heavy stuff once warmed
– JVM is a really really finicky piece of software to operate
– Needs for overcomplex architecture and code to do anything
– Needs for a lot of “Best practices” to do the work
– Really hard to separate good from average devs.
– OOP, ie flawed by design

PHP

++ Easy to find devs
++ Easy to sell to companies (Facebook use it!)
++ PHP7 is not too bad at speed at all
++ Easy to deploy
– Broken by design
– Not really meant for long lived stuff
– Hard to operate.
– Hard to keep clean and maintainable
– Really hard to separate good from average devs

Ruby

++ Easy to find devs
++ Gem for everything
++ “Easy” to deploy
++ Nice for the devs
++ Can be easy to maintain if nicely done
– Flawed by design (OOP)
– Slow. As hell
– Not really easy to operate
– Really hard to separate good to average devs
– Really not meant for long lived stuff

Elixir

++ Nice for the devs
++ A design that make sense (and do not breaks the laws of physics)
++ Easy to maintain
++ Easy to operate and debug
++ Quite fast
++ Ease of interacting with other languages
++ “Habits of solving the hard problem the right way”
++ Accept the reality of errors and problems.
– Harder to find devs, but tend to be good
– Harder to find “Good Practices”
– A bit harder to deploy
– Meant mainly for longer lived stuff, bad at scripting.
– Hard to sell to other companies (there are case study mind you)
– Not good at computational heavy (but see interactions with others)

There i hope it helps

BTW @OvermindDL1, welcome to the RESF ( Rust Evangelism Strike Force)

10
Post #8
alisinabh

alisinabh

Hi @restack_oslo

I will explain some things i learnt from Elixir. This is what i know i what i know can be wrong.

To answer your question first i need to remind you Elixir will compile to Erlang VM (AKA BEAM) Bytecode, So we can say it’s same as Erlang in runtime.

Upsides

  • First of all Erlang is super robust. I heard there are telecom switches running Erlang non stop for 20+ years. Thats interesting.

  • Elixir/Erlang use immutable data structure, means it’s less likely going to suffer from concurrency issues. these issues can happen a lot on Object Oriented languages like Java.

  • Elixir/Erlang is easily scalable. A client-server architecture in Elixir (like GenServer) is very helpful to convert a monolith application to a micro-service like application without needs for creating an API interface since Erlang can talk between machines easily using Node module.

  • Elixir has a friendly community and maintainers, I really value this.

  • In Elixir/Erlang your process (BEAM process) will not get terminated easily. There is no StackOverflow exception. However memory outage can crash whole VM.

  • Most Elixir libraries are well documented. The code-style encourages programmers to write good docs about every public function by providing nice Tools like ex_docs

  • Deployment of elixir code to server if fun and safe. Specially the Hot Code Upgrade lets you upgrade you application with zero downtime.

  • For web development i’ve never seen something like plug. plug is awesome.

  • Erlang/Elixir can handle high loads of traffic like a boss.
    Visit here to learn more: 2 Million Websocket Connections in Phoenix
    Whatsapp uses Erlang as their main language. I’ve read in their blog that they handled over 2,300,000 connections to a single box. Whats app 2 million connections

Downsides

  • Elixir is a new language and can change a lot in many aspects. So you need to be more active and up-to-date.

  • Erlang/Elixir is not a good candidate for applications which rely heavily on calculations. (But you can use a combination of C/C++ or Rust with Elixir if you need calculations. more info here: github.com/hansihe/Rustler)

  • There are not lot’s of Erlang/Elixir developers. Currently they are not easy to find. It may cause some expenses to your company.

  • Some Erlang native libraries are hard to understand and Erlang documents are a bit wired in my opinion.

Im sorry about my poor english.

AstonJ

AstonJ

Elixir and Erlang are built with distributed systems and concurrency in mind - for scalability and availability (fault tolerance) few languages come close. Do you need more reasons than this? :lol: Elixir offers us a ‘modern’ language for the Erlang Virtual Machine - many say that Elixir is the language that the Erlang Virtual Machine deserves (thanks to it’s ‘nicer’ syntax, tools, frameworks etc).

Personally I think something that is often overlooked by managers is that developers who use languages like Elixir often fall in love with them. This promotes a culture of learning and something I believe leads to significantly better developers …they learn as much as they can because they want to, not because they have to (JS/browsers) or because they are told to (Java/enterprise).

People usually excel at what they enjoy - do you want a team who is passionate not just about your startup but about the technology it uses? Or a team who are not all that inspired by the work because it’s with a language they don’t really like? I know what I’d choose :003:

Last Post!

OvermindDL1

OvermindDL1

As much as I still feel I’m not, I’d think I’d qualify as a seasoned language developer, and Erlang is easy, it is simple prolog’y syntax wrapper a dynamically typed ML language, it is really easy. If you want ‘difficult and not intuitive’ I can point you to other languages. :wink:

Entirely agree. Elixir is a bliss to deploy! Compared to erlang or ruby or node or any other horror of things, Erlang is by far the easiest to deploy short of simple setup scripts.

Have to agree here too. The JVM has so many great languages on it, and even recent Java has got so many ‘modern’ features that it has become quite nice as well.

I’d pick a good blas library in C++/Rust over Python for number crunching any day. Python is still interpreted and has to marshall data to the numpy library, it just has an easier syntax of it (and even that is debatable).

As well as the BEAM’s Ports are fantastic to interoperate with anything! ^.^

Yeah, no coupling here whatsoever, even Ecto comes with postgresql and mysql both.

I think most use postgresql just because postgresql is amazing.

Erlang does have ‘macros’ called Parse Transforms. Overall they are actually ‘more’ powerful than Elixir’s macro’s, however they are an utter pain to use. >.<

Like I said, PostgreSQL is amazing! ^.^
I have mine FDW’d to an Oracle database and soon an old MySQL database too!!

Where Next?

Popular in Discussions Top

AstonJ
If a newbie asked you about Phoenix Contexts, how would you explain the basics to them? Feel free to be as concise or in-depth as you li...
New
und0ck3d
Hello everyone! A few days ago I’ve created a topic here about how people were creating CMSs with Elixir and Phoenix. I’ve been studying...
New
pillaiindu
In django there is a cache framework backed by memcached. Rails also puts a lot of emphasis on caching, and even the idea of russian-doll...
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40165 209
New
tomekowal
Hey guys! I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
RudManusachi
What configs will make sense to put to runtime.exs? – A bit of how I configure apps: I have generic configs in config/config.exs, dev...
New

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1144 55125 245
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

We're in Beta

About us Mission Statement