What JVM language support

Currently Java virtual machine already supports a number of languages ​​other than the Java language, such as Kotlin, Groovy, JRuby, Jython, Scala and so on. The reason can support, because these languages ​​can also be compiled into byte code. The virtual machine does not care what language bytecode is compiled from the. Developers often use the IDE may find that when we Intelij IDEA, the right mouse button you want to create Java classes, IDE will be prompted to create other types of files, which is supported by some of the default IDE can run on top of the JVM language, without prompting, can be supported by plug-ins.

Currently, you can run on the JVM language directly lot, the more important today introduced nine. Each language presentation "HelloWorld" by the code section, to see what different grammar of different languages.

Kotlin
Kotlin is a run on the Java Virtual Machine statically typed programming language, it can also be compiled into JavaScript source code. Kotlin is designed program is used to produce high-performance requirements, it is up and running and Java is comparable. Kotlin can use this from JetBrains InteilliJ Idea IDE development tools, a plug-in.
The In Kotlin World hello
Fun main (args: the Array <String>) {
( "! The Hello, World") the println
}
Groovy
the Apache Groovy design of the object oriented programming language Java platform. Its syntax and style much like Java, Java programmers can quickly familiar with Groovy, in fact, Groovy compiler is acceptable entirely pure Java syntax format.
Using Groovy's an important feature is the use of type inference, that allows the compiler to infer the type of a variable when programmers not explicitly stated. Groovy can use other libraries written in the Java language. Groovy syntax is very similar to Java, most Java code is also matching Groovy syntax rules, even though the semantics may differ.
The Hello World the In Groovy
static void main (String [] args) {
the println ( 'the Hello, World!');
}
Scala
Scala is a multi-paradigm programming language, designed to integrate object oriented programming and functional programming each species characteristics.
Scala is often described as the programming language of our multi-mode, because it features a mix of many elements from the programming language. But in any case it is still essentially a pure object-oriented language. It is the biggest advantage compared to traditional programming language that provides the basis for a parallel programming framework for good measure. Scala code is optimized well into bytecode, and running as fast as native Java.
Scala the In World hello
Object the HelloWorld {
DEF main (args: the Array [String]) {
( "! The Hello, World") System.out.println;
}
}
JRuby
JRuby is used to bridge the Java and Ruby, which is to use than Groovy more short syntax to write code, so that each line of code can perform more tasks. Like you and Ruby, JRuby not only provides advanced syntax. It also provides an implementation of pure object-oriented, closures, etc., and JRuby with Ruby compared to a lot more than you can call itself Java-based library, although there are many Ruby libraries, but in the number and breadth is not with compared to the Java standard library.
World JRuby an In the Hello
"the puts 'the Hello, world!'"
Jython
Jython, a Java language written in the Python interpreter. Jython can be efficiently generated dynamically compiled Java byte code in the Python language.
World Jython an In the Hello
Print "the Hello, world!"
The Fantom
Fantom is a general purpose object-oriented programming language, created by Brian and Andy Frank, runs on Java Runtime Environment, JavaScript and .NET Common Language Runtime. Its main design goal is to provide the standard library API, to abstract the question whether the code will eventually run on the JRE or CLR.
Fantom is almost the same as Groovy and JRuby object-oriented programming language, but the tragedy is Fantom can not use Java class libraries, but uses its own extension libraries.
World the In the Fantom the Hello
class hello
{
static Void main () {echo ( "hello, World!")}
}
Clojure
Clojure is Lisp programming language modern, functional and dynamic tongues on the Java platform. Like other Lisp, Clojure code data depending on Lisp and has a macro system.
While Clojure can also be compiled into Java byte code directly, but can not use dynamic language features, and direct calls to Java class libraries. Unlike other JVM scripting language, Clojure is not regarded as an object-oriented.
World Clojure an In the Hello
(defn -main [& args]
(println "the Hello, World!"))
Rhino
Rhino is a full JavaScript engine written in Java, currently managed by the Mozilla Foundation.
Rhino features for JavaScript added a shell, and then embedded in Java, so Java programmers can make direct use. Rhino's JavaAdapters which allows JavaScript to perform specific functions by calling the Java class.
Rhino the In World hello
Print ( 'the Hello, World!')

Ceylon is a
Ceylon is a is an object-oriented, strongly statically typed programming language, emphasizing immutability, created by Red Hat. Ceylon programs running on the Java virtual machine, can be compiled to JavaScript. Language design focuses on source code readability, predictability, scalability, modularity, and meta-programming resistance.

Ceylon the In World hello
Shared void RUN () {
Print ( "hello, World!");
}
Summarized
Well, more than nine languages is the current mainstream in the JVM can run above. Plus Java exactly 10 species. If you are a Java developer, we need to master a more than 9 in, so you can have more choices in some scenes with special needs in. Recommended Groovy, Scala, Kotlin pick one.

 

Guess you like

Origin www.cnblogs.com/lujiahua/p/11404928.html