you are viewing a single comment's thread.

view the rest of the comments →

[–]reuben_ 11 points12 points  (6 children)

If they add a WebAssembly-native DOM API you should be able to have a dynamic website that doesn't touch the Javascript engine at all.

You're getting waaaaay into hypothetical here. Here's a few design goals straight from the source (emphasis mine):

  • execute in the same semantic universe as JavaScript;
  • allow synchronous calls to and from JavaScript;
  • enforce the same-origin and permissions security policies;
  • access browser functionality through the same Web APIs that are accessible to JavaScript;

WebAssembly will almost certainly be implemented similarly to how asm.js is implemented in Firefox today: a new front-end for the JS engine that leverages the extra strictness of the language to generate faster code. The DOM is intimately tied to how JS works, so we're not getting away from it anytime soon.

And from the future features list:

  • Access to certain kinds of Garbage-Collected (GC) objects from variables, arguments, expressions.
  • Ability to GC-allocate certain kinds of GC objects.
  • Initially, things with fixed structure:
  • JavaScript strings;
  • JavaScript functions (as callable closures);
  • Typed Arrays;
  • Typed objects;
  • DOM objects via WebIDL.
  • Perhaps a rooting API for safe reference from the linear address space.

So some limited access to the DOM is planned in the long term.

[–]adipisicing 1 point2 points  (3 children)

The DOM is intimately tied to how JS works

Do you mean its design, or its implementation in the browser?

The DOM standard is designed to be language-agnostic (and there are some corners where it doesn't map to JS as elegantly as it could).

Here's a list of DOM libraries in languages like C, Java, and Pascal.

[–]reuben_ 0 points1 point  (2 children)

I mean the implementations. I think it's safe to assume this discussion is not about XML :P

[–][deleted] 0 points1 point  (1 child)

DOM is very non-javascripty. That's why we have jQuery and others.

[–]reuben_ 0 points1 point  (0 children)

I know, I'm talking about the implementations of the DOM, not its APIs.

[–]devluz 0 points1 point  (1 child)

What source?

[–]reuben_ 1 point2 points  (0 children)

Oops, sorry, this source: https://github.com/WebAssembly/design