4 ms·
I personally have fallen quite significantly out of favor with Erlang. There are many reasons for which I would absolutely use it---soft realtime being key---bu
by tel 14y ago
I personally have fallen quite significantly out of favor with Erlang. There are many reasons for which I would absolutely use it---soft realtime being key---but it is an absolute bear to work with.
Erlang's reliance on spawning processes as a central abstraction conceit leads to conflating a lot of best practice OTP ceremony with your domain logic. You end up with a Service Oriented Architecture at the application level---people rarely write pure libraries, but instead bootable applications that you communicate to handle needs asynchronously. Additionally, launching processes is not as simple an interaction as beginner Erlang tutorials have you believe. Instead, there's a lot of reason to wrap in the OTP boilerplate leading you to split out things into multiple files and applications.
Dialyzer/Typer is a mess. They're crucial tools for using Erlang successfully, I believe, but they're also only mildly tied into the language and have weird, difficult to understand error messages. That said, they're really good at discovering the myriad errors you'll make passing tuples around.
There's also an enormous amount of black magic surrounding rel creation and management. Using Rebar and reverse engineering Riak I was able to figure (most of) it out. It is, as the author states, a very smart system, but it's also very difficult to get all the pieces firing together.
I would today use Erlang for creating simple, bombproof server architecture. It's a joy for doing lots of independent, network things in parallel. Mochi Media seems to be an obvious example, and I remember reading that [forgotten game name that isn't ROTMG, thanks!] is an MMO game which models every interacting player as an independent Erlang process. Those examples are both beautiful, as an infrastructure language I think it's unparalleled and begets great technology like Riak---I'm seriously itching to use Riak Core sometime. I just wouldn't want to be the guy who wrote the player logic to run one of those processes.
(Edit: to qualify, a lot of these flaws are more my own than Erlang's, but despite spending 3-4 months with it I put it in the box with C as a Right Knife for the Job kind of language)
- rdw 14y agoThat's interesting that you mention Realm of the Mad God. My understanding was that it was pretty standard App Engine. I just checked the traffic with Wireshark, and it's still hosted on App Engine. This job posting for developing the server codebase doesn't mention Erlang, either. http://www.gamejobhunter.com/job/2021/software-engineer-c-kabam-at-kabam/ http://www.gamejobhunter.com/job/2021/software-engineer-c-ka... Not to take away from your larger point. I also enthusiastically embraced Erlang and then grew annoyed with its shortcomings. Tsung is a great load testing tool, but it appears that only myself and Yoda have the patience to actually set it up.
- tel 14y agoIt must not have been Realm of the Mad God, whoops! I'll edit the above.
- kevingadd 14y agoWhen did ROTMG move to Erlang? I spoke personally with one of the game's original developers at GDC before the title launched and he said the game servers were written in C++.
- devinus 14y agoI highly recommend you check out Elixir (http://elixir-lang.org/ http://elixir-lang.org/). We also now have Relex (https://github.com/yrashk/relex https://github.com/yrashk/relex) which makes making releases a breeze.
- tel 14y agoI definitely wanted to take a look the whole time I was using Erlang, but kept feeling like it was more important to really get a handle on Erlang/OTP before branching out. I imagine it's hard to play in the same waters as OTP's "real, tested engineering" with a new language, though I definitely support any language that targets the ERTS.
- peerst 14y agoI can understand you need users desperately ... but are you going to fill every erlang thread here with elixir spam?
- beemoe 14y agoIt is no secret that BSGO(Battlestar Galactica Online) uses erlang for the game-servers. If you were talking about some other MMO I would be very interested to know.
- nirvana 14y agoWhat you describe, I think, is simply one of the Stages Of Being An Erlanger. It is unfortunate that this language has that stage, as other languages don't, but giving it another 3-4 months will get you thru it. For me, I was in that stage for the middle 3 months of the first 6 months I used erlang. Then working with other languages for a couple years and not erlang, put me back in it when I had to relearn the language. Still, of all the languages I've learned or looked into, none of them have the key features of erlang or compare. For instance, people talk about ruby, and I might consider ruby for something then I start thinking "ok, for this one part of my application, I'm really going to need a pool of processes... how will I do that" and realize that I really want to be in erlang.
- tel 14y agoI traded happily to Haskell where I get my category theory, my light pool of processes, my HM type checking, my functional programming. I miss OTP and soft-realtime and would go back to Erlang in a heartbeat if I needed those---I may, indeed, use it to write one of our API servers, but I just don't see using it for projects where soft-realtime and asynchronous processing isn't the central conceit. I would, for instance, never write an embedded language or parser in Erlang, but I do it constantly in Haskell just to play around with ideas. I also think there are opportunities for other kinds of powerful parallelism in Haskell such as the Par monad or the Data-Parallel stuff. Those things would obviously be possible in Erlang, but I think not worth the trouble.