• Thr 2018.09.27

    I should have asked this question a year ago.

    From: http://www.espruino.com/FAQ

    'we do implement as standards-compliant as possible'

    and reference link http://www.espruino.com/Reference

    which refers to 'View MDN documentation'

    which doesn't have a language reference as such but refers to ECMAScript, many versions


    and MDN appears to mix versions in their own examples and snippets.

    We have Jscript, LiveScript, ActionScript, ECMAScript, Vanilla Javascript to name a few, and now for microcontrollers, the Espruino flavor. @allObjects did I leave out any?

    ref: https://en.wikipedia.org/wiki/JavaScript­

    The Espruino function reference, which is not a language reference


    So as to reduce the number of questions to be asked, what are the links to the reference material that covers both the Javascript Standards (which version) and the Javascript Language Reference that should be followed for development on the Espruino platform?

    Using those links and for others that are starting out, please embellish the FAQs page under heading 'Is Espruino 100% JavaScript compatible?'

    EDIT Sun 2018.09.30
    Ref #4 below

    Ok, features table is now here: http://www.espruino.com/Features

  • @Robin, good point... things get a bit murky...

    An explanation of the easier sort can be given for the point

    The Espruino function reference, which is not a language reference

    Because Espruino roots in MC / Hardware and the firmware includes a standalone JavaScript, it is kind of the hardware reference, because there is no operating system layer involved on top of which applications written in JavaScript or any other Language do run. JavaScript / Espruino_JavaScript IS the operating system through which all of Espruino Hardware is controlled; that's why all these extra, Espruino hardware (and soft/firm-ware) specific functions and classes exist. And for the applications, the same 'operating system command language' has been chosen to make life easy (for Web knowledgeable developers/users). - Historically it was though the other way round: @Gordon goal was to make IoT accessible for the sleuth of Web knowledgeable users and using related readily available technology and infrastructure, such as the browser - as a fine contra-point to the Arduino world... - with other finesses built in... like event drivenness, (extreme) low power (for battery operation with very long battery life), extreme small (PICO, now NRF52...), no complex build system, low memory, and very powerful - 32bit (self serving too, because interpreters need a bit more juice to get around).

    This concept of having a hardware and only one language is known since first small computers showed that were, for example, controlled with BASIC, Business BASIC, etc. The language was then extended with commands needed to operate basic hardware functions, such as writing / reading / loading a program file - operations not needed in data processing applications. Famous examples are Commodore PET, Sinclair ZX80, to name a few from the INTEL 4000 / 8080 triggered MP - Micro Processor - revolution. There were others like Wang T - a fully TTL 74... built machine - also BASIC, and of course HP, IBM, etc. with their first desktop computers but proprietary processors.

    With the Standalone JavaScript aka Espruino the reference you mention is THEentry point for any reference - hardware and software.

    Once browsing the Espruino Reference, MDN - Mozilla Developer Network - is referenced where suitable. No point to describe things again that are already standard and accepted and part of Espruino. It was and is @Gordon's goal to be ES up to date to the point of feasibility... and things that came with ES6 really shook the tree, and therefore, more subtile differences are between MDN ES6 and Espruino. It is though pointed out... but may be this part could need a bit more help for developers joining more recently the Espruino train and therefore missed past Espruino evolution history.

    The reference tries hard to include user guidance by referencing actual projects, tutorials, and other dedicated pages to help explore the features not standard to JavaScript and where different. Language is one part of this discussion... but there are also this class or object libraries that often fall in to a gray zone... and especially the modules, which connect hardware specifics to JavaScript code that is completely missing in a typical application programming language for data processing. The modules are node.js aligned (vs. AMD or Browser oriented), even though more recently these lines begn to blur, because JavaScript as standard is picking up on these needs. So far this was always some 3rd-party driven effort... also until more recent, JavaScript in the browser could not access any hardware of the hosting system, such as sending / receiving bytes over USB, etc.

    That there is a need for clarification and focus shows thru Useful forum posts, which otherwise would not have come to be. Grabbing this flag and running with it is lots of work and so far no one has taken on to be the curator(s)... @Gordon could have, but then we wold not be able to enjoy his generous helping hands in the forum - and Espruino would not evolve and grow as fast as it is. Partake in the forum takes a lot of his time and his crucial contributions are very appreciated by the community - and expressed so. @Gordon's immediate presence is one of the key ingredients of the secret sauce that made Espruino become what it already is.

    It's for sure an agile world (see manifesto)... where - for example - working code (examples) is(are) valued over documentation... like all pendulums swing...

    Conclusion form this not so crisp post is, that some more can be done in the
    JavaScript w/ Espruino User Guide area, where things are picked up that are not pure reference oriented.

  • Thanks @allObjects.

    In reality things are quite murky with JavaScript.

    Even in the browser world it's confusing - look at MDN for example... Go to https://developer.mozilla.org/en-US/docs­/Web/JavaScript/Reference/Functions/get and look under Browser Compatability - not all browsers (or versions of browsers) support all features.

    In reality even if I maintained my own complete language reference (which is a huge undertaking) very few people would actually read through it.

    It's been suggested that I add a table of JS features (maybe linking to MDN) and their status of support in Espruino though - and I think that could well be a good idea.

    As @allObjects says, I have limited time available to work on things. I split it between updating docs, tutorials, the forums, Espruino software, hardware, shipping, advertising, and more. Some things (like a full language reference) which would suck up time on an ongoing basis as Espruino changed just have to get left out.

    Having said that, all the documentation is open, so it's trivial to suggest changes/improvements. There's a link at the bottom of each page on the Espruino site.

  • Ok, features table is now here: http://www.espruino.com/Features

    Should clear up what's in Espruino and what isn't.

  • Sun 2018.09.30

    Thank you Gordon, nicely done!

  • Actually this was pretty useful. :) I also quite like the "Official" tag. :P

  • Thanks. Honestly it's hard to think of a good word instead of Official (I'm open to suggestions). It's not really true since some other boards do have support, but if you get an official Espruino board then you are guaranteed to have it :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Which Javascript Standards Version and Javascript Language Reference should be used?

Posted by Avatar for Robin @Robin