As I said in my last post, for a commercial project elixir makes the most sense as you can use the widest variety of libraries. For an open source project Erlang makes the most sense as you can be used by the widest variety of users.
I think itās more like if you are making a open source library for Erlang ecosystem that doesnāt need other Elixir libraries or features then it might make more sense to use Erlang. For other kind of projects it doesnāt really matter. From what I understand Gleam language also has good interoperability story but that language might not yet be mature enough.
Well the reason I came to Elixir is because I want to use it to build a social network
As many have said in the thread, WhatsApp is already powered by Erlang, and is a technological feat - youāll see in the article linked to by @toronja that their app has 900M users and they did it with a team of just 50. Thatās incredible - and goes to show that Elixir/Erlang will be able to get you to that sort of scale much easier and quicker than what might be possible in other systems.
With regards to Elixir or Erlang - Elixir runs on the Erlang VM, so all the power of Erlang is available to Elixir. The differences are in things like tools/libraries/frameworks etc. Erlang has frameworks like Zotonic, Nitrogen, Nova, Chicago Boss and Elixir has Phoenix (as the community has preferred to stick to one) so look at the syntax and tools of each and just go with which you prefer. Ultimately, in my eyes, weāre all Erlangers in some shape or form at the end of the day
@alphanumeric If youāre interested in more detail about the similarity of BEAM byte code regardless of source language I did a presentation at Elixir Sydney that compares the BEAM byte code generated by an Elixir and Lisp Flavoured Erlang implementation of the Exercism ISBN verifier: ISBN Verifier Verily Verified - Robin Hilliard - YouTube. You can find out even more at my source for the presentation: GitHub - happi/theBeamBook: A description of the Erlang Runtime System ERTS and the virtual Machine BEAM..
If Elixir sits on top of Erlang, wouldnt that make Elixir slower than erlang?
Doesnāt sit on top, it runs on the same Virtual Machine, the BEAM.
Erlang code is compiled to run on the BEAM and Elixir code is also compiled to run on the BEAM.
As already pointed out Discord itās a good example of running Elixir at scale:
Now if at some point you need to squeeze more performance then you can call Rust from Elixir as Discord does nowadays for some bits of their app that are very performance sensitive:
If Elixir sits on top of Erlang, wouldnt that make Elixir slower than erlang?
No it wonāt be slower it doesnāt sit ātopā of Erlang it compiles to Erlang abstract format. Good comparison is TypeScript that compiles to JavaScript and TypeScript isnāt slower than JavaScript. You could also think it as similar to Kotlin for Java VM that compiles to same Java bytecode like Java itself does. Kotlin is not slower and can use Java libraries similar how Elixir can use Erlang libraries.
I didnāt understand this argument as WhatsApp has billion of users and server is written in Erlang ?
Any chat is a stupidly simple problem that is very hard to scale properly. The entirety of a chat system is: get a message, broadcast it to all participants. Thatās it. Proper social networks like Facebook are more complex, of course. That said:
WhatsApp is built on Erlang. Erlang VM is what Elixir runs on, so yes, you can use Elixir for that.
Discord uses Elixir.
Facebook is C++, and PHP (most likely not a lot of it now), and at some time Erlang.
Instagram is Python.
EVE Online, one of the largest MMOs in the world, is Python.
Appleās push notifications are Java.
Spotify is Java and Python.
Literally any language can be used to build what you need. Elixir/Erlang give you better basic building blocks than other languages, but you still need to know what to do.
I am aware and itās a very classic that many people give to advocate for Erlang/Elixir ā myself included. This is not bashing the BEAM.
I am simply assuming that from a certain scale and on the throughput might be a problem, thatās all.
Hi AstonJ, did you build the social networking app, yet? Iāve a similar idea to build an app for doctors appointment⦠Iām right now learning to work with absinthe but Iām stuck at authenticating an user on web and mobile app
Sorry for the delay in getting back to you both (thanks for the reminder @troo_co!)
@HappyBee - It is my long term project/goal I quite like my life as it is and Iām only too aware how drastically that could change subject to a successful project in the space
I have enough crazy āstalkersā as it is and the sites Iāve run to date are tiny in comparison to the big SNs
Seriously tho, I really value being able to have genuine interactions with everyday people and Iād hate being in a position where Iād have to second guess whether those interactions were sincere - but at the same time I feel like itās something I must do (when I think about it it makes the hairs on the back of my neck stand up ) so itās definitely something I aim to do but I am quite happy taking my time getting there. Good luck with yours and I look forward to hearing more about it on the forum!
@troo_co - thanks for thinking of me Michael (and the DM)! Your project sounds really cool! You might also want to check out SNs like @pleroma (Pleroma ā a lightweight fediverse server) or @f0rest8ās SN Metamorphic With regards to joining your team, as mentioned to HappyBee, Iām not quite ready to dive in to a big SN yet, but I will definitely keep a look out for yours
Thanks for thinking of me and good luck, I hope you keep us posted on the forum
More like 500 million
Why is that, actually? Which bits of this problem make it too hard for BEAM to handle? What are the limitations here?
Itās mostly paranoia. You can use GenServer
mailboxes for the same things just fine; however if a node falls down youāll lose a lot of enqueued data. So using Kafka in particular is a way of saying āwhatever makes it to our servers we want it enqueued and persisted AS SOON AS POSSIBLE and have super fast background workers that pick it up milliseconds later and process itā.
Why Rust? No particular reason to pick it over Elixir except if you want less nodes to manage in your k8s cluster (if you use k8s at all which you ideally should not). But Rust will definitely give you some performance advantage plus you can fine-tune it very well; e.g. āletās have these 10 background workers and theyāll each be responsible for this or that Kafka partitionā. But Elixirās concurrency levels can be fine-tuned as well so no particular advantage here. Rust wins mostly on raw speed and very small memory footprint.
So my advice was mostly aimed at super high load servers where you can fine-tune your storage and code.
But if you donāt care about the above aspects then just using Elixir and utilize GenServer
mailboxes will get you VERY far.
Discord write its backned in Elixir with some help of Rust ( NIF ) for mutable data structure .
Facebook wrote whole messaging service in erlang before
Whatsapp and wechat work pretty great with very high clients numbers.
Elixir/Erlang ( Beam ) made for Communication.
Even you can write Twitter in Elixir/Erlang
But for Many tools around its like Machine learning and distributed processing or Analyzing data you 100% need another tools/language like Python, JVM based project ( Apache ⦠) or Scala ( Spark )
This 100% affirmation is misleading, because Elixir already supported it in 2022, not as much tools and libs available as the old players mentioned, but its catching up quickly.
ā¦sorta. Itās 2024 and we just had to pivot off of Elixir over to python for an ML project because the relevant library didnāt support categorical encodings properly. It is definitely coming a long way, and much of the tooling is arguably superior. BUT itās still true that for a lot of ML stuff youāre gonna find it mandatory to use python or other languages.
Iāve actually wondered about this, but my question is slightly different:
Can Phoenix/LiveView be used to implement a social-network-scale user interfaces, since user state is kept on the server?
Is this filed in GitHub issues or stuff?