201 points · by alokrai · 5y ago · 55 comments
We can knock out features very fast and the api server has NEVER been the bottleneck. performance is a dream. Elixir has been refreshingly low on hype and strong on delivery.
We were able to scale using Oban to run background workers. The BEAM makes runnign background workers so easy we can add background processes without needing to setup any external orchestration. This lets me focus on building features instead of puttng together micro-serverices or orchestration tooling
Channels let us consider realtime from the get go. Since push functionality over web-sockets is so cheap resoruces wise, we use it everywhere. Our scaling strategy when the database is he bottleneck is to insert data as a job in oban job and send the result out over a channel. This would be an orchestration nightmare in production with any other system.
WE have a few other challenges (which I can't go into) where elixir makes it possible for a small team to do things that would be impossible in other languages without vastly more resources. Suffice to say, the ability to create independent processes under a supervision tree both via configuration and dynamically via the registry allow us to create scalable topologies that would be a crushing level of complexity to manage without the solid shoulders that the beam stands on.
Basically, if realtime is a component of your startup, phoenix does not dissapoint.
Is it possible to share any details about your project? I'm just curious since I also use F# and am learning Elixir.
e.g. in f#
let splitHeadAndTail = function
| h :: [] -> printfn "got head and EMPTY tail"
| h :: t -> printfn "got head and tail"
| [] -> printfn "got empty list"
The example in their docs does a 1:1 map and doesn't show if you can bind the whole tail[1][1]: https://gleam.run/book/tour/case-expressions.html#destructur...
It'd be kind of silly to create a greenfield BEAM language that doesn't expose one of the most fundamental operations you can do in BEAM bytecode, and that every list-processing function ultimately relies upon :)
There's usually updates on Twitter too here: https://twitter.com/CaramelLang
Also, it would be super cool if I could easily find a list of limitations/differences vs. conventional OCaml language & runtime. And a hello-world snippet on the front page (or possibly some other tiny one showing some cool BEAM feature), it took me a while to find the "examples" folder in the github repo.
Please note those are just some tiny complaints rooted in the fact that I absolutely love what you did here! :)
https://github.com/AbstractMachinesLab/caramel/issues/73 https://github.com/AbstractMachinesLab/caramel/issues/74 https://github.com/AbstractMachinesLab/caramel/issues/75
Thanks a lot <3 - you're welcome in our Discord: http://discord.caramel.run
Some back story:
"Through the years, there were some attempts to build type systems on top of Erlang. One such attempt happened back in 1997, conducted by Simon Marlow, one of the lead developers of the Glasgow Haskell Compiler, and Philip Wadler, who worked on Haskell's design and has contributed to the theory behind monads (Read the paper on said type system). Joe Armstrong later commented on the paper:
One day Phil phoned me up and announced that a) Erlang needed a type system, b) he had written a small prototype of a type system and c) he had a one year’s sabbatical and was going to write a type system for Erlang and “were we interested?” Answer —“Yes.”
Phil Wadler and Simon Marlow worked on a type system for over a year and the results were published in [20]. The results of the project were somewhat disappointing. To start with, only a subset of the language was type-checkable, the major omission being the lack of process types and of type checking inter-process messages."
one quote I found:
Q: "Erlang is currently a dynamically typed language. Are you saying you would like some static type as optional typing or both, or would you change the nature of Erlang to static typing?"
A: "No, I wouldn't change it, but I would like subdomains where it is statically typed. You could actually encapsulate parts in statically typed."
So it sounds like he stands by dynamic as the correct choice for Erlang, although not all of the time.
While a lot of users avoid hot load and restart/replace nodes instead, I don't think many restart/replace the whole cluster.
Exactly. Blue-green deploys could get seriously messed up if the static typing system doesn't strongly think about this.
"I just want to confirm what has already been mentioned a number of times in this thread: the reason for not having static typing in Erlang was the absolute need for doing dynamic code upgrades of running systems. This was an absolute requirement and if we couldn’t do it then our language/system wasn’t interesting. There aren’t many systems using it today as most try to do rolling upgrades but we didn’t have that option back then so we had to be able to upgrade a running system. Remember we are talking late 80’s early 90’s here."
There is more to his comment and the thread that's worth reading:
https://elixirforum.com/t/how-hard-would-it-be-to-have-a-str...
Using a type-system as a linter (with a few escape hatches whenever dynamic behavior is needed and without any impact on runtime) is still a great step forward as opposed to no types at all.
Please excuse this naïve question, but what is the main value proposition here over plain OCaml: Erlang/BEAM library ecosystem interop, or more something relating to high concurrency? It wasn’t really clear to me from the website/docs.
1. https://dashbit.co/blog/nx-numerical-elixir-is-now-publicly-...
There are really many languages start targeting BEAM lately. Quite a pleasant trend since Erlang was always underrated IMO.
Once sealed types are introduced, we'll get closer and closer since you already have records and pattern matching.
Obviously, it'll never be the same. Java will always have it's ways of doing things, the community, etc.
I don't know who said it, but it was probably here in HN, where "if you squint very hard, you'll see what Brian et al are trying to accomplish". This was regarding the MLfication of Java.
But it does not seem to be maintained.
If you don't pass functions around as MFAs in a distributed app you run into trouble with upgrading your cluster as they'll have different versions of a function during a rolling deploy
https://gist.github.com/macintux/6349828#alternative-languag...