New JVM language comparison: Ceylon vs Kotlin vs Fantom

Source: Internet
Author: User
Tags java keywords

There are thousands of kinds of existing computer programming languages, and there are more than 10 languages on the JVM, so you don't have to be surprised by the programming languages you haven't heard of.

Java flaws

For the reasons of work, the Java comparison is understood. From Java We summarize the lesson:

    1. object can be assigned null to cause NPE
    2. Exception to be inspected (checked exception)
    3. Attribute Getter,setter too annoying
    4. Interface cannot be implemented (JAVA8 fixed)
    5. Lack of lambda (java8 fixed)
    6. The overloading method causes damage to readability and dynamic calls.
    7. Language layer lacks modularity support
    8. Concurrency support is bad.
    9. The original type is not an object
05 After JVM language comparison

I mainly talk about the new languages on several JVMs: Ceylon, Kotlin, Fantom. Their properties are compared in the following table:

Features Ceylon Kotlin
Fantom Swift
Non-nullable type (non-nullable)
Yes Yes Yes Yes
Interface Implementation (MIXIN)
Yes
Yes
Yes
No
Extension Method (Extension)
No
Yes
No Yes
Declarative programming (declarative)
Yes
Yes
Yes
No
Dynamic Invocation (Dynamics)
Yes
Yes
Yes
No
Functional (LAMBDA)
Yes
Yes
Yes
Yes
Immutability (immutability)
Weak
Weak
Strong Weak
Standard library completeness (API)
Yes
No Yes
Yes
Modular Support (modularity)
Yes
No Yes
No
Operator overloading (Operator)
Yes
Yes
Yes
Yes
Default parameters (Defaultparam)
Yes
Yes
Yes
Yes
Fan type (generics)
Yes
Yes
No Yes
Property Getter/setter
Yes
Yes
Yes
Yes
Platform-based
Jvm,js Jvm,js Jvm,js,clr Ios


the above Swift is just a comparison. There are many new features that are not listed, such as "type inference", etc.

New language trends

1. The emerging programming language features tend to be unified, learn from each other and draw lessons from each other. where "non-nullable type", "Lambda closure", "attribute (getter/setter)", "compiled as JavaScript", became the standard configuration of the new language.

2. All of the new occurrences are static types and cannot see the dynamic type figure. Dynamic language is not good at reconfigurable and operational performance .

3. Object-oriented is still the mainstream of industry, and the time-tested.

History of non-nullable types

As long as the Java programmer, must be nullpointerexception to suffer. Since you have a non-nullable type, stay away from the NPE.

It is said that this concept has long been known in functional languages and is called an optional type. I first saw the question mark syntax in C #, but C # just put him in the original type. Fantom extended him to all types, and then almost became the standard of the new language. Swift calls him an optional type, stating that the inspiration is not from C #, but from the functional language.

CommentsIn addition to the above, the JVM programming language also has: gosu,xtend,x10,clojure, and the older generation of Scala,groovy.
    • Xtend and X10 compiled into Java source code, rather than Java bytecode, I am more worried about how to step through debugging.
    • Ceylon changed a lot of Java keywords, such as public to shared, the individual does not like this behavior. Another characteristic algebraic type of Ceylon is not listed in the table, because I think this thing is not very useful except to encourage the use of if instead of polymorphism.
    • Kotlin Grammar I prefer , almost like Swift. Instead of having a standard library of its own, it expands on a Java basis. I'm worried about how to expand to other platforms in the future. Also note that it will not increase the modularity of support.
    • the strong non-volatile type of fantom is characteristic. The lack of style is a soft rib, which is said to be the same philosophy as the go language.
    • Swift does not support garbage collection a bit, the memory leaks caused by reference counting are also difficult to check.
Prospect

Although these JVM languages have better features, they do not determine the foreground. The most promising is swift, a big company backed by a framework that has a language for development scenarios. I'm just studying this for fun.

Finally, language is just a tool, and the creation and use of tools is the essential difference between humans and animals.

New JVM language comparison: Ceylon vs Kotlin vs Fantom

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.