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

If in any of those forums you’d get a truth answer its here.

PHP kiddies often do see “their” PHP as the only truth.

Java is just the best because its Oracle and therefore has a huge amount of money behind AND it is the language used nearly everywhere since 1998-ish

Well, Ruby does know about some of their problems (the “real” parallelism we got with 2.0 actually still isn’t real), but still they do not accept much languages aside of their own. Well except CoffeeScript, but thats only because the Rails-Team has decided on this for the community.

The Elixir community seems to be different. Of course, elixir is cool, its a fine language, but, we have NIFs, we have Ports. When we see, that a job doesn’t suite the BEAM, we switch over to a better suited language. Maybe we ask someone else to code that piece adhering our API (or erlangs). But we are able to choose and used to actually consider those things and also to integrate stuff into our system.

3 Likes

I guess you mean while developing? Otherwise this is just wrong.

See e.g.: https://www.infoq.com/news/2012/11/twitter-ruby-to-java

You may get here an solid answer, but surely not only here. And actually your answer kind of contradicts it.

1 Like

hehe, that’s precisely what I’m talking about ;). In fact I think everyone, including myself, have often irrational preferences and are always biased against/for some technologies. Take PHP, and “PHP kiddies”. Well, Facebook is doing well with PHP, the chances are you can actually build decent software with it now days.

Yes, especially compilation - comparing to Elixir developing - using Java is really, really slow. One time when working with one designer in Elixir/Phoenix project he want lots of small “one-line fixes” - I can’t imagine doing this with Groovy/Grails + Tomcat, because this could take few hours instead of some minutes. In Elixir the only limitation while deploying is my network upload speed (uploading release archive to multiple nodes) and compilation is really fast enough for such situations.

1 Like

Yes, but even Facebook felt compelled to create an “escape hatch” with Hack - which doesn’t really seem to be catching on within the PHP community proper.
(PHP 7 vs HHVM – Which One Should You Use?)

Eh, don’t be that hard on Java:

  • The types help ensure your program is correct, which cannot be said about Elixir (though java does not go far enough, everything can be cast to an Object like you can to void* in C, blehg)
  • Tomcat is indeed hell, but don’t use it, there are much better server containers for java programs than Tomcat.

Java7 is actually much faster than before and you can make good software in it now without fighting with it too much. However Joomla and Wordpress are both ‘old PHP’ things that are not made well. And with PHP it is easier to have security problems, but with enough discipline those are minimized (however yes, there are still lots of security issues with PHP, PHP7 closed more of those thankfully). It’s still faster than Ruby/Rails though. :wink:

More secure by default is great yeah, but using PHP frameworks you get a lot of that too (if you tried to, say, re-implement Rails on Ruby you’d probably have a lot of security issues as well), but even by default Rails has a lot of security issues that are easy to fall in to unless you know to avoid them. Also Ruby/Rails is a lot slower than Groovy (no clue about Grails), and tomcat you should avoid anyway.

You get this with about any language with any decent IDE, and many languages, like Rust, do the same built-in. I think the biggest advantage of Elixir is it is built on the BEAM and instead of entirely ignoring its heritage it instead embraces it, which helps people to write proper code the first time instead of trying to figure it out (great docs for the BEAM!).

Also people need to quit saying that Facebook is using PHP, because they are not. :wink:
They are using HHVM, which is PHP-like in syntax, but it has types (whoo) and is much faster and has a different API and more and more. You can run PHP on it as well (and it is still faster than normal PHP) but it is not taking full advantage of its enhanced API and without putting the Types in the source it will not run as fast as it possibly can anyway. Facebook uses HHVM, they don’t use PHP anywhere anymore.

3 Likes

I’m not hard for Java. It’s my experience using Groovy/Grails and Tomcat about 2 years ago.

I don’t had yet any problems related to that, so it’s not a best pros for me.

I don’t - it was introduced in my first job. Owner was a really good person that listen others, but anyway imagine that he will change working solution like Tomcat to something else, because new developer says that it’s a slow as hell. :slight_smile:

You mean PHP 7, right? :smiley:
I also heard something about it and I can agree that it’s faster than Ruby, but in these 2 languages speed is not a big problem for newbie. They are enough fast to start work on it without required break for tea. :slight_smile:

Hmm, interesting … I don’t compared their runtime speed. I don’t have so much time to develop two small similar projects. :smiley:

hahah, you don’t understand me - I mean a result of that command like example of documentation and tests. Sorry, next time I will be more precise :slight_smile:

2 Likes

Groovy sucks, no clue about Grails, and tomcat is utterly horrible. ^.^;

You’d never really had an issue where you accidentally passed a {:ok, something} to a function instead of a something? Or wanted to have a restricted set of inputs to a certain function that would not accept anything else and enforce the caller to verify it is correct before, say, blindly passing in user input? Or etc… etc… etc…? Type systems are awesome as they categorically prevent all those issues and far far far more. :wink:

Tomcat is not only slow but by default is very open and can be taken over with ease (locking it down is a first step of any install of it, and it is easy to miss a lot of vectors). But the container api for java is pretty well standard so you can literally take the server you have no and replace tomcat with a better one and it should all still ‘just work’ (usually). :slight_smile:

Er, yes! ^.^;

Not just a little faster either, it is a magnitude of difference. But yeah not an issue if serving up to a few a second, but getting more than that and PHP can still survive where even well crafted Ruby/Rails apps will fail.

Even then it is common in a lot of languages (either built-in or via template-new-project-systems). ^.^

1 Like

Groovy/Grails was … mistake :slight_smile: Kotlin is going to fix this mistake.

2 Likes

10 posts were split to a new topic: Strong Typing vs Unityping

You might find these threads interesting :slight_smile:

https://elixirforum.com/t/what-do-you-think-are-the-most-appealing-aspects-of-elixir/2440

https://elixirforum.com/t/why-elixir-slides-from-my-elixir-presentation/2431

https://elixirforum.com/t/if-elixir-were-an-animal-what-would-it-be/2353

3 Likes

Actually the deployments for our java micro services is normally faster than with elixir.

I do not think that this is true anymore.

why do you think so?

and for java vs elixir… if you use and environment that is not just a postgres DB it can be really time consuming to use elixir where is just works with java…

Wow that is so true, thanks for sharing

1 Like

Back when I had to run it before replacing it with something better it has major security issues at the start until those ‘features’ were individually turned off, it was significantly slower than what it was replaced with, and it had a nasty habit of using classes that were loaded from being replaced when the .war(?) updated, forcing a reload. Just to start…

Uh, why? In the past I’ve used MySQL, Sqlite, Oracle, Riak, and at least a dozen other things. Maybe you are talking about Ecto and not Elixir. Ecto is not Elixir, and Ecto is not the only SQL library out for Elixir/Erlang. :wink:

1 Like

we replaced tomcat with with anothter container a short time ago and went back to tomcat as our monitoring showed, that the app was slower. After going bacl to tomcat the response time decreased again.

I do not know whether this still exists, as we are always starting new instances when deploying.

But only maybe. :slight_smile:

Actually we do not use Ecto at all and are working directly with the DB driver. In our case mongodb.

We started with the mongodb driver and realized later that it does not support replica sets. that means that driver was simply not production ready and merely a proof of concept. thats you do experience with java.

and lately we made a proof of concept application where we had to access a teradata DB. for this project we did not even consider elixir as the language of choice. does there exists a teradata driver for elixir?

1 Like

Technically I would classify Ecto as a Data Mapper (or more accurately as part of one**) - and the issue is that a significant segment of the developer population has come to expect the presence of data mapping - rather than having to get their hands dirty (… suffering a loss in their productivity) writing their own low level persistent storage logic.

**As far as I can tell Ecto is only capable of defining it’s own structs (types) via the schema mechanism - I haven’t come across functionality that would let it deal with structs (types) that have been defined outside of Ecto (yet). So I imagine that would necessitate defining your domain types to contain an opaque portion for the Ecto struct and declaring the data inside the domain type off-limits for direct access (probably a good idea anyway). However I would imagine that the functionality for the domain module could still get messy especially if it has to deal with nested types that are represented by separate Ecto structs.

2 Likes

Just in case you were not aware, I finished replica set support recently.

There is actually an erlang mongodb driver that has supported replica sets since May 2011.

If you cannot find what you consider to be a production quality library in Elixir, make sure you look for one in Erlang.

2 Likes

thanks for letting me know.

Yes, we already knew that and we tried to migrate the db driver and ran into some problems. I already created an issue at github about it.:wink:

thats surely a good tip. but when we started with elixir we did not want to dive directly into another language we were not familier with. but nevertheless that a good tip.

It is really still the same language, just different syntaxes. Never be afraid to look at erlang libraries, it has quite a lot. :slight_smile:

[quote=“Ankhers, post:44, topic:6501”]
Just in case you were not aware, I finished replica set support recently.[/quote]

and… btw… thank you very much for finishing this! ww were looking forward for getting this feature!

1 Like