Code That Pushed the Language Envelope?
Lil Fritz asks: "Following on from the cool Flash Adventure game last week, this geezer Neil Pearce has written a full client side JavaScript CPU chess player (which drew with me, but then I'm papz at Chess). Now this sort of thing always amazes me. Doing stuff for which it was never intended. Do we have other warped (ie 'they wrote it in what?!?') uses of languages and tools?"
When I first saw it, I was amazed that it worked, but I would say it pushed the limits
Code example and discussion in the Jargon File
For a more detailed explation see here.
Can't post the code, due to Lameness filter.
If we think about it, Chess is only requiring a lot of processing on the client side. It's a waste of CPU power but nothing more.
I remember being rather more impressed when a friend wrote a Tetris clone in JavaScript. Interactive, real-time processing in JavaScript? Well done.
Greg
(Inside a nuclear plant)
Aaaarrrggh! Run! The canary has mutated!
I think BaSiX ought to qualify - a BASIC interpreter written in TeX, no less.
My opinion? See above.
Along the same vein, a couple weeks ago I coded Tic-Tac-Toe in JavaScript complete with an alpha-beta search such that the when it is in expert mode, you cannot beat your web browser. Solving the whole game on my computer takes about 5 seconds, so I added an opening book to compute the first move. With that response time is pretty much instantaneous even in expert mode.
Lots of "barrier pushing" code can be found in obfuscation contests. Check out the Obfuscated C contest or the Obfuscated Perl contest. For similar feats on the web, check out The 5k (which recently featured a lightweight chess entry).
Searching this page didn't show it up, so here's the link:
Wolfenstein in 5kb of JavaScript
The other day I played around with PHP's socket-extension. After some reading I thought about a normal server-service I could try. A webserver came to my mind. So I made up a HTTP-server/daemon in PHP. PHP should be an extension to a webserver not a webserver itself, that's why it might fit into this topic.
...
I played around with it and tested it with apache benchmark. As I'm able to handle multiple request it got pretty fast and stable - even faster then pure apache (no wonder - it has more features).
The advantage of this webserver is, you don't need any php-optimizer as everything in your application gets includes in the webserver and loaded with it. If anyone wants the code just tell me
b4n
I know a guy who wrote a program to calculate Pi to an arbitrary number of digits in
You ready for this?
DOS
He wrote the entire progeram as a series of .BAT files that recursively called each other.
No external programs, no tricks. Nothing but the native capabilities of COMMAND.COM. Local variables were stored in the environment, and globals were stored in files.
It ran really slow.
The Web is like Usenet, but
the elephants are untrained.