发布于 2014-08-11 23:47:55 | 200 次阅读 | 评论: 0 | 来源: 网友投递
Ceylon JVM上的新语言
Ceylon面向企业级应用开发设计,在JVM运行时基础上执行,支持与Java的交互操作。Ceylon语言充分借鉴了Java语言的优势并屏蔽其在设计上的不足,使用静态类型并提供高阶函数支持,在保持代码良好可读性的同时进一步降低开发者入门的难度。
Ceylon 1.1 已经开发6个月了,是时候给大家交待一下开发的进度了。这在 6 个月内我们处理并关闭了超过 650 个 issue,关于编译器和语言模块方面,其中 IDE 方面的问题有 300 个。
目前 Ceylon 1.1 优先级最高的是:
语言模块 API 的最终确认
清理和最小化使用 Java 和 JavaScript 代码
处理影响 Java 互操作的遗留问题
性能提升
IDE 构建的性能
当然,也包括很多 bug 修复。
语言方面的变化比较少,基本上 1.0 后我们认为比较稳定,而 1.1 主要新特性有::
因为 Byte 类专门为 JVM 的编译器中的 byte 优化
其他值得关注的变化:
Allow comprehensions to begin with anifclause.
Newsealedannotation to prevent extension or instantiation of a type outside the module in which it is defined.
Introduction ofdynamicinterfaces, designed for wrapping native JavaScript APIs.
Redefined-operator to work for anyInvertible.
Allow metamodel references toobjects and members ofobjects.
try (x)was changed to distinguish between the lifecycles ofObtainableandDestroyableresources.
The type of the expression{}is now{Nothing*}instead of[].
Allow refinement of multiple overloaded versions of a Java supertype method.
Added ability tocatchinstances ofThrowable.
最后两项变化比较大,但多数程序不受影响。
在 1.1 中我们引入很多思想和开发的效果在语言模块上,并非常小心的评审这些设计和范围,降低原生代码的使用、优化性能等等。
因此语言模块包含很多不兼容以前的变化,这些都会影响到现有的程序。但 1.1 之后就会稳定下来,不会再有大变化。
Addition of a raft of new methods and functions for working with streams.
Optimization of the performance ofArray, along with some minor improvements to interop with Java native arrays.
Removal of theCloneableinterface, and addition of aclone()method toCollection.
Addition ofThrowable.
Replacement ofCloseablewithObtainableandDestroyable.
Minor changes to the operations ofIterable,List, andMap.
ArraySequenceis nowsealedand may be instantiated via thesequence()function.
Substantial redesign ofEnumerableandRange.
Several changes to the type hierarchy for numeric types.
Removal ofSequenceBuilderand move ofStringBuildertoceylon.collection.
Removal ofLazyList,LazySetandLazyMap`.
主要是提升易用性
Ceylon.cararchives now include automatically generated OSGi and Maven metadata, and can execute in an OSGi container.
New API for cross-platform resource loading.
Support for deploying Ceylon modules to Vert.x.
主要包括:
Introduction ofceylon.locale,ceylon.logging, andceylon.promise.
Many enhancements toceylon.collection, including addition ofArrayList,TreeSet,TreeMap, andPriorityQueueclasses, along withStackandQueueinterfaces.
Various improvements toceylon.dbc.
Many improvements toceylon.test.
目前 collections 模块已经稳定。
IDE 的开发非常活跃,包含很多新特性和性能的提升:
Complete rework of build process, for much improved performance.
New refactorings: Move Out, Make Receiver, Move to Unit, Extract Parameter, Collect Parameters, Invert Boolean, Safe Delete.
Major enhancements to the Change Parameters refactoring.
Inline refactoring now works for shared class/interface members.
Brand new high quality code formatter.
Rewritten Ceylon Explorer with much better presentation of modules and modular dependencies.
New navigation actions: Open in Type Hierarchy View, Go to Refined Declaration.
Popup Quick Find References and Recently Edited Files.
Graphical Visualize Modular Dependencies.
Further integration of "linked mode" with refactorings and quick assists.
Useful Format Block source action.
Auto-escape special characters when pasting into string literals.
Synchronization of all keyboard accelerators with JDT equivalents (by popular request).
Save actions in Ceylon Editor preferences.
IntelliJ-style "chain completion" (hit ctrl-space twice).
Propose toplevel functions applying to a type alongside members of the type.
Several new options for customizing autocompletion and appearance in Ceylon Editor preferences.
New quick fixes/assists: convert between string interpolation and concatenation, convert to/from verbatim string, add satisfied interfaces, add type parameter, change named argument list to positional, fill in argument names, export module, convert to verbose form refinement, print expression, fix refining method signature, change toif (exists), change module version, assign tofor/try/if (exists)/if (nonempty)/if (is).
Run As Ceylon Test on node.js.
New default color scheme for syntax highlighting and many other aesthetic improvements.