基于 JVM 的編程語言,Kotlin 1.0 Beta 3 發布

jopen 9年前發布 | 8K 次閱讀 Kotlin

Kotlin 是一個基于 JVM 的新的編程語言,由 JetBrains 開發。

其主要設計目標:

  • 創建一種兼容Java的語言

  • 讓它比Java更安全,能夠靜態檢測常見的陷阱。如:引用空指針

  • 讓 它比Java更簡潔,通過支持variable type inference,higher-order functions (closures),extension functions,mixins and first-class delegation等實現。

  • 讓它比最成熟的競爭對手Scala語言更加簡單。

Kotlin 1.0 Beta 3 發布,此版本主要是要完成標準庫開發,還有移除一些廢棄的語言結構。同時還有一些 bug 修復,性能提升。此版本包括庫,語言,IDE 和 Android 擴展方面的改進和修復。詳細改進內容請看 發行說明

改進列表:

  • Library

    • increment deprecated in Progressions in favor of step property to Progressions, for-loops updated to refer to step

    • contains() and other similar extensions now accept supertypes of the element of the collection

    • Delegates.mapVal and mapVar, MapVal, MapVar, FixedMapVal, FixedMapVar are deprecated

    • String.toCharArray() introduced instead of String.getChars(); String.toCharList() deprecated

    • MutableCollection.removeAll(predicate: (T) -> Boolean) and similar for retainAll added

    • sequence(initialValueFunction, nextValueFunction) doesn't evaluate first value until it's requested by sequence iterator

    • sequenceOf(Progression) deprecated

    • flatten operation for Sequence<Iterable<...>> added

  • Langauge

    • No references to PropertyMetadata are generated in the byte code

    • Suffixes to numeric literals, such as 1baz are prohibited

    • Comma-separated conditions in when without an argument are prohibited (KT-5143)

    • Annotation classes can't be instantiated (KT-4391)

    • Arrays of annotations supported as annotation arguments (KT-10136)

    • Generic types in catch clauses (including reified T) are prohibited (KT-9816)

    • protected members are allowed in companion objects

    • Calls to non-@JvmStatic protected members of companion objects from subclasses are marked as errors (unsupported)

    • "" is reserved as a token (KT-9708)

    • Enum entry can not be used as a type (KT-5401)

    • Enum.values is deprecated in favor of Enum.values()

    • private setters are now deprecated for open properties

    • Local sealed classes are deprecated

    • Use of uninitialized variables in lambdas / object literals / local functions is forbidden

    • Overriding setter cannot weaken visibility

    • Inner classes are no longer allowed inside enum entries

    • Implicit receiver smart casts are supported

    • Older deprecations have become errors

    </ul>

    下載:

    kotlin-compiler-1.0.0-beta-3595.zip

    來自:http://www.oschina.net/news/68768/kotlin-1-0-beta-3

     本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
     轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
     本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!