-
in Dart 输出: 'top-level' CoffeeScript 2009,4年前 Jeremy Ashkenas CoffeeScript 受 Ruby 和 Python 影响较多 ● 简洁、语法清晰 ● 缩进表示 ● 变量声明和作用域 ● 支持类 ● …… CoffeeScript #coffee alert "I knew it!" if elvis //JavaScript if (typeof elvis !== "undefined" && elvis !== null) { alert("I knew it!"); } CoffeeScript math = root: Math.sqrt square: square cube: (x) -> x * square x math = { root: Math http://try.dartlang.org/ ● TypeScript http://www.typescriptlang.org/Playground/ ● CoffeeScript http://coffeescript.org/ CoffeeScript等编译器就是 JS 实现的,可以在线直接编译。 Dart 有所不同,dart2js 编译器 是 Dart 语言实现的,然后 dart2js 自己把自己编译成了
0 码力 |
91 页 |
3.44 MB
| 1 年前 3
-
都可称为AltJS AltJS TypeScript ●JS + 静态类型 ●工具完善 ●贴合语言标准 TS和伙伴们 ●动态类型语法糖: CoffeeScript ●静态类型新语言: BuckleScript ●渐进定型: Flow Type CoffeeScript ●纯语法糖,动态类型 ●上手简单 ●工具不良 ●与新标准有冲突 BuckleScript ●脱胎于OCaml ●类型系统强大 ●编译高度优化 ●编译高度优化 ●语义语法疏远,上手难* Flow Type ●JS+类型标注 ●工具相对完善 ●上手容易 ●与TS设计相似* 比较 类型系统 难度 工具链 CoffeeScript 动态 低 差 BuckleScript 很强 高 较好 FlowType 强 较低 较好 TypeScript 强 低 很好 TS发展史 ●简单易用,不求完美 ●原汁原味,贴合JS ●从简单到强大
0 码力 |
64 页 |
6.17 MB
| 1 年前 3
-
Parameters 36 Examples 36 Using Browserify with Vanilla Javascript 36 Using Browserify with Coffeescript 36 Chapter 15: Using file filters. 38 Examples 38 Creating Images, JS, and CSS(SASS) rule for task('one', function() { // compile sass css }); gulp.task('two', function() { // compile coffeescript }); // task three will execute only after tasks one and two have been completed // note that insertGlobals: true }) .pipe(gulp.dest('./build/')); } Using Browserify with Coffeescript First install gulp and browserify via npm i gulp gulp-coffeeify. This will install browserify
0 码力 |
45 页 |
977.19 KB
| 1 年前 3
-
Compile to JavaScript tools • There are a lot. • 345 • Source: https://github.com/jashkenas/coffeescript/wiki/List-of- languages-that-compile-to-JS • Ruby, Python, Erlang, Java, Scala, C#, F#, Lisp Compile to JavaScript tools • There are a lot. • 345 • Source: https://github.com/jashkenas/coffeescript/wiki/List-of- languages-that-compile-to-JS • Ruby, Python, Erlang, Java, Scala, C#, F#, Lisp
0 码力 |
61 页 |
3.65 MB
| 1 年前 3
-
是使用基于测试框架对Promis的支持,还是使用基于类似 done 这样回调风格的测试方 式,每个人都可以自由的选择,只是风格问题,我觉得倒没必要去争一个孰优孰劣。 比如在 CoffeeScript41下进行测试的话,由于CoffeeScript 会隐式的使用return返回,所 以使用 done 的话可能更容易理解一些。 对Promise进行测试比对通常的异步函数进行测试坑更多,虽说采取什么样的测试方法 。首先能想到的原因是有些运 行环境并不支持 ES6 Promises 。 40 https://github.com/azu/promise-test-helper 41 http://coffeescript.org/ JavaScript Promise 迷你书(中文版) 57 当我们在网上查找Promise的实现类库的时候,有一个因素是首先要考虑的,那就是是 否具有 Promises/A+兼容性
0 码力 |
112 页 |
1010.02 KB
| 1 年前 3
-
app.getVersion()); 7. 8.