Hacker Newsnew | past | comments | ask | show | jobs | submit | drewying's commentslogin


Does it have to be interesting to share? Writing a gameboy emulator is a fun and challenging project in and of itself, and something that not everyone can do. That alone I think is impressive enough to share.


I agree with you in general, but I think it's worth pointing out that programming the NES's PPU is actually very similar to programming with a 2D graphics library today.

NES games never wrote their own scrolling logic, or there own graphics logic. They wrote tile values into a background table and then told the NES how much to scroll the playing field, and the NES rendered and scrolled everything automagically.

NES games never drew their own sprites. They just said "Hey NES, write the sprite at this x and y location" and the NES did it.

Audio worked the same way.

Honestly, coding for the NES would be similar to working with a simple 2D graphics library. So I don't know if it would be accurate to say "every line of code is yours" on the NES. It's more just that the "libraries" used were implemented in hardware instead of software.


> NES games never drew their own sprites. They just said "Hey NES, write the sprite at this x and y location"

Yeah, but the hardware is so limited with weird corner cases that writing a bitblt might be easier. For example, some games have to reconfigure their sprites at the beginning of every horizontal scan line to overcome the hardware limitation on simultaneously displayed sprites (8).


Which games? To my knowledge this is at best exceptionally rare because there are only ~114 CPU cycles in a scan line. The reports I've heard are that if you do any OAM changes mid-frame, you get something like four lines of glitches. More common is to just do a full OAM DMA during vertical blank, at least from the ROMs I've seen.


I can't find the original link where I read about this, it may have been more theory than about specific games. These links seem to be relevant: http://wiki.nesdev.com/w/index.php/Sprite_overflow_games http://forums.nesdev.com/viewtopic.php?t=16299


This is only sort of true in that while there are hardware supported things, the way in which you work with them is both more finicky than most APIs, and they get you relatively less close to a finished renderer.

For example, concepts like a scroll register don't typically appear in an abstracted API. They're a hardware detail that happens to assist in implementing a smooth scroll by reducing the necessary computation. But they aren't a "smooth scrolling API" because it works on the tilemap data only - you can also have sprites scroll. That necessitates a software implementation specifically for the task of sprite rendering. Witness the numerous NES games that either let sprites disappear when they hit negative X coordinates or put up a convenient black bar to hide it.


While Salt Lake technically meets the requirements, they do so just barely. The metro area barely cracks a million people, and the airport maybe has 1 or 2 international flights a day. Plus Amazon and the Utah state government still have a lot animosity towards each other from the whole online tax thing.

Plus it's really tough to attract out of state talent in Utah.

I think Salt Lake would be a very hard sell compared to what Amazon could easily get with Denver.


Can someone who is a little more into Lord of the Rings comment on this? This guy didn't really get a lawsuit dropped by claiming that Tolkeins books were actually written 5000 years ago did he?

Or is there something here whooshing over my head?


It's a satire piece that suggests that authors who pretend to write translations of fictional books (such as Tolkien with LotR and Goldman with The Princess Bride) may actually be opening up their stories to plagiarists who claim to be "translating" the same source material. Or at least, that's my reading of it.

In a world where the Red Book of Westmarch actually existed, this other translation would be legal.


The latter. Had anyone actually written a supposed translation of the "Red Book" I'm pretty sure the Tolkein estate has enough movie money to fund an orc army of lawyers who would march to court thumping their shields, or, rather briefcases with swords, or, rather, umbrellas, chanting "We are the Triple Eagles, sons of BC High!"


I suspect that if the book were written as described -- foul-mouthed Galadriel, hobbit sex, diarrhea in Moria -- it would end up a parody.


That's pretty much what Harvard Lampoon did back in 1969:

http://en.wikipedia.org/wiki/Bored_of_the_Rings


http://en.wikipedia.org/wiki/Red_Book_of_Westmarch

Edit: this is a work of fiction 'blog post' in a pretty fictional-oriented 'blog'


A quick scan makes it look like you don't have direct access to create your own UI elements, you are stuck to the prebuilt stuff.

This definitely is designed to maximize battery life


Yeah, and you can't create UX elements on the fly, they have to be contained in the bundle pushed to the phone. So, less to install/push/change over the phone/watch network connection.


Kudos to the creator. Writing something like this takes a lot of effort and it looks like they did a great job! Well done!

With that said, on wider level, what's the allure of these JavaScript replacement languages? Is JavaScript syntax really that difficult for some developers to wrap their head around? I can understand something like Dart that has an underlying goal of performance, but the purposes of things like this or CoffeeScript genuinely confuse me.


It's not that JavaScript syntax is difficult. It's that there are some common patterns that repeat themselves so much times.

For example, safe object navigation. This code in Spider/CoffeeScript:

    var x = a?.b?.c?.d;
compiles to something like:

    var x = typeof a !== "undefined" && a && a.b && a.b.c ? a.b.c.d : void 0;


You can also handle problems like this via libraries. For example, underscore-contrib [1] does it this way:

    var x = _.getPath(a, "b.c.d");
There are definitely advantages to having this pattern baked into the language, though.

[1] http://documentcloud.github.io/underscore-contrib/


I've been using node-jsx and jsx-loader to bring JS Harmony syntax into projects I'm working on now. The last great hurdle to make JS a language that's easy to express in is the existential operator. It sucks how often you have to manually null-check in JS.

I'm mighty tempted to write a Webpack plugin to make `?` usable in vanilla JS.


Another reason to prefer CoffeeScript is because of its low cost of both defining and calling functions. The combination makes functional programming, including working with callbacks and promises, much less of a headache.

Even if you don't know CS very well, I dare you to take a look at the JavaScript this compiles to and call it more readable:

    (req, res)->
      getUserIds(req.query)
      .then (ids)->
        Promise.all ids.map (id)-> 
          getUser(id).then (user)-> user.friends.count
      .then (response)-> res.send 200, response
      .catch (error)-> res.send 500, error


I believe your example is a perfect demonstration of how coffeescript can cause unintended bugs.

You code compiles to:

  (function(req, res) {
    return getUserIds(req.query).then(function(ids) {
      return Promise.all(ids.map(function(id) {
        return getUser(id).then(function(user) {
          return user.friends.count;
        });
      }));
    }).then(function(response) {
      return res.send(200, response);
    })["catch"](function(error) {
      return res.send(500, error);
    });
  });
Not what intended, I assume :)


Well, that's definitely the JavaScript I intended to create :) Is there a bug in my logic somewhere?

Edit: But that aside, to be fair, I'll readily agree that it is easy to mess up CoffeeScript's significant whitespace if you don't pay attention to it. For example, you add a multi-line callback to one of those single-line callbacks at your peril!

But the tradeoff is, no mismatched braces/parenteses. Personally, I find the warts are not that hard to avoid, and the overall impact on my productivity is positive.


I guess he's referring to the implicit returns which are a pain in the neck to deal with.


Implicit returns are the norm in ES6's arrow functions. I use CoffeeScript for most of my personal coding, and I can think of exactly one situation where an implicit return got me in trouble. Generally, if you don't care enough about what your function returns to check it, then it's likely the calling function doesn't either, assuming you're familiar with the particular API you're working with.


In LiveScript there's syntax to explicitly omit any return value, it's just a function with !-> instead of -> for the arrow.


That's a question of perspective, I think-- if we're calling this function from somewhere, and we care about what it does, we need those returns.


I doubt anyone will see this, but just for posterity: Still not seeing a bug in this code, and under the tentative assumption that none exists, I find it amusing that you were confused by what you think is the more readable version :)


More concise? Yes.

More readable? Eh...

I can grok either at about the same speed.


That's fair. Personally, I spend a lot of time reading and writing JavaScript, and I still can't not find all the braces distracting.

I mean, if you're talking about a deep understanding of what the code does, I agree with you. But when you're writing a lot of code that basically looks like that, it's useful to be able to take it in at a glance.


The main reasons I reach for Coffeescript for my personal projects are: * built-in support for comprehensions and other array/object operations * simple syntax for context binding * automatic module isolation. These eliminate a lot of boilerplate littering my JS code. At my company gig we use JS but rely heavily on Underscore to address the same pain points; I prefer to have it built into the language syntax instead. ES6 probably has enough of this built in to make me switch back eventually.


It's relatively easy to build a compile-to-js language because of the pre-existing tooling.


We ask a variation of this question in our interviews. (We use lightbulbs, not eggs). I've yet to have anyone storm out yet.


It's not a matter of it's a culture fit or not, it's a matter of showing that you care about the job.

We wear whatever the hell we want to at the office, but if I conduct an interview and the interviewee comes wearing jeans and a T-Shirt with holes, I problem will end the interview short and thank him for his time. If he doesn't care about this job enough to even make an attempt at dressing up then why waste our time.

Same with swearing. If you can't show to us that you care about this job enough to use professional language for an hour then I probably won't consider you past the first round. It's not whether we care about swearing, it's about proving to us you really want this job.


> cares enough about his job enough to even make an attempt at dressing up Why not be yourself and let the right role culture find you?

If my employer won't swear in the interview out of principle, we are a bad culture fit.


Very cool!

I created an app using some of nathanborrors work that let's you browse through all of the Sonos Music services (Like Rdio, Spotify, Pandora, iHearRadio, etc). Setup your account, browse through your collections and play them on your system. I should submit a pull request to see if I can get this integrated into this project!

You can see the project here: https://github.com/drewying/Sonos-Music-Services-Browser

I also have an app on the App Store that turns your Sonos System into a wireless PA system. The current version is a little buggy but an update is coming shortly that makes it much more stable. You can check it out here:

https://itunes.apple.com/us/app/sonos-voice/id689673100?mt=8


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

Search: