Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Another update: "Exploring Programming Language Architecture in Perl"

by billh (Pilgrim)
on Nov 15, 2006 at 06:12 UTC ( [id://584105]=perlmeditation: print w/replies, xml ) Need Help??

Hello again,
See http://billhails.net/Book.
It's been a few weeks since my last update. Slow but steady progress: I've finished the continuations chapter and added another short one on how to use continuations to implement threads. The pdf is in much better shape, I've abandoned the PostScript, and I've included links to complete source code for each version of the interpreter.
But, mwahahaha, you'll have to read the book to find the links :-)
Please read, and especially, please comment because I'm desparate for feedback. The whole text lacks any editorial input at the moment, so I have no-one to blame but myself for any and all mistakes.
See also: Book update: "Exploring Programming Language Architecture in Perl", RFC: more of that almost-book and RFC: Almost a Book
Bill H
perl -e 'print sub { "Hello @{[shift]}!\n" }->("World")'

Replies are listed 'Best First'.
Re: Another update: "Exploring Programming Language Architecture in Perl"
by BrowserUk (Patriarch) on Nov 15, 2006 at 07:32 UTC

    I applaud you for chapter 13. That's the most cogent explanation of continuations and CPS I read. And I've read several.

    In terms of feedback. I think you might reconsider the decision in the final paragraph of 13.2:

    This time I haven't bothered to perform all of the possible tail call optimizations,

    I think you leave your point unfinished by not showing the full conversion at that point. The first thing I did was attempt to complete the example. It may be that you see that as a good learning experience for the reader, but it took me a couple of attempts to get it right and when what I thought should work didn't after the first couple of attempts, it diluted the wow factor of the chapter to that point.

    It left me with the antsy feeling that you avoided showing it because you felt that the full conversion might look too complicated at that stage of the chapter?


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Thanks for your input.
      You're right, the main reason I didn't complete all of the tco's was so as not to unnecessarily clutter an already complex example. I'll take what you've said on board though, and provide a completely optimized version in addition.
      Bill H
      perl -e 'print sub { "Hello @{[shift]}!\n" }->("World")'
Re: Another update: "Exploring Programming Language Architecture in Perl"
by diotalevi (Canon) on Nov 17, 2006 at 20:58 UTC
      Cool! I've not had much of a chance to experiment, and I'm no expert on perl internals, but B::Utils looks like it might be perfect for doing implicit tail-call optimization at the very least, maybe even automated CPS transforms.
      Bill H
      perl -e 'print sub { "Hello @{[shift]}!\n" }->("World")'

        Well... B::Utils is just a readonly interface. The XPath interface is even better. If you don't do XPath yet, you deserve to teach it to yourself right now. You can only change things once you use B::Generate.

        ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Re: Another update: "Exploring Programming Language Architecture in Perl"
by duff (Parson) on Nov 15, 2006 at 18:51 UTC

    billh++ Based solely on what BrowserUk said, I went and read Chapter 13 and I have to agree--very well explained.

Re: Another update: "Exploring Programming Language Architecture in Perl"
by educated_foo (Vicar) on Nov 17, 2006 at 04:24 UTC
    I know this is a terrible nit to pick, but could you please go through the whole text reading "it's" as "it is", and "its" as "belonging to it", and correct the uses of "its" and "it's"?
      Heh! :-)
      Exactly the sort of editorial help I need.
      I've actually bought a copy of "Eats, Shoots and Leaves", I guess I should probably read it :-)
      Update I've made the changes locally. They'll be visible on the next update.
      Bill H
      perl -e 'print sub { "Hello @{[shift]}!\n" }->("World")'

        The best book I know of for this kind of advice is the venerable Strunk and White classic Elements of Style.


        TGI says moo

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://584105]
Approved by GrandFather
Front-paged by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2024-03-28 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found