Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6book, 2010-06-05

| Channels | #perl6book index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:46 dalek book: 07fd0ad | chromatic++ | src/subs-n-sigs.pod:
00:46 dalek book: Edited chapter, leaving a couple of author notes.
00:46 dalek book: review: http://github.com/perl6/book/commit/07fd0ad803fd1827c6efe6ad1a87c7332cc63129
03:48 dalek book: b3a2e1c | util++ | src/roles.pod:
03:48 dalek book: Fixed two bad POD keywords for programlisting sections - s/=being/=begin/
03:48 dalek book: review: http://github.com/perl6/book/commit/b3a2e1c3c75278fc3634025ee9c7a0ca4f431d4d
03:54 dalek book: 190bf45 | util++ | src/subs-n-sigs.pod:
03:54 dalek book: Fixed missing closing brace in code example
03:54 dalek book: review: http://github.com/perl6/book/commit/190bf4541bb9f1877ed7685e527d7d0ae1824895
04:06 dalek book: 288b3d2 | util++ | src/subs-n-sigs.pod:
04:06 dalek book: Changed approximation of "e" to exact value in code example
04:06 dalek book: review: http://github.com/perl6/book/commit/288b3d24db964898bcf8c76b7f554700e5db098b
05:07 dalek book: 9eacc6b | util++ | README:
05:07 dalek book: Fixed typo in distro name - s/Ununtu/Ubuntu/
05:07 dalek book: review: http://github.com/perl6/book/commit/9eacc6b85528a11d73eef8fb1470ed679d444f51
05:07 dalek book: c88e280 | util++ | src/subs-n-sigs.pod:
05:07 dalek book: Fixed missing ";" in code example
05:07 dalek book: review: http://github.com/perl6/book/commit/c88e2809bf7a67966e5682af7c3c29199e1310be
05:09 eternaleye joined #perl6book
14:23 Util joined #perl6book
14:26 dalek book: 001c38c | util++ | src/multi-dispatch.pod:
14:26 dalek book: [mmd] Fixed syntax by adding "multi" to example
14:26 dalek book: review: http://github.com/perl6/book/commit/001c38c25cc07bbcd5ddc57bad674dd7a80c945b
15:09 shamu joined #perl6book
15:15 shamu anyone out there?
15:16 shamu had a question about the intended audience for the book; http://irclog.perlgeek.de/perl6book/2009-10-07 answers much of my questions, and brings up a couple others
15:18 shamu someone mentioned junior programmer; should it be someone who already knows perl, already knows another dynamic language, already knows c?
15:27 moritz_ already knows a programming language
15:27 moritz_ dynamic language is helpful, but not a must
15:27 moritz_ (oh, we should mentioni garbage collection at some point)
15:37 shamu It also says its supposed to be example-based; is that still the case, so it's a tutorial by examples, or will it attempt to fill in/refresh understanding of the programming concepts it reimplements?
15:37 shamu hold on, I'll find an example
15:39 shamu 'scores' is a string literal. A string is a piece of text, a sequence of characters. In this line, it's the
15:39 shamu argument provided to open. If you prefer C-style notation, you can write instead open('scores').
15:39 shamu my @names = $file.get.split(' ');
15:40 shamu and before that:
15:40 shamu A variable name begins with a sigil, which is a non-word character such as $, @, %, or &or occasionally
15:40 shamu the double colon ::. The sigils usually restrict the variable to some particular type. After the sigil
15:41 shamu argh, sorry -- start at 'a variable name begins with a sigil', then read all that, then:
15:41 shamu The built-in function open opens a file, here named scores, and returns an object representing that
15:41 shamu file, a file handle. The equality sign = assigns that file handle to the variable on the left, which
15:41 shamu means that $file now stores the file handle.
15:42 shamu there's no indication there that $ indicates a scalar -- or further on, since it says that you can store anything there (even arrays), what it does indicate
15:44 shamu so my guess is that you want more verbiage in there describing that the $ indicates a scalar, that a scalar holds one value, and maybe that that was historically true in perl but has been extended beyond that
15:46 p6eval joined #perl6book
15:46 shamu an existing perl5 programmer will find this familiar, but I'm wondering what the targeted level of the book is to indicate how much to fill in -- perhaps to draw analogies to other languages (such as a string in python or varchar in visual basic)
15:47 shamu or to explain 'scalar' from the basics (its a variable, and is intended to contain an integer or string, etc)
15:47 shamu I'm asking because I wanted to print out a copy of the book and add some edits and maybe some patches, so I wanted to know if edits are useful and/or what level to target any new content at
15:51 shamu and also whether to follow a tutorial style which focuses on the language syntax, or something that centers around detailed examples including design choices, or more referencey (from the log, it seemed we dont want the latter, but I'm guessing one is needed)
15:54 shamu oh, and who are the big active contributors to the book currently?
15:56 shamu dang, drove him away
15:59 * Util is here; backscrolling...
16:07 Util shamu: re: big active contributors
16:07 Util Title page reads: Jonathan S. Duff, Moritz Lenz, Carl M�sak, Patrick R. Michaud, Jonathan Worthington
16:07 Util Running `git log --pretty=format:'%an' | sort | uniq -c | sort -nr` shows lots of (content) commits by: Moritz Lenz, Carl Masak, Jonathan Scott Duff, Jonathan Worthington
16:08 Util Original commit by: pmichaud
16:08 Util Lots of edits by: Matt Kraai, chromatic, Bruce Gray (Util)
16:08 moritz_ re
16:08 Util Others contributors, I have not checked; might have contributed a major section?
16:08 moritz_ Util: the author's list is still very preliminary
16:10 moritz_ shamu: sorry, been away for a while...
16:10 moritz_ shamu: yes, scalar and $ needs more explanation
16:10 Util moritz_: Good; I hope to be added to it! I wrote an extensive outline for the subs chapter months ago, then my git-fu was weak, and it was invisible to the other authors :(
16:10 moritz_ however I don't know how to phrase it well. Saying that a scalar can hold one value is quite misleading in Perl 6
16:11 shamu np
16:11 shamu oh right, I can check that
16:11 moritz_ especially since we don't follow the "a [ ... ] is a reference pointing to an array" meme anymore
16:12 moritz_ and yes, we still try to follow the Example - Explanation - Extension pattern
16:12 p6eval joined #perl6book
16:13 shamu *exactly* -- that's a subtlety that's introduced in perl5 (sigil $ indicates one, whether from scalar or single array elt) to perl6 ( sigil sticks with the variable, so now even $ can be a deep data structure and indexed directly via [] or {})
16:13 shamu and both of those subtleties are lost on someone coming from a bare language (pretty much anything but php or basic)
16:14 p6eval joined #perl6book
16:14 moritz_ the real difference between $ and @ in Perl 6 is that in list context, $ variables produce one value
16:14 shamu in the example - explanation - extension context, then, I'd think one would want to:
16:14 shamu Saying that a scalar can hold one value is quite misleading in Perl 6
16:15 shamu lie about that to further the central purpose of the example, with a footnote saying 'its not really so, but think about it this way for now'
16:15 moritz_ good place for a footnote!
16:16 shamu yes -- exactly -- I saw that trying to make it an accurate tutorial describing the language features as they are (textbook, class-like) vs example (goal-directed) comes up with these kinds of conflicts, and I wanted to know which way to go, and you're saying it's go for the purpose of the example, right?
16:17 Util My wife was a phrase for "its not really so, but good enough depiction for now" from AIDS lecturing: "This is the `cartoon` version of..."
16:17 Util s/was/has/
16:18 moritz_ oh, src/subs-n-sigs.pod has ":A scalar (the C<$> sigil) implies no constraints.  Anything may bind to it, ..."
16:18 shamu gotcha.
16:19 moritz_ but it should be in chapter one in some form
16:19 shamu how about saying a scalar is a scalar in the example, but referring forward to that: 'footnote: not really true, cf <sub section>'
16:23 moritz_ The C<$> sigil indicates a I<scalar> variable, which indicates
16:23 moritz_ that the variable stores a single value N<However, this single value
16:23 moritz_ can still be a compound object like an array or a hash. When you iterate over
16:23 moritz_ a C<$>-sigiled variable, it is interpreted as a single value, even it does
16:23 moritz_ store an array>.
16:24 moritz_ is that sufficiently non-confusing?
16:26 shamu it's sufficiently precise from a description of the implementation; but this is a perfect case of me wanting to know, relative to the context of the book, how much 'why' to put in.  I think there are historical and other design decisions about why you have a $ as a visual indicator of scalar, yet allow it to semantically mean an array
16:26 moritz_ shamu: I think "why" is good, as long as it's not focused on "why, in contrast to Perl 5"
16:26 moritz_ because we don't assume perl 5 knowledge
16:27 moritz_ that's what http://perlgeek.de/en/article/5-to-6 is about (and might be a different book at some point)
16:27 shamu ah ok
16:28 shamu ok, so 'why' is good as long as one can describe it in the context of perl 6 design decisions.
16:28 moritz_ right
16:29 Util thoughts on refinement of that particular text:
16:29 Util The C<$> sigil indicates a I<scalar> variable, which indicates that the variable stores a single value
16:29 Util N<However, this value can be a sort of I<reference> to a multi-value object (such as an array). More on such references in chapter XXX.>
16:29 moritz_ Util: that's perl 5 think
16:29 moritz_ Util: and doesn't make much sense, when dereferncing is implicit
16:31 shamu great -- how do you explain the 'why', from the perspective of a junior programmer, solely in perl 6 design decisions that a coder can burn into their brain in a way that makes sense, why you have a visual indicator for something called a scalar, which also can mean multiple things -- maybe an analogy to visual basic's 'variant' type?
16:32 shamu I'm not trying to bash on you, just want a guideline for how much detail to go into for this kind of stuff, and how much you'd feel its ok for me to gloss over/punt, when describing a worked example
16:32 shamu if I contribute stuff, which I'd like to
16:32 Util moritz_: I must have missed the meeting where the thinking changed from "implicit dereferencing is a convenience to the programmer" to "scalars really *are* compound objects sometimes". If you (or anyone) could provide a pointer to such a discussion, it would help me not try to contribute text based on older Perl6 concepts. TIA
16:34 moritz_ shamu: I think it doesn't make sense to explain the "why" of $ and @ in-depth so early in the book...
16:34 shamu also, is it cool to cross-reference other documentation, and if so, what other ones can we refer to?
16:35 shamu good, so err on glossing over in favor of the example
16:36 moritz_ shamu: in the first chapter I'd just say something along the lines of "while you can store arrays in scalar variables, it really makes more sense to use the @ sigil, becuase it gives you some kind of type safety"
16:36 shamu in that context, I'd just say that it stores one value such as a string, filehandle, or number, and punt the entire rest to point to a data types reference/tutorial section
16:36 shamu should I even bother mentioning this, if the example doesn't do that?
16:36 moritz_ Util: I'll try to find such a discussion, but I'm afraid most of these are not coherent for the casual reader, or even understandable :(
16:38 moritz_ shamu: that might be better than my approach
16:38 shamu I'd much rather footnote 'advanced/other/special uses of scalar variable can store other items; cf <some reference>' and leave at at that for the purpose of getting through the example
16:38 shamu oh ok
16:39 shamu Well, if you're disposed to not dogmatically reject changes like that, I'm willing to try to contribute and reshape prose that has some chance of being accepted
16:39 shamu I've wanted to contribute for a while,  but other factors made it difficult.  Now I'll give it a shot.
16:40 shamu thanks for responding!
16:40 Util moritz_: thanks! I am actually not a casual reader; I just look that way online :)
16:40 shamu oh and I'd like to meet some of the authors at yapc; know who's going?
16:40 moritz_ shamu: I try hard not to reject stuff... even if some patch goes against the idea of the book, it usually points to some deficit that needs tackling
16:41 moritz_ no idea
16:41 * Util will see shamu at YAPC again.
16:42 moritz_ \o/
16:42 * shamu considers this eeeexcellent
16:43 shamu ah, that's key; thank you very much for that elaboration
16:43 moritz_ I'm afraid my budget is too limited this year, for both YAPC::NA and ::EU
16:43 shamu where are you located?
16:43 moritz_ shamu: do you have a github ID?
16:43 moritz_ germany
16:43 moritz_ car broke down; need to buy a (mostly) new one
16:44 moritz_ shamu: I've pushed the first version about scalars; feel free to improve
16:44 shamu 'krishnoid'
16:44 moritz_ hugme: add krishnoid to book
16:44 * hugme hugs krishnoid. Welcome to book!
16:44 moritz_ there you go
16:45 dalek book: 38d3aa9 | moritz++ | src/basics.pod:
16:45 dalek book: [basics] talk more about scalars
16:45 dalek book: shamu++ for proposing it, and Util++ for discussion
16:45 dalek book: Also remove a notice from chromatic++ which we follow now;
16:45 dalek book: Add a footnote for the Perl 5 programmer about sigil invariance
16:45 dalek book: review: http://github.com/perl6/book/commit/38d3aa9ed0176ed45e938fcec51bfbf54f378d3a
16:45 shamu wow, ok.  Not sure how much I can commit to ahead of time, but with that last note about why you don't try to reject stuff, I will try to contribute
16:46 shamu and ... off to breakfast
16:48 moritz_ Util: http://irclog.perlgeek.de/search.pl?channel=perl6&amp;nick=TimToady&amp;q=reference shows that the official stance is "everything is a reference", so it doesn't really make sense to say that my $a = [1, 2, 3] stores a reference, while @a = (1, 2, 3); does not
16:48 moritz_ (which I mess up from time to time)
16:51 moritz_ and maybe interesting in this respect is that whether things interpolate (both in strings and in list/slice context) is a syntactic question, not of references
16:51 moritz_ but I have a hard time finding a discussion about it
16:53 Util moritz_: thanks! I need to give some thought as to where "references" would fit in a pure-Perl6-from-scratch training class, since they still have an important conceptual place once you get to multi-level data structures (and probably before that place, somewhere)
16:53 moritz_ Util: that's right...
16:53 moritz_ Util: it's weird that you basically need to understand references, but we try not to talk about them explicitly
16:54 shamu breakfast was delayed briefly
16:54 moritz_ one reason for avoiding the discussion is that it's a rather complicated topic in Perl 6
16:55 shamu my 2c is that a description of references has to exist, but where to put it maybe can be decided later -- possibly to fit in a basic whys-of-design or underlying technology discussion
16:55 moritz_ and it's hard to for me to give a "close enough" description without fully grokking them
16:55 moritz_ we should have more of those discussions
16:55 moritz_ maybe with some special markup
16:56 moritz_ indicating "if you're already confused, skip this section on first reading"
16:56 moritz_ :-)
16:56 shamu ah -- one suggestion is to try to tell it more narratively rather than factually
16:57 shamu it might help with the understanding for some, then others have actual english phrases they can hang concepts on and get them fleshed out through more extensive reference material, once it becomes available
16:57 Util shamu: I see pmichaud and chromatic are attending YAPC, but no other perl6book people are pre-registered.
16:58 shamu thanks for checking; I look forward to seeing you and the others
16:58 moritz_ shamu: picking up your previous question about linking to other docs... providing links to synopsis and other pages that have proofed to be long living
16:58 moritz_ ... is certainly a good idea
16:58 shamu ok cool
17:00 shamu Thank you very much for the info.
17:00 moritz_ thank you for the discussion
17:02 Util taking details that are just "clutter" at one stage of learning, and explicitly *deferring* their discussion until later, is a useful technique. By using a footnote to say "this is not the full story", you reduce confusion in those who already know something about the deferred detail, and subtly whet the appetite of the beginner, without coming across as a liar later.
17:02 Util s/liar/disorganized author/
17:03 moritz_ (problem is: we are disorganized authors)
17:03 dalek book: ef42d30 | moritz++ | src/subs-n-sigs.pod:
17:03 dalek book: [subs] incorporate some cleanup by chromatic++
17:03 dalek book: review: http://github.com/perl6/book/commit/ef42d30386082197dad87864636c58a96a887a9d
17:07 Util moritz_: too true. A coherent voice is important, but printed (and accurate) knowledge-on-paper is even more imporatant at this stage in the Rakudo game (Rakudo Star release / major conference time).
17:36 cognominal joined #perl6book
20:45 eternaleye joined #perl6book

| Channels | #perl6book index | Today | | Search | Google Search | Plain-Text | summary