Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #20139

Re: Hello World problem

From Joshua Cranmer <Pidgeot18@verizon.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Hello World problem
Date 2012-12-06 15:52 -0600
Organization A noiseless patient Spider
Message-ID <k9r43f$spo$1@dont-email.me> (permalink)
References (2 earlier) <50bacd7f$0$287$14726298@news.sunsite.dk> <k9fcmi$lua$1@localhost.localdomain> <50bd717a$0$289$14726298@news.sunsite.dk> <k9lubf$b3n$1@localhost.localdomain> <50be90b7$0$281$14726298@news.sunsite.dk>

Show all headers | View raw


On 12/4/2012 6:09 PM, Arne Vajhøj wrote:
> On 12/4/2012 5:43 PM, Martin Gregorie wrote:
>> The ECMA-262 specification was never mentioned on that newsgroup or I'd
>> have grabbed and used it.
>
> It is pretty compact.
>
> 188 pages to cover both language and some core classes (a la
> java.lang package in Java),

That's a pretty unfair comparison. JavaScript is dynamically-typed, 
which means it just has to cover runtime semantics and can ignore a lot 
of the complexity that statically-typed object-oriented systems bring. 
Effectively, JS only needs to specify equivalents to sections 1-3, 14, 
and 15 of the JLS (with small portions of other sections), which comes 
out 215 pages by my count. Even then, the JLS also includes bulky parts 
in these sections that JS can happily ignore a lot of, including how to 
find candidate method overloads (a thick 30 pages unneeded in dynamic 
languages).

The core JS library is also pitiful by Java's standards, being far 
smaller than even just java.lang: Array corresponds vaguely to 
java.lang.ArrayList, String to java.lang.String, Math to java.lang.Math, 
Number to java.lang.Double, Date to java.util.Date (minus almost all 
locale concerns), RegExp to java.text.regex.Pattern, and Object and 
Function both covering features which don't really exist in Java but 
could be considered roughly equivalent to java.lang.Class.

>>> Runtime environment is a bit more tricky, because it somewhat depends on
>>> the runtime.
>>>
>> Yes, sure. But, is that poor language design and specification or merely
>> a lack of rigour on the part of the interpreter writers?
>
> Well - I am not a JavaScript expert, but based on my very limited
> knowledge about this then the main problem is that use of JavaScript
> in browsers are highly dependent on the HTML DOM model and CSS support
> used in the browser. So JavaScript is really suffering from the chaos
> in the HTML world and not so much due to its own problems.

When most people talk about JS, they're really talking about JS + 
"HTML5", which I'm using here to refer to both the DOM APIs presented by 
the HTML specification itself and the large collection of auxiliary APIs 
that are assumed to be implemented by web browsers. Most variance in 
practice tends to be associated with the DOM.

That said, there are some places where I've heard that increasing 
compatibility is contentious by various engine writers; the biggest one 
I know of is the iteration order of object properties (particularly if 
you have both "foo" and 0 as properties...).

-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Hello World problem John Dildy <jdildy85@gmail.com> - 2012-11-30 07:19 -0800
  Re: Hello World problem FredK <fred.l.kleinschmidt@gmail.com> - 2012-11-30 07:47 -0800
  Re: Hello World problem Tim Slattery <Slattery_T@bls.gov> - 2012-11-30 12:34 -0500
  Re: Hello World problem Roedy Green <see_website@mindprod.com.invalid> - 2012-11-30 10:31 -0800
  Re: Hello World problem John Dildy <jdildy85@gmail.com> - 2012-12-01 18:45 -0800
    Re: Hello World problem Arne Vajhøj <arne@vajhoej.dk> - 2012-12-01 22:39 -0500
      Re: Hello World problem Martin Gregorie <martin@address-in-sig.invalid> - 2012-12-02 11:05 +0000
        Re: Hello World problem Arne Vajhøj <arne@vajhoej.dk> - 2012-12-03 22:43 -0500
          Re: Hello World problem Martin Gregorie <martin@address-in-sig.invalid> - 2012-12-04 22:43 +0000
            Re: Hello World problem Arne Vajhøj <arne@vajhoej.dk> - 2012-12-04 19:09 -0500
              Re: Hello World problem Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-12-06 15:52 -0600
                Re: Hello World problem Arne Vajhøj <arne@vajhoej.dk> - 2012-12-07 20:24 -0500
            Re: Hello World problem Gene Wirchenko <genew@telus.net> - 2012-12-13 08:49 -0800
    Re: Hello World problem Joerg Meier <joergmmeier@arcor.de> - 2012-12-02 12:19 +0100
  Re: Hello World problem John Dildy <jdildy85@gmail.com> - 2012-12-02 17:51 -0800
    Re: Hello World problem "Charles Hottel" <chottel@earthlink.net> - 2012-12-02 23:17 -0500
    Re: Hello World problem Joerg Meier <joergmmeier@arcor.de> - 2012-12-03 12:26 +0100
    Re: Hello World problem Roedy Green <see_website@mindprod.com.invalid> - 2012-12-05 14:30 -0800
  Re: Hello World problem John Dildy <jdildy85@gmail.com> - 2012-12-05 14:44 -0800
    Re: Hello World problem Martin Gregorie <martin@address-in-sig.invalid> - 2012-12-05 23:17 +0000
  Re: Hello World problem John Dildy <jdildy85@gmail.com> - 2012-12-06 15:27 -0800
    Re: Hello World problem Lew <lewbloch@gmail.com> - 2012-12-06 15:29 -0800
      Re: Hello World problem John Dildy <jdildy85@gmail.com> - 2012-12-06 17:17 -0800

csiph-web