<font face="arial" size="2"><p style="margin:0;padding:0;font-family: arial; font-size: 10pt;">Hello,</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;">> Now if one is trying to do a ground up tutorial for Erlang, and OTP, as <br />> a platform - that immediately leads to three questions:<br />> - what is the audience trying to learn?<br />> - what is the reader's state of knowledge about such things as <br />> distributed system concepts and architectures, run-time environments, <br />> platforms, and so forth?<br />> - where to start?</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;">Spot on!</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;">No laws of the universe dictate against more than one tutorial.</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;">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.</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;">All the best,</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;">Lloyd</p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;"> </p>
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;">-----Original Message-----<br />From: "Miles Fidelman" <mfidelman@meetinghouse.net><br />Sent: Thursday, June 12, 2014 11:48am<br />To: "Erlang" <erlang-questions@erlang.org><br />Subject: Re: [erlang-questions] Beginners tutorials<br /><br /></p>
<div id="SafeStyles1402589681">
<p style="margin:0;padding:0;font-family: arial; font-size: 10pt;">Doesn't it kind of depend on what the goal of a tutorial is?<br /><br />If all one is trying to do is teach straight coding in Erlang, the big <br />conceptual issue is getting one's head around a functional language. <br />For that, there's:<br />http://www.erlang.org/static/getting_started_quickly.html<br />and<br />http://learnyousomeerlang.com/content<br /><br />But, really, if all one is trying to do is get from "hello world" to <br />stand-alone code modules, that kind of misses the point of Erlang (at <br />least IMHO). It's not like one is progressing from short, simple <br />programs, to very large complicated ones - the whole point of Erlang is <br />to develop systems of actors - where the conceptual issues have a lot <br />more to do with how to structure large collections of interacting units.<br /><br />Now if one is trying to do a ground up tutorial for Erlang, and OTP, as <br />a platform - that immediately leads to three questions:<br />- what is the audience trying to learn?<br />- what is the reader's state of knowledge about such things as <br />distributed system concepts and architectures, run-time environments, <br />platforms, and so forth?<br />- where to start?<br />- and maybe, whether to proceed with a bottom-up incremental approach to <br />system building, or a top-down architectural approach<br /><br />In fact, if anything, rather than a bottom-up tutorial, what might be <br />really useful is a top-down tutorial - more along the lines of learning <br />Linux for the first time. Rather than starting with echo "Hello <br />World!" a tutorial is more along the lines of:<br />- insert liveCD into slot, and boot<br />- log in<br />- list some files<br />- create a file, display it, examine its properties,<br />- examine directory structures and file types (including device types)<br />- examine the processes running, manipulate them<br />- examine environment variables, paths, etc.<br />- create and manipulate some shells<br />- download, unpack, and install some packages<br />- and so forth<br /><br />For Erlang, the equivalent might start with:<br />- install Erlang<br />- start a node<br />- use the various run-time tools to start examining what's running<br />- write, compile, load, run a simple 2-actor ping-pong application; <br />examine it's behavior with the various run-time tools<br />- start up another node<br />- modify ping-pong to run across nodes; examine its run-time behavior<br />- play with some of the packaging/installation/distribution tools<br />- from there, I think we're getting into areas that are more complex <br />than it makes sense to address in a tutorial - more like the ground that <br />"Erlang and OTP in Action" covers pretty well<br /><br />Just my two cents,<br /><br />Miles Fidelman<br /><br /><br /><br />Loïc Hoguin wrote:<br />> The simple nodejs example works because it's a nodejs example and not <br />> a Javascript example. Someone who doesn't know Javascript (pretty much <br />> equivalent to someone who doesn't know programming at all) won't <br />> understand it. In particular it has a number of objects in it, and <br />> these are not what you start learning a language with.<br />><br />> Most people who look at Erlang necessarily have to learn a number of <br />> things that people who look at nodejs don't. You can't dumb it down as <br />> much as nodejs can.<br />><br />> The other issue would be that teaching someone to do that in Erlang <br />> would be counter-productive. Do you really want to teach people to do <br />> that and then tell them they're doing it wrong? I think the bigger <br />> difference here is that nodejs uses a scripting language vs Erlang's <br />> compiled/run in a VM language. There's simply more to do and learn <br />> before you can start something. You have to compile the file. You have <br />> to start the VM with the proper paths set. And so on. Since you have <br />> to do all that, why not explain it properly from the beginning?<br />><br />> That's why the Cowboy guide starts with building a release. It takes <br />> about five minutes to go from nothing to your first release running a <br />> hello world application. Of course that's not as fast as nodejs, but <br />> we simply can't go that fast anyway. We're not a scripting language. <br />> Still I think that's a pretty quick way to start.<br />><br />> The chapter is here if you want to take a look and provide feedback: <br />> http://ninenines.eu/docs/en/cowboy/HEAD/guide/getting_started/<br />><br />> On 06/12/2014 04:54 PM, Joe Armstrong wrote:<br />>> Re: Garrett's great talk at EUC2014<br />>><br />>> The point has been made many times before that<br />>> "There are no easy Erlang getting started guides"<br />>><br />>> So I thought I'd take a look at Node.js.<br />>><br />>> The node js home page (node.js) starts with a simple example<br />>><br />>><br />>> <quote><br />>> var http = require('http');<br />>> http.createServer(function (req, res) {<br />>> res.writeHead(200, {'Content-Type': 'text/plain'});<br />>> res.end('Hello World\n');<br />>> }).listen(1337, '127.0.0.1');<br />>> console.log('Server running at http://127.0.0.1:1337/');<br />>><br />>> To run the server, put the code into a file example.js and execute it<br />>> with the node program from the command line:<br />>><br />>> % node example.js<br />>> Server running at http://127.0.0.1:1337/<br />>> </endquote><br />>><br />>> It's pretty easy to knock up an almost identical example in Erlang -<br />>> using any of the well-known web<br />>> servers in the background, unfortunately this has not been done, or if<br />>> it has been done<br />>> it's not easy to find the examples (or if there are examples I can't<br />>> find them)<br />>><br />>> I was vaguely thinking of making some examples that are more-or-less<br />>> isomorphic to the<br />>> node.js examples and then applying small transformation steps to turn<br />>> then from idiomatic node.js code to idiomatic Erlang code.<br />>><br />>> Although I could find a simple hello world example in node.js I could<br />>> not find a tutorial that<br />>> started with a simple example and then built on it in very small steps<br />>> adding routing, authentication,<br />>> database access and so on.<br />>><br />>> Does anybody know of some examples of node.js that could be used for <br />>> this.<br />>> Cheers<br />>><br />>> /Joe<br />>><br />>><br />>><br />>> _______________________________________________<br />>> erlang-questions mailing list<br />>> erlang-questions@erlang.org<br />>> http://erlang.org/mailman/listinfo/erlang-questions<br />>><br />><br /><br /><br />-- <br />In theory, there is no difference between theory and practice.<br />In practice, there is. .... Yogi Berra<br /><br />_______________________________________________<br />erlang-questions mailing list<br />erlang-questions@erlang.org<br />http://erlang.org/mailman/listinfo/erlang-questions</p>
</div></font>