Slashdot Mirror


Hacking the NES With Lisp

Andy Hefner has a detailed blog post covering his quest to program an NES with the assistance of Common Lisp. He developed a new 6502 assembler, a mini-language for composing musical sequences, and a neat demo (rom image).

11 of 80 comments (clear)

  1. a strange mix of nausea and admiration by decora · · Score: 5, Funny

    on the one hand, this guy has re-implemented assembler with lisp syntax.

    on the other hand, this guy has re-implemented assembler with lisp syntax.

    1. Re:a strange mix of nausea and admiration by Dwedit · · Score: 4, Informative

      Yeah, when you're writing Assembly, it's still assembly. Using lisp to make macros doesn't change the langauge.

    2. Re:a strange mix of nausea and admiration by MightyMartian · · Score: 4, Funny

      Great. Now I can run Super Mario Bros. in Emacs!

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    3. Re:a strange mix of nausea and admiration by Anonymous Coward · · Score: 5, Funny

      This reminds me of the old quote "Emacs is a wonderful operating system. All it's missing is a decent text editor."

    4. Re:a strange mix of nausea and admiration by Anonymous Coward · · Score: 5, Funny

      on the one hand, this guy has re-implemented assembler with lisp syntax.

      on the other hand, this guy has re-implemented assembler with lisp syntax.

      and on the gripping hand, it's the world's first assembler that requires you to start lines with seven parentheses and rewrites itself at runtime.

    5. Re:a strange mix of nausea and admiration by Darinbob · · Score: 4, Informative

      The earliest lisps had assembler. It was sort of normal in a way because assembler was your language of choice for this sort of thing. C didn't exist yet, Fortran was just wrong, the other procedural languages were bulky, etc. Machines were low on memory and you often wanted to machine specific actions, you were writing your own runtime library as you went. So even as far back as Lisp 1.5 documentation discusses how to use assembler.

      The earliest lisps had compilers as well which went well with assembler written functions. Your programming environment was often a stack of cards that were loaded into a machine, or a tape that was read. So stopping to edit/compile/link/load was often impractical compared to just dumping some assembler while still in the interpreter (though of course if you crashed the machine you had to hide until pitchfork wielding mob stopped looking for you).

      The thing people remember most about Lisp other than parentheses are CAR and CDR functions. These are named for specific fields in a PDP 36-bit word which were accessible via machine instructions.

    6. Re:a strange mix of nausea and admiration by ratboy666 · · Score: 5, Interesting

      Read the fine article. Using CL does substantially change the language. Specifically, note the higher order manipulation of the eventual low-level program that the author achieved using promises (delayed evaluations). Basically, "threading while assembling".

      Also, notice the ease of introducing higher-level flow control constructs (IF and UNTIL) into assembler. And the elimination of a second assembler pass by use of promises for forward references. It's kind of "magic" -- the correct data will be there when it's needed!

      In this use-case, CL is a notational system for NES programming. It probably shouldn't be called "assembler" anymore, as the power of CL can be brought to bear in the process of generating the desired machine code.

      --
      Just another "Cubible(sic) Joe" 2 17 3061
  2. Re:Nostalgia is a powerful force... by Anonymous Coward · · Score: 5, Funny

    Those NES boxes are quite comfortable with their sexuality, thank you very much, and just value their privacy. If they want to stay in the closet, who are we to disagree?

  3. This is what Slashdot needs more of by comrade+k · · Score: 5, Interesting

    Bravo, Slashdot. This is the kind of stuff that the geek crowd finds interesting. Is it useful? Nope. Is it cool and borderline bizarre? Yep!

    --
    "Every vision is a joke until the first man accomplishes it; once realized, it becomes commonplace." -Robert H. Goddard
  4. Re:Nostalgia is a powerful force... by Pseudonym+Authority · · Score: 4, Funny

    I truly extend my condolences that your pet project didn't get featured on Slashdot and that it has made you bitter and jealous of the work of others.

  5. thats b/c "this stuff" became illegal by decora · · Score: 4, Insightful

    if you tried to do what this guy is doing for NES with a Sony Playstation or IPhone you would sued and threatened with millions in legal bills. If you don't believe me, ask George Hotz.

    slashdot didn't move away from geeky stuff... certain corporate interests decided to attack the entire principle of DIY at its core. you can't expect slashdot to be silent about that.