博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JetBrains公司引入了新的JVM语言Kotlin
阅读量:7071 次
发布时间:2019-06-28

本文共 2799 字,大约阅读时间需要 9 分钟。

  hot3.png

So far, Kotlin has been primarily known as a Russian island thirty kilometers west of Saint Petersburg. More recently, the Czech company introduced a new programming language named  running on the JVM (Java Virtual Machine). It is the intent of the language developers to get rid of some challenges in the Java language.

JetBrains’ product portfolio mainly consists of IDE for Java, PHP, Objective-C, Ruby and  MPS. With the Project Kotlin they are now entering unchartered space.

The language developers emphasize, that the main design goals behind their project are:

    • to create a ,
    • make it safer than Java, i.e. statically check for common pitfalls such as ,
    • make it more concise than Java by supporting ,  (closures), , , etc;
    • and, keeping the useful level of expressiveness (see above), make it way .

According to JetBrains, the new language is statically typed, object-oriented,  targets the JVM, is built for industrial use, and gets rid of problems and challenges in Java that are due to backward compatibility.

For instance, the type system takes control of Null references so that Kotlin does not need Null Pointer Exceptions. There are no raw types in Kotlin, arrays are invariant, and generics are type-safe even at runtime. In addition, the language supports clojures that can be optimized using inlining. And it doesn’t support checked exceptions, which many language designers consider a bad feature, anyway. An essential aspect is the interoperability between Kotlin and Java: Kotlin can call Java, and Java can call Kotlin.

The following code snippet illustrates a simple object-oriented “Hello World” implemented in Kotlin. Further examples are available by.

class Greeter(name : String) {       fun greet() {          println("Hello, ${name}");       } } fun main(args : Array
) { Greeter(args[0]).greet() }

 

There are a couple of other languages that consider themselves reasonable alternatives to Java. In particular, Scala, Fantom, Groovy, Gosu, and Ceylon are natural competitors with Scala and Groovy having achieved the most distribution.

At the moment, there is lot of - sometimes heated - debate in different discussion groups how Kotlin compares to other languages such as in the  website or in the .

It remains to be seen how many software developers will consider Kotlin as their language of choice. At least, the reactions of many developers prove that Kotlin has at least entered the race for the next new cool language.

A public Beta will be available at the end of 2011. Reportedly, there will be an open source compiler and IntelliJ IDEA plug-in under the Apache 2 license. While the compiler will initially emit Java byte-code, there might also be a Kotlin version emitting JavaScript.

 

RelatedVendorContent

转载于:https://my.oschina.net/opleo/blog/28666

你可能感兴趣的文章
CPU-bound(计算密集型) 和I/O bound(I/O密集型)
查看>>
线性时间 筛素数,求前n个数的欧拉函数值,求前n个数的约数个数
查看>>
Spring 中JDKProxy和CGlibProxy的区别
查看>>
在Map 3D显示管理器中更改当前地图的名字
查看>>
通俗解释WIndows上的CRITICAL SECTION
查看>>
下载文件使用缓存(一次性读取到内存),优化性能(注意静态对象修改需要加锁)...
查看>>
组织行为学对项目管理的意义(2):人格的大五模型
查看>>
NGUI Sprite Type(Simple、Sliced、Tiled、Filed、Advanced)
查看>>
Windows Phone开发(12):认识一下独具个性的磁贴
查看>>
每日英语:Six Ways to Modernize Your Car
查看>>
使用VS2010开发Qt程序的一点经验
查看>>
tpl demo
查看>>
用Ghostscript API将PDF格式转换为图像格式(C#)
查看>>
Android自定义进度条
查看>>
编写高质量代码改善C#程序的157个建议[匿名类型、Lambda、延迟求值和主动求值]...
查看>>
CkEditor 插件开发
查看>>
《如何让TT T4模板输出多个文件(VS2010中)》-- access911.net 文章
查看>>
CSS Hack大全-可区分出IE6-IE10、FireFox、Chrome、Opera
查看>>
从程序员到项目经理(16):原来一切问题都是可以解决的【转载】
查看>>
当kfreebsd 用户遇见openSUSE系统
查看>>