Some of my old co-workers are working with this language because of Guidewire products. Initially the benefit was that you could write code with lambdas that would share a JVM with the product itself, but now that Java 8 has them, the only reason to keep Gosu around is that all that legacy code. You would never choose Gosu unless you were working with Guidewire products.
Java 8 lambdas are not real lambdas, they capture only effectively final local variables. In Gosu you can modify the value of a captured variable.
Gosu – A pragmatic language for the JVM
41–50 of 79 posts
Re: Gosu – A pragmatic language for the JVM
#42"enhancements" feel like monkeypatching in that they let you attach things to existing classes for pretty code. This left me sweating at first -- implementations of features like this in ruby seems to be a large part of why the language is both challenging as you add devs (I recently saw one class spanning 4 files and 3 gems, I don't even) and frankly slow, and scala has similar performance barriers brought on by 'implicits' [1] and their ilk. But in gosu, enhancements appear to be defined in an statically disbatchable way so there's zero runtime timewasting, and they're also only valid for your syntactical convenience, they don't complicated inheritance or interface fitting. Looks like all the beauty, none of the sticky mess. Very interesting.
Compatibility looks like a better story than some of the alternatives -- both groovy and scala always felt to me like their mechanics encouraged an extend+extinguish feeling to their libraries because of the radical overhaul or complete dismissing of types, whereas gosu looks like you could sanely call it from java. I (as a purely personal observation; others may disagree) found I could never write a groovy or scala library and ask a java developer to use it with a straight face, and with gosu, it looks like maybe I can!
I'm speaking as someone who's just seeing the language for the first time today, so perhaps my enthusiasm will be modified by practical experience later... but I'm seeing a lot to love both in the examples and in the general philosophy of pragmatism. A language that lets me do more with fewer characters while not giving up ground on compile-time checks and performance is exactly what I want to see more of. I look forward to playing with this!
If any gosu developers are here, my biggest single beef right now is I can't instantly see from your docs what my process is like if I'm going to ship a jar. I assume it can be done and it's not hard to script, but it would be great to see up front, because if that isn't smooth, then my impressions of using it to ship a library usable from other java projects (or feed it into cross compilers, etc) is impacted. I found some docs at [2], but it appears to mostly talk about shell script style usage; ctrl-f for "jar" hit nothing. Perhaps I just haven't looked hard enough yet :) (Also, that help site is one of those annoying things where there's no content without javascript, and even after allowing it, middle click gives me some sad snippet of javascript instead of opening the page I wanted. The rest of your site looks great; I hope the wave of design refresh is going to wash over here soon too.)
[1] https://stackoverflow.com/questions/3606591/why-does-intelli...
[2] https://gosu-lang.github.io/doc/wwhelp/wwhimpl/js/html/wwhel...
Edited: to note that my spate of points-to-love at the top is by no means exhaustive.
Re: Gosu – A pragmatic language for the JVM
#43Some of my old co-workers are working with this language because of Guidewire products. Initially the benefit was that you could write code with lambdas that would share a JVM with the product itself, but now that Java 8 has them, the only reason to keep Gosu around is that all that legacy code. You would never choose Gosu unless you were working with Guidewire products.
A very simple, but amazingly useful example is properties, which have the useful behavior of being both l-values and r-values. Easy to implement, but Java doesn't have them.
Another useful differentiator are feature references:
var methodRef = someInstance#someMethod()
which have all sorts of interesting applications as a sort of type-safe reflection syntax.And so on.
Re: Gosu – A pragmatic language for the JVM
#44Oh man. Nice string interpolation. Can shell script with a shebang. All those little niceties like the `.?` operator. Map literal definitions. Type inferring declarations (like golang: strongly typed, but not wearing out your keyboard). "enhancements"... very interesting, deserve a full paragraph. And I'm just cherrypicking my favorite features; there's so many more. "enhancements" feel like monkeypatching in that th…
[1] https://github.com/sparkgs/sparkgs/blob/master/pom.xml [2] http://sparkgs.github.io/
Re: Gosu – A pragmatic language for the JVM
#45Oh man. Nice string interpolation. Can shell script with a shebang. All those little niceties like the `.?` operator. Map literal definitions. Type inferring declarations (like golang: strongly typed, but not wearing out your keyboard). "enhancements"... very interesting, deserve a full paragraph. And I'm just cherrypicking my favorite features; there's so many more. "enhancements" feel like monkeypatching in that th…
I think what you'll find if you use Gosu, today, is that it has a lot of interesting features and is fun to play around with, but that you will run into trouble when you start trying to use it for larger projects. This is mainly because:
* It doesn't integrate cleanly with Maven in a mixed language project. It can be done, but it requires some hacks.
* There isn't a huge community around it outside of Guidewire, the classic bootstrapping problem.
* The IDE support is in IntelliJ only and can be a bit of a bear to set up initially.
We do have a (very alpha) web microframework that you can use to play around with the language:
http://sparkgs.github.io/
And we are hoping to address all these issues over the coming year, but it's a long process to go from an internal language to a truly viable open source development platform if you don't have the resources Google has to throw at it.Re: Gosu – A pragmatic language for the JVM
#46Oh man. Nice string interpolation. Can shell script with a shebang. All those little niceties like the `.?` operator. Map literal definitions. Type inferring declarations (like golang: strongly typed, but not wearing out your keyboard). "enhancements"... very interesting, deserve a full paragraph. And I'm just cherrypicking my favorite features; there's so many more. "enhancements" feel like monkeypatching in that th…
Thanks for the positive feedback, really appreciated. I think what you'll find if you use Gosu, today, is that it has a lot of interesting features and is fun to play around with, but that you will run into trouble when you start trying to use it for larger projects. This is mainly because: * It doesn't integrate cleanly with Maven in a mixed language project. It can be done, but it requires some hacks. * There isn't…
Edit: Just tried it, doesn't seem to work yet. Hope this is coming down the pipeline soon.
Re: Gosu – A pragmatic language for the JVM
#47"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.
Re: Gosu – A pragmatic language for the JVM
#48At (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…
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...)Re: Gosu – A pragmatic language for the JVM
#49It would be very helpful if the creators made a page (linked to right from the home page) explaining their philosophy and guiding principles, and how their design differs from other languages in the same space. Don't tell us fluffy things like "we choose simplicity over complexity". #1, that is not a trade-off. #2, "simplicity" is such a vague and overused word that it's hard to know what you mean. (What I think they mean by "choosing simplicity" is: keeping the feature set and number of syntactic constructs small.)
Another point: "For the JVM" is a 2-edged sword. If I see a programming language described as "for the JVM", it would make me think twice about investing the time to learn it. The JVM is good technology and I do make use of it, but for reasons I won't detail here, I don't want to be locked in to it.
"Can run on the JVM" is a different matter. "The compiler has a JVM backend, among others" is great. "Currently runs only on the JVM, other backends are coming" is OK.
If Gosu was specifically designed for very tight integration with Java, such that it wouldn't make sense to separate it from the JVM, that is a design trade-off and should be explained on the "design rationale" page I suggested above.
Re: Gosu – A pragmatic language for the JVM
#50At (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…
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...