473,395 Members | 1,670 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

A suggestion for a new Web standard (Discussion)

Daz
Hi everyone.

Forgive me if I sound Naive, but JavaScript is downloaded to the
browser, and then compiled into byte code. The resulting byte code (to
my knowledge), is smaller than the original script.

Should there be a Web standard that allows us to compress code into
bytecode, and then send the byte code directly to the browser?

Perhaps there is a flaw, in the sense that bytecode is different from
browser to browser, but isn't that what standards are all about?

I'd be interested in hearing the opinions of others on this subject.

Many thanks.

Daz.

May 8 '07 #1
8 1292
Daz said the following on 5/8/2007 11:06 AM:
Hi everyone.

Forgive me if I sound Naive, but JavaScript is downloaded to the
browser, and then compiled into byte code. The resulting byte code (to
my knowledge), is smaller than the original script.
Never tested it (never really cared) but it sounds about right.
Should there be a Web standard that allows us to compress code into
bytecode, and then send the byte code directly to the browser?
No. What is the point?
Perhaps there is a flaw, in the sense that bytecode is different from
browser to browser, but isn't that what standards are all about?
Huge flaw.
I'd be interested in hearing the opinions of others on this subject.
I think it would be a bad idea. But, that is just one opinion. The
obfuscators would probably hate it because it would allow obfuscation
(to a degree) and put them out of business.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 8 '07 #2
Daz <cu********@gmail.comwrote:
>Hi everyone.

Forgive me if I sound Naive, but JavaScript is downloaded to the
browser, and then compiled into byte code. The resulting byte code (to
my knowledge), is smaller than the original script.
No bytecode, this is Javascript, not Java. The browser reads and
interprets the script. Exactly how it does that is up to the browser's
programmer.

--
Tim Slattery
Sl********@bls.gov
http://members.cox.net/slatteryt
May 8 '07 #3
On May 8, 11:44 am, Tim Slattery <Slatter...@bls.govwrote:
Daz <cutenfu...@gmail.comwrote:
Hi everyone.
Forgive me if I sound Naive, but JavaScript is downloaded to the
browser, and then compiled into byte code. The resulting byte code (to
my knowledge), is smaller than the original script.

No bytecode, this is Javascript, not Java. The browser reads and
interprets the script. Exactly how it does that is up to the browser's
programmer.

--
Tim Slattery
Slatter...@bls.govhttp://members.cox.net/slatteryt
I think if we wanna make something like that then maybe we prefer
using applets instead of javascript. And the good thing about
Javascript, in my opinion, is mostly the 'script' part. If I wanna
make something fast, then just gotta script here and there and it's
done.

Certainly it's not a bad idea but I think it would be better to
promote standarization of Javascript among browsers, like W3C does,
don't you think?

May 8 '07 #4
Vicente Raśl Plata Fonseca [XnT] said the following on 5/8/2007 6:50 PM:
On May 8, 11:44 am, Tim Slattery <Slatter...@bls.govwrote:
>Daz <cutenfu...@gmail.comwrote:
>>Hi everyone.
Forgive me if I sound Naive, but JavaScript is downloaded to the
browser, and then compiled into byte code. The resulting byte code (to
my knowledge), is smaller than the original script.
No bytecode, this is Javascript, not Java. The browser reads and
interprets the script. Exactly how it does that is up to the browser's
programmer.
I think if we wanna make something like that then maybe we prefer
using applets instead of javascript. And the good thing about
Javascript, in my opinion, is mostly the 'script' part. If I wanna
make something fast, then just gotta script here and there and it's
done.

Certainly it's not a bad idea but I think it would be better to
promote standarization of Javascript among browsers, like W3C does,
don't you think?
If all browsers were exactly the same, following every standard, then
there would end up being only one browser and then you would never have
change as the one browser would have no reason to change/update anything.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 8 '07 #5
On May 9, 8:59 am, Randy Webb <HikksNotAtH...@aol.comwrote:
[...]
If all browsers were exactly the same, following every standard, then
there would end up being only one browser and then you would never have
change as the one browser would have no reason to change/update anything.
I don't think anyone begrudges browser developers offering extensions
to standards, but life would be very much simpler if they'd all
support applicable W3C and ECMA standards as a baseline rather than
providing proprietary standards in lieu.
--
Rob

May 9 '07 #6
Daz
On May 8, 11:59 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
Vicente Raśl Plata Fonseca [XnT] said the following on 5/8/2007 6:50 PM:
On May 8, 11:44 am, Tim Slattery <Slatter...@bls.govwrote:
Daz <cutenfu...@gmail.comwrote:
Hi everyone.
Forgive me if I sound Naive, but JavaScript is downloaded to the
browser, and then compiled into byte code. The resulting byte code (to
my knowledge), is smaller than the original script.
No bytecode, this is Javascript, not Java. The browser reads and
interprets the script. Exactly how it does that is up to the browser's
programmer.
I think if we wanna make something like that then maybe we prefer
using applets instead of javascript. And the good thing about
Javascript, in my opinion, is mostly the 'script' part. If I wanna
make something fast, then just gotta script here and there and it's
done.
Certainly it's not a bad idea but I think it would be better to
promote standarization of Javascript among browsers, like W3C does,
don't you think?

If all browsers were exactly the same, following every standard, then
there would end up being only one browser and then you would never have
change as the one browser would have no reason to change/update anything.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
Incorrect. I'd still choose Firefox over IE any day. Following the
standards doesn't necessarily mean that that's ALL you can do. For
example, an inline spell checker, or bookmark manager has nothing to
do with any standards. Also, it's how you implement the standard that
matters. If you browser keep crashing all the time, but still supports
the standards, no-one will use it. :)

May 9 '07 #7
Daz
On May 9, 3:49 am, RobG <r...@iinet.net.auwrote:
On May 9, 8:59 am, Randy Webb <HikksNotAtH...@aol.comwrote:
[...]
If all browsers were exactly the same, following every standard, then
there would end up being only one browser and then you would never have
change as the one browser would have no reason to change/update anything.

I don't think anyone begrudges browser developers offering extensions
to standards, but life would be very much simpler if they'd all
support applicable W3C and ECMA standards as a baseline rather than
providing proprietary standards in lieu.

--
Rob
Agreed. I was simply thinking from a speed point of view, in order to
save bandwidth and make things load quicker. I would also love to see
constants/variable as standard in CSS. That way, we can re-use lines
of code easily and not have to repeat them anywhere.

Thanks for your input everyone. I really appreciate it. I suspected
that the concept was flawed, but figured there was only one way to
find out. As always it's freedom Vs standards, in the sense that
browser developers sometimes "use their freedom not to follow
standards".

May 9 '07 #8
On 8 mai, 11:06, Daz <cutenfu...@gmail.comwrote:
Hi everyone.

Forgive me if I sound Naive, but JavaScript is downloaded to the
browser, and then compiled into byte code. The resulting byte code (to
my knowledge), is smaller than the original script.
Well, not necessarily. If you're looking for a Javascript compiler,
Rhino has one (http://www.mozilla.org/rhino/jsc.html), but has it was
said in this thread, browsers implements their own interpretation of
the language (http://en.wikipedia.org/wiki/JavaScript)

Unlike Perl or PHP, Javascript files aren't kept in a cache since it
wasn't originally made to support large, extensive, data
manipulations ; it's a scripting language to enforce server scripting,
a mean to control the portion of HTML loaded onto the client's
computer (I'm strictly talking Web scripting here). To extend the
limitations, IE added ActiveX to it's list of features (an ugly
feature if you ask me... security and standard-wise)
Should there be a Web standard that allows us to compress code into
bytecode, and then send the byte code directly to the browser?
I did think about having a pre-compiled scripting standard for
browsers, but the fact is that as computer evolves, there is less and
less need to do so, and interpreted or executed, the speed difference
tends to be more and more negligeable. Browser scripting will always
be, at a level or another, interpreted. There is a long way before
achieving performances like compiled C++ for the Web, because 1) C++
is OS and hardware specific, 2) every browsers implements their own
memory allocations for DOM ressources, 3) for security reasons, it is
the browser's responsibility to handle policies, so it has to
interpret the script whatsoever.

As for code size, there are alternatives : code obfuscators, and code
compressor (like here : http://javascriptcompressor.com/)
Perhaps there is a flaw, in the sense that bytecode is different from
browser to browser, but isn't that what standards are all about?
As a final note, I would hate having to recompile my Javascript files
all the time... mostly because many of my scripts depends on other
scripts, and HTML files.... Since there will always be things like
<div onclick="foot();"></div(interpreted scripts) I don't see why
adding new "embrace and expands from Microsoft through new ways of
handling data" will help in restoring compliancies (*grin*) KISS
I'd be interested in hearing the opinions of others on this subject.
Cheers !
Many thanks.

Daz.
- Yanick

May 9 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Steven Bethard | last post by:
The poll, as stated, asked voters to vote for the syntax suggestion they liked the /most/. Some of the conclusions people are trying to draw from it are what syntaxes people liked the /least/. ...
5
by: Ioannis Vranos | last post by:
I have initiated a similar discussion thread in clc++m, however because of the "m" in the name, the discussion is progressing slowly, so I am setting another thread here. Well the story is...
43
by: Steven T. Hatton | last post by:
Now that I have a better grasp of the scope and capabilities of the C++ Standard Library, I understand that products such as Qt actually provide much of the same functionality through their own...
93
by: Matt | last post by:
Hi folks. Can you help with some questions? I gather that some types supported by g++ are nonstandard but have been proposed as standards. Are the long long and unsigned long long types still...
13
by: 31337one | last post by:
Hello everyone, I am writing an application that uses a command line interface. It will be configurable by passing arguments on the command line. The program is going to run in windows and...
22
by: David Mathog | last post by:
One thing that keeps coming up in this forum is that standard C lacks many functions which are required in a workstation or server but not possible in an embedded controller. This results in a...
270
by: jacob navia | last post by:
In my "Happy Christmas" message, I proposed a function to read a file into a RAM buffer and return that buffer or NULL if the file doesn't exist or some other error is found. It is interesting...
126
by: Dann Corbit | last post by:
Rather than create a new way of doing things: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html why not just pick up ACE into the existing standard:...
6
by: dhtml | last post by:
4.9 How do I find the size of the window/browser canvas area? The answer is completely wrong and the example code is not cross browser. innerWidth is not the same as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.