LoginSignup
1
1

More than 5 years have passed since last update.

FYI: a possible AltJS like skin in ES6 era.

Last updated at Posted at 2015-10-22

This is just a FYI about a proposal: Real ES6 JS with Coffeescript syntax.

I like coffeescript and livescript in ES5 world. But I also know the great power of ES6 now.
So, I'm interested in a possible AltJS in ES6 era.
I find mark-hahn's cool jsw trial.

Mark-hahn says:
"Unlike Coffeescript, JSW does not provide a new language with differing semantics. It is a thin skin over Javascript that only changes the syntax. ... JSW is a great way for Coffeescript users to migrate to real Javascript with ES6."

So,
JSW will turn jsw code such as

example.jsw
-> func1 arg1, arg2                 
  var hash1 = key1: val1            
              key2: val2            
              key3:                 
  block                             
    let x = y                       
    func2 x                         
    if q and z                      
      func1 "This is text spread    
             over two lines."    

into Javascript code like that:

example.js
function func1 (arg1, arg2) {
  var hash1 = {
    key1: val1,
    key2: val2,
    key3: key3
  }
  {
    let x = y;
    func2(x);
    if (q && z) {
      func1("This is text spread " +
            "over two lines.");
    }
  }
}

A possible future ;)

1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1