[erlang-questions] node.js vs erlang
Wed Jun 18 22:22:42 CEST 2014
On Wed, Jun 18, 2014 at 11:02 AM, Loïc Hoguin <essen@REDACTED> wrote:
> Okay I wanted to skip this thread entirely but you mentioned Cowboy and
> said weird things about it so I'll bite.
> "Setting up a working Erlang application is a little more complex than for
>> most other languages. The reason is that Erlang is designed to build
>> and not just simple applications."
>> ... aaaaaaaand cowboy just lost me as a user. i don't WANT complex,
>> and my
>> application IS simple. so cowboy is not for me! right?
> Well there's nothing we can do about that. We can't just write one file
> and run a program on it. That's simply not how Erlang works. We have to
> create an OTP application, compile, start the VM with the right paths etc.
> That's not just Cowboy deciding to be more complex than nodejs, that's how
> Erlang was designed.
If this is written in the Cowboy User Guide I think it is a bit
unfortunate. I don't agree that it need to be more complex to set up a
Erlang application than it is in many other languages. Maybe it is true in
the way you have choosen but for sure there are more simplistic ways also.
And in other languages it is also more complicated if you need a serious
server with logging, possibility to upgrade etc.
I can come up with many non complex approaches. Whats wrong with erl -run
..... and having the module(s) in the current path?
I mean that if you have a more complex set up with Erlang maybe you also
get features that you don't get with a simple setup in another language?
> And while it's improving (you should have seen things 4 years ago when I
> started, the getting started in Cowboy is *immensely* simpler than it would
> have been then), it'll never be as simple as nodejs. Because most of the
> stuff in the getting started chapter is necessary as I'll explain in a bit.
> * the rest of the "getting started" walks me through doing a ton of
>> boilerplate stuff. it's nice to know how things work, but i'm a busy web
>> (have i mentioned my lack of attention span yet? oh look, a peanut! and
>> an event driven async peanut! yum! *runs off*). everything in that section
>> ought to be boiled down to "run this one simple command and everything is
>> for you. click here to read about the gory details." and doing so should
>> me a fully functional application template that i can immediately start.
>> one command should probably take a simple config file with things like
>> the app
>> name and other variable details (such as which erlang apps to include in
>> awesome new project, including but also in addition to cowboy).
>> basically, an
> The next erlang.mk version will make it a little easier by generating a
> base project (using templates, as you say). But that will not change the
> getting started chapter much, as we will still have to explain things.
> Instead of saying "create" it will say "edit", basically.
> It may sound like a lot for someone with as little attention span as you,
> but going through these steps saves you an immense amount of time later on.
> If Erlang beginners start using releases immediately, we win. They will not
> have to suffer going through hoops like we did to get to that point. They
> will not have to fiddle with paths, or make start scripts, or deal with
> complex deployment issues, or anything that we struggled with for years. It
> *is* a big step, and we probably can't reduce it much more, but it's an
> incredible time saver.
> But of course impatient people will prefer to waste their time by missing
> out on it.
> And to be honest if we weren't doing this then we would have to explain
> how to write a start function, start erl with the -s option and make a
> start script for frequent use. It wouldn't be simpler, it would just be
> different, and we would just miss an opportunity to teach beginners "the
> right way" from the start.
That is what I meant, you are using a more complex setup with Erlang in
order to get more features. So the comparision with other languages "simple
setup" is not fair.
Cut, cut .....
But also note that I think it is important to make it easier for beginners
to approach Erlang. We are working on that and
are happy to cooperate with the Erlang community on this.
> Loïc Hoguin
> Kenneth, Erlang/OTP, Ericsson
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions