Will groovy (grails) give you compile time checking like java?
If you always specify the type, will that change things much?
"With the @CompileStatic, the performance of Groovy is about 1-2 times slower than Java, and without Groovy, it's about 3-5 times slower.
Groovy is an object-oriented programming language for the Java platform. Grails is an open-source web application framework. So, what is the link between them? It turns out that Groovy is a perfect language to use as a domain-specific programming language to build web applications using Grails.
Groovy is a compiled language, but it allows you to execute scripts. Calling groovy like you did compiles and runs the script.
Compile-time checking occurs during the compile time. Compile time errors are error occurred due to typing mistake, if we do not follow the proper syntax and semantics of any programming language then compile time errors are thrown by the compiler.
Since Groovy 2.0 it is possible to check types at compile time. Annotations can be used on class or method: @TypeChecked or @CompileStatic. The 1st one tells compiler to do type checking during compilation and the 2nd one force it to do 'static compilation' which more or less results with binary code like from native JAVA compiler. Of course, usage of the 2nd annotation involves type checking by itself.
Grails 2.2 is the first release that uses Groovy 2.0.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With