14 ms·
Languages on BEAM, the Erlang virtual machine
- nerdywordy 10y agoI'm diving into Elixir now to compare it with Golang for a new web app backend I'm working on. I really enjoy the functional paradigm but from what I've seen deployment can be a bit annoying. Whereas with Go you can compile and drop it easily into production. Does anyone have experience with this?
- ch4s3 10y agoYou might want to look into edeliver https://github.com/boldpoker/edeliver https://github.com/boldpoker/edeliver
- HalcyonicStorm 10y agoDistillery is highly recommended https://github.com/bitwalker/distillery https://github.com/bitwalker/distillery
- iagooar 10y agoI totally agree. It takes a bit of trial-and-error for the first time, but works perfectly fine once you have figured it out. I recommend going with edeliver + distillery for the best experience, plus it is the recommended way of deploying Phoenix as of today.
- hamandcheese 10y agoWhere do you plan to deploy? Its easy enough to deploy to Heroku, and I imagine dockerizing an Elixir app is also a straightforward process. If, on the other hand, you are taking a more traditional approach and just deploying to a Linux box/vps there are solutions for that too (i.e. Chef, Capistrano). It should be pretty far down in the list of things that influence your choice, imo, since it's basically a solved problem.
- nerdywordy 10y agoMy company's first choice is always Azure since outside of my team we're C# head to toe. Though after skimming through a few deployment articles I might push for a Heroku deploy. I can honestly say I've not been this excited about a language in quite a while. Working with Go is pretty straightforward... but it's a complete bore. The more I dig into Elixir the more I desire to use it full-time.
- iagooar 10y agoI think that with proper deploy automation (e.g. Ansible) and the right approach (avoid hot-code updates unless your REALLY need them) you are going to get a pretty solid deploy experience, no matter what your target deploy platform is. Just throw in an HAProxy for rolling deploys and you are ready to go! If you need any specific help, feel free to contact me!
- geakstr 10y agoYes, deployment in Elixir is painfull. We use distillery and edeliver, but plan to try move to docker
- bitwalker 10y agoI build releases with distillery and deploy them with Docker, the combination has worked really nicely for my projects. Disclaimer: I'm the author of exrm and distillery, so I'm probably biased.
- iagooar 10y agoI don't see why it should be painful. What were the issues you were facing? I found that besides hot-code updates, there is not as much magic as one could think, and once you "grasp" the idea of a build machine, it should be pretty straigt-forward. Throw in an HAProxy for rolling deploys and you have a sweet zero-downtime solution! Feel free to contact me if you need someone to help out (from some free general tips and tricks to supporting your team as a consultant).
- rubyn00bie 10y agoDeploying to production is a pain in the ass to setup the first time and has a lot of gotchas. I know, I've done it. It is getting better but right now the few things I can recommend the most are: • learn what an "OTP release" actually is and what it means. This alone will save you days of your life. • do rolling restarts, doing live upgrades is difficult and not necessary for the vast majority of applications. • read the prod.exs config, there's a commented out setting you'll need to enable. I forget the name of it, but it's on my github "tehprofessor" with the repo "flying with Phoenix" (its probably outdated in many ways but that setting is essential). • remember the application is compiled and then run, so you really won't get any runtime configuration (likes Rails' environments). • Docker can alleviate build pain a bit, as it stabilizes your environment-- I don't use it myself but it makes building a bit more pleasant from what others have told me. • you'll very likely need to include all the applications, including ones listed in your dependencies (it's a pain in the ass), in your mix.exs applications list if you're using exrm. ... it's been a couple months as I've been on a coding hiatus for health reasons (and a broken arm) but I believe most of the above should still be very true. That said and even with all the bitching I've had about it, I still love Elixir and Erlang. Though I've been moving more to pure Erlang as time goes on (FWIW). Edit: clarity and note about loving me some elixir/erlang.
- iagooar 10y agoI do not agree that it is a pain in the ass. It's not more or less complex than many other languages. Also, the tooling has improved a lot in the recent months and edeliver + distillery work great, even without much previous experience.
- GrinningFool 10y agoedit: my experience has been with Erlang deployments, I don't yet know what the landscape is like for Elixir - at least the first part of my comment below can be disregarded. I would assume it's similar to deploying an erlang application, but I don't know for sure. I think the second part is still possible, since if it can be done for Erlang it can be done for Elixir. -- Original post -- I haven't found production deployments to be particularly painful, I'd be interested to hear what kind of troubles you've run into. Runtime configuration is definitely possible - you can deploy configuration files with your application and determine which one you want to load. It's not built-in, but it's a few lines of code to do it manually. You can also always use environment variables, which is arguably a better approach.
- ivarvong 10y agoWe have Elixir/Phoenix in production on Heroku (with Heroku Pipelines) using a custom buildpack [0]. It's been great. We'll probably look at Docker. We use CircleCI, and this setup script [1] was a great starting point. 0: https://github.com/HashNuke/heroku-buildpack-elixir https://github.com/HashNuke/heroku-buildpack-elixir 1: https://gist.github.com/joakimk/48ed80f1a7adb5f5ea27 https://gist.github.com/joakimk/48ed80f1a7adb5f5ea27
- bitwalker 10y agoDeploying releases has been fairly painless in my experience, but I also have had my head in Elixir and releases in general for a long time, so I may not be a great sample. You get a tarball containing everything the app needs to run, and all you do is extract it and run the boot script - other than entirely self-contained binaries like Go produces, I don't think it gets much better. Deploying without releases is probably a lot more painful though, due to the number of dependencies required, particularly web applications (Erlang, Elixir and Node). I recommend anyone deploying Elixir applications look into releases - it makes life much easier (imo).
- amsha 10y agoI'd mostly agree, and the packages you've written (ExRM and Distillery) make releases super easy to build, start, and stop. The main benefit of Go, I think, is that it can cross-compile builds. Erlang and Elixir don't have any way to do that, so if you develop on Mac and deploy on Linux you'll need to build your release in a VM or on a build server running Linux.
- chrisseaton 10y agoI thought BEAM was a bytecode VM so why do you need to cross compile anyway? Is the bytecode different on different architectures?
- rubiquity 10y agoReleases include the Erlang byte code and the VM as well which needs to be compiled for the platform it will run on.
- chrisseaton 10y agoBut why would you want to recompile the VM when you've just changed your program? And it looks like you can cross compile BEAM anyway. http://erlang.org/faq/implementations.html http://erlang.org/faq/implementations.html. It's just a C program isn't it so why wouldn't you be able to?
- deleted 10y ago[deleted]
- gamache 10y agoA non-autoscaling deployment is quite easy to accomplish. Build releases with Distillery[1], and deploy them with Edeliver[2]. You get zero-downtime upgrades and rollbacks for free, as well as nearly automatic server clustering. I gave a talk about this last year in New York[3]. A deployment that can autoscale is harder to accomplish, but still not impossible. AFAICT, most people doing this are building releases with Distillery, wrapping those releases in a Docker image, then using the deployment and orchestration tools of their choice. Monica Hirst gave a talk about doing this with AWS CodeDeploy last year at Empire City Elixir as well[4]. [1] https://github.com/bitwalker/distillery https://github.com/bitwalker/distillery [2] https://github.com/boldpoker/edeliver https://github.com/boldpoker/edeliver [3] https://www.youtube.com/watch?v=H686MDn4Lo8 https://www.youtube.com/watch?v=H686MDn4Lo8 [4] https://www.youtube.com/watch?v=mRspOj_sRgo https://www.youtube.com/watch?v=mRspOj_sRgo
- toast0 10y agoI run erlang in production; our deploy is push code, compile, l(foo) from debug shell. (push code and compile driven by Makefile). It doesn't follow the OTP deployment model, but it's easy.
- yellowapple 10y agoEven without exrm (Distillery nowadays), I've had quite a bit of success with using Docker, complete with hot patching. I come from a Linux administration background, though, so I'm a bit more open to abusing Docker's semantics in horrific ways.
- afro88 10y agoAs far as deployment goes, I've had great success with flynn.io and an Elixir buildpack. Flynn is amazingly easy to deploy. It provisions DO/AWS/Azure then bootstraps a single node or cluster literally at the push of a button. Then you just add it to your repo and push (provided the buildpack is already set up)
- ocschwar 10y agoSo besides Elixir and Erlang, is anyone using any other language in this family in production?
- gamache 10y agoHi Omri! No.
- ocschwar 10y agoSnarly! Suspected as much.
- ocschwar 10y agoHeh. So, I'm doing smart grid stuff, and looking to see just what tools the sector really, really needs. For some things: Rust. For other things: BEAM/OTP
- gamache 10y agoIf you're interested in getting chocolate in your peanut butter, check out Rustler: https://github.com/hansihe/Rustler https://github.com/hansihe/Rustler
- ocschwar 10y agoOOh. That does cover it. Where I need safety assurance: rust. Where I need resilience for crashes: BEAM. This does fill in the gaps.
- rvirding 10y agoThere are other languages, just read the reference.
- metalon 10y agoI think LFE is at least not unheard of, but anyway, that's not really the point here probably ;)
- iagooar 10y agoIn case you are wondering what to use as your next programming language, please consider Elixir! It has a lot of advantages: - it is an easy to use, well-designed functional programming language, that happens to boost productivity and be (a lot of!) fun at the same time - it is modern, with modern tooling around the language (e.g. mix, edeliver) - it has Phoenix, a modular web framework, ideal for APIs and traditional MVC, very modular - it is rock-solid for a relatively young language - stack traces are clean, readable, and point you in the right direction most times - performance is decent on a single-core, but since it's basically Erlang, it scales better on multicore than most solutions out there - it has a world-class concurrency model powered by OTP, but more approachable to the average programmer, lots of high-level concurrency abstractions built-in - Umbrella projects for those who need or want a truly modular application without going all-in with microservices - it is the only language besides Erlang proper, that runs on the ErlangVM that seems to be getting a lot of traction (or at least a lot more compared to the alternatives) - the community is very welcoming and open, lead by José Valim and Chris McCord who are smart, pragmatic and very nice people
- gamache 10y agoI love Elixir as much as the next guy, probably more, but I want to temper your enthusiasm a bit: > it is modern, with modern tooling around the language (e.g. mix, edeliver) Sort of. Mix is a nice package manager. Edeliver is a series of hacks on deliver, a five-year-old Capistrano clone. But don't expect Elixir to fit into 2015-class deployment systems just yet. > stack traces are clean, readable, and point you in the right direction most times Other times, the error happened in another process, all you see is a timeout, and it takes some spelunking. Not uncommon in my experience. But I'll also add a couple of points: - the docs system is fantastic, in particular the automatic generation of handsome docs websites, and the `doctest` system which allows example code in your docs to double as test code - I'm not sure there is anything better than supervisors for isolating and recovering from errors. Defensive programming is one thing, but sometimes your RAM stick gets hit by a cosmic ray. Shit happens; have a plan.
- oomkiller 10y ago
- sergiotapia 10y agoI read that processor makers are betting everything on multicore. More and more cores. Languages with great support for these hardware features will be the languages of the future and today. Elixir is definitely a great bet, you'll max all your cores and not break a mental sweat about it. Really compelling stuff and great developer UX.
- kungfooguru 10y agoMissing Alpaca, https://github.com/alpaca-lang/ https://github.com/alpaca-lang/
- Ambrosia 10y agoIt's there now!
- marianoguerra 10y agohi, here's a talk i gave called "how beams are made" http://marianoguerra.org/talks/beamba-buenos-aires-meetup/#/how-beams-are-made http://marianoguerra.org/talks/beamba-buenos-aires-meetup/#/... follow the commits on this repo from the beginning to se how a fairly complete language is built https://github.com/marianoguerra/otl https://github.com/marianoguerra/otl
- pmontra 10y agoI'm really sad about the fate of Reia. It could have been the OO like language that migrated millions of developers to concurrent functional languages. Potentially much more effective at that than Elixir, which looks like Ruby at a distance but it's very different when one sits at the keyboard. http://reia-lang.org/ http://reia-lang.org/
- solidsnack9000 10y agoThe programming style encouraged by Erlang/BEAM is a good multi-computer style as well as a good multi-core style. Everything is passed by value -- there are no pointer or reference types to put in messages. If you want a shared value then it has to be a key into a database. If a company gets its major apps onto BEAM one could imagine a fairly straightforward auto-scaling story. As the number of scheduled BEAM processes grows for a given app, the need for CPU and memory could be expected to grow more or less linearly with it.
- bogomipz 10y agoI wanted to ask if any of you have found a market for Elixir devs and/or what you think the state of it might be.
- macintux 10y agoThere was a lot of chatter in a post a few weeks ago about Ruby shops adding Elixir to their toolkit. Erlang remains a niche, sadly, but Elixir looks poised to be mainstream.
- yellowapple 10y agoI feel like Erlang is already mainstream; it's just mainstream in a different setting than Elixir (namely, Elixir seems to be targeting web development, while Erlang has traditionally targeted telecom and related fields). Erlang feels like a niche in comparison because there are a lot more companies that need websites nowadays than there are companies that need to build their own nine-nines-capable telecom systems.
- qaq 10y agoIt's developing I've seen a number of large companies starting adoption on a small scale and searching for devs. GoPro, Adobe, Pinterest, Rakuten, Bleacher Report is a major user and has open positions. I am sure this is not a complete list.
- im_down_w_otp 10y agoIt's great to see this list. As an Erlanger there's one thing that's started to bother me of late, and that's how subdued and declining the community feels. There are a handful of passionate and capable people making great strides to improve things (rebar3 is excellent for instance), but the momentum seems to be all behind Elixir these days. Most of the action around Erlang (conferences, etc.) seems rooted in nostalgia not in finding ways to connect to new users or new use cases. Looking at the speaker list for Erlang Factory 2017 I'm trying to figure out why there's nobody from Whatsapp, MZ, Facebook, Amazon, Visa, Goldman Sachs, etc., and why so many of the speakers are repeats of years past (in some cases multiple times over multiple years past). Despite having a ~15 year head start, and some really high-profile use cases, it seems like the Erlang powers-that-be haven't figured out how to capitalize on much of that, and it's a real bummer for people in my situation (and I'd argue the industry as a whole is worse off for it too). I'd really like to have my team use Erlang, but I'm feeling increasingly irresponsible suggesting they invest in it instead of Elixir.
- dxhdr 10y agoErlang Just Works(tm) for me, I have a problem and I write code to solve it, no whiz-bang new features or frameworks needed. That said I do partially agree, in particular advancing the state-of-the art in regards to inspecting and debugging would be great. Rebar3 is indeed excellent!
- im_down_w_otp 10y agoI totally agree. It just works for me too. That's why I prefer it. But it needs new users and new use cases to stay relevant and to be defensible as an investment of time, money, and people in companies and enterprises that are willing to depart from the traditional strongholds of Java or whatever the latest thing out of Google is unfortunately. To say nothing of the more risk averse institutions, which are vast and numerous. Given how great it is I'm often at a loss for why it's ecosystem feels stagnant and much of its evangelism (what little there is to begin with) appears unable to build much excitement. :-( Anyway, back to Erlanging and hoping more people discover how pleasant, simple, and robust it can be.
- xor-xor 10y agoI'll just leave this here, especially for Elixir fans: https://notamonadtutorial.com/interview-with-robert-virding-creator-lisp-flavored-erlang-an-alien-technology-masterpiece-c37003945c https://notamonadtutorial.com/interview-with-robert-virding-...
- digitalzombie 10y agoErlang community is really bad. I went to a couple of meetups at OpenX. It's majority older programmers. The topic of the day was how to attract new programmers to Erlang. I've stated perhaps we need to emulate Ruby and have some killer framework such as Rails. Their community is very vibrant. The response was no, stay the course, we don't need to do anything. What's the point of this talk of attracting new programmers to Erlang if the consensus was stay the course and do nothing? This way back before Elixir was on the radar. Stopped going to that Erlang meetup, the programmers were out of touch. I am mighty glad that Elixir and Phoenix is taking off. Shows them that I was right. Either Erlang community change their mindset or stay the same.
- jchassoul 10y ago3 days later, 146 comments and no love for lua on the beam?