Little Smallscript http://ympbyc.github.com/LittleSmallscript/
| Animal Snake sam |
Animal := Object subclass.
Animal method: [:name |
this at: #name put: name
] at: #init.
Animal method: [:metres |
window alert: ([@name](/user/name) + 'moved ' + metres + 'm.')
] at: #move.
Snake := Animal subclass.
Snake method: [
"'super' is not supported yet"
window alert: 'Slithering...'.
self move: 5
] at: #crawl.
sam := Snake new: 'Sammy the Python'.
sam crawl
six https://github.com/matthewrobb/six
// Arrow Function
[ 1, 2, 3 ].forEach( item => print(item) )
// Egal Operators
if(x isnt y && y is z) { }
// Classes
class Person {
constructor(name) {
this.name = name
}
greet() {
print("Hello, my name is " + this.name + ".")
}
}
// Quasi Literals / Template Strings
var me = new Person("Matthew")
print(`Hello, my name is ${me.name}.`)
List of languages that compile to JS https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS
没完没了...
回复 (6)
J
这个世界的新朋友, 就是在没完没了地重复地造轮子
G
其乐无穷呗
L
引用 j4cnodejs这个世界的新朋友, 就是在没完没了地重复地造轮子
重复造轮子是成长之路
J
引用 j4cnodejs这个世界的新朋友, 就是在没完没了地重复地造轮子
大家都是冲着 JS 杀过去的 :P 我也好想那么玩啊, 自己造一门能实用的 JS 方言, 那就帅了
J
引用 j4cnodejs这个世界的新朋友, 就是在没完没了地重复地造轮子
@jiyinyiyong 都编译成javascript ,那以后javascript岂不成了伪汇编语言?
J
参与回复
登录后即可参与回复。登录