Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You are two users each talking about your team to promote a framework. I'll take some actual time to look at some code from the sole link here, which is the website:

  class DataDriven extends Specification {
      def "maximum of two numbers"() {
          expect:
          Math.max(a, b) == c

          where:
          a | b || c
          3 | 5 || 5
          7 | 0 || 7
          0 | 0 || 0
      }
  }
I see here a DSL that

* defines blocks without curlies by overloading the C-style label syntax normally used for break targets

* overloads the | and || operators to build tables of data without quotes around it

* uses strings as function names instead of camelCase

The Apache Groovy DSL enables that by having a complex grammar and intercepting the AST during the compile. Clojure, also for the JVM, has a simple grammar and provides macros, which are convenient for eliminating syntax in repetitive tests. I switched from Groovy 1.x to Clojure years ago for testing on the JVM.



In a team/company using Java, Groovy is a relatively easy sell compared to Clojure.

(I love Clojure and would much rather use it than Groovy.)


Show me the code, please?




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: