osmie: (Default)
Hey people--

Say you were writing a quick & dirty Perl script to hunt through your source code for a particular chunk of broken code, in order to replace it with a fixed version. Being code, the text you're hunting for is chock full of variable names & other weird punctuation marks. Now, the obvious thing to do would be to use the s/// operator ... except that s/// tries to compile your search string into a regexp, which breaks your quick & dirty Perl script. (And you don't really want to go through the code and backslash all the backslashable characters, because the chunk is nontrival, and right now it works.)

I mean, there's got to be a quick & dirty way of substituting text in Perl, right? There's got to be a way of turning off regular expressions?

Suppose further that you've just spent 45 minutes banging your head against this problem, and are starting to suspect that a brute force copy & paste on all 50 or so source files would have been finished & tested by now.

What do you do?
osmie: (Default)
Hey people--

Say you were writing a quick & dirty Perl script to hunt through your source code for a particular chunk of broken code, in order to replace it with a fixed version. Being code, the text you're hunting for is chock full of variable names & other weird punctuation marks. Now, the obvious thing to do would be to use the s/// operator ... except that s/// tries to compile your search string into a regexp, which breaks your quick & dirty Perl script. (And you don't really want to go through the code and backslash all the backslashable characters, because the chunk is nontrival, and right now it works.)

I mean, there's got to be a quick & dirty way of substituting text in Perl, right? There's got to be a way of turning off regular expressions?

Suppose further that you've just spent 45 minutes banging your head against this problem, and are starting to suspect that a brute force copy & paste on all 50 or so source files would have been finished & tested by now.

What do you do?
osmie: (Default)
By perusing other people's comment threads, I've discovered two new programming languages this week: Perligata and LOLcode.

I cannot decide which I like better.
osmie: (Default)
By perusing other people's comment threads, I've discovered two new programming languages this week: Perligata and LOLcode.

I cannot decide which I like better.
osmie: (Penguin)
Eh?  Answer me that.  I dare you.
osmie: (Penguin)
Eh?  Answer me that.  I dare you.
osmie: (Default)
In case there are any programming junkies out there who haven't already heard about the 2006 ICFP Programming Contest, let me encourage you to go there immediately and start hacking.

The contest itself ran for 72 hours last July, so there's absolutely nothing to be won except the extraordinary fun of it.  This is the coolest programming challenge I have ever seen; I've been at it since Friday and it only gets more fun the deeper I get.  It's got all the charm of the best Infocom games, only you progress by ... well ... programming.

The shtick (which you'll see if you follow that link) is that arch├Žologists in Pennsylvania have unearthed an enormous quantity of 2000-year-old scrolls from a society known as the Cult of the Bound Variable.  These early programmers had developed quite a lot of computing theory, but were constrained to work by carving 1s and 0s on sandstone tablets.  However, the scrolls include construction specifications for a "Universal Machine" designed to automate much of the sandstone-tablet labour.

Your job is to implement a Universal Machine emulator in the programming language of your choice -- then use your emulator to decrypt a huge codex written in UM-code.

Only it doesn't end there.  The decrypted codex turns out to be an entire operating system, written in (you guessed it) UM-code.  You need to run this operating system (Universal Machine version 9, or UMIX) on your UM emulator, and then hack into a variety of user accounts to explore as many embedded programs as possible.

Currently I'm in the process of writing a program in a dialect of BASIC.  Think of the layers here:  I will be soon be running a program I wrote in BASIC, compiled on an operating system written in UM-code, which in turn is running on an emulator I wrote in Perl and compiled on MacOSX.  And I'm not even halfway through the contest yet.  The time and energy and forethought which went into constructing this contest simply boggle my mind.

I've always found it difficult to learn new programming languages without an application I need to program right away.  The textbook examples never sink in, and I'm left without any mastery of the language at all.  But this contest ... I've already learned lots of debugging & profiling & optimizing strategies; I've programmed in two languages and thought very carefully about the machine-code-like elements of a third; and I rather suspect that I have several more languages to go before I'm done.   I hope this codex is handed out to a generation of CompSci students, just for the fun of it alone.

Heck, even if you're not a programming junkie, go follow the link.  The UM spec sheet is worth reading in its own right -- and the tasks aren't that difficult.  (At least not so far.)  You might find that you can solve more of it than you think.
osmie: (Default)
In case there are any programming junkies out there who haven't already heard about the 2006 ICFP Programming Contest, let me encourage you to go there immediately and start hacking.

The contest itself ran for 72 hours last July, so there's absolutely nothing to be won except the extraordinary fun of it.  This is the coolest programming challenge I have ever seen; I've been at it since Friday and it only gets more fun the deeper I get.  It's got all the charm of the best Infocom games, only you progress by ... well ... programming.

The shtick (which you'll see if you follow that link) is that arch├Žologists in Pennsylvania have unearthed an enormous quantity of 2000-year-old scrolls from a society known as the Cult of the Bound Variable.  These early programmers had developed quite a lot of computing theory, but were constrained to work by carving 1s and 0s on sandstone tablets.  However, the scrolls include construction specifications for a "Universal Machine" designed to automate much of the sandstone-tablet labour.

Your job is to implement a Universal Machine emulator in the programming language of your choice -- then use your emulator to decrypt a huge codex written in UM-code.

Only it doesn't end there.  The decrypted codex turns out to be an entire operating system, written in (you guessed it) UM-code.  You need to run this operating system (Universal Machine version 9, or UMIX) on your UM emulator, and then hack into a variety of user accounts to explore as many embedded programs as possible.

Currently I'm in the process of writing a program in a dialect of BASIC.  Think of the layers here:  I will be soon be running a program I wrote in BASIC, compiled on an operating system written in UM-code, which in turn is running on an emulator I wrote in Perl and compiled on MacOSX.  And I'm not even halfway through the contest yet.  The time and energy and forethought which went into constructing this contest simply boggle my mind.

I've always found it difficult to learn new programming languages without an application I need to program right away.  The textbook examples never sink in, and I'm left without any mastery of the language at all.  But this contest ... I've already learned lots of debugging & profiling & optimizing strategies; I've programmed in two languages and thought very carefully about the machine-code-like elements of a third; and I rather suspect that I have several more languages to go before I'm done.   I hope this codex is handed out to a generation of CompSci students, just for the fun of it alone.

Heck, even if you're not a programming junkie, go follow the link.  The UM spec sheet is worth reading in its own right -- and the tasks aren't that difficult.  (At least not so far.)  You might find that you can solve more of it than you think.

Profile

osmie: (Default)
Osmium Penguin

April 2016

S M T W T F S
     12
345678 9
10 111213141516
171819202122 23
2425262728 2930

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags