[erlang-questions] Erlang newbie questions
Tue Oct 18 16:27:34 CEST 2011
On Tue, Oct 18, 2011 at 3:32 AM, CGS <cgsmcmlxxv@REDACTED> wrote:
> The main point for entering the discussion is the fact that many who replied
> here were saying that if something crashes in your application doesn't kill
> your application like in C. I beg to differ on this point. If your Erlang
> application is single threaded, then your application (I do not speak here
> about OTP application) will crash if an error occurs there.
I'm inclined to argue that a "single threaded" application isn't a
valid Erlang app :)
I'll be slightly pedantic here -- just because I think it's worth mentioning...
* When you run "erl" you start an OTP facility -- it's not an optional
feature; it's fundamental to an Erlang system
* A "single threaded" app would presumably be an app that's run using
"erl" with -s or -eval. That'll work for running an application, but
it's not the right way :)
* The right way to run an Erlang app is to create an OTP application
and include that app in a release, which is specified when you run
"erl" with the -boot option
If you run your Erlang application this way, you get all the benefits
people have been describing.
This is admittedly a bit of a bugaboo for me, but I think the
dichotomy that people draw between "Erlang" and "OTP" is overall not
helpful. The so called OTP patterns that are treated as
optional/advanced are fundamental to the way the Erlang runtime is
designed. So I tend to blur the two together into a single "Erlang" :)
I think with some improvements in tooling and documentation, the
headaches associated with using "OTP" will go away, which will be a
huge boon for developers -- especially those new to Erlang.
More information about the erlang-questions