Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
MononcQc
May 29, 2007



Erlang is a functional, conncurrent, distributed, and fault-tolerant programming language with soft real-time capabilities. It's especially good for server software, and it supports hot code loading so that you can upgrade applications without stopping them.

It's got Prolog-like syntax, powerful pattern matching, one of the best (if not the best) ways to deal with binary data, and contrary to many functional languages, it was built to deal with real world problems before anything else.

It was created at Ericsson Labs in 1986, and has been used in flagship products for them since the early 90s. In 1998, Ericsson decided they didn't want to make languages anymore and abandoned the project, making it open source. A few years later, they figured out it was a mistake and have been the main maintainers of the language since then.

https://www.youtube.com/watch?v=xrIjfIjssLE

Why should I care?

There are a couple of reasons:
  • You want to get into actor-based (and message-passing-based) concurrency
  • You want to program in a functional language that can land you jobs and build products1
  • You need to build reliable and fault-tolerant server-side software
  • You need to build a low-latency application or one that requires massive concurrency
  • Hey, experience is experience, so why not?
If the idea of 'letting it crash' sounds absurd to you, Erlang might be of significant interest. Why do Erlangers embrace such principles, and what form do they take? Why is it that most Erlang developers get into the language for concurrency, but decide to stay for fault-tolerance and letting things crash? Taking a bit of time and trying the language could change how you think about building systems.

The Open Telecom Platform (OTP) framework, despite its boring name, is an decent piece of engineering shared by all Erlang apps worth their while in the wild that let you organize your code in a logical way. It's so useful that most Erlang developers judge it as more important than tests, documentation, or coworkers who know the code to help maintain software. It is so important that the language is officially called 'Erlang/OTP'. Learning it might be worth your time too.

Erlang is not a silver bullet, it's not a new messiah, and it's likely you're not gonna use it at work and will dislike how it looks. It's worth a try though.

Where can I learn more?

First there are websites:
Books are the next best way to learn things, and outside of LYSE (which is the whole book online) they tend to be more complete:


Programming Erlang by Joe Armstrong (Pragmatic Programmers) is the book written by one of the inventors of Erlang. The book is good for people who want to get into the concurrent views of Erlang, stories that led to its design, and a strong focus on raw Erlang, with less OTP. The second edition is coming out soon and will have content on Maps, which should be the next addition to the language.


Erlang Programming by Francesco Cesarini and Simon Thompson (O'Reilly) is a book written by people who are used to giving Erlang classes all the time through Erlang Solutions and the University of Kent. It's similar to Joe Armstrong's book in that it doesn't go too deep in OTP, but shows sufficiently enough to get going for a good while. If Joe's book is more about why the language is the way it is, this one takes a more "get it done" practical approach, and shows supporting tools more.


Erlang and OTP in Action by Martin Logan, Eric Merritt, and Richard Carlsson (Manning) is probably the book you want if you want to dive deep in OTP to get better at it while feeling like skimming the content of basic Erlang. It's got a good lot of practical tips, tuning ideas, and probably spends the most time discussing Java integration, NIFs, and other ways to communicate with other languages.


Learn You Some Erlang for Great Good! by yours truly (No Starch Press). It's possibly the most complete one if what you want is to go from basic Erlang to pretty much the entirety of OTP. Given I'm biased here, I'll let you read it from the website, as it's entirely free there, and you can judge for yourself.


Introducing Erlang by Simon St-Laurent (O'Reilly). It's the gentlest (and shortest) introduction to the language as a book outside of the one in 7 languages in 7 weeks. It was meant that way, and has a few exercises and shows the basics. If you want an overview, this is a good one, and could be a good match when coupled with Erlang and OTP in Action.


Études for Erlang by J. David Eisenberg (O'Reilly) is a short book that has a series of exercises to help programmers learning Erlang. It is originally written to go with Introducing Erlang, but the author has added notes pointing you to the equivalent chapters of Erlang Programming, Programming Erlang, Erlang and OTP in Action, and Learn You Some Erlang For Great Good! It's also available for free online.


This book is out of print, and while the first chapter is available for free online, it's outdated. This book shines if you can find a re-print and know Erlang already. Later chapters show how to build distributed databases (commits, eventual consistency) and insights about how some of the internal libraries of Erlang/OTP are implemented.

Most the books have extracts available at http://erlangcentral.org/books/

Jobs:

Other links

What's this thread for

Questions, discussions, code reviews, anything related Erlang. Post away :toot:

1: Not that there are that many Erlang jobs around, but at least, there are Erlang jobs.

Adbot
ADBOT LOVES YOU

Police Academy III
Nov 4, 2011
How is the library situation with Erlang, like if I want to do something with graphics + sound or a native-looking UI, how easy is that? Are libraries fairly idiomatic or are they mostly a bunch of half baked ffi wrappers like with a lot of other languages (looking at you common lisp). Also, what does a good Erlang development environment look like, is there an IDE or am I fine with just emacs?

netcat
Apr 29, 2008
What are some interesting/fun projects to do while learning Erlang? I've been meaning to learn it for some time (for work actually) but I kinda need to do something tangible or I'll lose interest.

Posting Principle
Dec 10, 2011

by Ralp

Police Academy III posted:

Also, what does a good Erlang development environment look like, is there an IDE or am I fine with just emacs?

I worked through LYSE (excellent book, buy it) this year using Sublime Text 2, the SublimErl plugin, and Rebar, and everything worked very nicely straight from ST2.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Police Academy III posted:

How is the library situation with Erlang, like if I want to do something with graphics + sound or a native-looking UI, how easy is that?

For the most part, they don't exist, or they're bad. Don't use Erlang for a desktop app.

Police Academy III posted:

Also, what does a good Erlang development environment look like, is there an IDE or am I fine with just emacs?

Joe Armstrong uses emacs, Sublime is good too.

MononcQc
May 29, 2007

Police Academy III posted:

How is the library situation with Erlang, like if I want to do something with graphics + sound or a native-looking UI, how easy is that? Are libraries fairly idiomatic or are they mostly a bunch of half baked ffi wrappers like with a lot of other languages (looking at you common lisp). Also, what does a good Erlang development environment look like, is there an IDE or am I fine with just emacs?

For native UIs Erlang comes with Wx widgets. They're not the most stable thing in the world -- people will tend to boot a slave VM just to deal with the graphics in case it crashes. Most of it appears to be a literal translation of the other APIs. The only tutorial I know for it is http://www.idiom.com/~turner/wxtut/wxwidgets.html

Generally speaking, Erlang is used more for server-side stuff, so people will either manage things through a CLI or create a web interface to interact with the program. Still, you can call observer:start() on a node that has Wx support and you'll see something like this:



Those are diagnostics of the node you started it on, and it's all written in Erlang using the Wx bindings -- you can read the source to figure things out, but it's likely not gonna be great. As Cocoa Crispies said, Erlang doesn't do super well for the desktop.

Regarding IDEs, there's ErlIDE for Eclipse, but the vast majority of Erlang programmers survive on Emacs, Vim, or Sublime.

MononcQc
May 29, 2007

netcat posted:

What are some interesting/fun projects to do while learning Erlang? I've been meaning to learn it for some time (for work actually) but I kinda need to do something tangible or I'll lose interest.

Well, what you're gonna think is 'fun' is gonna be different for everyone. In general, beginner projects include things like writing a socket or HTTP server, a chat application, an IRC bot, or stuff like that. All these component can be put together to write some kind of game to be played over a browser, say poker or cards against humanity, without ever needing to involve a database.

Other people will try to go another way and do AI stuff -- neural nets and whatnot.

If you have more specific details to mention, it's probably possible to recommend better.

Oh and I recommend installing https://github.com/ferd/erlang-history as it will allow your Erlang shell to save their history!

tef
May 30, 2004

-> some l-system crap ->
Erlang!

Even if you don't use erlang, it is still worth understanding the architectural principles behind it. Joe Armstrong's Thesis is an excellent read.

http://www.erlang.org/download/armstrong_thesis_2003.pdf

quote:

Making reliable distributed systems in the presence of sofware errors

The work described in this thesis is the result of a research program started in 1981 to find better ways of programming Telecom applica- tions. These applications are large programs which despite careful testing will probably contain many errors when the program is put into service. We assume that such programs do contain errors, and investigate methods for building reliable systems despite such errors.

The research has resulted in the development of a new programming language (called Erlang), together with a design methodology, and set of libraries for building robust systems (called OTP). At the time of writing the technology described here is used in a number of major Ericsson, and Nortel products. A number of small companies have also been formed which exploit the technology.

The central problem addressed by this thesis is the problem of constructing reliable systems from programs which may themselves contain errors. Constructing such systems imposes a number of requirements on any programming language that is to be used for the construction. I discuss these language requirements, and show how they are satisfied by Erlang.

Problems can be solved in a programming language, or in the stan- dard libraries which accompany the language. I argue how certain of the requirements necessary to build a fault-tolerant system are solved in the language, and others are solved in the standard libraries. Together these form a basis for building fault-tolerant sodware systems.

No theory is complete without proof that the ideas work in practice. To demonstrate that these ideas work in practice I present a number of case studies of large commercially successful products which use this technology. At the time of writing the largest of these projects is a major Ericsson product, having over a million lines of Erlang code. This product (the AXD301) is thought to be one of the most reliable products ever made by Ericsson.

Finally, I ask if the goal of finding better ways to program Telecom applications was fulfilled—I also point to areas where I think the system could be improved.

tef
May 30, 2004

-> some l-system crap ->

MononcQc posted:

It's got Prolog-like syntax

Also worth reading is 'Use of Prolog for developing a new programming language'

http://www.erlang.se/publications/prac_appl_prolog.pdf

quote:

This paper describes how Prolog was used for the development of a new concurrent real-time symbolic programming language called Erlang.Erlang was developed by rst building a prototype in Prolog - the prototype was used bya user group to test their reactions to the language. As time passed many features were added(and removed) from the interpreter and eventually the language reached a level of maturitywhere it was decided to try it out on a signi cant problem.About 3 years and some 20,000 lines of Erlang later, performance became an issue - wewrote Prolog cross compilers from Erlang to various concurrent logic programing languagesfollowed by a direct implementation of Erlang itself. The direct implementation of Erlangwas loosely based on the WAM and made by writing a Prolog compiler from Erlang to a newabstract machine and an emulator for the abstract machine in 'C'. The instruction set forthe abstract machine was rst prototyped in Prolog - nally the compiler was re-written inErlang, thus totally removing any dependency on Prolog.This paper describes some of the key events which lay between the simple prototype andthe current version of the language.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





As someone who can't be assed to read the 100+ messages about it on the mailing list but someone who should probably be informed, could you explain the maps/frames controversy? All I have figured out is everyone is unhappy

MononcQc
May 29, 2007

the talent deficit posted:

As someone who can't be assed to read the 100+ messages about it on the mailing list but someone who should probably be informed, could you explain the maps/frames controversy? All I have figured out is everyone is unhappy

Ah yes. The thread in question is at http://erlang.org/pipermail/erlang-questions/2013-May/073656.html and the Erlang Enhancement Proposal (EEP) draft is at https://github.com/psyeugenic/eep/blob/egil/maps/eeps/eep-0043.md

The EEP draft basically suggests a new native dictionary structure to be native to the language, coming with specific pattern matching syntax (people are often fed up of dict:lookup(Key, Dict) or some variant). The main inspiration for this draft was an EEP/Draft by Richard O'Keefe (the mailing list's "always right because he really knows everything" guy) available at http://www.cs.otago.ac.nz/staffpriv/ok/frames.pdf (PDF), about a structure called 'frames'.

This is where things get a bit confusing. The frames had the following motivation behind them:

  • Replace Erlang records for their current use case (fast, internal state of a process with pattern matching, static records, much like a C struct, addressable by keys, which should be atoms and static)
  • Can be used cross-modules without sharing definitions in .hrl files (a wart of records)
  • Keep things as efficient as current records (which are basically tuples)
  • Can be seen as its own data type (i.e. not a tuple as the underlying structure)
  • No absolute need for O(1) updates, and said updates should be functional (not in-place)

The maps proposal is inspired by frames, but some of the motivations are slightly different:

  • Replace dicts in their current use cases, and make them nicer to use with pattern matching
  • Provide a faster implementation (likely native)
  • No direct hope to replace records, but that requirement is open to be stapled on later.
  • Arbitrary keys and number of elements
  • Maps should respect global sort order even with arbitrary keys and elements -- because you want to pattern match on them, you need to be able to compare them by {Key,Value}, and they want better comparison than O(n log n).
  • It should be possible to have a way to differentiate between adding and updating a key.

This last requirement meant that the implementation needs to preserve order, which meant that you get in the usual Erlang problem: integers and floats are two distinct data types, but they can compare equal in the case of 1.0 and 1, for example. However, they do no match the same. That is:

code:
true  = 1 == 1.0,
false = 1 =:= 1.0,
1 = 1, % works
1 = 1.0. % crashes
Ideally, this wart would have been avoided by possibly having multiple comparison operators for floats and integers (and not just == vs. =:= and /= and =/=, but also < and @<, for example). However, they don't exist. For this reason, maps get two assignment operators: key => val and key := val (used as SomeMap#{key => val, key2 := val2}.

=> is usable in order to create new keys and update them, but the update is done with comparison semantics (1.0 == 1).

:= is usable in order to pattern match on maps, and they update new keys only (not create new ones), but the update is done with match semantics (1.0 =/= 1).

Now a lot of people haven't read both proposals, and many others have not read either proposals. There a few arguments people were debating:

  • The choice of operators and their semantic is not ideal, but in the end you can't do much about it because of the difference between floats and integers. Some people found it a lot less ideal than others.
  • There was a debate about whether we really needed frames or maps more than the other, or if one could do both at once. This is still up in the air, but the OTP team said they don't intend for Maps to replace Frames.
  • Syntax of nested updates were debated, with alternative recommendations. Most vocal people found out that the syntax suggested in the draft proposal was good enough as is.
  • Questions were asked regarding the underlying implementation. In past conferences, the OTP team hinted at HAMTs being used, but given the need for ordering, they are not applicable there. People talked about such implementations, compared them to frames, discussed tradeoffs, etc. I do not think the OTP team has settled on any specific implementation at this point, and they're open to the idea of having different implementations depending on the map size (they should transition up/down automatically).

For the first point, I believe people tended to like the maps syntax more than frames syntax. And syntax debates being what they are a lot of opinions that led up to little progress were exchanged.

Most of it was really a debate and a bit of a RFC -- it's not enacted yet, there was no prototype implementation made public, and the OTP team is likely going back to the drawing board considering some of these issues and comments.

I don't think people are generally unhappy, but everyone wants things to be right and not get another situation similar to records on their hands. Everyone seems to be relatively happy about it, although Richard O'Keefe seems to think maps are not required -- Frames are the real urgent addition.

Personally my biggest worry is that everything turns into dict-passing where all other data structures and their relative advantages are forbidden, and message passing becomes heavier because everyone just sends internal state around as a map, and APIs and encapsulation go out the window. I'm trying to trust people on this one, but it's still scaring me a bit.

MononcQc fucked around with this message at 19:50 on May 21, 2013

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Given what you've written Maps are basically proplists except with arbitrary order matching? Although the Maps themselves have order you can match on a K/V pair at any position not just the head?

Are Frames still on the roadmap? I don't really care about these Maps (proplists are generally good enough for what I'd use Maps for) but I do really care about the death of records. Records are loving awful.

MononcQc
May 29, 2007

"Basically proplists" is a tricky way to put it. Proplists are not necessarily a key/value store. For example, this list of options for the file:open/2 call could be: [read, {encoding,utf8}, write]. This is a proplist that is implicitly expanded to [{read,true} {encoding,utf8}, {write,true}]. Proplists also support say, modifying the list before by prepending [{encoding,latin1}|OldOpts] and for most use cases, the first result found will supercede the other ones.

This form of expansion and overwriting is somewhat unique to proplists and my reading of the Maps EEP doesn't lead me to believe they will support similar operations. They'll be closer to lists of key/value pairs, or orddicts, so yeah, you will be able to match anywhere, not just on heads.

Maps will also add map comprehensions and generators:

code:
M0 = #{ K => V*2  || K := V <- map() },
M1 = #{ I => f(I) || I <- list() },
M2 = #{ K => V    || <<L:8,K:L/binary,V/float>> <= binary() }.
B1 = << <<V:8>> || _ := V <- map() >>,
L1 = [ {K,V} || K := V <- map() ].
Which won't add much in your case.

Frames were never really on the roadmap. eeps have this tendency to be neither denied or worked on for years at a time. The proposal is not rejected, but I don't think the OTP team is announcing them as a feature nor is actively working on them at this time. I'm starting to think I would have preferred them to maps myself.

Hypnobeard
Sep 15, 2004

Obey the Beard



What's your impression/opinion of Elixir?

MononcQc
May 29, 2007

Tolan posted:

What's your impression/opinion of Elixir?

Elixir is not adding too much to Erlang, IMO. Its biggest contributions are in macros, multiple modules per file, and the ability to have contracts, but otherwise most of its features will be a variation of something available in Erlang through the BEAM VM and Core Erlang (the intermediary language many can compile to, if they don't just generate an Erlang abstract parse tree), and its weaknesses will likely be a similar variation.

Then there's also the different syntax.

I think it's a nice attempt at a new language, and possibly the best alternative language on BEAM (though LFE is definitely nice too), but it doesn't offer much for people who already know Erlang outside of a change in a few semantics and the features I mentioned above. My hope for it is that it becomes a honeypot to Ruby fanboys who want Ruby and its do notation everywhere so they stop bothering the Erlang regulars about it, and those that really want to will be able to jump to Erlang from there.

Honeypot is a bit of a strong word, given Elixir can stand on its own and has its own tiny community that's still at the very flexible stage where they can modify the language as they go for what they like, but it's somewhat appropriate because at this point you still need to understand Erlang to be efficient with Elixir.

They got their first book out very lately http://pragprog.com/book/elixir/programming-elixir, so it might be the first sign of the language taking off. You'll probably still need to know a bit of Erlang to feel at home with Elixir, but I believe this is happening less and less.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Tolan posted:

What's your impression/opinion of Elixir?

I really like elixir as a complement to erlang. Erlang is dynamic but not in the same kind of way python, ruby and js are dynamic. It's annoying and fiddly to do a lot of common scripting language type things in erlang but elixir makes most of them much easier. I think too many people are currently caught up in a 'erlang/elixir is the one true way!' fight but most people using one should be using both in tandem.

MononcQc
May 29, 2007

So I've started making a list of a bunch of functionality people like to have when debugging production code. I've had a few snippets in the past already -- mostly gists about obtaining a node's memory, safe ways to read process info (without blowing up the mailbox), and so on.

I've got my own and also Geoff Cant's https://github.com/archaelus/eshellcode. My objective is to progressively add them to a library that can then be deployed with any other app to let DevOps stuff be way simpler and avoid copy/pasting poo poo all around.

If any people in here have useful functions they'd like to see in that or just recommend I add, that would be pretty neat so I can slowly inch my way towards something worthy.

double sulk
Jul 2, 2010

Seems as if Elixir gets the Joe Armstrong Seal of Approval!

http://joearms.github.io/2013/05/31/a-week-with-elixir.html

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





http://thisotplife.tumblr.com/

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

gucci void main posted:

Seems as if Elixir gets the Joe Armstrong Seal of Approval!

http://joearms.github.io/2013/05/31/a-week-with-elixir.html


"Sigils are great – love ‘em. We should add these to Erlang." - Joe Armstrong, 2013

Looks like the time is ripe for Perlang :getin:

MononcQc
May 29, 2007

Joe has all kinds of crazy idea all the time. He has started work on erl2, which sits dormant on github, and at some point in the past year has suggested people get rid of modules entirely and instead only use functions floating in a global namespace that could be fetched from the Internet on demand. He also has attempted repeatedly to implement SSL equivalents in Javascript, not really understanding why certificates are useful (or not wanting to care about it).

People have described him to me as a guy who gets a thousand ideas before breakfast, and once in a while, one is really really good. What I've seen so far seems to be true. He's extremely creative, genuinely nice, and has a lot of crazy thoughts. If you give a talk about web servers or frameworks at an Erlang conference, he's the guy who'll heckle you about your poo poo being too complex and why isn't the web just a raw TCP connection with message passing protocols and calls in it anyway.

Posting Principle
Dec 10, 2011

by Ralp
I know it was brought up on the mailing list, but is there a reason that rebar or a rebar like app isn't included in official releases?

MononcQc
May 29, 2007

No explicit reason. The gist of it is that whatever is in the official OTP repository is the responsibility of the OTP team at Ericsson. I figure they don't want to have to maintain and document rebar, especially given a lot of its functionality is just a wrapper around existing tools.


In other news, there's a preliminary version of R16B01 (RC1) announced today. Here's the upcoming changelog: http://erlang.org/pipermail/erlang-questions/2013-June/074188.html

Sang-
Nov 2, 2007

MononcQc posted:

People have described him to me as a guy who gets a thousand ideas before breakfast, and once in a while, one is really really good. What I've seen so far seems to be true. He's extremely creative, genuinely nice, and has a lot of crazy thoughts. If you give a talk about web servers or frameworks at an Erlang conference, he's the guy who'll heckle you about your poo poo being too complex and why isn't the web just a raw TCP connection with message passing protocols and calls in it anyway.

As well as being a really good public speaker, his C compiler talk is really engaging and a pretty lovely intro to writing a C compiler.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

MononcQc posted:

No explicit reason. The gist of it is that whatever is in the official OTP repository is the responsibility of the OTP team at Ericsson. I figure they don't want to have to maintain and document rebar, especially given a lot of its functionality is just a wrapper around existing tools.

That, OTP doesn't have a reputation for pulling in packages developed externally, and that rebar is basically the Dizzy show with Tuncer as comic relief.

more like dICK
Feb 15, 2010

This is inevitable.

Cocoa Crispies posted:

and that rebar is basically the Dizzy show with Tuncer as comic relief.

Can you explain this for people who don't follow Github or HN drama? I've found rebar quite useful.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

more like dICK posted:

Can you explain this for people who don't follow Github or HN drama? I've found rebar quite useful.

Dave "Dizzy" Smith was Erlang User of the Year prior to MononcQc, used to be VP of Engineering at Basho, and wrote rebar.

Tuncer made some bad PRs with some WTF parts but I haven't heard any gripes about his changes lately v:shobon:v

rebar's basically the best way to make a blank OTP app, and the only good way to make a new riak_core app.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





rebar is terrible if you ever do more than throw some '.erl' files in '/src' and type 'rebar compile' in a bash prompt

I like what cowboy does with it's build poo poo

MononcQc
May 29, 2007

What does cowboy do that's even remotely better with its makefiles?

Posting Principle
Dec 10, 2011

by Ralp
So I've got an existing OTP app that's using TCP sockets right now. I'd like to add in an HTTP front end to it. The two names I keep seeing come up are Yaws and MochiWeb (and of course raw httpd). MochiWeb seems simple enough, but as far as I can tell it uses its own build system. For httpd it looks like I'd be looking at mod_esi?

Does anyone have experience with these?

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Jerry SanDisky posted:

So I've got an existing OTP app that's using TCP sockets right now. I'd like to add in an HTTP front end to it. The two names I keep seeing come up are Yaws and MochiWeb (and of course raw httpd). MochiWeb seems simple enough, but as far as I can tell it uses its own build system. For httpd it looks like I'd be looking at mod_esi?

Does anyone have experience with these?

MochiWeb is what webmachine (and therefore riak_kv, riak_cs, etc.) use, and those are pretty standard rebar apps?

Posting Principle
Dec 10, 2011

by Ralp
Oh yeah I guess I should actually look inside those makefiles. Webmachine actually seems to be what I'm looking for, so I guess I'll get started with that tonight.

MononcQc
May 29, 2007

There's also cowboy available, and it can do some RESTful stuff too. I like it because it uses binaries by default, but otherwise everything else works too.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
Some of the Erlang User Conference presentations are starting to appear publicly.

How Basho packages Riak for multiple OSes: https://speakerdeck.com/jaredmorrow/packaging-erlang-applications

How Basho tests Erlang code: http://www.erlang-factory.com/upload/presentations/818/joedevivo-test.pdf

More: http://www.erlang-factory.com/conference/ErlangUserConference2013/talks

MrMoo
Sep 14, 2000

An alternative to recommend would be using 0mq in Erlang and setting up Mongel2 as a http-0mq gateway. I'm using it with Python, Go, and Java so far.

MononcQc
May 29, 2007

Sorry for the thread necromancy, but I was wondering if anyone in here planned to be around for the Erlang Factory Lite in September, in New York City?

I've been invented to talk there and am still working on a presentation outline, but I was wondering if I'd meet anybody from here there.

Also it seems http://thisotplife.tumblr.com is dead, which is a shame.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

MononcQc posted:

Sorry for the thread necromancy, but I was wondering if anyone in here planned to be around for the Erlang Factory Lite in September, in New York City?

I've been invented to talk there and am still working on a presentation outline, but I was wondering if I'd meet anybody from here there.

Also it seems http://thisotplife.tumblr.com is dead, which is a shame.

I saw three posts surface just now :)

"Accidentally disconnecting a remote shell while doing a live upgrade" is something I've got even worse stories about. I'll let these patch notes speak:

quote:

Changed behavior of riak attach

If you are a frequent user of riak attach it is worth noting that the behavior has changed in 1.4. riak attach used to attach to a named pipe that erlang provides to talk to running erlang nodes. This is great except that an accidental Ctrl-C would not only kill your session, but also kill the running node. The behavior has now changed to use -remsh (remote shell) to connect to the node. This method is safer because a Ctrl-C will not kill a running node. In cases where distributed erlang having problems for some reason and a -remsh is not wanted, riak attach-direct is a new command which uses the old pipe behavior of riak attach.
(emphasis mine)

MononcQc
May 29, 2007

Aha yeah, named pipes require you to close stdio to disconnect (^D), not ^C, and they're 100% local. Using -remsh uses a trickier setup for shells (which I explain briefly at http://ferd.ca/yet-another-article-on-zippers.html)


Remsh is generally the safest, but you have to remember to quit with ^G then q, or ^C, but not with q() or init:stop() as the two latter will also shut down the node entirely.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

MononcQc posted:

Also it seems http://thisotplife.tumblr.com is dead, which is a shame.

Dead as in you can't submit stuff to it any more or dead as in nobody has submitted anything for a while?

Adbot
ADBOT LOVES YOU

MononcQc
May 29, 2007

Otto Skorzeny posted:

Dead as in you can't submit stuff to it any more or dead as in nobody has submitted anything for a while?

Dead as in stuff I had submitted nearly a month ago was still not there (and nothing else either). But the magic of complaining did its thing and early this morning updates were pushed through to make me look foolish.

  • Locked thread