[erlang-questions] Beginners tutorials

lloyd@REDACTED lloyd@REDACTED
Thu Jun 12 18:19:32 CEST 2014


Hello,
 
> Now if one is trying to do a ground up tutorial for Erlang, and OTP, as 
> a platform - that immediately leads to three questions:
> - what is the audience trying to learn?
> - what is the reader's state of knowledge about such things as 
> distributed system concepts and architectures, run-time environments, 
> platforms, and so forth?
> - where to start?
 
Spot on!
 
No laws of the universe dictate against more than one tutorial.
 
Love your idea of two-note ping-pong plus dissect with tools. Getting my head around OTP concepts was my first major learning barrier; understanding how to architect ambitious Erlang systems is the issue I'm wrestling with now.
 
All the best,
 
Lloyd
 
-----Original Message-----
From: "Miles Fidelman" <mfidelman@REDACTED>
Sent: Thursday, June 12, 2014 11:48am
To: "Erlang" <erlang-questions@REDACTED>
Subject: Re: [erlang-questions] Beginners tutorials



Doesn't it kind of depend on what the goal of a tutorial is?

If all one is trying to do is teach straight coding in Erlang, the big 
conceptual issue is getting one's head around a functional language. 
For that, there's:
http://www.erlang.org/static/getting_started_quickly.html
and
http://learnyousomeerlang.com/content

But, really, if all one is trying to do is get from "hello world" to 
stand-alone code modules, that kind of misses the point of Erlang (at 
least IMHO). It's not like one is progressing from short, simple 
programs, to very large complicated ones - the whole point of Erlang is 
to develop systems of actors - where the conceptual issues have a lot 
more to do with how to structure large collections of interacting units.

Now if one is trying to do a ground up tutorial for Erlang, and OTP, as 
a platform - that immediately leads to three questions:
- what is the audience trying to learn?
- what is the reader's state of knowledge about such things as 
distributed system concepts and architectures, run-time environments, 
platforms, and so forth?
- where to start?
- and maybe, whether to proceed with a bottom-up incremental approach to 
system building, or a top-down architectural approach

In fact, if anything, rather than a bottom-up tutorial, what might be 
really useful is a top-down tutorial - more along the lines of learning 
Linux for the first time. Rather than starting with echo "Hello 
World!" a tutorial is more along the lines of:
- insert liveCD into slot, and boot
- log in
- list some files
- create a file, display it, examine its properties,
- examine directory structures and file types (including device types)
- examine the processes running, manipulate them
- examine environment variables, paths, etc.
- create and manipulate some shells
- download, unpack, and install some packages
- and so forth

For Erlang, the equivalent might start with:
- install Erlang
- start a node
- use the various run-time tools to start examining what's running
- write, compile, load, run a simple 2-actor ping-pong application; 
examine it's behavior with the various run-time tools
- start up another node
- modify ping-pong to run across nodes; examine its run-time behavior
- play with some of the packaging/installation/distribution tools
- from there, I think we're getting into areas that are more complex 
than it makes sense to address in a tutorial - more like the ground that 
"Erlang and OTP in Action" covers pretty well

Just my two cents,

Miles Fidelman



Loïc Hoguin wrote:
> The simple nodejs example works because it's a nodejs example and not 
> a Javascript example. Someone who doesn't know Javascript (pretty much 
> equivalent to someone who doesn't know programming at all) won't 
> understand it. In particular it has a number of objects in it, and 
> these are not what you start learning a language with.
>
> Most people who look at Erlang necessarily have to learn a number of 
> things that people who look at nodejs don't. You can't dumb it down as 
> much as nodejs can.
>
> The other issue would be that teaching someone to do that in Erlang 
> would be counter-productive. Do you really want to teach people to do 
> that and then tell them they're doing it wrong? I think the bigger 
> difference here is that nodejs uses a scripting language vs Erlang's 
> compiled/run in a VM language. There's simply more to do and learn 
> before you can start something. You have to compile the file. You have 
> to start the VM with the proper paths set. And so on. Since you have 
> to do all that, why not explain it properly from the beginning?
>
> That's why the Cowboy guide starts with building a release. It takes 
> about five minutes to go from nothing to your first release running a 
> hello world application. Of course that's not as fast as nodejs, but 
> we simply can't go that fast anyway. We're not a scripting language. 
> Still I think that's a pretty quick way to start.
>
> The chapter is here if you want to take a look and provide feedback: 
> http://ninenines.eu/docs/en/cowboy/HEAD/guide/getting_started/
>
> On 06/12/2014 04:54 PM, Joe Armstrong wrote:
>> Re: Garrett's great talk at EUC2014
>>
>> The point has been made many times before that
>> "There are no easy Erlang getting started guides"
>>
>> So I thought I'd take a look at Node.js.
>>
>> The node js home page (node.js) starts with a simple example
>>
>>
>> <quote>
>> var http = require('http');
>> http.createServer(function (req, res) {
>> res.writeHead(200, {'Content-Type': 'text/plain'});
>> res.end('Hello World\n');
>> }).listen(1337, '127.0.0.1');
>> console.log('Server running at http://127.0.0.1:1337/');
>>
>> To run the server, put the code into a file example.js and execute it
>> with the node program from the command line:
>>
>> % node example.js
>> Server running at http://127.0.0.1:1337/
>> </endquote>
>>
>> It's pretty easy to knock up an almost identical example in Erlang -
>> using any of the well-known web
>> servers in the background, unfortunately this has not been done, or if
>> it has been done
>> it's not easy to find the examples (or if there are examples I can't
>> find them)
>>
>> I was vaguely thinking of making some examples that are more-or-less
>> isomorphic to the
>> node.js examples and then applying small transformation steps to turn
>> then from idiomatic node.js code to idiomatic Erlang code.
>>
>> Although I could find a simple hello world example in node.js I could
>> not find a tutorial that
>> started with a simple example and then built on it in very small steps
>> adding routing, authentication,
>> database access and so on.
>>
>> Does anybody know of some examples of node.js that could be used for 
>> this.
>> Cheers
>>
>> /Joe
>>
>>
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>


-- 
In theory, there is no difference between theory and practice.
In practice, there is. .... Yogi Berra

_______________________________________________
erlang-questions mailing list
erlang-questions@REDACTED
http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140612/c75608bf/attachment.htm>


More information about the erlang-questions mailing list