Slashdot Mirror


Web 2.0, Meet JavaScript 2.0

Jeremy Martin writes "Well I suppose it's an undeniable fact about us programmer-types — every now and then we just can't help but get excited about something really nerdy. For me right now, that is definitely JavaScript 2.0. I was just taking a look at the proposed specifications and I am really, truly excited about what we have coming."

9 of 248 comments (clear)

  1. Re:Sounds awesome, by cheater512 · · Score: 4, Informative

    Use the error console in Firefox/Seamonkey. Very specific errors.
    Seamonkey even has a javascript debugger.

    If your using IE, well then *snigger* your screwed. ;)

  2. Re:Ugh by Paradise+Pete · · Score: 2, Informative
    Javascript has always had overloaded operators. Or do you really think that string concatenation and arithmetic are similar operations?

    User-defined overloading, obviously. And it's considered by some to be a bad idea.

  3. Don't forget about ECMAScript and Actionscript! by jinushaun · · Score: 2, Informative

    For those who didn't RTFA, it should be noted that Javascript 2.0 is actually ECMAScript 4.0 (ES4). Even if IE9 and FF4 supported ES4 completely, we'll still have to develop for the legacy browsers! Oy vey! Such is the life of a front-end web developer!

    That being said, Flash Actionscript 3.0 (available now) includes many of the new features found in ES4 such as real classes. The next version of Actionscript will most likely be ES4-compliant.

    Notable features in ES4 include:
    - Classes and interfaces
    - Generics
    - Packages and namespaces
    - Compile-time type checking
    - Constants
    - Operator overloading
    - Record types (i.e., structs or light-weight classes)
    - Typed arrays and hash maps
    - Iterators
    - Exceptions

    More info: http://www.ecmascript.org/es4/spec/overview.pdf

  4. Re:As long as I got my Framework by larry+bagina · · Score: 2, Informative

    you can track the status.

    Use a perl (or some other language that handles everything manually*) script to receive the upload submission and write it to disk in a known location with a known name*. A second script can then compare the file size as it's uploading. Somewhat ugly

    * PHP won't work since file uploading is handled behind the scenes.
    ** this may involve storing statistics in a database, manipulating session data, etc.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  5. Re:Cross-Browser by stephanruby · · Score: 4, Informative

    These new features are nice and all, but what I really want as a Web developer is for a Javascript standard thorough and widespread enough that I can write scripts that work on most browsers without a bunch of hacks to make sure that each browser gets the right code. Anyone have a prognosis on this?
    You mean this? An (almost) universal metalanguage that generates the right Javascript/Actionscript/Neko scripts for different environments.
  6. Re:"Program Units" - potential for misuse by Bogtha · · Score: 3, Informative

    No, really, there's no new security problem here. Different hosts? How is that different to <script> elements pointing to different hosts today? Compromised hosts? What's different to today?

    Browsers have been able to download code from disparate, potentially untrustworthy remote hosts since they first started executing JavaScript. You have not discovered a new problem.

    I was just hoping someone more knowledgeable on the subject would provide some thoughts on the issues.

    Somebody already did, but you didn't like the answer.

    --
    Bogtha Bogtha Bogtha
  7. Re:Bleah. Classes. by jsebrech · · Score: 2, Informative

    I agree with Gosling. Classes are an unnecessary abstraction layer. Why shouldn't you be able to inherit from any object?

    Gosling's argument against classes is that they encourage implementation inheritance, instead of interface inheritance.

    Javascript lacks interface inheritance, and that's what makes it weak.

    IMHO, inheriting the implementation from an object buys you nothing of value because well-structured code simply doesn't need it.

  8. Re:Here's the link to the real info. by imbaczek · · Score: 3, Informative

    At least they didn't add templates. They did, sort of.

    Parameterized types
    A parameterized type is a template for new types and is defined by adding type parameters to class, interface, type, and function definitions:

    class Pair.<T> {
    var first: T, second: T
    }
    type Box.<T> = { value: T }
    function f.<T>( x:T ): T ...
    A parameterized type is instantiated by supplying concrete types for its parameters:

    new Pair.<int>(3, 4)
    f.<int>(37)
    var v: Box.<boolean> = new Box.<boolean>(true)
    The predefined types Map, Vector, IteratorType, and ControlInspector (among others) are parameterized.
    The parameterized types in ES4 do not allow for type parameter constraints or variance annotations. However, nothing precludes the inclusion of these in a future edition of the language.
  9. Re:Ugh by Anonymous Coward · · Score: 1, Informative

    Use typedef several times in preparation.