The page-centric concept of the web (from a browse...
# thinking-together
d
The page-centric concept of the web (from a browser standpoint) is a bit strange to begin with, if you think about it. I think it would make sense if instead of "loading a page", you loaded a script, which then programmatically creates content. And then, why should loading something else have to make that go away? Perhaps loading the same thing twice would just give you two copies of it, just like if you run the same program twice or open the same file twice. That would also give "history" a different connotation
m
Actually, HTML is a scripting language which programmatically creates content. The proof is that you can embed <script>document.write(...)</script> anywhere and the content will be written after the script itself, not at the end of the loaded document. It means that the above is a command. Plus, HTML support different syntaxes for attributes, entities, space, so really HTML is a script language (albeit not turing complete).
d
If you think about it, all programming languages are scripting / interpreted languages. A compiler is an interpreter for a declarative language, where the commands are things like "build this function" or "build this object-factory, and a method-lookup table" and "build some code to lookup method 'x' from this object's table and invoke it". I actually think it would be powerful if compiled languages were replaced with code-building libraries, and the code that consumes it could also declare it's own stuff too or mix different languages by combining libraries.
That's also why I think it's ironic that "classes" were added to JacaScript, since it's a scripting language to begin with and already had adequate facilities for making object-factories, to the extent that you could explore different approaches and do things like mixins, because you just code up the mechanism however you want. That's why "class" in JavaScript really is just syntactic sugar for doing it manually (although, unfortunately, using the "this" anti-pattern)