Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Switch from where?

If this were as commonly supported (and as performant) as JavaScript, and if, as I expect, this allows DOM manipulation, I would prefer it over it, if only for the strong typing.

Also, I haven't read the spec yet, but I would expect the 'VM' to run Dalvik code. If so, this will make it easier to port your web app to Android.



From the menu example:

    document.query("#menu").nodes.add(sliderMenu.node);
So, yes, DOM manipulation is there albeit kind of ugly.


Not perfect, but I prefer that over:

    document.querySelector('#menu').appendChild(sliderMenu.node);
If you have suggestions for improvement, please do pass them along.


Bake in a jQuery-like thing, or make it easy to build jQuery-like things, since I would much rather write something like the following in any language:

  $('#menu').append(sliderMenu);


We had a separate jQuery-like lib that we wrote in Dart for a while before we figured, "why not just make the main DOM API better"? So this stuff:

    document.query('#menu').nodes.add(sliderMenu.node);
Is a reflection of that. The ".node" part after sliderMenu will go away at some point. Our DOM lib doesn't currently work like jQuery's "collection-that-acts-like-an-object" style because we're worried about performance.

Keep in mind that you can always ditch jQuery and go straight to the DOM if jQuery is too slow. If jQuery was the only way, you'd lose your fast path.

So we've tried to come up with a DOM API that's easier to use, but still performant. If you've got ideas for how we can improve it, we'd definitely like to hear them.


how about literal DOM elements?

    #menu.add(.sliderMenu)
e.g. #,., maybe % or _ before elements, and you have a much more fluent syntax.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: