<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-6142292830567779982</id><updated>2008-11-01T20:26:36.522-07:00</updated><title type='text'>considered harmful</title><subtitle type='html'></subtitle><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default'/><link rel='alternate' type='text/html' href='http://www.brucealderman.info/harmful/'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.brucealderman.info/harmful/atom.xml'/><author><name>BruceA</name><uri>http://www.blogger.com/profile/16013588487417582411</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6142292830567779982.post-5375960262464058501</id><published>2008-10-31T23:58:00.000-07:00</published><updated>2008-11-01T20:26:36.532-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Halloween Documents'/><category scheme='http://www.blogger.com/atom/ns#' term='anniversary'/><title type='text'>halloween documents anniversary</title><summary type='text'>It's been ten years this weekend since the release of the first of the Halloween Documents. How time flies.</summary><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6142292830567779982&amp;postID=5375960262464058501' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/5375960262464058501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/5375960262464058501'/><link rel='alternate' type='text/html' href='http://www.brucealderman.info/harmful/2008/10/halloween-documents-anniversary.html' title='halloween documents anniversary'/><author><name>BruceA</name><uri>http://www.blogger.com/profile/16013588487417582411</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6142292830567779982.post-6122798674110839074</id><published>2008-09-08T21:42:00.000-07:00</published><updated>2008-09-08T21:42:29.720-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PIR'/><category scheme='http://www.blogger.com/atom/ns#' term='recursion'/><category scheme='http://www.blogger.com/atom/ns#' term='factorial'/><category scheme='http://www.blogger.com/atom/ns#' term='benchmark'/><title type='text'>pir factorials - a simple algorithm comparison</title><summary type='text'>Here are a couple algorithms to calculate factorials in PIR.

The first is a straightforward procedural algorithm:


.sub factor
    .param int n
    .local int total

    total = n
    if n == 1 goto done

loop1:
    dec n
    total = total * n
    if n &gt; 1 goto loop1
    
done:
    .return (total)
.end


The second is recursive:


.sub factor
    .param int n
    .local int total
    .local int</summary><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6142292830567779982&amp;postID=6122798674110839074' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/6122798674110839074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/6122798674110839074'/><link rel='alternate' type='text/html' href='http://www.brucealderman.info/harmful/2008/09/pir-factorials-simple-algorithm.html' title='pir factorials - a simple algorithm comparison'/><author><name>BruceA</name><uri>http://www.blogger.com/profile/16013588487417582411</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6142292830567779982.post-5682552838513951126</id><published>2008-08-12T22:15:00.000-07:00</published><updated>2008-08-12T22:19:09.818-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PIR'/><category scheme='http://www.blogger.com/atom/ns#' term='Parrot'/><title type='text'>pir file i/o</title><summary type='text'>File I/O in PIR is very simple and straightforward, just as in a high-level language. Here's a short code snippet to read from an existing file and display its contents.



.sub main
    .local string readfile
    .local string data
    .local pmc fd

    readfile  = 'read.txt'
    print 'Opening: '
    say readfile

    fd = open readfile, '&lt;'
    data = readline fd
    close fd
    say data
</summary><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6142292830567779982&amp;postID=5682552838513951126' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/5682552838513951126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/5682552838513951126'/><link rel='alternate' type='text/html' href='http://www.brucealderman.info/harmful/2008/08/pir-file-io.html' title='pir file i/o'/><author><name>BruceA</name><uri>http://www.blogger.com/profile/16013588487417582411</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6142292830567779982.post-5096072896535365354</id><published>2008-07-07T23:17:00.000-07:00</published><updated>2008-08-18T07:24:02.833-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PIR'/><category scheme='http://www.blogger.com/atom/ns#' term='Parrot'/><category scheme='http://www.blogger.com/atom/ns#' term='PMCs'/><title type='text'>parrot magic cookies</title><summary type='text'>In a statically typed language, all variables are given a type when they are created. Take these declarations in C:


int i = 4;
char c = '4';


The variables i and c are not equal, and can't interact with each other. You can't add i and c to get 8, and you can't concatenate i and c to get 44, not without some sort of explicit conversion. (Well, technically you can add or concatenate them, but </summary><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6142292830567779982&amp;postID=5096072896535365354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/5096072896535365354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/5096072896535365354'/><link rel='alternate' type='text/html' href='http://www.brucealderman.info/harmful/2008/07/parrot-magic-cookies.html' title='parrot magic cookies'/><author><name>BruceA</name><uri>http://www.blogger.com/profile/16013588487417582411</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6142292830567779982.post-5251549395169187537</id><published>2008-07-01T23:20:00.000-07:00</published><updated>2008-07-22T19:56:41.094-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PIR'/><category scheme='http://www.blogger.com/atom/ns#' term='Parrot'/><title type='text'>grokking pir</title><summary type='text'>If you're writing a compiler for the Parrot Virtual Machine, you'll need to understand Parrot Intermediate Representation (PIR). I've been slogging through the PIR documentation, and am slowly beginning to understand how it works.

PIR is not Parrot's bytecode, and it's not Parrot's assembly language. Those are PBC and PASM, respectively. PIR resembles PASM, but has some additional syntactic </summary><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6142292830567779982&amp;postID=5251549395169187537' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/5251549395169187537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/5251549395169187537'/><link rel='alternate' type='text/html' href='http://www.brucealderman.info/harmful/2008/07/grokking-pir.html' title='grokking pir'/><author><name>BruceA</name><uri>http://www.blogger.com/profile/16013588487417582411</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6142292830567779982.post-2013503717498553691</id><published>2008-06-16T21:04:00.000-07:00</published><updated>2008-06-16T21:04:22.069-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='meta'/><title type='text'>what you might see here</title><summary type='text'>I plan to use this blog to post my thoughts about my current non-work-related projects, whatever they may be at the time. Currently, I'm interested in the following:


The Parrot Virtual Machine. I'm creating a small language I call Simple Parrot Test Language (SPTL), and writing a compiler to translate SPTL to Parrot's PIR code.
The jQuery JavaScript Library. I've just started looking into this,</summary><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6142292830567779982&amp;postID=2013503717498553691' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/2013503717498553691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/2013503717498553691'/><link rel='alternate' type='text/html' href='http://www.brucealderman.info/harmful/2008/06/what-you-might-see-here.html' title='what you might see here'/><author><name>BruceA</name><uri>http://www.blogger.com/profile/16013588487417582411</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6142292830567779982.post-6862226300268876820</id><published>2008-06-15T22:40:00.000-07:00</published><updated>2008-06-15T22:42:23.197-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='welcome'/><category scheme='http://www.blogger.com/atom/ns#' term='meta'/><title type='text'>what's in a name?</title><summary type='text'>It's not every day that someone, upon starting a new blog, decides to name said blog considered harmful, even if the blog's subject is computer programming, where this phrase has been part of the lexicon since the publication of Edsger Dijsktra's seminal 1968 paper Go-to Statement Considered Harmful (pdf) in Communications of the ACM.

Considered harmful has become such an overused phrase in </summary><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=6142292830567779982&amp;postID=6862226300268876820' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/6862226300268876820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6142292830567779982/posts/default/6862226300268876820'/><link rel='alternate' type='text/html' href='http://www.brucealderman.info/harmful/2008/06/whats-in-name.html' title='what&apos;s in a name?'/><author><name>BruceA</name><uri>http://www.blogger.com/profile/16013588487417582411</uri><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>