Hacker News new | past | comments | ask | show | jobs | submit login

Sometimes the new magic incantation is longer than the old incantations it was based on, though. And slower. And harder to understand. And buggier. And doesn't expose important functionality, so you invent roundabout ways to access it. And when you put several abstractions on top of each other, you will eventually get all these problems combined.

For example, try to draw a single black pixel on the screen... using JavaScript, or better yet, some language that compiles to JavaScript. How long would that take you? How many lines of code? How fast does it run? How much memory used by all subsystems combined? How many system calls involved? In assembly language that would be one instruction. And don't tell me that drawing single pixels is unimportant. I can show you any number of hackers who would create extremely cool webapps if drawing a pixel took one assembly instruction.

I don't know what it's like for other Javascript-based environments, but in mine it looks like this:


    var app = new Mars.UIApplication().init(1280, 720);

    var scene = new Mars.UIScene().init(app);

    var surface = new Mars.UISurface().init(app);
    surface.setSize(300, 200);

    var texture = surface.getTexture();
    texture.setPixel(150, 100, 0x000000FF);

Do not confuse the language with the environment in which it runs. The difficulty with pixel-poking isn't with JavaScript, it's with the environment. Give it another environment that allows the language direct access to the window (rather than to a DOM node nestled deep withing the bowels a parse tree which then needs to be rendered by a completely separate engine) then the difficulty would vanish. JavaScript may most typically run in a browser context, but the browser context is not JavaScript.

On the other hand, there are things that you want to make difficult, like stealing credit card information.

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