views:

254

answers:

7

I've written a number of pieces of code that attempt to do tasks that are wholly inappropriate for the language being used, eg. particle engines in javascript, a web server made from bash scripts, etc.

Has anyone else deliberately set out to achieve such absurdity? what languages did you use and for what purpose?

+1  A: 

Far too many atrocities to the programming world have been written in batch files by me then I care to admit :P

Adam Haile
+4  A: 

My best:

I wrote a C# application that used plugins and (stupidly) in version 1.0, added strong names to the assemblies that all plugins had to consume. This became a serious problem a couple of versions later as I became unable to make meaningful changes to the API without breaking every single existing plugin (many of whose developers had disappeared, and, consequently, could not even be recompiled against new binaries). I wanted to keep backward compatibility, but polluting the app with two different sets of API binaries wasn't practical.

The solution? New assemblies in version 3.0 with the old API rearranged across DLLs and extended with the new functionality. When the app attempted to install an old plugin, it would disassemble the plugin's DLL (using the command-line tools; not even doing this properly), search through the resulting .il files for the references to the strongly-named assemblies, change those to the un-strongly-named assembly references, add the new assemblies, then recompile the il source back to a DLL (with ilasm).

As ridiculous as that sounds (and as potentially breaking), it actually worked very, very well. And nobody needed to rewrite any plugins.

DannySmurf
A: 

I wrote a 99 bottles of beer script in a random language I found on the internet called "Emoticon". It was solely to have a post there that was mine, but the choice of language ended up being terrible. The implementation had several bugs so I had to use different constructs in the "language" which weren't as efficient as the buggy ones.

I also did one in another language called Spiral. I chose that language because it was designed to have code flow visually, like another language I can't recall the name of now. It was fun, my initial goal was to have the code loop around in a bunch of spirals, but I got sick of it towards the end and just had it flow back and forth a bunch.

Mike Stone
A: 

A friend of mine wrote a parser for email headers that would then calculate the PageRank of the email messages on his HP calculator, including all of the code to send them over, and then send the results back.

A different friend once did a numerical programming challenge for Mathematica in Postscript, and then ran it through Mathematica's Postscript interpreter.

I think for me, I wrote half of a website in Processing before I realized the fonts rendering didn't work good enough for what I needed to do.

John the Statistician
+2  A: 

When I worked at NEC in their telecom division, I wrote a Gantt chart processor that would allow you to have (rather nice looking, IMHO!) Gantt charts embedded in your troff documents.

I started this in awk (the typical 'this will take about a day and a page of code'), and it eventually grew to 36 pages which is about 34.5 pages longer than was comfortable to maintain.

Mark Harrison
+1  A: 

At the risk of picking the obvious "XML applied inappropriately" story...

I've worked on something that uses in-memory XML representations for data, instead of just doing nice sensible function calls. It generates XML, passes it to another part of the system which then parses the XML to get the data back out. All in the same application in the same JVM. It produced output in a proprietary binary format and would first of all create a representation of the binary in XML, in memory before transforming that into the final output. In the original version, there were parts of the XML that looked like this:

<flags>110110001</flags>

It... Was... Slow...

And impenetrable.

izb