“Programmers in the Java environment have another tool in their box, following the launch of a new programming language called Gosu. Publicly released by Guidewire Software, Gosu is a general purpose programming language that runs on the Java Virtual Machine. According to the developers, Gosu is an object-oriented language that is 100% compatible with Java and has a promising set of attributes compared to other JVM languages. For example, Gosu boasts solid IDE tooling and static typing (meaning variables don’t have to be defined before they’re used), which remain rare in the world of JVMs.”
I’m pretty sure that static typing has little to do with type inference.
Actually it probably does:
http://en.wikipedia.org/wiki/Type_inference
Sorry, I’d forgotten how literal one has to be on osnews. Of course they’re related, but the statement:
is a bit misleading.
That was probably supposed to say the type of variables don’t have to be defined before they’re used.
He means that the blurb is wrong to say that static typing MEANS type inference. You can have strong static typing but not type inference (look at Java <= 6 and C++ < 0x).
While it is true that you can’t have type inferencing in a meaningful way without strong static types, the other way around is not true.
Yes, you said this better than I did.
Static typing bring so much information to the compiler, it both enables very good type inference (just look at F# or other functional languages doing), and pretty good compiler time checks.
Gosu is like Matlab/Octave/Scilab. Type inference boosts productivity but it is a double edged sword.
After a two minute look, it seems pretty similar to Fantom.
They are obviously targeting the large starcraft playerbase
For people who don’t know, gosu means a skilled game player or athlete in Korean. Literally means a person with an upper hand.
I was about to describe the meaning as well.. actually doesn’t need to be a game player or an athlete. “gosu”(ê³ ìˆ˜) is just like “guru”. You can be a “gosu” on any kind of work, play or something non physical; e.g. gosu of love, gosu of chess, gosu of typing, gosu of wasting time
Anyway, it is quite exciting for me(Korean background) to see some of projects adopting Korean words like suhoshin of php and this gosu language and etc. I am about to go and have a look at the syntax and referecen if there are any.
Yes, I now want a special keyword called ‘Jaedong’ which will automatically improve code performance tenfold!!!
would be fine until it has to compete with Flash
Edited 2010-11-12 02:13 UTC
“static typing (meaning variables don’t have to be defined before they’re used”. Isn’t it the opposite?
No. You’re thinking about dynamic typing. Type inferencing in this case is really just getting rid of redundancy.
So instead of saying:
Arraylist<int> blah = new ArrayList<int>();
Just say:
val blah = new ArrayList<int>();
Which is *okay* because by looking at the right side of the equal sign, the compiler can statically figure out the type of the variable.
Yes but there is a downside which is that it takes longer for humans to step through inferred code.
If you insist on figuring out the exact type of every variable, then perhaps.
If you don’t, then less types in the code means less overhead for your brain.
Understanding variables is part of stepping through code.
With type inference there is less for new programmers to learn but when it comes to reading code your brain ends up doing more work especially as a program increases in size.
This is where the “if you insist” part comes into play.
We live in different worlds. I’m used to dynamically typed languages, and very seldom have a problem with not having any type information what so ever in the code. I think static typing has benefits in the tool support department, but not so much for me understanding the code. Perhaps once in a while I would like to see the type of a variable. Ultimately, I would then be able to ask the IDE and it would come back with the inferred type. The rest of the year, explicit types in the code only stand in the way and mean extra work for me as a developer.
I find “dumbassEnterpriseyNamedClass= new DumbassEnterpriseyNamedClass()” _far_ easier to read then “DumbassEnterpriseyNamedClass dumbassEnterpriseyNamedClass = new DumbassEnterpriseyNamedClass()”, especially when that is nestled in the middle of 20 other similar statements. It’s not so bad when classes don’t have names that stretch on forever, but for some reason people who use verbose languages tend to love to embrace that aspect and run with it.
Well it sounds like you have been reading Java which is one of the worst in that regard.
The readability issue becomes apparent when skimming through code to figure out what it does. Type deceleration makes it easier to quickly focus on and keep track of important variables. I’ve stepped through VB.NET code (DIM DIM DIM DIM) that would have taken me half as long in C# or C++.
…but not enough to draw me from groovy. It claims to have better performance because the variables are statically typed but I don’t really use groovy for performance (altho’ it isn’t bad). It does (to my eye) appear to integrate a little more cleanly with Java than something like JRuby and of course the form is familiar like Java and Groovy and C… etc.
I thought it was interesting that looping constructs seem more limited – or force you into a more list processing point of view.
I downloaded it anyway, of course.
The other thing that caught my eye was the increment operator… which isn’t REALLY an increment operator at all, but a complete assignment statement in function.
So i++ really translates to i = i + 1 (it is not really an unary operator to Gosu). It cannot, therefore, be used in the middle of an expression.
I think that is confusing – why even offer it?
Can anyone say what differentiates this language from Java, Scala or Groovy? To me, it looks like something in between of Java and Scala. Does it have any unique features?
It has closures, type interference and type extensions but these are already available in other more established JVM languages.
The comparison table (http://gosu-lang.org/comparison.shtml) is questionable. Not only it’s cherry-picking features available in Gosu but also presents them in a biased form (static vs. dynamic typing, “not lisp”) or outright lies (“Solid IDE tooling”).
I for one will stay with Scala/Clojure/Groovy for the JVM, nothing new to see here.
But it is nice to see people investing on the JVM anyway.
That they omit semicolons as ‘unnecessary’ (when they can be used to concatenate lines) while using VAR as a single line declaration with no multi-line/multi-var format… Hey, Mr. Joke…
Shades of the old L1 BASIC LET statement.
Otherwise though, it screams ‘let’s make Javascript run in JVM’ — not seeing anything ‘fresh’ about it.
Of course NOT having strict typecasting or the need for forward declaration in my book is NOT something to ‘boast’ about — but I’m a Wirth language fan so…
Edited 2010-11-11 10:40 UTC
Ugh, and that will be the appeal.
Have you created some Javascript textbox snippets? You can now start working on a JVM based word processor!
The keyword here is start.
Javascript already runs on the JVM. The implementation is called Rhino.
And Gosu looks nothing like Javascript, other than both have the “C” heritage, and share some features.
One of the developers of Gosu just did a presentation at my local (Sacramento, CA), Java User Group.
Gosu looks very very interesting.
Some things I like:
Static typing (unlike Groovy), for compiler checks, and IDE/editor code completion.
Easy to learn and read (unlike Scala).
Support for both OOP and Functional Programming.
Support of C#-ish cutting edge features like lambdas, extension methods, and delegates (although a Gosu delegate is a bit different than a C# delegate).
So, it looks like it has potential. The developer said they’ve been using Gosu internally and with their customer base (multi-billion dollar insurance companies) for a long time, but they are now open sourcing to help create a buzz, and get more people knowing the language.
So Gosu support will be strong – backed up by a company that sells to multi-billion dollar insurance companies.
In other words, it won’t just be a “toy” or “hobby” or “intellectual language weenie” project. It’s got real usage, and real reason for existence (a particular niche, but hopefully that will expand with open sourcing).
My experience with Open sourced code from a company that just has one huge customer, is that the really obscure features that are needed for that app for the giant customer are added, but none of the ones that would make sense for more general purposes.
Full disclosure, I’m one of the guys at Guidewire. One of the things that we’ve done right over the 9 years that we’ve been building enterprise software, is that we’ve never built a language feature just for one customer. GEICO, Liberty Mutual, and about 80 other insurance companies have been convinced that our software is solid, and that they’re going to invest in training 100’s of their own developers to use Gosu.
I totally understand why you’d be skeptical, but we’re very pragmatic about the features we do put in. They can’t be just useful to a couple language nerds.
This will be slightly critical of the language, but I’m also open to responses from the OSNews community.
First a perspective: recently I’ve been trying to get on with the new languages. What I’ve seen with in F# is amazing — it’s so good MS is building newer C# versions around it.
I’m also looking at Clojure and Scala on the Java side, but they’re not ready for the prime time — at least for me. That does not mean they bring very good ideas on the table.
But looking at the examples of Gosu, it seems like they’re borrowing heavily from C# with a slightly different syntax. For example, the using statement, or the lambda declarations are very C# like. Or general library improvements are a catchup to CLR libraries and LINQ.
If this is the case, why bother if you can use the real thing? (Even in JVM via third party converters).
Or am I over simplifying the situation?
Why bother? Simple. So you can use those goodies on other platforms besides Windows, or .Net. I’m not knocking those, but lots of people prefer choice of platforms as well as vendor.
And give credit where credit is due. Ander Hejlsberg and his team at MS have done a fantastic job of designing and evolving C#.
And unfortunately, Java (the language) has fallen behind.
However, the JVM itself is a fantastic, wonderful feat of software engineering, and a great platform to run on, and loaded with huge, fantastic, libraries.
Java (the Language) being behind the times, + the JVM (the runtime/platform) being a wonderful platform and great engineering = need for other JVM languages. Enter Scala, Groovy, JRuby, Jython, Clojure, and now Gosu. And some of these are already well into large production environments – Groovy and Grails, Scala + Lift, JRuby, etc.
This is where the excitement of Java lies – JVM + newer JVM languages.
Edited 2010-11-12 16:41 UTC
You’re right, I agree that there is still value in the Java platform.
However with the real thing, I mean the thing itself. You can actually use C# with JVM. For example:
* Grasshopper lets you use C# to directly write JVM code. It was expensive, but I think it became free: http://dev.mainsoft.com/Default.aspx?tabid=29
* Stab (another open source project) is already an implementation of a C# like language on the JVM: http://code.google.com/p/stab-language/
* As a side note, IKVM lets you do the reverse: Java JAR -> .Net DLL conversion, thus you can employ Java libraries in .Net project
And there could be others. That’s why I’m questioning the novelty of this new language.
Hi Guys,
I’m one of the gosu developers, the guy who gave the presentation to the SacJUG.
So, yeah, Gosu isn’t revolutionary in many ways: it takes good ideas from C#, Ruby, etc. and then tries to be a very smooth lateral transition for java developers. It is statically typed mainly to support tooling (code competion, etc.) It has a few interesting features, such as a delegate keyword that allows you to implement interfaces with a field, which allows for easy compositional programming (“Favor composition over inheritance” the experts always tell me.)
It also has automatic downcasting after a type test:
var foo : Object = “foo”
if( foo typeis String ) {
print( foo.capitalize() ) // <– automatically downcast to String
}
These are small things, but nice.
The core innovation of the language is the Open Type System, which allows frameworks to generate Domain Specific Type Systems. It’s effectively a formalized and simple to understand metaprogramming system that gives library and framework developers a heck of a tool. Scott McKinney, the father of the language, will be putting a post up on this concept soon here:
http://guidewiredevelopment.wordpress.com/
If you are a JVM programmer or someone who likes to dabble in lots of languages, Gosu is worth watching.
Also, for the concerns that this language might be too oriented towards a particular client: don’t worry. Gosu is a general programming language that used in all sorts of ways by Guidewire. The commercial support increases the chance that it won’t go away. (Guidewire actually makes money, this isn’t a vanity project.)
I’m happy to answer any questions or comments.