Slashdot Mirror


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?"

18 of 87 comments (clear)

  1. What about Duff's device? by chrestomanci · · Score: 5, Interesting

    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.

  2. Chess? Pah! by GregWebb · · Score: 4, Interesting

    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!

  3. Not the brightest AI... by dasunt · · Score: 2, Interesting

    It falls to a scholar's mate.

    Wants to reload the icons every move too on my 56k connection for some odd reason.

    1. Re:Not the brightest AI... by pocra · · Score: 2, Interesting

      Well, of even lower (artificial) intelligence, but to my mind hugely more impressive is the classic, unbelievable, ladies and gentlemen please put your hands together for David Horne's chess program for the unexpanded ZX81! It's amazing what can be done in 1K (well, 672 bytes really).

  4. BaSiX by ebbe11 · · Score: 5, Interesting

    I think BaSiX ought to qualify - a BASIC interpreter written in TeX, no less.

    --

    My opinion? See above.
  5. Chess is nifty by DeadSea · · Score: 4, Interesting

    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.

  6. Language facilities and syntax not that foreign. by abdulla · · Score: 3, Interesting

    JavaScript's syntax and language facilities are pretty similar to C, it's not that far fetched that he was able to do this, and considering that a lot of Mozilla is controlled via JavaScript, it doesn't suprise me that this is possible.

  7. Postscript web server by Samus · · Score: 3, Interesting

    I seem to remember a web server writen in postscript being mentioned on /. some years back. It seems like a pretty big stretch to me having a language designed for displaying text and graphics serve out web pages.

    --
    In Republican America phones tap you.
  8. Solving the N-Queens problem in XSLT by oren · · Score: 3, Interesting

    Once upon a time there was an argument whether XSLT was turing-complete (this was when the spec was being worked out), so I posted an XSLT "stylesheet" that places N queens on an NxN chessboard so that none threatens the other. You can see the post here: http://www.biglist.com/lists/xsl-list/archives/199 906/msg00289.html and the stylesheet here: http://www.biglist.com/lists/xsl-list/archives/199 906/bin00003.bin. That's a pretty twisted piece of code if I do say so myself :-) Strangely enough it has been actually "used" - to benchmark XSLT processors etc. (e.g., here: http://www.machi.pe.kr/xml/document/xslt/xslt_benc hmark.htm.

  9. Obfuscated code, 1K competition by JonBob · · Score: 4, Interesting

    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).

  10. Wolfenstein by 'The+'.$L3mm1ng · · Score: 5, Interesting

    Searching this page didn't show it up, so here's the link:

    Wolfenstein in 5kb of JavaScript

  11. Best pushing of the envelope I've ever done by CodeShark · · Score: 2, Interesting
    Granted I am dating myself here, but way back in 1981 I helped tweak a screen reader for the Apple II so that it would correctly read either the original 40x25 screen (which was interlaced, which made reading it from assembly a rather weird bit of code), or for one of the original 80x25 mod cards. The text was then sent out as a stream through the RS-232 port to an Echo 2 Speech synthesizer which had a phoneme chip and speaker, etc. Granted, compared to today's tech the Echo II is a piece of junk -- but at the time it had the advantages of being both cheap and somewhat easy to program in terms of phoneme translations. We also altered the reader code and text to speech sections of the code (in Applesoft Basic BTW) to implement a reader that would correctly pronounce text displayed on the screen that was written in Spanish or Romanized Japanese -- the only languages besides English which I spoke well enough to code for.) As far as I know it was the first "personal computer" based reader for the blind in the state where it was developed.

    Not coincidentally, one on my pet projects that I want to spend time on is to make (or find if it already exists) a generic plug-in module in Mozilla that can do the same thing with no external hardware outside a vanilla PC sound card (or on board chip). Links anyone?

    --
    ...Open Source isn't the only answer -- but it's almost always a better value than the alternatives...
  12. Maybe interested in a HTTP-server in PHP? by 1110110001 · · Score: 4, Interesting

    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

  13. Postscript Raytracer by parroyo · · Score: 2, Interesting
  14. Quines and Polyglots, oh my! by onesadcookie · · Score: 2, Interesting

    How about a program that compiles and runs in seven different languages?
    http://www.nyx.net/~gthompso/poly/polyglot.txt

    Or a program that prints its own source code?
    http://www.nyx.net/~gthompso/quine.htm

    Or just a whole collection of weird programming-related stuff?
    http://www.catseye.mb.ca/

    (OK, so I'm way too late to the party and nobody's going to read this, but hey :)

  15. Elaborate batch files by Datoyminaytah · · Score: 2, Interesting

    At a company where I worked in the early '90s, I used to write batch files that really pushed the limits. I tried to avoid using third-party utilities such as 4DOS so they'd run about anywhere but I sure used the standard DOS utilities. Some of my batch files used pipes and redirects to script EDLIN to search and replace data in text files. Some used ASCII control codes to send color data to the ANSI.SYS driver. They called me ".bat man". I still have a Batman coffee mug at work. It was a joke then, but nobody gets it anymore. :) These days, I'd just use Perl.

    --
    assert(birth_date<time-86400)
  16. Pushing the limits by bobv-pillars-net · · Score: 5, Interesting

    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.
  17. Pac-Man by Anonymous Coward · · Score: 1, Interesting

    I used to have Pac-Man written entirely within MS Excel.

    Should be able to grab it from

    http://www.winsite.com/info/pc/win3/excel/pac-ma n. zip

    May not have pushed the limit, but it was pretty cool nonetheless. Boss key? We don't need no shtinkin boss key!