BUILT-IN Web-Language Interpreters

If we put Html, Dhtml, Xml and Javascript codes onto our webpages and view them on a browser then we do not see the “text of the codes but the “translated version of the codes because the browser “translates the codes before loading the webpages on our screens. But, when you put Java codes onto your webpage and view it on a browser then the browser is unable to translate the Java codes unless you download the Java Interpreter which is the “Java Virtual Machine.

Question 1.
Now, why is it that, the browser behaves one way with the other languages and one way with Java ?
I guess that, it is because the browsers do not have the Java Virtual Machine “installed or “built-in to the browser.
Am I correct ?

Question 2.
If so, then why do not these browsers have the Java Virtual Machine installed in them ?
Why the inconvenience for us to download it ?

Question 3.
Can some-one tell me where exactly in the browser’s source codes is it written about the Html, Dhtml, Xml and Javascript interpreters ?
This way, I can insert beside them the source code of the Java Virtual Machine on the popular open source browser so next time Java codes will be interpreted without needing to download the Java Virtual Machine. I could call this version the latest version that can translate Java Applets with-out the need to download and install the Java Virtual Machine.

Anyway, in order for my browser to view Java Applets, I know that, all I have to do is download the Java Virtual Machine but I prefer to do things manually just to experiment with the source codes.
Also, I want to learn where exactly the Html, Dhtml, Xml, Javascript interpreters reside inside a browser and check how their source codes look like.
Again, more experiments.
It would be totally impossible for me to go through all the source code of a browser as it could have millions of lines of code. I prefer to be pointed to the right direction.

Example :

Say that, I bought a webscript that turns my website into a dating website.
Say that, the webscript creates 6 dynamic webpages :

1. Admin log-In Page
2. Admin Control Panel

3. User Sign-Up Page
4. User Log-In Page
5. User Account Control Panel

6. Search Page

And imagine that, there are 3 Perl Cgi files that has the source codes to make the webscript work :

1. admin.cgi
2. signup.cgi
3. search.cgi

Now, imagine that I want to add a new query field “What Country Do You Reside on the “Search Page because this query field does not exist.

Now, if I ask the script-owner which part of the script to modify to add the new field, he will not simply ask me to go through al the 3 cgi files because this would be too daunting and a time waste for me and working in-effectively and so he will point me to the right direction which is to check the “search.cgi file for the other “existing query fields such as “what is your name, “what is your age, blah blah blah and insert my new query field’s Perl code beside these other query fields. If the other query fields are in the middle of the cgi file then it is no good me inserting my new query fields’ Perl code at the top or bottom of the cgi file as this would make the file look messy and when next time I want to modify this query field I won’t find it near the other query field’s codes and will need to foolishly and unprofessionally search the whole file for it.
So, to make things easy for me, I would insert my new query field’s Perl code near the other existing query field’s Perl code. This is how I would “organise things so it is easy for me to find something quickly that needs modifying.
Also, the Cgi programmers do not write all the codes of a webscript in one file as the file would be too large and too messy to find a certain code for a certain function. That’s why they create different files for different functions such as “search.cgi for all the Perl Codes that makes the “Search page work and “signup.cgi for all the Perl Codes that makes the “Sign-up page work.
This way, if anything needs to be modified for the “Search page then we would look into the “search.cgi instead of the other cgi files.
That’s how cgi files are organised to make things easier for a programmer to modify a webscript.

Question 4 :
Now, I guess the same kind of “organising technique exist in desktop software source codes ?
If so, then in a browser, where is the folder and file that has the source codes for the Html, Dhtml, Xml and Javascript interpreters ?
I want some clever programmer to point me to the right direction like a Cgi programmer would point me to if I need to modify a certain part of his webscript.
Should I be on the look-out for a folder called “Interpreters in the browser source code ?

Since Internet Explorer is not open source then I would appreciate it if anybody can point me to the right direction on the source codes of those other browsers that are open source such as Mozilla, Netscape Navigator, etc.

One of the other reasons why I want to see where the Interpreters are residing so I can check the source codes of the Interpreters too and experiment with them.

Recommended Answers

All 2 Replies

1) the browser interprets certain HTML tags as meaning it should launch a plugin and pass the rest of the information contained in that tag to the plugin.
This is what happens with Java and Flash as well as several other less common ones.

2) legal and religious issues mostly. Sun refused to allow Microsoft to ship any JVM newer than 1.1.6 with Windows, Microsoft retaliated by stating openly (and who's to blame them?) that they're not going to ship a 5 year old JVM that's 10 versions out of date and so they removed it completely (they, being nice, did keep the ability to install a JVM as a plugin). Many Linux distros out of religious zeal don't ship anything that's not open source as they define it (never mind the full source for the JVM including the compiler is available at no cost).

3) you'd need to include a complete JVM inside the browser source. It can possibly be done but it's a lot of work to write one from scratch (and you're not going to steal someone else's code are you?).

As to what sections of the code pertain to the HTML, JS, etc. parsers and interpreters, that clearly can't be answered by someone without perusing the source code.
As you seem to have that sourcecode and think you're smart enough and have enough time to build a complete JVM into it you should be able to find the relevant code sections yourself with no problem.

1) the browser interprets certain HTML tags as meaning it should launch a plugin and pass the rest of the information contained in that tag to the plugin.
This is what happens with Java and Flash as well as several other less common ones.

2) legal and religious issues mostly. Sun refused to allow Microsoft to ship any JVM newer than 1.1.6 with Windows, Microsoft retaliated by stating openly (and who's to blame them?) that they're not going to ship a 5 year old JVM that's 10 versions out of date and so they removed it completely (they, being nice, did keep the ability to install a JVM as a plugin). Many Linux distros out of religious zeal don't ship anything that's not open source as they define it (never mind the full source for the JVM including the compiler is available at no cost).

3) you'd need to include a complete JVM inside the browser source. It can possibly be done but it's a lot of work to write one from scratch (and you're not going to steal someone else's code are you?).

As to what sections of the code pertain to the HTML, JS, etc. parsers and interpreters, that clearly can't be answered by someone without perusing the source code.
As you seem to have that sourcecode and think you're smart enough and have enough time to build a complete JVM into it you should be able to find the relevant code sections yourself with no problem.

Cheers for the reply but what makes you think that I think of myself to be "smart" ?
No. I have no intentions of adding the JVM.
But, if I ever am able to write my own compiler then I would like the codes to work on the web too so that means I will have to write an interpreter.
Hence, must know where it must be included in the browser's source code.
I have no intentions of updating IE.
Must work on Open Source browsers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.