Features Podcasts Family Video Comics Music Tech Science Books Film & TV Games ✚

Jill

If HP Lovecraft wrote C manuals

Cory Doctorow at 9:40 pm Sun, Jan 10, 2010

— FEATURED —

Science

Last chance to enter the Armchair Taxonomist challenge!

Book Review

Black Code: how spies, cops and crims are making cyberspace unfit for human habitation

Book Review

We Can Fix it! - a graphic novel time travel memoir

Science

The technology that links taxonomy and Star Trek

— FOLLOW US —

Boing Boing is on Twitter and Facebook. Subscribe to our RSS feed or daily email.

 

— POLICIES —

Except where indicated, Boing Boing is licensed under a Creative Commons License permitting non-commercial sharing with attribution

 

— FONTS —

Tweet
Kindle
I can't say that it made me a better programmer, but this mashup of Brian W Kernighan & Dennis M Ritchie's classic "The C Programming Language" with the elder horrors of HP Lovecraft's Cthulhu mythos has alerted me to the urgent problem of inadvertent dimensional rifts that may be opened through poor programming practice:

And yet I saw them in a limitless stream- flopping, hopping, croaking, bleating- sorting themselves inhumanly through the spectral moonlight in a grotesque, malignant saraband of fantastic nightmare. Their croaking, baying voices called out in the hideous language of the Old Ones:

void Rlyeh
(int mene[], int wgah, int nagl) {
int Ia, fhtagn;
if (wgah>=nagl) return;
swap (mene,wgah,(wgah+nagl)/2);
fhtagn = wgah;
for (Ia=wgah+1; Ia<=nagl; Ia++)
if (mene[Ia] swap (mene,++fhtagn,Ia);
swap (mene,wgah,fhtagn);
Rlyeh (mene,wgah,fhtagn-1);
Rlyeh (mene,fhtagn+1,nagl);

} // PH'NGLUI MGLW'NAFH CTHULHU!

The C Programming Language (via JWZ)
Previously:
  • Animation: Lil Cthulhu - Boing Boing
  • Cthulhu mask -- the sequel - Boing Boing
  • Cthulhu violates a Parsec science fiction award - Boing Boing
  • Lovecraft sculptures - Boing Boing
  • Leather Cthuhlu mask from steampunk gas-mask artist - Boing Boing
  • Boing Boing: Plush Cthulhu slippers
  • Cthulhu fonts - Boing Boing

I write books. My latest is a YA science fiction novel called Homeland (it's the sequel to Little Brother). More books: Rapture of the Nerds (a novel, with Charlie Stross); With a Little Help (short stories); and The Great Big Beautiful Tomorrow (novella and nonfic). I speak all over the place and I tweet and tumble, too.

MORE:  Entertainment • geek • lovecraft • Technology

More at Boing Boing

The technology that links taxonomy and Star Trek

Hackers prepare for first "national holiday" in their honor

  • Anonymous

    For Perl, please see my module, Acme::Phlegethoth, on the Comprehensive Perl Archive Network: http://search.cpan.org/dist/Acme-Phlegethoth/

  • Anonymous

    But had they had single line comments, they would have used them. The Olde Ones did!

  • bobtato

    The code in the quotation above is broken because… something… has eaten the characters after the less-than sign, but the original compiles OK.

    Of course, the linker will give errors because swap() and main() have been left as exercises for the reader and even if they hadn’t, the creeping squamous symbols in this code may well cause ld to go utterly insane and link your face to thousands of tiny screaming spiders.

  • bobtato

    PS kudos on Acme::Phlegethtoth. There truly are no end of uses for Perl.

  • Anonymous

    The Old Ones never actually compiled their code, because this code contains a syntax error. ;)

    • dragonfrog

      Your compiler fails to produce an executable, as a means of protecting its sanity. It is not a syntax “error”, your compiler simply lacks the fortitude to face the horrifying implications of the syntax.

  • Anonymous

    Too bad it’s spelt ‘fthagn’.

    In both programming and summoning eldritch horrors, spelling and pronunciation matter!

  • pKp

    It’s not exactly a “mashup”, it’s a rewrite/pastiche of “The Shadow Over Innsmouth”.

    Good for a laugh, tho. Thanks !

  • mirrormonkey

    It’s not exactly a “mashup”, K&R C lacked C++-style comments (//), which is a C99-ism

  • klg19

    Don’t you mean “eldritch” horrors?

    I’ve always loved that word.

  • bobtato

    It is too a mashup– I just bludgeoned section 4.10 of K&R (2nd ed.) into The Shadow over Innsmouth by brute force (this was for the previous BoingBoing mashup contest). You’re right about the C++ comments, though. Now I feel like a total asshole.