A few weeks ago an interesting question was asked on the StackOverflow. Someone experimented with a recursion in Groovy and stepped into
Closure.trampoline() . It quickly turned out that using
TrampolineClosure makes a recursive execution slower. Is this a valid behavior, or do we do something wrong?
It’s been a week since GR8Conf EU 2019 is over, so it is the right time to write some recap of this outstanding event. It was my first time at GR8Conf, both as a speaker and an attendee. I spent an awesome six days in the beautiful city of Copenhagen, and I brought a lot of good memories back home. I want to share them with you in this short blog post. Enjoy reading!
GR8Conf EU 2019 starts precisely in 13 days (on May 27th). Each year Copenhagen becomes a heart of Groovy vibrant community for 3 days. The conference offers both talks and workshops, focused on Groovy related topics such as upcoming Groovy 3 release, building DSLs, using Micronaut in the cloud-native environment, or testing applications with Spock and Geb, to name a few. And that’s not even a quarter of great stuff you can expect from it. This year you can also attend one of my three talks I’m going to deliver.
Spock Framework executes test methods (features) in a single class (specification) in the declaration order. There is nothing wrong in this default behavior - we should write tests with their isolation in mind. However, in some cases, we would like to randomize test methods execution. Today we are going to learn how to do it.
Ratpack is an excellent tool for building RESTful applications. However, to benefit most of it, we need to know the tool a little bit better. It applies to Ratpack handler’s mechanism - it is much different compared to what we have learned by using many popular MVC frameworks. In today’s blog post I would like to show you a relatively simple example that confused many newcomers.
In the second part of the "Groovy Regular Expression" blog post, I want to show you some benchmarks. And let me make one thing clear - the following results you are going to see are not scientific proof. I present those results only to give you a hint about the overall performance of some cool features you have seen before.
Welcome to "Groovy Regular Expressions - The Definitive Guide"! In the next 15 minutes, you are going to learn everything you need to start working productively with regular expressions in Groovy programming language. Let’s get started!
One of the most interesting Groovy features is its ability to configure advanced compiler options using DSL script. It becomes handy when you want to apply some global modifications to all Groovy classes. (For instance, you want to add
@CompileStatic annotation to all classes, without applying changes to the source code). In most cases, you want to add something to the existing source code, e.g., classes imports or useful annotations, but what if we want to remove one annotation or another?
The Apache Groovy programming language has extraordinary scripting capabilities. When you combine it with the Grape dependency management system, it turns out that the sky is the limit. In one of the previous blog posts, I explained how you can start compiling Groovy code to the native binary files, using GraalVM’s
native-image compiler. This time I tried to do the same with the Groovy script that uses Grape to provide an external library to the classpath. I thought it won’t be possible, but luckily - I was wrong.
When I get the paperback copy of the "Programming Groovy 2" book back in the June 2017, I was wondering if I can find something new or exciting in the book that was written in July 2013. It took me almost 1,5 year before I have finally put the book on my desk and started reading and playing around with the examples. As a veteran Groovy developer, I have to say - it was worth it!
Spock Framework is one of my favorite tools in the Groovy ecosystem toolbox. It makes writing automated tests a few times more pleasant thanks to its opinionated syntax. From time to time I see some corner cases where Spock behaves unexpectedly. Today I would like to show you one of these corner cases and explains what happens under the hood.