FWIW I do not think ES6 modules are a good solution for your problem. Since 
they are not in browsers, you would effectively be adding a layer of 
indirection (the “transpilation” James discusses) that serves no purpose 
besides to beta-test a future platform feature for us. There are much more 
straightforward ways of solving your problem, i.e. I see no reason to go Java 
-> JavaScript that doesn’t work in browsers -> JavaScript that works in 
browsers. Just do Java -> JavaScript that works in browsers.

From: James M. Greene [mailto:james.m.gre...@gmail.com]
Sent: Friday, September 5, 2014 05:09
To: Robert Hanson
Cc: David Rajchenbach-Teller; public-webapps; Greeves, Nick; Olli Pettay
Subject: Re: =[xhr]

ES6 is short for ECMAScript, 6th Edition, which is the next version of the 
standard specification that underlies the JavaScript programming language.

All modern browsers currently support ES5 (ECMAScript, 5th Edition) and some 
parts of ES6. IE7-8 supported ES3 (ES4 was rejected, so supporting ES3 was 
really only being 1 version behind at the time).

In ES6, there is [finally] a syntax introduced for importing and exporting 
"modules" (libraries, etc.).  For some quick examples, you can peek at the 
ECMAScript 
wiki<http://wiki.ecmascript.org/doku.php?id=harmony:modules_examples>.

A transpiler is a tool that can take code written in one version of the 
language syntax and convert it to another [older] version of that language.  In 
the case of ES6, you'd want to look into using 
es6-module-transpiler<http://esnext.github.io/es6-module-transpiler/> to 
convert ES6-style imports/exports into an AMD (asynchronous module 
definition)<https://github.com/amdjs/amdjs-api/blob/master/AMD.md> format.

That is, of course, assuming that your Java2Script translation could be updated 
to output ES6 module syntax.

Sincerely,
    James Greene

On Thu, Sep 4, 2014 at 4:55 PM, Robert Hanson 
<hans...@stolaf.edu<mailto:hans...@stolaf.edu>> wrote:
Can you send me some reference links? "transpiler"? "ES6 Module"? I realize 
that what I am doing is pretty wild -- direct implementation of Java in 
JavaScript -- but it is working so fantastically. Truly a dream come true from 
a code management point of view. You should check it out.

As far as I can see, what I would need if I did NOT implement async throughout 
Jmol is a suspendable JavaScript thread, as in Java. Is that on the horizon?
Bob Hanson
​

Reply via email to