Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6book, 2009-10-09

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

All times shown according to UTC.

Time Nick Message
03:05 last_ joined #perl6book
03:05 colomon_ joined #perl6book
04:20 colomon joined #perl6book
04:20 last joined #perl6book
04:46 FOAD_ joined #perl6book
06:27 FOAD_ joined #perl6book
06:46 dalek book: 5b820d8 | moritz++ | authors.pod:
06:46 dalek book: [authors.pod] description for Moritz (erm, me)
06:46 dalek book: review: http://github.com/perl6/book/commit/5b820d825bccfc5b474133605db901fb2fa879c8
09:53 Infinoid left #perl6book
10:04 FOAD_ joined #perl6book
13:10 moritz_ folks, we really need a plan
13:11 moritz_ I wanted to write a chapter about grammars, using JSON::Tiny as the leading example
13:11 moritz_ and I found that I have no idea what to explain and what not
13:11 moritz_ because we don't have a plan yet which chapter should explain what
13:22 masak joined #perl6book
13:22 masak \o/
13:23 moritz_ just commited an initial outline. Feel free to critcize, hack, bikeshed, and improve!
13:23 * masak looks
13:24 dalek book: 3567eef | moritz++ |  (2 files):
13:24 dalek book: move preface.pod to src/
13:24 dalek book: review: http://github.com/perl6/book/commit/3567eefa65feea44d3a88294b75596b1a995057c
13:24 dalek book: 80a7d80 | moritz++ | outline.pod:
13:24 dalek book: added a basic, rough outline
13:24 dalek book: review: http://github.com/perl6/book/commit/80a7d80dcbffe2361b866feecaca90cb7cf73794
13:24 masak general comment: I believe it is good to have a plan for what to bring up, and in which chapter. I also believe we should be ready to totally re-arrange that plan if needed.
13:25 moritz_ agreed
13:25 moritz_ so maybe we should declare dependencies among the chapters?
13:25 carlin joined #perl6book
13:26 masak I also have a feeling that two things stand in approximate opposite proportion: the clearness of the subdivisions between the chapters, and the naturalness of the examples.
13:26 masak in my mind, the examples take center stage, and the necessary topics fall out from that. YMMV.
13:27 jnthn oh hai
13:27 jnthn =head2 Chapter 3 - Subs and signatures, multis
13:27 jnthn =head2 Chapter 4 - Object orientation
13:28 jnthn Hmm. I only wonder about this ordering because while subs and sigs early is nice...
13:28 moritz_ it's hard to properly understand them without knowing about types
13:28 jnthn ...it's probably going to be harder to talk about multis without forward references and make good examples.
13:28 moritz_ ok
13:28 moritz_ feel free to turn around
13:28 jnthn Since we want to show how people can use it with their own types.
13:29 masak` joined #perl6book
13:29 jnthn Well no, I think subs and sigs early is nice.
13:29 jnthn As you can build upon that for methods.
13:29 masak` argh.
13:29 jnthn But multi stuff...I mean, you can't give nice things like the paper / scissor / stone without people people able to introduce their own types.
13:31 moritz_ so, what's the way out? forward references (or creating classes without much explanation)?
13:31 masak it's probably hopeless to have a totally linear order of exposition.
13:32 masak introducing things several times with increasing levels of detail might help.
13:32 jnthn moritz_: Actually, my leaning was more, talk about subs and signatures, but not dive into multiple dispatch until after we talk about OO.
13:32 masak "remember X? well, an X is really an Y on steroids, like this:"
13:32 jnthn So
13:33 jnthn Subroutines and Signatures - covers subs, sigs, can mention types but it ain't a huge deal here yet
13:33 [particle]1 joined #perl6book
13:33 masak aye.
13:33 jnthn OO - deals with classes and the stuff that goes in them, and probably non-parametric roles
13:34 masak nod.
13:34 jnthn oh no, parametrics are OK
13:34 jnthn well, debatable
13:34 jnthn And then after that a chapter like
13:34 jnthn Types and Multiple Dispatch
13:34 [particle]1 a link to the book source should be in /title
13:35 masak it all depends on the examples. talking about it before we have the examples is like trying to determine what ingredients to have in our food before deciding on the dish.
13:35 masak it's possible, but kinda abstract.
13:35 Topic for #perl6bookis now brainstorming lists: http://gist.github.com/203173 http://paste.lisp.org/display/88288 IRC logs:  http://irclog.perlgeek.de/perl6book/today  source: http://github.com/perl6/book/
13:35 jnthn Well, if the shops are closed and my fridge only has a few things in, that model is good too. ;-)
13:36 jnthn Trouble is, my fridge only tends to have beer and salsa when I hit that situation. :-/
13:36 masak :)
13:36 masak well, we're not in that situation.
13:36 masak we're starting early. we can go shopping several times if we wish.
13:37 masak five times, to be exact.
13:37 jnthn Aye.
13:38 * carlin likes the roleplaying game idea
13:38 jnthn My more serious point though is that while we want to somewhat drive it by examples, six examples that all use masses of features that we can't explain without loads of forward references is also an issue.
13:38 moritz_ well
13:39 jnthn Not to mention that I suspect a big, complex example in the first few chapters will be perhaps intimidating, which we also don't want.
13:39 moritz_ for the JSON::Tiny thing we just need *very* basic OO, *very* basic MMD, *very* basic operators, and very basic control flow
13:39 jnthn moritz_: How important is the MMD there?
13:39 moritz_ and the grammar features aren't all that intimidating either
13:39 masak I have a another example proposal (quite apart from the zany SHRDLU idea): I'm thinking of a dependency tracker. http://gist.github.com/206033
13:39 moritz_ jnthn: not at all - it's for generating the JSON (which is 20% of the code)
13:39 jnthn moritz_: oh, not quite what I wanted to ask
13:40 jnthn I meant, how does the new protoregexes influence it?
13:40 moritz_ it makes two places easier
13:41 masak moritz_: might be nice to linger for a while on that, and show both variants.
13:41 moritz_ masak: yes
13:41 masak did chromatic ever push his build tools?
13:42 moritz_ not yet
13:42 masak then I'll nudge him on that when I see him.
13:42 moritz_ I'm not sure we asked him to do that, just that he offered it
13:42 masak oh.
13:42 masak I think I said I was interested in them.
13:43 last I keep looking at http://norvig.com/sudoku.html as a potential example.
13:43 moritz_ just ask him, then :-)
13:43 masak aye.
13:43 last Norvig's Python is beatiful, but at least half of the helper functions he writes are built-ins in p6.
13:44 masak PerlJam++ asked chromatic to put the build tools in the repo. so yes, we've asked him.
13:45 moritz_ last: aye. But we should come up with examples ourselves :-)
13:45 masak curse those convenient built-ins! they take all the good examples from us. :)
13:45 * moritz_ also looked at nonograms, but thinks they are too complicated to put in a short example
13:45 last fair enough!  blog post, then....
13:46 masak moritz_: does your JSON::Tiny have tests?
13:47 masak oh, I see it does.
13:47 colomon The problem with a lot of potential examples is they have to do things people understand, so you can spend your time explaining how it works rather than what it is trying to do.
13:47 masak moritz_: what's the coverage, in your estimation?
13:48 masak colomon: excellent point.
13:48 masak that's why I don't think esoteric games are a good example.
13:48 masak Poker, on the other hand, would be excellent.
13:48 PerlJam good morning
13:48 [particle] whatever the example, it should make the code proto-aware
13:48 colomon masak: agreed.  poker is the only card game that makes sense, I think.
13:49 PerlJam I notice there's an outline in the repo now.   Are we really trying to stick with 6 chapters?
13:49 [particle] if you're making card games, you could start with blackjack
13:49 masak [particle]: "proto-aware"? as in, almost self-aware?
13:49 [particle] i think there should be as many chapters as necessary
13:49 [particle] masak: yes, like shrdlu, but internationalized :)
13:49 PerlJam [particle]: me too, but should 6 be a target minimum?
13:50 masak man, I hope I can make a case for SHRDLU. it's such a cool example. :)
13:51 colomon masak: with the graphics?
13:51 masak colomon: possibly.
13:52 masak but I'll get back to you on that after I implemented it. :)
13:52 [particle] i'd rather see a practical example than a game
13:52 [particle] but it should be something engaging and impressively cool
13:52 [particle] so games do have appeal
13:52 [particle] how about writing a c compiler :)
13:53 colomon aaaaagh!  I think I just went blind looking at the SHRDLU source code.  Lisp + all uppercase is ugly...
13:53 masak [particle]: have a go. we're waiting. :)
13:53 carlin Port Mini-C to Perl6?
13:53 colomon That's actually maybe not a bad idea.
13:53 masak colomon: aye. I looked ar it too. I don't udnerstand half of it.
13:53 colomon certainly would give the regexes a workout...
13:54 [particle] perl 6 has great power in its regex engine, and is vastly different from perl 5 there
13:54 [particle] we all know how easy it is to build compilers using perl 6 regex syntax
13:54 [particle] but maybe that is better saved for a pct book
13:54 colomon BTW, I liked the original suggestion of a symbolic algebra example.
13:55 PerlJam Maybe a game would be a good example of putting all of the techniques from earlier chapters.  Kind of like a wrapup example.
13:55 colomon [particle]: It wouldn't have to be a full C compiler to show off the regexes -- some sort of C source code analyzer would be shorter
13:55 masak colomon: the challenge with that one is knowing how to delimit it.
13:55 [particle] actually, a perl source code analyzer would be cool
13:55 masak colomon: (the symbol algebra example)
13:56 colomon masak: I believe that's the challenge with all of these...
13:56 masak [particle]: Perl 5 or Perl 6?
13:56 masak colomon: quite possibly.
13:56 moritz_ masak: yes, JSON::Tiny has tests. Coverage is very good.
13:56 [particle] p6
13:56 masak moritz_: I've looked at the tests now. I agree.
13:56 [particle] we have ppi already
13:57 [particle] for pelr 5
13:57 masak [particle]: I dare you to show me how to parse Perl 6 in Perl 6 today. I've been trying for ages.
13:57 PerlJam masak: see STD.pm  :)
13:57 masak [particle]: (it might be possible by April, though)
13:57 masak PerlJam: in Perl 6. :)
13:57 masak STD.pm is written in a complicated source filter to Perl 5.
13:58 [particle] being able to show that a particular block uses 5 lexicals, one state var, and two contextuals
13:58 PerlJam It's written in Perl 6 mostly; it's just that currently the implementation takes you through Perl 5 to do anything
13:58 masak and Perl 6 cannot yet read the output from STD.pm.
13:59 masak [particle]: remind me to hire you when my static analyzer becomes feasible.
13:59 masak PerlJam: I know, I know. but we're limited to Rakudo in the book...
13:59 [particle] i will :)
13:59 [particle] masak: rakudo should be using something STD-like by april
13:59 colomon masak: looking at the Lisp code a bit, my feeling is SHRDLU is probably too big for this purpose...
14:00 [particle] in fact, pmichaud has said he hopes to convince larry to change STD.pm to do it the rakudo way
14:00 masak colomon: aye, it's very ambitious. it parses arbitrary English.
14:00 PerlJam Sounds like a Big, Hairy, Audacious Goal to me.
14:01 masak [particle]: I don't know what that means. but Rakudo doesn't parse Perl 6 at present, in any conceivable way.
14:01 masak PerlJam: that's why it was released in '71 and then Nothing Happened.
14:02 pmichaud actually, what I said was that I hope that STD ends up adopting NQP's Cursor model.
14:02 masak I'm reading up on the Winograd academic paper now, to follow his trajectory of disillusionment.
14:02 masak pmichaud: how is STD.pm's Cursor model currently different from NQP's?
14:02 pmichaud STD.pm creates a new Cursor object for every backtracking point
14:03 masak oh.
14:03 masak costly.
14:03 pmichaud NQP's backtracking points are an array of integers
14:03 pmichaud (that are held in a Cursor object)
14:03 moritz_ anyway, I don't think a "Parsing Perl 6" example is feasible for the book, because it's still rather complex to explain the AST structure, and we don't have much time left when we can actually use STD.pm
14:04 masak nod.
14:04 pmichaud there's always abc
14:04 moritz_ I've used that too often already ;-)
14:04 masak I think symbolic algebra sits on the appropriate level of complexity.
14:05 [particle] yeah, it does.
14:05 pmichaud that's essentially what abc is/does :)
14:05 pmichaud or could do :)
14:05 masak :)
14:05 masak then we agree. :)
14:06 pmichaud abc is likely to be the first nqp-based example I write
14:06 pmichaud so it may happen soonish
14:07 colomon abc like the music format?
14:07 pmichaud oh, sorry
14:08 pmichaud abc as in "another basic calculator"
14:08 pmichaud it implements a unix "bc" equivalent
14:08 colomon ah.
14:08 moritz_ or just "a bc", if you know what bc(1) does
14:08 colomon actually, the music format might not be a bad example.
14:08 pmichaud that also
14:09 masak having at least one example which draws things might not be a bad idea.
14:09 pmichaud I always like examples using graphics
14:10 colomon http://abc.sourceforge.net/standard/abc2-draft.html
14:10 PerlJam logo  :)
14:11 masak PerlJam: yes, something in that direction. though preferably something more meaningful.
14:11 PerlJam meaningful to whom?
14:11 jnthn Graphical - you could combine it with OO and introspection stuff.
14:11 * colomon always wanted a Perl module for hacking on ABC files...
14:11 masak jnthn: indeed.
14:11 jnthn And generate class diagram.
14:11 jnthn Or something
14:11 jnthn :-)
14:12 masak PerlJam: meaningful to the reader. LOGO is more meaningful to a user than to a reader.
14:12 masak LOGO has some kind of second-degree meaningfulness to it. it's the things you can do using LOGO that are meaningful.
14:12 colomon do we have a way to do a decent interactive LOGO at the moment?
14:13 PerlJam colomon: not that I know of.
14:13 colomon Or would this take LOGO programs and convert them to SVG?
14:13 * [particle] <3 LOGO
14:13 PerlJam Does someone have SDL working on Rakudo?
14:13 [particle] i've been wanting, for a long time, something to introduce children to perl
14:14 [particle] LOGO is a great way to do that
14:16 colomon masak and moritz_ have proto modules for SVG...
14:17 masak if it were possible to run Rakudo in the browser, I'd be more positive towards a LOGO example. that'd give an easy way to combine command input and graphics. as it stands now, it's difficult.
14:17 colomon whoops, tried to answer PerlJam's SDL question with SVG info.
14:18 moritz_ SVG is bad for the book, because then you'd have to explain not only Perl 6, but also SVG
14:19 masak nod.
14:20 colomon good point.
14:26 PerlJam colomon: you should write something that parses and otherwise manipulates ABC.  Even if it doesn't make it into the book, it would make a good article elsewhere
14:27 colomon PerlJam: believe me, now that it has occurred to me, I'm probably not going to forget that one.  :)
14:27 colomon I actually meant to do it a year ago or so, but quickly got bogged down because I didn't understand the new regexes, and Rakudo was too buggy to easily learn them.
14:28 masak maybe another too-ambitious idea for a book example, but someone should really implement a Lisp in Perl 6. :)
14:28 colomon masak: doesn't that only take 20 lines of code, or something like that?  ;)
14:28 masak colomon: I don't know, I haven't tried.
14:29 [particle] it seems it's a slang
14:32 PerlJam IMHO, we don't want to fill the book with too many computer-sciencey examples since, for practicality, most people aren't modeling CS problems.  They're modeling more "real world" things.
14:33 [particle] perljam: i agree
14:33 masak nod.
14:33 masak parsing a file and summarizing it would be right up Perl's alley.
14:33 colomon Going back to the poker example -- maybe something that combines pmichaud's card code with code to deal and rank poker hands?
14:33 masak and Perl 6 can shine there, too.
14:33 masak especially if we get the -p and -n flags into Rakudo. :)
14:34 [particle] *cough*
14:34 [particle] maybe i'll dust off the old S19 work next week on vacation
14:34 masak yes, please, please. :)
14:34 [particle] or maybe i'll just enjoy disneyworld...
14:35 [particle] oh, the choices!
14:35 PerlJam [particle]: S19 implemented by April would be *really* nice :)
14:35 [particle] yes, it sure would.
14:35 masak [particle]: if you get back to S19, I promise to give a helping hand.
14:35 [particle] hugme: hug masak
14:35 * hugme hugs masak
16:23 pmurias joined #perl6book
16:24 [particle] welcome!
16:29 japhb (from backlog): The objection re: Norvig's Sudoku solver, that he has to write helper functions that we get as builtins, is not a bad thing in my mind.  Y'all have been talking a lot about explain the Big Important Concepts.  But I think sometimes it's nice to just see how easy common operations are.  That's why all of your slide decks about Perl 6 tend to have a few slides about coolness like zip and cross ....
16:31 japhb In fact, it might not be a bad idea to have an early chapter that doesn't focus on one medium-sized example, but a bunch of small ones that can serve as simple "forward references", so that when they reach the medium-sized examples, they can focus on the real point of the chapter, rather than little confusing details.
16:31 japhb Need to work people up from zero a little gently, I think.
16:32 masak aye.
16:32 japhb And also, those forward references can help the reader go "Hey, this is kinda cool, can't wait for the full chapter on this!"
16:33 masak kind of a "smorgasboard chapter"...
16:33 japhb yeah, exactly.
16:33 japhb Kinda like a prose version of one of those Perl 6 intro slide decks.
16:38 [particle] damian has a great slide deck on why perl 6 is so cool
16:38 [particle] has a wonderful list of gems
16:40 japhb As long as he isn't aiming for brain warp ...
16:40 japhb That would be the last chapter, not the first.  ;-)
16:46 pmurias the intent of the book is to be a tutorial style on or a reference one?
16:46 pmurias s/on/one/
16:47 carlin Learning by example, I think
16:47 jnthn Not reference, for sure.
16:48 pmurias so the next Programming Perl will be the reference one?
16:48 masak it's a gentle introduction to Perl 6 through a few well-chosen examples.
16:49 jnthn Also using features in Rakudo *, which the book is aimed to be published to conincide with.
16:52 masak sure, but most people don't know Perl 6 at all, so picking any features up until April will serve as an eye-opener for people.
16:53 jnthn Indeed.
16:53 jnthn The point was more than it slightly constrains some of the examples.
16:53 jnthn Though the Rakudo subset is a pretty large subset. :-)
16:55 masak oh, I hardly see the constraints any more.
16:56 masak remember, I wrote my first mid-sized application in the Rakudo of summer 2008. :)
16:56 masak anything after that is liberty.
16:59 jnthn ;-)
16:59 jnthn Wow. Did we have any features then? ;-)
17:00 moritz_ basic OO
17:00 masak no.
17:00 moritz_ without constructors
17:00 masak we had no features then.
17:00 jnthn lol
17:00 moritz_ no real lexicals
17:00 moritz_ pattern matching was broken inside the body of an if-clause
17:00 masak ouch, it's all coming back. :/
17:07 [particle] ...and have things improved? ;)
17:07 [particle] how will we look back on this time, next year?
17:07 jnthn No, we still have no features. ;-)
19:10 japhb joined #perl6book
19:10 masak joined #perl6book
19:12 masak` joined #perl6book

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