
Journal Journal: Poetry in Programming.
I had a thought a few days ago that will probably be derided as inane but, so what, I need to get it out of my head.
I thought it would be a Neet Idea (tm) to write poetry using programming syntax. Now, Lisp probably wouldn't do, but c-like syntaxes should be pretty good.
Poetry is all about structure and clever word-play. At least it is to me. My favorite poems all contain a certain element of surprise or metaphorical 'hidden-ness'. A poet has something to say, but unlike a novelist or essayist, the poet makes things harder on himself by enforcing, among other things, meter and rhyming patterns.
e.e. cummings played with structure qute a bit, look at the poem 'Grasshopper' for what I mean. (Gosh, I HOPE it was e.e. cummings who wrote that poem)
C++ has some very interesting possibilities for creating poetry. One is through the reading of the source code. This would be a non-compilable file written in C++ that when READ is found to be poetry.
A MUCH harder excersize would be to create C++ poetry that actually COMPILES into an executable, which should output something related to what the poetry of the source code.
A simple example would be something like this:
main() {
NOTHING = 0;
YOU = 100000;
for (I=NOTHING; I < YOU; I++) {
cout << "I Love You!";
}
}
a simple program, with a very nice (if rather pithy) meaning... For I am Nothing but loving you improves me.
Poetry flows. C++ is all about flow. Executions happen one after the other until something occurs to terminate the program. C++ allows you to do things like define functions, instructions that are given in a different portion of a file (or even in a different file alltogether!). C++ doesn't read like english does, and that is the whole point! You can direct the reader to wherever you want him to go, you can break up his train of thought or force him to go into endless loops. You can even make your poetry INTERACTIVE by giving readers a choice of options to follow, as in this simple case statement fragment:
case (she_loves_me) {
case 1:
kiss_the_girl(boy, girl);
case 0:
find_another_girl(boy, car, bar);
default:
crusing_with_da_boys(buddies, beer, beach);
}
If the reader thinks that the girl loves the boy, then they should head to the function kiss_the_girl(istream& Girl, istream& Boy)
and read along from that point, returning to the main execution code when done.
I thought it would be a Neet Idea (tm) to write poetry using programming syntax. Now, Lisp probably wouldn't do, but c-like syntaxes should be pretty good.
Poetry is all about structure and clever word-play. At least it is to me. My favorite poems all contain a certain element of surprise or metaphorical 'hidden-ness'. A poet has something to say, but unlike a novelist or essayist, the poet makes things harder on himself by enforcing, among other things, meter and rhyming patterns.
e.e. cummings played with structure qute a bit, look at the poem 'Grasshopper' for what I mean. (Gosh, I HOPE it was e.e. cummings who wrote that poem)
C++ has some very interesting possibilities for creating poetry. One is through the reading of the source code. This would be a non-compilable file written in C++ that when READ is found to be poetry.
A MUCH harder excersize would be to create C++ poetry that actually COMPILES into an executable, which should output something related to what the poetry of the source code.
A simple example would be something like this:
main() {
NOTHING = 0;
YOU = 100000;
for (I=NOTHING; I < YOU; I++) {
cout << "I Love You!";
}
}
a simple program, with a very nice (if rather pithy) meaning... For I am Nothing but loving you improves me.
Poetry flows. C++ is all about flow. Executions happen one after the other until something occurs to terminate the program. C++ allows you to do things like define functions, instructions that are given in a different portion of a file (or even in a different file alltogether!). C++ doesn't read like english does, and that is the whole point! You can direct the reader to wherever you want him to go, you can break up his train of thought or force him to go into endless loops. You can even make your poetry INTERACTIVE by giving readers a choice of options to follow, as in this simple case statement fragment:
case (she_loves_me) {
case 1:
kiss_the_girl(boy, girl);
case 0:
find_another_girl(boy, car, bar);
default:
crusing_with_da_boys(buddies, beer, beach);
}
If the reader thinks that the girl loves the boy, then they should head to the function kiss_the_girl(istream& Girl, istream& Boy)
and read along from that point, returning to the main execution code when done.