Live data from Hacker News

Gosu – A pragmatic language for the JVM

gosu-lang.github.io

71–79 of 79 posts

Re: Gosu – A pragmatic language for the JVM

#71

Why Gosu over Groovy or Kotlin?

Gosu, like Scala, Kotlin and Ceylon, was built to be statically typed from the ground up and thoroughly tested and documented by many developers, with dynamic typing added to some of them as an afterthought, like the Dynamic type in Scala.

Groovy, like Clojure, Beanshell, Jython, JRuby, Rhino and Nashorn, was built to be dynamically typed from the ground up, with static typing added opportunistically in version 2.0 by a single developer and requiring klunky annotation syntax.

Re: Gosu – A pragmatic language for the JVM

#73
Very cool. I'm starting a JVM-based project, and I'd love to use this in the places where I was planning to use JRuby. Besides being impressed overall, two pieces of feedback:

* On enhancements, I very much like C# extensions design, partially because I do have to import them explicitly. One of the things I dislike in Ruby is that you don't know where your methods come from, and that gets more complicated when they're actually from third-party gems. If a jar is giving me an enhancement, how does that work? How do I handle name conflicts?

* I'd love to have some built-in support for shell commands, a la Ruby's tick marks.

Re: Gosu – A pragmatic language for the JVM

#74

At (insert swear word here) last! "The classpath can also include Maven coordinates, and Gosu will automatically resolve and download them at runtime: #! /path/to/gosu classpath "../src,org.gosu-lang.gosu:sparkgs:0.1.0" print( "Here is a library object: ${new SweetLibraryObject()}") " Been writing java for 14 years and I've never had a nice way to run scripts. Now if you can work natively (tougher than folk think) wi…

Well, Groovy has done it for a long time ...

    #!/usr/local/bin/groovy
    @Grab(group='org.springframework',module='spring',version='2.5.6')
    import org.springframework.jdbc.core.JdbcTemplate

    println "..."
Actually Groovy looks really similar to Gosu and one would argue has a lot wider recognition and support. But then, I do like that Gosu feels much "cleaner" in some way that Groovy doesn't.

Re: Gosu – A pragmatic language for the JVM

#75
post #31

Earlier quoted context omitted.

It's statically typed.

Groovy allows you statically typed variables also (if you want it).

So the answer would be, it's statically typed by default, whereas Groovy is optionally statically typed. Groovy's static typing can be a little finicky as well, you sort of really need to only use it optionally because using it everywhere gets kind of painful (although it might be better in the most recent versions, type inference is quite hit and miss).

But then I would say there are a lot of other advantages that Groovy brings - just a wider usage and knowledge base in general mainly.

Edit: Gosu also seems to offer reified generics, I'm not sure how that is implemented, esp. while maintaining the seamless Java interop people speak of, but it could be pretty powerful.

Re: Gosu – A pragmatic language for the JVM

#77

Very cool. I'm starting a JVM-based project, and I'd love to use this in the places where I was planning to use JRuby. Besides being impressed overall, two pieces of feedback: * On enhancements, I very much like C# extensions design, partially because I do have to import them explicitly. One of the things I dislike in Ruby is that you don't know where your methods come from, and that gets more complicated when they'r…

On enhancements: yeah, that's reasonable, but we also wanted to be able to add some obviously missing methods to things like List, globally available. We've toyed around with a scope declaration on the enhancement, e.g. global, module, or explicit but haven't settled on anything.

Back-tick has been on the list forever and wouldn't be hard to add. Open a ticket. :)

Re: Gosu – A pragmatic language for the JVM

#78
post #38

Earlier quoted context omitted.

We use a bit of a dated version of Gosu where I work (something I never thought I'd get to claim on HN...), but I believe that curly braces are perfectly fine to use, and actually required if you have a multi-statement block (essentially starting to look like anonymous functions in Javascript).

Exactly if you want to return just an expression you can avoid them, otherwise if you use statements in the body of the lambda you need curly braces.

OK, thank you both for the explanation. That does sound sane :-).

Re: Gosu – A pragmatic language for the JVM

#79

Very cool. I'm starting a JVM-based project, and I'd love to use this in the places where I was planning to use JRuby. Besides being impressed overall, two pieces of feedback: * On enhancements, I very much like C# extensions design, partially because I do have to import them explicitly. One of the things I dislike in Ruby is that you don't know where your methods come from, and that gets more complicated when they'r…

On enhancements: yeah, that's reasonable, but we also wanted to be able to add some obviously missing methods to things like List, globally available. We've toyed around with a scope declaration on the enhancement, e.g. global, module, or explicit but haven't settled on anything. Back-tick has been on the list forever and wouldn't be hard to add. Open a ticket. :)

Ticket submitted.
Post reply on HN