A pragmatic language for the JVM.

Gosu is a pragmatic programming language for the JVM. It has been designed with Java developers in mind by providing a set of features that allow them to be more productive without sacrificing the benefits of static typing. Gosu is an object oriented language with a sprinkle of functional programming features.

Gosu features:

  • Open Type System (similar to F# type providers)
  • Type inference
  • Enhancements (similar to Extension Methods in C#)
  • Full Java interoperability
  • Blocks (also called closures or lambda expressions)
  • Classes/Interfaces/Enums
  • Generics (reified, covariant type parameters and no wildcards)
  • Composition (with the delegate keyword)
  • Properties (similar to C#)
  • Null Safety (with the Groovy-like operator ?. and many more)
  • Named Arguments and Default Parameter Values
  • A powerful for each statement with user-defined intervals types
  • Feature Literals (to refer to a method on a Class)
  • Object Initializers
  • Classpath Statement and Shebang (useful when you use Gosu as a scripting language)
  • ...and more
// Type inference cuts down on the clutter
 var minLength = 4

 // Literal support for common data structures, such as Lists and Maps
 var strings = { "red", "green", "blue" }

 // Closures + pragmatic extensions to the core JVM classes
 print( strings.where( \ s -> s.length() >= minLength ).sort().join( ", " ) )

 // Utilizing the standard Java API
 var someFile = new java.io.File( "SomeFile.txt" )

 // Enhanced to make your life easier
 someFile.write( strings.join( ", " ) )
Information updated 01/24/16
View Comments