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

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) with JSON I'd be very happy indeed. That would include supporting fully de-typed data not nasty schema based data binding. I've switched to NodeJS/JS because they speak the language of the web (not JS, but JSON). But I can't see why other languages can't learn to.



In Java8 you can #!/bin/jjs to start a Nashorn (JavaScript) script running on the JVM.

Nashorn has shell extensions that helps you write shell scripts https://wiki.openjdk.java.net/display/Nashorn/Nashorn+extens...

It's also a great way to bootstrap your Java app with some JSON config http://benjiweber.co.uk/blog/2014/05/08/json-to-java-interfa...


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.


:)

It's the little things, isn't it?

Regarding JSON support, Gosu has map literal syntax and integrates easily enough with Google's GSON library. Not great, but not terrible.

More speculatively, I put together a type-loader to work with JSON content specified using JSchema:

  https://github.com/gosu-lang/Goson
But I'm not sure it works with the current release. (This HN post caught us mid-rework...)




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

Search: