简体   繁体   English

Groovy和Groovy ++,它们有什么不同吗?

[英]Groovy And Groovy++,Are they different?

我最近才知道groovy ++已经发布了,Groovy和Groovy ++的主要区别是什么?

From the groovy++ page http://code.google.com/p/groovypptest/ 来自groovy ++页面http://code.google.com/p/groovypptest/

Groovy++ is statically typed extension of Groovy programming language. Groovy ++是Groovy编程语言的静态类型扩展。 Additionally to all goodies of standard Groovy it adds a lot of functionality 除了标准Groovy的所有好处之外,它还增加了许多功能

  • compile time checking of code 编译时检查代码
  • as fast as Java performance of compiled code 与编译代码的Java性能一样快
  • easy mixing of statically and dynamically typed code 轻松混合静态和动态类型的代码
  • very powerful type inference 非常强大的类型推断
  • tail recursion traits (interfaces with default implementation) tail recursion traits(具有默认实现的接口)
  • extension methods (compile time categories) 扩展方法(编译时间类别)
  • standard library of utilities for functional programming, concurrency and distributed computing (early prototype stage) 用于函数式编程,并发和分布式计算的标准实用程序库(早期原型阶段)

There is a good article on what Groovy++ brings to Groovy here . 有什么的Groovy ++带给Groovy的一个很好的文章在这里 It includes benchmark results, so you can see the performance difference vs. Groovy and straight Java. 它包括基准测试结果,因此您可以看到与Groovy和直接Java相比的性能差异。

Groovy++ is an extension to the core Groovy 1.x language. Groovy ++是核心Groovy 1.x语言的扩展。 You drop the GroovyPP.jar file into the Groovy library directory, add @Typed in front of the package keyword in your code, then run your code just as you would in core Groovy. 将GroovyPP.jar文件放入Groovy库目录,在代码中的package关键字前添加@Typed,然后像在核心Groovy中一样运行代码。 It infers the types, AND runs faster! 它推断出类型,运行速度更快!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM