Thread overview
Compile-time perversions on WWWEP
Dec 07, 2006
Stewart Gordon
Dec 08, 2006
BCS
Dec 08, 2006
clayasaurus
Dec 08, 2006
Frits van Bommel
Dec 08, 2006
Don Clugston
Dec 09, 2006
Stewart Gordon
Dec 09, 2006
Don Clugston
Dec 10, 2006
Stewart Gordon
Dec 08, 2006
John S. Skogtvedt
December 07, 2006
A few of you may have already seen WWWEP, through the occasional threads here about quines or otherwise.  Now there's a new section on compile-time perversions like the kind we've talked about here.

http://smjg.port5.com/wwwep/ctp/

You'll notice that most of them are by no means new ideas, but the code is 100% my work.

Stewart.
December 08, 2006
Stewart Gordon wrote:
> A few of you may have already seen WWWEP, through the occasional threads here about quines or otherwise.  Now there's a new section on compile-time perversions like the kind we've talked about here.
> 
> http://smjg.port5.com/wwwep/ctp/
> 
> You'll notice that most of them are by no means new ideas, but the code is 100% my work.
> 
> Stewart.

Somewhere somebody has a compile time ray tracer!

think:
dmd -c -o- somefile.d > image.ppm
open image.ppm in viewer of your choice
December 08, 2006
Stewart Gordon wrote:
> http://smjg.port5.com/wwwep/ctp/

Seems to be down :(.
December 08, 2006
Stewart Gordon wrote:
> A few of you may have already seen WWWEP, through the occasional threads here about quines or otherwise.  Now there's a new section on compile-time perversions like the kind we've talked about here.
> 
> http://smjg.port5.com/wwwep/ctp/
> 
> You'll notice that most of them are by no means new ideas, but the code is 100% my work.
> 
> Stewart.

The '99 bottles of beer' song is incorrect. The last six lines should read:
---
Take one down and pass it around,
no more bottles of beer on the wall.

No more bottles of beer on the wall,
no more bottles of beer.
Go to the store and buy some more,
99 bottles of beer on the wall.
---

Note that on the 99 bottles of beer website, the C preprocessor version is incorrect, too (it gets the second last verse wrong).
December 08, 2006
Stewart Gordon skrev:
> A few of you may have already seen WWWEP, through the occasional threads here about quines or otherwise.  Now there's a new section on compile-time perversions like the kind we've talked about here.
> 
> http://smjg.port5.com/wwwep/ctp/
> 
> You'll notice that most of them are by no means new ideas, but the code is 100% my work.
> 
> Stewart.

Just to mention another example of compile-time perversions, a month ago I posted a brainfuck (http://en.wikipedia.org/wiki/Brainfuck) "compiler" using D templates (each BF command is expanded into a function call).

If anyone is interested do a search for "brainf..." in D.learn or see
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=5158

(I later changed it so it would work with larger BF programs as well, I got a huge mandelbrot program to run 1-2 seconds slower than the translated-into-C-and-compiled version. The compilation was very slow and used lots of memory though.)
December 08, 2006
BCS wrote:
> Stewart Gordon wrote:
>> A few of you may have already seen WWWEP, through the occasional threads here about quines or otherwise.  Now there's a new section on compile-time perversions like the kind we've talked about here.
>>
>> http://smjg.port5.com/wwwep/ctp/
>>
>> You'll notice that most of them are by no means new ideas, but the code is 100% my work.
>>
>> Stewart.
> 
> Somewhere somebody has a compile time ray tracer!
> 
> think:
> dmd -c -o- somefile.d > image.ppm
> open image.ppm in viewer of your choice

You mean h3r3tic's ctrace?

http://www-users.mat.uni.torun.pl/~h3r3tic/ctrace/
December 09, 2006
Don Clugston wrote:
<snip>
> The '99 bottles of beer' song is incorrect. The last six lines should read:
> ---
> Take one down and pass it around,
> no more bottles of beer on the wall.
> 
> No more bottles of beer on the wall,
> no more bottles of beer.
> Go to the store and buy some more,
> 99 bottles of beer on the wall.
> ---

As with many playground songs (if that's the right term), there are a number of versions in circulation.  See also

http://en.wikipedia.org/wiki/99_Bottles_of_Beer

Are you assuming yours is the only correct one because it's on the front page of the 99 bottles website, or have you other evidence?

In my collection I have a Befunge version with " no more beer..." as the last line.  I'm not sure where I got it from....

> Note that on the 99 bottles of beer website, the C preprocessor version is incorrect, too (it gets the second last verse wrong).

It took me a moment to figure what you were supposed to do with the first of these.  DMC doesn't appear to have an option to do just the preprocessing.  Borland cpp32 (version 5.2) works, but generates loads of blank lines.  But I can't at the moment see what you're claiming is wrong with it.

Stewart.
December 09, 2006
Stewart Gordon wrote:
> Don Clugston wrote:
> <snip>
>> The '99 bottles of beer' song is incorrect. The last six lines should read:
>> ---
>> Take one down and pass it around,
>> no more bottles of beer on the wall.
>>
>> No more bottles of beer on the wall,
>> no more bottles of beer.
>> Go to the store and buy some more,
>> 99 bottles of beer on the wall.
>> ---
> 
> As with many playground songs (if that's the right term), there are a number of versions in circulation.  See also
> 
> http://en.wikipedia.org/wiki/99_Bottles_of_Beer
> 
> Are you assuming yours is the only correct one because it's on the front page of the 99 bottles website, or have you other evidence?

No, I don't. Just the "lyrics" page on the website. The version you're using is much simpler than that one. Though "history" page refers to the  simple version.

> In my collection I have a Befunge version with " no more beer..." as the last line.  I'm not sure where I got it from....
> 
>> Note that on the 99 bottles of beer website, the C preprocessor version is incorrect, too (it gets the second last verse wrong).
> 
> It took me a moment to figure what you were supposed to do with the first of these.  DMC doesn't appear to have an option to do just the preprocessing.  Borland cpp32 (version 5.2) works, but generates loads of blank lines.  But I can't at the moment see what you're claiming is wrong with it.

I don't remember now. I think it's the capitalisation (there should be one instance of "no more" and two of "No more").

> 
> Stewart.
December 10, 2006
Don Clugston wrote:
> Stewart Gordon wrote:
<snip>
>> It took me a moment to figure what you were supposed to do with the first of these.  DMC doesn't appear to have an option to do just the preprocessing.  Borland cpp32 (version 5.2) works, but generates loads of blank lines.  But I can't at the moment see what you're claiming is wrong with it.
> 
> I don't remember now. I think it's the capitalisation (there should be one instance of "no more" and two of "No more").

Normally when writing poetry or song lyrics, the beginning of every line is capitalised.  So in the way it's usually written - four lines per verse - they would all be "No more".  OTOH

http://www.99-bottles-of-beer.net/lyrics.html

compresses each verse into two lines, and so has "No more" once and "no more" twice.

But if any versions are wrong, surely it's those written by lazy programmers to write

2 bottle(s) of beer on the wall
2 bottle(s) of beer
Take one down, pass it around
1 bottle(s) of beer on the wall

How does one pronounce "bottle(s)", let alone to fit the song?

(That's just reminded me - I'd better fix my Come Here version sometime soon....)

Stewart.