Live data from Hacker News

Gosu – A pragmatic language for the JVM

gosu-lang.github.io

1–10 of 79 posts

Re: Gosu – A pragmatic language for the JVM

#2
I'm fairly new to the language, as it hasn't been mentioned much since it's public release several years ago. The language takes many queues from Ruby; for example, "enhancements" are similar to monkey patching in Ruby. The syntax, semantics, and standard library (especially in collections) are also familiar.

e.g.:

Ruby

[1, 2, 3].map { |x| 2 * x }

Gosu

{1, 2, 3}.map (\x -> 2 * x)

Unlike Ruby, Gosu provides a static type system which includes type inference and structural typing (similar to Go's interfaces). It also includes an open type system (http://devblog.guidewire.com/2010/11/18/gosus-secret-sauce-t...), which allows first-class representations of user created types at compile time – no code generation is needed. F# programmers would find many similarities between Gosu's open type system and F#'s type providers.

Like most JVM languages, you can leverage Java compatibility to use all of the third-party libraries you want. Compared to Scala, Gosu tends to eschew complexity for simplicity and pragmatism. Their implementation of generics is a good example of this.

And of course, Gosu just has a lot of features that make it enjoyable to work with. Such as the null-safe invocation operator (?.), elvis operator (?:), type variable reification, terse syntax, etc.

Re: Gosu – A pragmatic language for the JVM

#3
From a quick glance, this looks very nice and well thought-out.

The only thing that I didn't like at first glance was that closures aren't explicitly delimited:

    print( strings.where( \ s -> s.length() > 3 ).sort() )
This looks like it could get ugly very fast if you want to write any kind of non-trivial closures. (Which is some of the same criticism that python often gets, and from which one could learn).

"if", "for", "using" and all the other standard constructs use curly braces around the code - why not lambdas too? Hey, they even call them "Blocks" in the documentation (http://gosu-lang.github.io/docs.html#blocks)

Re: Gosu – A pragmatic language for the JVM

#7
Hey Everyone,

I'm a developer on the project.

We are going through an open-source reboot with Gosu, moving all development out onto Github, and the current site and release isn't 100% ready for prime time, but I guess it's too late for that now...

I'm happy to answer any questions anyone has.

Also, we are working on a web micro-framework called SparkGS:

  http://sparkgs.github.io/
which is a wrapper around the excellent SparkJava library.

Re: Gosu – A pragmatic language for the JVM

#8
post #6

Something seems amiss with their 'Play' page ( http://gosu-lang.github.io/play.html ). The Hello World template printed 'gosu' hundreds of times.

I saw that. The site isn't 100% ready for primetime (we are mid-reboot of the open source effort) so, yeah... pardon our dust. :)

Re: Gosu – A pragmatic language for the JVM

#9
post #6

Something seems amiss with their 'Play' page ( http://gosu-lang.github.io/play.html ). The Hello World template printed 'gosu' hundreds of times.

I saw that. The site isn't 100% ready for primetime (we are mid-reboot of the open source effort) so, yeah... pardon our dust. :)

Nothing a `heroku restart` can't fix. :)

Re: Gosu – A pragmatic language for the JVM

#10
I've tried to figure out for a while why the creators think this language is more practical than, say, Java. They don't seem to answer that directly. To me, it looks too much like other languages I already know. I'm not that impressed with their feature laundry list. That makes me wonder, why I should care about Gosu.
Post reply on HN