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

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

heh, didn’t realize that was you. Hopefully I should be fixing it shortly. I’m pretty sure I know what the issue is.

No problem. Just glad it is useful to people.

2 Likes

I am already working through LYSE. :thumbsup:

that will be very useful for us! Thanks again!

1 Like

What about Python? JS, ES? Python is taught everywhere and clean, used everywhere (Pi, AI, Web…), JS/ES has Node.JS now, so one shouldn’t focus on Java, PHP, Ruby…?

We tried to start a CMS from Python/Django, I wanted to give a try to Elixir and ELM but too few web libraries, we finally made “the horrible choice” with JS but with Node and React, we actually found a very productive (and dynamic) tooling, community, ecosystem… and ES6, TypeScript or even Dart are cleaning the JS, so all in all… we finally didn’t get the best tool but “the less worst” for any scenario, whatever the platform, Server Web iOS or Android…
Code everywhere (you find JS coders easily), run everywhere… I don’t see anymore place for Java, PHP or Ruby, but in legacy systems…

With WebAssembly coming, I’m waiting for such a universal stack…: Elixir on both the terminal and the server, or ELM on BEAM? :wink:

Elixir and Elm aren’t really a package deal. I use Elm on a static site to build a search box for example. That said, I use React with all of my Elixir and Ruby projects.

Hello @ChaseGilliam

I am curious about the way You bind Elixir and React. Do You use Relay/GraphQL or Redux/REST?