Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Javascript emulator for Notch's DCPU-16 (jazzychad.net)
33 points by jazzychad on April 5, 2012 | hide | past | favorite | 16 comments


Am I missing the part where the registers and memory are 16 bits?

  this.data = new Array(size);
  ...
  a = d.data[pa];
  b = d.data[pb];
  ...
  case 0x2: // ADD a, b
    res = a + b;
  ...
    d.data[pa] = res;


oops, meant to be

  d.data[pa] = res & 0xffff;
updated, thanks!


It seems as though HN had a nerdgasm, and now everybody wants to make an emulator for something that's not even released. What is the point of this? Everybody here knows it's possible to emulate a CPU in any Turing complete language, so why do we need an emulator for the same computer in every programming language there is?


As long as everyone's talking about instruction sets and writing emulators and critiquing architectures and not pumping Bitcoin, who cares? Thanks, Notch, for temporarily fixing HN. :)


Exactly. It's like everyone forgot what the "hacker" in Hacker News means. This is the kind of stuff I live for.


It's fun? A lot of people build things for fun, you wouldn't tell someone building a table not to do it because we already know how to build tables.


There's nothing wrong with reinventing the wheel if your goal is to teach yourself more about wheels.

Understanding something by implementing it in a favourite programming language is at the heart of being a hacker.


Right... it is not released yet. But if you have emulators you can write code for it now. And then when it IS released... BAM!... programs are already written to use on it. Am I wrong here?


This site is named Hacker News. The word Hacker is used in the hacking things together, apart, and back again sense. Like a hobbyist. What else were you expecting from this crowd?


It's just really low-hanging fruit I think (the spec is crazy simple), and people are understandably excited to get to work on something of the sort vs. boring day job stuff.

I think we'll see a massive wave of python/javascript implementations, a few C/C++/C# ones, and then finally a trickle of novelty implementations in haskell, lisp, brainfuck, etc. This part could last for months. :)


I'm guessing you didn't program a 6502-based computer in assembler in the 80's?


Well, I think what happened was that this morning everybody saw that Notch had released the spec, and then about 1% of our ranks said "Hey I bet it would be a fun project to implement this spec in my favorite language! I'll bet that definitely nobody else is going to do this." Then that poor, misguided 1% set to work, and the rest is history.


If doing something allows you to learn, it doesn't matter if someone else has done it before.


This is true, but not all learning experiences need to be shown to the world.

I suppose really I only gave half of an explanation though and did not account for how so many of these posts have gotten voted to the front page. I expect it still has to do with "my favorite language" though.


There's always the possibility that this has real value to some people. Assuming that Notch follows through with his claim that you will be able write arbitrary programs to run ingame, then an online playground to prototype these programs might be very useful. Its appeal is unlikely to be as broad as say, JsFiddle, but putting it out there isn't necessarily just self-aggrandizement.


I didn't mean to imply that it was. But I think calibwam has a point that there have been a disproportionate number of front-page posts today about these implementations, and it's just kind of odd.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: