Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > A suggestion for a new Web standard (Discussion)

Reply
Thread Tools

A suggestion for a new Web standard (Discussion)

 
 
Daz
Guest
Posts: n/a
 
      05-08-2007
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.

 
Reply With Quote
 
 
 
 
Tim Slattery
Guest
Posts: n/a
 
      05-08-2007
Daz <(E-Mail Removed)> wrote:

>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
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://members.cox.net/slatteryt
 
Reply With Quote
 
 
 
 
Vicente Raśl Plata Fonseca [XnT]
Guest
Posts: n/a
 
      05-08-2007
On May 8, 11:44 am, Tim Slattery <(E-Mail Removed)> wrote:
> Daz <(E-Mail Removed)> wrote:
> >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
> (E-Mail Removed)://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?

 
Reply With Quote
 
RobG
Guest
Posts: n/a
 
      05-09-2007
On May 9, 8:59 am, Randy Webb <(E-Mail Removed)> wrote:
[...]
> 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

 
Reply With Quote
 
Daz
Guest
Posts: n/a
 
      05-09-2007
On May 8, 11:59 pm, Randy Webb <(E-Mail Removed)> wrote:
> Vicente Raśl Plata Fonseca [XnT] said the following on 5/8/2007 6:50 PM:
>
>
>
> > On May 8, 11:44 am, Tim Slattery <(E-Mail Removed)> wrote:
> >> Daz <(E-Mail Removed)> wrote:
> >>> 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.

 
Reply With Quote
 
Daz
Guest
Posts: n/a
 
      05-09-2007
On May 9, 3:49 am, RobG <(E-Mail Removed)> wrote:
> On May 9, 8:59 am, Randy Webb <(E-Mail Removed)> wrote:
> [...]
>
> > 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".

 
Reply With Quote
 
Yanick
Guest
Posts: n/a
 
      05-09-2007
On 8 mai, 11:06, Daz <(E-Mail Removed)> wrote:
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
standard libraries don't behave like standard 'libraries' Sriram Srinivasan Python 13 11-12-2009 06:05 PM
What are the standard network functions provided in standard C? disappearedng@gmail.com C Programming 5 06-10-2008 08:57 PM
How to redirect a "system" standard output and standard error to avariable (Linux) Venks Ruby 5 12-06-2007 12:21 AM
add pexpect to the standard library, standard "install" mechanism. funkyj Python 5 01-20-2006 08:35 PM
How standard is the standard library? steve.leach Python 1 04-18-2005 04:07 PM



Advertisments