11 ms·
What can I only do in Erlang?
- querulous 12y agoerlang's whole design is what OO promised but failed to deliver. it's completely trivial and natural to represent programs as a collection of loosely coupled state machines that communicate asynchronously. it turns out this is a fantastic model for anything network related but also for programming in general
- IndianAstronaut 12y agoThis is quite interesting. I am currently working on a Java based state machine and it solves problems in a very unique way. It is quite a change from procedural code.
- davexunit 12y agoErlang aside, I was pleasantly surprised to see that this person uses Guile Scheme for internal tools at their workplace. That's awesome!
- davidw 12y agoThis is a pretty good summary of what makes Erlang unique. There's definitely a learning curve, as he says, but once you start to 'get it', you can make some really solid stuff with it. I've been having a lot of success with remotely debugging things with observer ( http://www.erlang.org/doc/apps/observer/observer_ug.html http://www.erlang.org/doc/apps/observer/observer_ug.html ) and Recon ( http://ferd.github.io/recon/ http://ferd.github.io/recon/ ). I've been using the latter to compile code locally and quickly deploy it to a remote machine (while it's running, of course) to debug problems without going through a whole commit/pull/build cycle. Some of the other responses in the thread are pretty good too: http://erlang.org/pipermail/erlang-questions/2014-November/thread.html#81564 http://erlang.org/pipermail/erlang-questions/2014-November/t...
- StavrosK 12y agoOnly semi on-topic: Anyone hiring experienced remote Erlang developers? 30 years of experience or so.
- johnloeber 12y ago30 years?! Erlang was published internally by Ericsson in 1986, so you were (or know someone) on the original development team or among the first users?
- StavrosK 12y agoSorry, I may be assuming incorrectly. The person is in their 50s, and they're the most experienced developer I know (and can pick stuff up very quickly), so I assumed they'd have 30+ years of Erlang experience. It only dawned on me later that Erlang was only created in the 80s, so I must have misspoken, but yeah, my friend is one of the best developers I've had the pleasure of working with regardless.
- ccozan 12y agoMy next start-up will be based almost 100% in Erlang ecosystem. So, once this happens, I will definitively look for experienced people, working remote. I would add you to my candidates, if you send me a CV to costin at cozan dot com.
- 12y ago
- willvarfar 12y agoCurious how much people think Go will eat into Erlang? Many of the points made were about Erlang as CSP and that's Go-territory. Loïc Hogun (author of Cowboy, other projects) said: For me Erlang is first fault tolerant, then concurrent, then functional As Go gains libraries like groupcache will it become more and more go-to for networked and shared systems? Is Go moving up from concurrent to fault-tolerant in a real way?
- davidw 12y agoIf you dig around in HN's search there are a lot of good comments from people like jerf on the differences: https://news.ycombinator.com/item?id=5451916 https://news.ycombinator.com/item?id=5451916 https://news.ycombinator.com/item?id=7943248 https://news.ycombinator.com/item?id=7943248 But there are more here and there if you hunt for them. I think for things where they are sort of similar, Go will definitely be the more successful language because it looks so much more familiar and because it's moving faster with more momentum, at this point. I'm using Erlang for a semi-embedded thing at the moment, though, where stability is more important.
- Ixiaus 12y agoFor what kind of embedded thing? We're using it for embedded things too...
- polskibus 12y agoWhenever I think about Erlang's stability I recall the problems mentioned by CouchDB authors and RabbitMQ users. Apparently CouchDB hit some problems with low level disk access that they couldn't trace and that pushed them to migrate away from Erlang. RabbitMQ is allegedly dropping lots of messages for unknown reasons under heavy use. I do not have the links at hand for reference but such stories make me wonder how battle-tested Erlang really is when you need to persist your data (and not just transmit it over the network).
- Ixiaus 12y agoThe Riak guys have better experience here and I would argue that it's pretty well battle-tested when Apple is deploying hundred node Riak clusters for production :) (Riak is built on-top of Erlang)
- deleted 12y ago[deleted]
- radmuzom 12y agoIn 2005, I worked in software development for 6 months before abandoning it for another field. In my new job, I was given the task of writing a server for a messaging application - which would allow users to send a "hand-drawn" message from our own proprietary handheld device to Windows phones. I was told to learn Erlang and get it done - the company was barely 30 people and had no formal training programs. While I have a degree in theoretical computer science, I didn't do much functional programming before - learnt some Haskell in 2001 in college (just the basics, equivalent of first 6 chapters of LYAH, no monads). I remember learning Erlang over the weekend and delivering it in the first week of my job. Obviously, the code was neither great nor scalable - but I write this not to boast but to tell people that Erlang was so beautiful and easy that even an average intelligence person like me could use to produce functional software in a week. Today, my only regret is that I am not a programmer.
- zerr 12y agoAgree, and to look at it from a different angle - to me writing Erlang felt like I was writing config txt files to some underlying system. The system performs good following your "config" but all the hardcore feel is lost for you.
- Ixiaus 12y agoHuh? "Hardcore feel" is definitely there and the language is anything but "writing config txt files to some underlying system". I've built applications in the > 10k SLOC range that use a consensus algorithm for distributed computing and it was hard but made tremendously easier because of Erlang's built in primitives. No hardcore feel was lost at all and neither was it writing a config txt file... [EDIT] I would love to know why the downvoter disagrees with me, unless you're being a downvote kiddie.
- baldfat 12y agoDown vote = I don't agree with your statement normally here. Not that it might be a starting point on a conversation?
- cowabunga 12y agoNot sure I agree with the conclusions: 1. Binaries: this isn't really an issue. We ship the JVM with anything that we do in Java. Unzip, run, done. Go is probably ideal there but it doesn't support embedded resources without some hideous hacks so you're still going to be deploying more than just a single binary in a lot of cases. CLR is pretty good at this as well. 2. Sockets: 0MQ/WCF/JMS/any stream abstraction wired up correctly. 3. ASN.1: Everything has ASN.1 libraries these days. I've never had to use one in the real world in any of the sectors I've worked in. 3. Let it crash: we do this. In fact we force threads to crash if they do anything bad by throwing an exception that isn't caught. All threads are designed to be idempotent, restartable and transaction aware. This is true in JVM/CLR at least. 4. Supervision: New thread, new state, no shared state. Not hard. PHP does this... 5. Inspection: I've seen the Erlang toolchain and it's pretty good but I'm not joking but inspecting and debugging the state of a system is better when there is lots of pooled knowledge (google) and lots of diverse tools. JVM wins there every time. 7. Messaging is not RPC: It's not in JMS either or WCF. It abstracts the transport away. In fact we have inproc transports in some cases that use concurrent collections to throw messages around. 8. Dialyzer: compiler, static typing (Java is less strong here to be honest than say C#). I really like the idea of Erlang but the worse is better mantra applies here. It's easier to get staff, the knowledge when something goes pop is available, we benefit from the reuse of billions of lines of code written and tested by others if we pick a JVM. If we have to think a bit or throw some more kit at it, so be it. Edit: just to add, I'm not knocking Erlang and quite like it in principle (I spent 2 months disassembling CouchDB to see if we could maintain it so it's not a foreign language to me), but the justifications in the reply aren't particularly unique ones nor are they major advantages.
- davidw 12y agoHe's talking about dealing with binary data when he says 'binaries': http://www.erlang.org/doc/efficiency_guide/binaryhandling.html http://www.erlang.org/doc/efficiency_guide/binaryhandling.ht... http://www.erlang.org/doc/programming_examples/bit_syntax.html http://www.erlang.org/doc/programming_examples/bit_syntax.ht... Erlang is really strong for that. As to Java, sure, you can do anything with it, and do a decent job of it. But sometimes, as a startup, you are resource constrained, so if you can do more with less because you have a good grasp of a tool like Rails, or Erlang or Lua or whatever, that might make the difference. For a large company, Java is definitely a safe pick - no one ever got fired for choosing it: you'll be able to get whatever you need done, and "If we have to think a bit or throw some more kit at it, so be it." For a group like WhatsApp, Erlang seems to have been a good pick.
- alecco 12y agoRepost https://news.ycombinator.com/item?id=8560579 https://news.ycombinator.com/item?id=8560579
- ninjakeyboard 12y agoDo you get off on this?
- philangist 12y agoI'm not sure what you're getting at here. Does it matter if it's a repost if the other link has 6 upvotes and 0 comments?
- bachback 12y agoZeroMQ gives you the same but better: messaging in any language. That means you can interface to any component you want written in any language you want. Also hiding native sockets, which means networking is not 1:1 but based on scalability patterns. At some point people will realize what a big deal that is.
- Spearchucker 12y agoNobody needs reliable messaging: http://www.infoq.com/articles/no-reliable-messaging http://www.infoq.com/articles/no-reliable-messaging
- bachback 12y agoTell that people who are trying to build scalable network applications. Saltstack uses ZeroMQ under the hood and the biggest cloud computing operations in the world use it. That article reads like from a past age, where you didn't have startups scaling to millions of users based on cloud computing. HTTP was invented for retrieving hypertext documents. Not for connecting millions of nodes.
- Spearchucker 12y agoScale covers lots of things, including statefull v. stateless and (appropriate to this discussion) asynchronous comms and the ability to queue requests. Scale in that sense is facilitated by retrying a remote call that failed - possibly because the server is at capacity. That implies store/forward, which is what the "queue" part of message queuing does. You can definitely use tools like ZeroMQ, MQ Series, MSMQ or WCF to achieve that. You can also use a database table with a flag indicating whether a message was delivered or not (ref. my link above). Not quite sure what HTTP has to do with message queuing, other than being a protocol one might use. If scale is so important, perf is a concern, in which case UDP would be a consideration. Would I go down that road? Doubt it, because I suspect the acceptable answer lies somewhere between HTTP and UDP, and I also suspect that better gains can be made by optimising end-to-end throughout and solution design rather than worrying about the semantics of a protocol. What's the benefit, for example, of streaming data over a TCP connection when that data is XML? TLV or some other binary format will serve you a lot better. Final words on scale - asynchronous delivery (such as message queuing) is one technique. Another is to scale servers out and/or up. Also, as already mentioned, server state and of course pipeline/routing efficiency. Whilst I stand by what I said, I've not had the opportunity to work at the scale you have, so I'd love to know what problems you've encountered when scaling to millions of nodes.
- mahmud 12y agoOp's work environment is exceptional in many ways. It's a quintessential hacker work place. Unbelievable flexibility. I am sure a place like that attracts people who can make any technical edge, however miniscule, into a real felt advantage. I want to learn about their management, hiring and culture-building practices more than their actual hacking triumphs.
- minikomi 12y agoIndeed. I'd love to progressively improve a system in Erlang over a year (!) .. Another thing, tangentially related, which I've been thinking about lately: I'd love to do an apprenticeship with an old-school erlang hacker.. haskell hacker or lisp hacker who learnt the hard way in the field.
- MrBuddyCasino 12y ago"As for encouraging adoption, I recommend you solve a problem in your spare time that your company has, in Erlang, and demonstrate how easy it is to maintain compared to whatever the accepted solution being worked on is. That's a lot safer thing to your management than "throwing money at a new toy, hoping for a payoff"." For me, this translates to: invest unpaid time for your employer to improve things, on the off chance that it will be accepted. I understand where he's coming from, but that borders on self-exploitation.
- scribu 12y agoI agree that in an ideal situation you would get paid for coding up a prototype for the company. On the other hand, if it gets accepted, there might be several benefits that could make the unpaid time worth it: * getting a raise or a promotion for the initiative * better work environment due to using the best tool for the job
- lostcolony 12y agoDoes your employer not have periodic internal needs, things that are basically "hey, we really need something that Xs", that isn't really directly funded, but which they'd be willing to let you take a week on? What about devops? Are there any areas where you either aren't collecting data you might want, or you are collecting it but only recovering it after it's caused an issue? Maybe a small utility there will, while nibbling a bit at your productive hours (few hours a week), lead to enough gains over the long term as to offset it. Sure, if your employer prevents you from touching anything outside your dev box without a TPS report signed by the head of engineering, the head of QA, legal, and Gryphon (the mythical animal one), and any code that passes always has to be in Java, you're out of luck, but that seems like the kind of environment to flee.
- amelius 12y agoErlang looks interesting. However, the only problem I have with starting in Erlang is that on the great computer language shootout, it shows that Erlang is about 10x slower than C++ on most examples. And about 3x slower than Go [1] I know that the problems on this website are not specifically "concurrent" problems, but still, even a distributed web-server must do some non-concurrent stuff at times :) Are my concerns correct/justified? [1] http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?test=all&lang=hipe&lang2=gpp&data=u32q http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?t... Edit: even Haskell seems to be about 7x faster than Erlang (according to [1]). Suddenly, Haskell looks like a good candidate for writing a distributed server :) Can somebody comment on this?
- davidw 12y agoYou wouldn't use Erlang for number crunching: you'd write some C code and communicate with that. Same as you'd likely do with Ruby or PHP or whatever.
- amelius 12y agoOkay. But let's take the example of the C++ webserver framework written by Facebook employees, which was discussed here a few days ago, [1]. This project contains lots of protocol-handling logic for HTTP/1.1 and SPDY, and beneath that TLS. Are you saying that such projects are better written in a combination of Erlang and C/C++? [1] https://news.ycombinator.com/item?id=8563199 https://news.ycombinator.com/item?id=8563199
- davidw 12y agoIt's a matter of economics. If you have the resources to throw at a problem and write it in C++, it'll probably be faster, in the end. However, it might also take longer and be less flexible. And with networked stuff, you want to be really careful, too. Facebook has the money to throw at something like that with no problems. Not everyone does.
- lostcolony 12y agoFacebook has two scaling problems. One is the code, sure, but one is also the employees. They need to be able to hire and scale out their teams, and have had to do so quite quickly. It's easier to find C++ people than it is Erlang. That is a consideration. It's why Facebook chat was originally in Erlang, then switched to PHP. Facebook already had a lot of PHP devs, they are a lot easier to find, so rather than having to bring people up to speed, or keep a dedicated team always slightly free to be able to handle issues for chat, they rewrote it in PHP. There is no magic bullet, not even Erlang. You have to weigh a variety of considerations, and pick appropriately based on them. But dismissing Erlang because a benchmark showed it to be slower is likely a mistake; dismissing it because you can't hire fast enough for it is a reasonable business decision.
- koloron 12y agoHow does Haskell compare to Erlang regarding these features?
- Ixiaus 12y agoThis is where many people get confused. If I have to build a distributed system, I will pick Erlang/OTP over Haskell any day. Everything in Haskell is wonderful, including concurrency. It does not have a built in DNS system (for node discovery and connection), inter-node RPC in Cloud Haskell is a joke compared to Erlang, and many other issues. I've built systems where I used Erlang as the distributed "coordinator" and Haskell for on the machine computing.
- john2x 12y agoI love Erlang (and it's younger sibling Elixir). I love reading about it. I enjoy following tutorials about it. I love its simplicity. But when I try to come up with scenarios/ideas where Erlang might be a good fit, I realize I'm not smart/motivated enough (yet?) to tackle such problems. Erlang isn't difficult. It's the problems it was designed to solve that are difficult.
- lostcolony 12y agoYou're probably thinking about it the wrong way then. It turns out that even in cases where you don't have some massively distributed, scalable needs, there are a lot of cases to use Erlang. While it makes insanely difficult problems tractable, it can also make moderately challenging problems simple (and it sometimes can make simple tasks irritating; see usual list of Erlang complaints). Just about any sort of web backend (that isn't having to do a whole lot of number crunching), any sort of interaction with hardware, handling/transport of binary data (as mentioned above), and of course any time you need reliability, it's worth considering. But even in areas where there's not an obvious win, a lot of problems that are traditionally done in a single threaded manner can be made simpler in a concurrent language like Erlang. An example I like to give is time based task scheduling. In a traditional language, you'd implement something like that with a priority queue. Which is fine, but you have a lot of work. First, what happens if timings change? You have to rejigger -everything-. What happens if you have multiple tasks at the same time? You need a threadpool or similar to dispatch these things onto. What happens if one task itself creates a new task for a later time? You'll have multiple people adding things onto the priority queue, so now you need to start locking. And of course, since you've got your dispatching process sleeping until the next task is to start, you have to make sure any time you modify the queue, you remember to notify that sleeping task, so it can update as necessary. There is a lot to get wrong. In Erlang? You spin up a separate process for each task, with a timer. Done (with caveats; you likely will need to persist the task information and load it periodically into a task+timer process, but that's pretty trivial). A similar case can be made for functional compared to a more procedural approach. That's a little too long winded for here, but even examples that seem -ideal- for OO, can oftentimes be described more simply in a functional, data-centric manner, and future refactorings are made simpler as well in doing so.
- ColinWright 12y agoAdded in edit: Seeing that this is getting down-votes suggests either that I've not been sufficiently clear in the point I'm trying to make, or that you think I've phrased it in an unacceptable way. Either way, sorry you don't think this fits here, but I'll leave it for others to down-vote, correct, reply to, or support, as they see fit. Another edit: Getting more down-votes, but not learning anything. Do you think this is the wrong place to say this? Or do you think I'm just wrong to worry about this level of precision in "normal" speech? Reply! Engage! Tell me why I'm wrong. ======== I'm going to be "that guy" ... warning: Rant ahead. The wording of this question is like sandpaper on my brain - for me, the "only" is misplaced. Assuming he is asking: What is there that I can do in Erlang, but cannot do (or is significantly more difficult to do) in other languages? With that reading, I feel the question should be: What can I do only in Erlang? The question as phrased, to me, admits the alternate interpretation of: What does Erlang force me to do? English, and natural languages in general, are weird things. To quote the great Terry Pratchett: It's very hard to talk quantum using a language originally designed to tell other monkeys where the ripe fruit is. -- (Night Watch, 2002) I'm sure I've seen it before, but Google searches are just turning up places where I've re-quoted it, but: When using plain language is it difficult to construct a sentence that a determined adversary cannot misconstrue. You may argue that in this case it doesn't matter, but I would suggest that practising precision in language is important, and helps to avoid sloppy thinking. This comment is intended to be constructive, although I admit freely that it is off-topic for the submission. Even so, I think it's useful to think about these things. I wonder if Erlang makes it easier to be truly precise about something.
- davidw 12y agoThat's actually the first thing the answer in the post addresses: > Anything can be done in any language, so the technical answer is "nothing". But the spirit of the question begs for an answer, especially in a company situation with deadlines.
- ColinWright 12y agoI read that first answer (and the others) carefully before writing the above, and I don't think it does. Well, let me be more precise. The answer addresses the question I think the questioner intended to ask. What the answer does not do is fully disambiguate the question as asked, nor does it even point out that the question as asked is ambiguous. It just takes what it thinks is the most obvious interpretation, and answers that. Which is fair enough. Most people are going to adopt that interpretation and understand the intent of the question. That's not addressing the point I'm trying to make, which is that the question as asked is ambiguous, and yet a simple re-wording would not be ambiguous. Or at least, not as ambiguous. But I guess my point is lost, and people will down-vote this thinking I'm just picking nits. Lost cause, but I honestly don't understand why programmers of all people should care so little about the careful and precise use of natural language. They appear not to, and I'll have to take that as an axiom without understanding. To be honest, your reply has made me stop completely and reassess everything. In particular, the fact that you of all people seem not have missed completely my intended point makes it perfectly clear to me that I quite simply have failed utterly to make my point at all. I know your posts and comments on HN, I recognize your nick, so to have you not see the point means that, somehow, it's simply not there to be seen. I'll have to go away and think again as to whether it is in fact possible to make the point, and if possible, whether I'm a good enough writer to do so. Current evidence suggests not. And finally, you say ... That's actually the first thing the answer in the post addresses ... Maybe I've mis-interpreted your use of "that's", and perhaps I don't know which part of what I've written you think is being addressed in that first answer. Perhaps we're just talking past each other.
- mtdewcmu 12y agoI got the sense that Erlang overlaps somewhat with node.js in terms of what one might use it for. Could anyone familiar with both compare them?
- rubiquity 12y agoI have experience with both Erlang and Node.js so I feel it's acceptable if I answer this question. I would use Erlang for anything I would have used Node.js for and I haven't touched Node.js since I've learned Erlang (and Elixir). - Erlang allows both CPU and IO concurrency. - Like Node.js, all I/O in Erlang is non-blocking. The difference is that in Erlang your code looks synchronous. There is no callback/promise/whatever sewage all over your codebase, the Erlang VM and its schedulers take care of that for you. - Messaging is built directly into Erlang, so communicating across OS processes, and within processes, is trivial. In Node.js you have to implement this yourself and will screw it up. - Node.js doesn't give you any tools for fault-tolerance or distribution, Erlang is best in class for this. - Erlang has pattern matching and tail recursion. This helps you create much more concise programs than JavaScript does. - Because Erlang is CPU concurrent and Node.js only offers I/O concurrency, Erlang programs are incredibly consistent in their response times. In Node.js, as your programs grow and take up more CPU time (thus blocking the event loop) you will notice your 99th percentile response times are way above the average.
- rozap 12y agoYour second point is extremely important. My elixir code is way cleaner than my node.js code. You aren't constantly thinking about async stuff because each connection is in its own process. Just write your code and let the process scheduler do the hard work. I don't think I could ever go back to node for a medium or large web app. Elixir has been so much simpler, even though I've been learning the language as I go. It also has benchmarked extremely well...
- rvirding 12y agoSome people have already been mentioning this but I wish to clarify some things. When Erlang was designed/invented the goal was never to make a new language, the goal was to design a way of building systems with a set of specific characteristics, massive concurrency, fault tolerance, scalability, etc. One part of this was the language, Erlang. But at the same time we were developing the language we were also looking at how you would use the language and its features to build such systems. The language and the system architecture went hand-in-hand with support in erlang for the type of patterns you would need in the system architecture. These ideas and patterns existed before OTP. So there were Ericsson products built on top of Erlang which used these ideas and patterns before OTP. OTP "just" took these ideas and design patterns and formalised them in a generic, cohesive way. Plus of course a lot of useful libraries. So we were never really out to design a functional language based on the actor model, we were trying to solve the problem. (We had actually never heard of the actor model but were told later that Erlang implements it)
- barbudorojo 12y agoI wonder how is going the Lisp Favored Erlang project, http://lfe.io http://lfe.io. As someone that enjoys lisp and prolog I find erlang a very nice language. Two feature I find handy: One is the ability to modify code while running, the other is OTP. Joe's thesis, available online, was for me an excellent resource to learn Erlang. I think that a good use case for Erlang is when a lot of actors are needed each one doing a little work with little resources (no big library, regular expression, atlas, or the like used). Funny, I recall some surprise in the community because Joe was asking some easy question about C for some glue code. It's been 5 years since I touched Erlang, only for learning, but is message passing style and the way you create functions like in prolog (or in Shen or picolisp) is unique and a great virtue. I know that tcl has secure interpreters, I wonder if there is such a think in erlang.
- rvirding 12y agoLFE (Lisp Flavoured Erlang) is very much alive with a whole bunch of new stuff now released on the master branch. For example you can now easily write LFE shell scripts and run them, much in them way as with sh. There is also a good webpage, the http://lfe.io/ http://lfe.io/ you mention, and a growing set of libraries which have been done by me. There is also a mailing list at https://groups.google.com/forum/?hl=en#!forum/lisp-flavoured-erlang https://groups.google.com/forum/?hl=en#!forum/lisp-flavoured... and an IRC chat at #erlang-lisp. P.S. I also have a prolog running on erlang as well.
- dpeck 12y agoI'm just starting to do some work on a system that is going to be very distributed with many endpoints, often on unreliable networks connecting back to a server. Erlang (elixir, really) looked promising for this so I've been investigating off and on while we do some prototyping and flesh out some of the details. So far it seems to be that you get nearly all the advantages of Erlang with running something like RabbitMQ and then being able to write message consumers in whatever language you desire. Everywhere I think Erlang would be a good fit, seems that relying on RabbitMQ instead and having less code to maintain in-house makes more sense. I'm still very early in my Erlang journey but so far haven't been able to convince myself to use it directly. I must be missing something.
- rvirding 12y agoThat RabbitMQ gives you many of the features you want from Erlang is not that strange really as RabbitMQ is implemented in Erlang. :-)
- angersock 12y agoI'd suggest reading up on Erlang and OTP ("Erlang and OTP In Action" is a good book) and then looking at Elixir. I think that it makes a little more sense to look at Erlang in its native habitat and then you'll get a better appreciation for the syntax sugar Elixir brings.
- lobster_johnson 12y agoRabbitMQ is a good piece of software, but it has issues. You mention unreliable connections; RMQ does not handle that well. Even just a few seconds of network hiccup will throw it into a partitioned state, out of which you cannot reliably escape without manual intervention. There are also quite a few bugs that you tend to hit only when RMQ is exposed to network issues. To use RMQ with bad networks, you need to use either the Shovel plugin or the Federation plugin. Both are somewhat awkward to use, and require manually setting up the different routes that copy messages across. My advice is, if you like Erlang's architecture and need failure-tolerant IPC, just use Erlang directly. Don't use RabbitMQ for IPC if you need reliability. I wish I could say better things about RabbitMQ, but it is easily the flakiest component of our stack. When you're used to rock solid server software like Postgres, HAProxy and Nginx, RabbitMQ is a big disappointment.
- hiring_sucks 12y agoHow does Akka (Scala/Java framework) compare to Erlang? It seems to deliver on the same promises that Erlang does.
- TheMagicHorsey 12y agoSomeone correct me if I'm wrong, but it seems to me the main advantage of Erlang over something like Go, is that the logic for your entire cluster is contained in Erlang itself, as opposed to in some external scripts or configuration. What I mean specifically is that it seems like you don't need anything like Mesos or Kubernetes to monitor and relaunch processes across the cluster. OTP within Erlang does that for you. Now whether this is worth the tradeoff of switching to a new language and framework (OTP is a framework even if it is lightweight to use) depends on the team I suppose. This is just based on my reading of the docs. I hope someone more experienced will correct me if my take is wrong here.
- philip1209 12y agoTechnically in turing-complete languages, there is nothing that one language can do that another is incapable of, correct?
- orbifold 12y agoNot really, the runtime system plays a huge role into what a language can conceivably do. Think Ruby and Python and their global interpreter lock or all languages with mandatory garbage collection and no pointer types.
- bosky101 12y agohere is a daemon that runs forever foo()-> foo(). 1. processes as tail-recursive functions it's callstack will never grow. you can have multiple of these running and the scheduler will still split work between them. a process is a tail-recursive function where the argument becomes its state. a process ceases to exist when it stops being tail-recursive. erlang's distributed computing strengths can in ways be attributed to tail-recursive approach to network programming & beginning with concurrency in mind. everything else came as a side-effect. for anyone interested for more examples of expressiveness/composition, this is from my talk at functionalconf http://www.slideshare.net/bosky101/recursion-and-erlang/43 http://www.slideshare.net/bosky101/recursion-and-erlang/43 2. Node's or machine's are first-class citizens. you can decide to replicate data over to them, make the data on one node location-transparent, or decide to just abstract it all in a distributed system. 3. binary patten matching you can pattern match not just [A,B] = [1,2] but also contents of A,B. or do gaurds against contents . eg if the contents of this binary variable begin with "foo". 4. you never have to import any header or module. the vm uses all modules available in its (ebin) path. big cyclic dependency headaches good bye. 5. as many schedulers as there are cores in your machine. (configurable) 6. hot code swapping. albeit little contrived for the beginner on production systems. 7. otp comes bundled with the fsm,client-server,etc skeletons called "otp", the same that runs 40% of the worlds telecom traffic. ~B PS: the root link describes more such features you may find useful
- halayli 12y agoFor those interested in scalable and fast socket handling in C/C++ using a threaded-like approach, take a look at lthread & lthread_cpp bindings. http://lthread.readthedocs.org/en/latest/ http://lthread.readthedocs.org/en/latest/ http://lthread-cpp.readthedocs.org/en/latest/ http://lthread-cpp.readthedocs.org/en/latest/
- deleted 12y ago[deleted]