Author Topic: Would an HTML rendering virtual machine be possible?  (Read 2709 times)

0 Members and 2 Guests are viewing this topic.

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Would an HTML rendering virtual machine be possible?
« on: April 18, 2009, 10:31:01 pm »
I'm not entirely sure how web browsers work. I haven't done any research into this idea, but from what I recall reading browsers use javascript to draw the HTML to screen.

So, I was just brainstorming about random programming ideas and kind of had a focus on web development and stuff. I was thinking about solutions to the problem of having to tailor my markup to the different browsers. This is a horrible thing to have to do and I wish I didn't have to do it. So, I was like well damn, I've got a cool idea but it's kind of similar to Flex. As I understand it, Flex uses the Flash Player to render layouts or something? You design your site with Flex, and it's rendered totally by the Flash Player? This is cool, because then it can be extended to your desktop using AIR, or however that beautiful mess of Adobe products works together.

Flex is great, it does what I think the only real solution to fixing this cross-browser, "tailor my markup" bullshit would have to do - get rid of HTML/CSS. This is a pretty scary task, though, that I probably think most of the world would be opposed to. HTML will remain what it is just for the simple fact that everyone uses it already. Who cares if it's good, bad, outdated, amazing, whatever you think it is - it's going to stick around. So, I kind of restated the 'solution' to myself.... get rid of HTML... orrrrr, relieve the browsers of this task. Which brings me to my idea...


Would it be possible to create a virtual machine that relieves browsers of the task of rendering the HTML? Could the virtual machine use some widely popular javascript engine and draw the HTML onto whatever browser the user made the request through? The browser could still handle the requests, and stuff, but the virtual machine could interject and take over the process of drawing the HTML. This would allow users to use their same favorite browser, it wouldn't shock the world by trying to kill off HTML, it wouldn't render old sites that aren't updated anymore obsolete... while adding the advantages of rendering pages the same on every browser.

Thoughts? Is this even possible?


Edit: I'm not even sure if there is a problem with this. I don't know if this is still a big issue these days. I don't typically have problems with my HTML/CSS. And, after thinking about this, the issue probably doesn't lie in the HTML. It's probably moreso the CSS. Now days most browsers seem to render things the same for the most part. I find myself following this work flow: 1) design markup 2) apply styles 3) fix any minor differences. So maybe it's not as big of an issue as I think it once may have been, though.
« Last Edit: April 18, 2009, 10:45:03 pm by warz »
http://www.chyea.org/ - web based markup debugger

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: Would an HTML rendering virtual machine be possible?
« Reply #1 on: April 19, 2009, 12:35:41 am »
Browsers do not use JavaScript to render pages, and I don't see how running the code that does on a VM would help browsers be more similar. Moreover, it's important for there to be independent competing rendering engines, because it drives them to suck less.

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Re: Would an HTML rendering virtual machine be possible?
« Reply #2 on: April 19, 2009, 02:22:27 am »
Browsers do not use JavaScript to render pages, and I don't see how running the code that does on a VM would help browsers be more similar. Moreover, it's important for there to be independent competing rendering engines, because it drives them to suck less.

Eh. As far as I knew, HTML was converted the DOM representation which was drawn using some type of JavaScript-based rendering engine. I'm not at all educated on how the browser really works.

As a developer and user, I really don't care about the market for rendering engines - I just want one that works the same everywhere.

I don't know. I was just brainstorming and felt like that was an interesting thought.

Basically, the concept in a nutshell was to take the part of the browser that does the physical drawing of the markup and styles to the screen and throw it into something like the JVM, so that the result is something constant no matter where the JVM-like thing is deployed.

Anywho, this whole thought process lead me into researching Flex and coming to the conclusion that I always come to when I encounter something that uses Eclipse - I don't like Eclipse. I also don't feel like doing Flex in vim. :P

This caused me to also research Silverlight which I'm not sure how I feel about. It just feels like a less mature version of Flex, but with better IDE choices. I understand that it's probably very powerful, though. I've seen a bunch of pretty intense things people have turned into web apps. Main drawback is the lack of adoption of their run time and quality Windows hosting is expensive as hell.

So, here I am bored and right back where I started - looking for something to do without knowing what I want to do. heh
« Last Edit: April 19, 2009, 02:56:17 am by warz »
http://www.chyea.org/ - web based markup debugger

Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: Would an HTML rendering virtual machine be possible?
« Reply #3 on: April 19, 2009, 03:29:38 am »
I'm pretty sure it would be pretty inefficient to use script to convert HTML to a DOM representation.  Far more likely is that native executable code converts the HTML to DOM, and then script is able to access the DOM.

There's not really a reason to virtualize HTML rendering.  HTML rendering is a fairly straightforward procedural task; HTML browsers don't need to care about how they allocate memory or control I/O.

The drawback to "standardizing" onto a single rendering engine is, as Camel said, that it limits innovation and drive to make things more accurate.

I'm pretty sure Flex doesn't do what you think it does.  Flex is a way of being able to provide control and componentization to RIAs in a reusable, consistent way - it's comparable to COM or ActiveX.  Flex is implemented in such a way that it's rendered through Flash.

Silverlight doesn't require Windows hosting; it's entirely a client-side technology.  But I think they've grown significantly (a potentially-dubious source suggests that they get 1.5 million downloads daily), and Mac OS X is a first-class priority for Microsoft (Linux has a small "Moonlight" project, but I doubt it's anywhere near the maturity level). 
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Re: Would an HTML rendering virtual machine be possible?
« Reply #4 on: April 19, 2009, 04:51:02 am »
It's a shame that Silverlight's site is littered with ads and crap. It doesn't have that elite Microsoft feel. heh
http://www.chyea.org/ - web based markup debugger

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: Would an HTML rendering virtual machine be possible?
« Reply #5 on: April 19, 2009, 11:00:50 am »
What's wrong with Eclipse? In the past, it was pretty bulky, but even then I still thought its features justified it. These days, it's actually incredibly fast.

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Offline warz

  • Hero Member
  • *****
  • Posts: 1134
    • View Profile
    • chyea.org
Re: Would an HTML rendering virtual machine be possible?
« Reply #6 on: April 19, 2009, 02:20:30 pm »
I used it less than a year ago and I recall it still being pretty bulky. *shrug*
http://www.chyea.org/ - web based markup debugger

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
Re: Would an HTML rendering virtual machine be possible?
« Reply #7 on: April 20, 2009, 02:46:12 pm »
Most of the improvements to Eclipse's bulkiness have come about in the past 6 months; the last two major releases (Europa and Ganymede) are each substantially faster than their predecessors.

That said, I'd still advocate for Eclipse even if they were each substantially slower than their predecessors. The refactoring capability of Eclipse alone saves me so much time that it doesn't matter how slow the IDE is, I still develop quicker than it would be possible to do with or without any other IDE out there.

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: Would an HTML rendering virtual machine be possible?
« Reply #8 on: April 20, 2009, 09:50:17 pm »
It's a shame that Silverlight's site is littered with ads and crap. It doesn't have that elite Microsoft feel. heh
Yeah, the Program Manager is a friend of mine.  I'll mention it to him, but believe me - he's heard it before.
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.