Slashdot Mirror


Gosu Programming Language Released To Public

llamafirst writes "Guidewire Software released the Gosu programming language for public availability. Gosu is a general-purpose programming language built on top of the Java Virtual Machine (JVM). It is object-oriented, static typed, imperative, and 100% Java compatible (use/extend Java types, implement Java interfaces, compile to Java bytecode). It has type inference (very readable code yet static typing!), in-line functions that you can pass as objects (closures / lambda expressions / blocks), enhancements (inject methods + properties, even on Java types!), and simplified generics. Gosu is provided via the Apache License v2.0. The language itself is not yet open source, although that is planned for a future community release. You can read a complete introduction to the Gosu language, a comparison to other languages, and syntax differences from Java."

19 of 330 comments (clear)

  1. Sounds like Scala by NightWhistler · · Score: 3, Insightful

    From a quick glance it looks like Scala with a more Java-like syntax... I wonder what added benefit they hope to bring.

    I'd be very interested to see an in-depth comparison of the two.

    --
    PageTurner Reader: open-source e-reader for Android with cloudsync. http://pageturner-reader.org
    1. Re:Sounds like Scala by NightWhistler · · Score: 4, Informative

      OK, replying to myself because I obviously didn't have enough coffee yet:

      They list as the benefits over Scala
        - Extensible type system
        - Easy transition from Java
        - Reified Generics

      From those 3 points, only the last one sounds useful...

      --
      PageTurner Reader: open-source e-reader for Android with cloudsync. http://pageturner-reader.org
  2. Another Language by phantomfive · · Score: 4, Insightful

    At one time in my programming life I liked learning languages, I made it my goal to learn pretty near every interesting language from APL to FORTH.

    Then one day I woke up and realized, it isn't the language, you can write good or bad code in any language. It's how you use the language, and how you organize the code that matters most. I realized as long as you have the ability to encapsulate, you can write good code in any language, even in assembly.

    In fact, with a good macro library, I can write code just as fast and well in assembly as in any other language.

    Or, on the other hand, maybe I've fallen into the trap represented by this saying, "The determined real programmer can write Fortran in any language." But I don't think so. :)

    --
    Qxe4
    1. Re:Another Language by Anonymous Coward · · Score: 5, Insightful

      Perhaps it is tempting to see only encapsulation as the sine qua non in programming languages. However, a programming language does not merely make an algorithm machine readable, but also human readable (eg. yourself after 2 weeks). Therefor, the following properties are important:

      - Conciseness: eg. Haskell is more suitable in representing certain algorithms, as part of the interpretter/compiler makes 'good' choices, you'd have to specify otherwise. The same goes for languages such as Prolog.
      - Manipulatibility: to change a certain aspect of an algorithm (or of a whole system), we need a representation of this aspect. Aspect Oriented Programming, Lambda expressions and meta-object oriented programming are examples of this.
      - Suitability to domain: whether a mathematician or a business process manager reads your code matters. Their experience and expectations differ.
      - lots more...

      Yes, all of it is reducable to a Turing Machine, but languages matter. A lot.

    2. Re:Another Language by OneSmartFellow · · Score: 3, Insightful

      it isn't the language, you can write good or bad code in any language

      But, VB makes writing bad code trivial, and writing good code challenging.

    3. Re:Another Language by kaffiene · · Score: 4, Insightful

      Exactly. Which is why this "all languages are equivalent" mantra is just so much bullshit. All languages have domains for which they are more or less suited.

      I don't do script-like tasks in assembler, I don't do device drivers in Java, I don't write enterprise apps in Javascript or VB. Neither do most sane software engineers. This isn't a coincidence, it's because certain tools are better at certain jobs. People who argue that it doesn't matter what language you use cannot explain why good software engineers know why some languages are inappropriate for some jobs.

    4. Re:Another Language by icebraining · · Score: 3, Insightful

      How many lines do you need to emulate a Python's list comprehension statement in assembly? Even if you encapsulate, assembly simply doesn't let you express everything in the statement without a massive number of LOCs.

      Higher level languages are more readable for higher level concepts. It's not the same.

  3. Epic type system fail - universal covariance by shutdown+-p+now · · Score: 5, Informative

    The introduction has this gem:

    Gosu supports a simplified version of generics. Generics are a way to abstract the behavior of a class to work with different types of objects, but to still retain type safety. There are no wildcards, and generic types are covariant, like Java arrays, which is usually what you want.

    And here's how to make the type system bite the dust with this flaw:

    uses java.util.*;
    var xs : List<Object> = null;
    var ys = new ArrayList<String>();
    xs = ys; // type system allows this blatant LSP violation
    xs.add(123); // we just added an integer to a list of strings - great
    print(xs.get(0)); // yeah, this prints 123 - just to be sure
    ys.get(0).length(); // finally, a ClassCastException which should've happened 3 lines earlier

    What's funny is that Eiffel has already fallen into the very same trap, and is still trying to dig itself out of it.

    1. Re:Epic type system fail - universal covariance by shutdown+-p+now · · Score: 4, Insightful

      The really funny thing is that in practice all generics really need to do is prevent you from having to repeat casts everywhere, catch errors moderately soon, and aid in documentation. Which is what these do.

      They don't let you "catch errors moderately soon" in many real scenarios. It's the same problem as implicit null value for reference types everywhere - end result is you can have one part of code returning null where it shouldn't, that null get quietly propagated throughout your system from component to component because no-one needs to do anything to it, and then it all finally blows up when some other code elsewhere receives a value that should not be null but is - and you end up with a NullPointerException and, often, no clue as to what code originally produced the invalid value.

      Same thing here - someone, somewhere will create a collection of subtype, implicitly upcast it to supertype, and pass it over because they do not understand that List<Number> cannot always be substituted for any random List<Object> - because it's non-intuitive, despite being true (since add() is not covariant). All the evidence I need for this are all the questions asking about how to do just that in Java or C# on StackOverflow. When you ask people to post the code, it almost invariably turns out to be broken, and the type system did them a favor by rejecting it.

      The real 'trap' here is thinking that something has to be theoretically perfect to be useful or convenient.

      We're not talking about "theoretically perfect" here. We're talking about a language that's statically typed - the sole benefit of which is type safety unless explicitly overriden (by casts etc) - but which then forgoes this very benefit.

      Furthermore, the only other language I'm aware of which has the same flaw is Eiffel. Neither Java nor C# nor any other language with generics has this. They all either have no variance at all (which is inconvenient by safe), or declaration-site variance (C# 4.0 "in" and "out" on type parameters) which is easier on the API client but does not let you express all relationships, or usage-site variance (Java generic wildcards) which requires API client to understand what it is all about.

  4. call be back.... by batistuta · · Score: 5, Insightful

    >> The language itself is not yet open source,

    ok, call me back once it is. I don't really need another programming language, let alone a closed-source once.

  5. Re:Run for the hills! by shutdown+-p+now · · Score: 3, Funny

    As a geek, you should actually prefer "and", because it is quicker to type than "&&" - it does not engage Shift, and it does not require pressing the same key twice (which requires waiting for release after the first press). Same for "or" vs "||".

  6. Re:Wonder how this turns out... by kaffiene · · Score: 4, Insightful

    You have to be some kind of uber noob to think that Java and the ecosystem it has engendered could ever be called "nothing of value". There are more jobs in Java and open source projects on Source Forge in Java than in any other language. Java is not everyone's cup of tea - neither are other significant languages like C or LISP, but to pretend that Java, like any of these languages offers "nothing of value" is either arrogance or ignorance beyond belief.

    I know that /. no longer caters to a technically literate crowd but you take the cake. I feel stupider for even bothering to reply to you.

  7. Online help browser sucks. by acooks · · Score: 4, Insightful

    Gosu people, your help browser sucks caravans.

    If I middle-click on a link, I don't want the page I'm currently reading to jump away. I want to read whatever is linked to _later_. Redirecting me and then breaking my browser's "Back" button, without even providing an alternative js back button, is unforgivable.

  8. Learning languages and their philosophies... by boorack · · Score: 4, Insightful
    Granted that not only you learn a language but also grasp philosophies/patterns/paradigms/etc. behind it, it's a Good Thing (TM) to learn new languages on regular basis. You need, however, learn much more than mere language.

    It's good to learn some assembly languages to see how machines work.

    It's good to learn C to get accustomed with low level things, pointer arithmetic, in-memory layout of code & data, OS internals and tons of other things. It's good to tinker and experiment with high performance C code, see how functions look disassembled. Try adding two matrixes row by row and then column by column and see performance differences etc.

    It's good to learn C++ to get accustomed with it's metaprogramming facilities, learn how to implement semi-automatic memory management via smart pointers and how all these high level things interact with low level.

    It's good to learn Java to get accustomed with that whole big world of objects, OOP patterns, TDD, exception handling strategies and tons of other things.

    It's good to learn Scala to get smooth introduction into functional programming concepts (higher level functions, closures etc.) and see how it can be incorporated into traditional object oriented code and more interesting concurrency models (actor model for example).

    It's good to learn Erlang to grasp functional programming even more, learn how to effectively use pattern matching, see the THE actor model implementation and learn about it's interesting error handling philosophy.

    It's good to learn LISP to grasp it's macro system that still cannot be matched in any other language. See Common Lisp at work and Clojure for it's approach to parallelism, mutability and distinction between values and identities.

    It's good to learn Haskell to see how to program in purely functional way and see monads in action.

    Not that I'm in any way competent in all things above. Much of it (plus other things) is still on my TODO list. I'm still being surprised by new ideas showing blind spots of my ignorance on regular basis. I don't buy however that learning new languages doesn't matter anymore. It matters. It's important. Maybe we should choose new languages to learn more carefully, choose less but dig deeper.

  9. Re:Alright! by carsongross · · Score: 3, Informative

    We aren't trying to sell anything to anyone. Well, unless you happen to be an insurance carrier. I assume not.

    We just released our language, and are excited about it.

  10. Re:Run for the hills! by danieltdp · · Score: 3, Insightful

    Which is good, because it teaches programmers the positive impact white space has on readability

    --
    -- dnl
  11. Re:Alright! by hesiod · · Score: 3, Insightful

    Convince me Scala is better than Haskell. Convince me cucumbers are better than green peppers. Convince me a bucket of dirt is better than a pile of gravel.

    He doesn't have to convince you of anything, because obviously you have already picked your preferred language and think that anything else is useless.

  12. Re:Stop It! by poopdeville · · Score: 5, Insightful

    Since I am not CS person (Business, rather), I won't attempt to to argue with you about that.

    Here is a business-like analogy: How hard is it to divide roman numerals? It's not easy. There are dozens of rules to memorize in order to make it work. Compare this to using Arabic numerals, where you only have to memorize two rules.

    However, I think that any reasonable person would recognize that this Tower of Babel approach is holding back software development as a whole, needlessly fragmenting knowledge and impacting the careers of excellent programmers simply because they didn't jump on the latest bandwagon X years ago.

    Yes, this is a big problem. But the issue isn't the "Tower of Babel" so much as a misunderstanding of the domains in which a tool can work well, which ultimately leads to "churn". There is an old joke along the lines of "Any sufficiently complex software project implements a buggy version of half of Lisp". There is some truth to that. Lisp is a language that allows abstraction over basically any term. This is something that imperative/OO programmers want, but they don't know how to say (and they tend to cover their ears screaming "LA LA LA LA LA" when academics tell them the problem was solved in the 1960s). So they build up ad hoc solutions to quantify over specific terms. Each of these operations is potentially tricky and buggy. The "Tower of Babel" is a consequence of this. Some of it is legitimate -- new languages can provide better tools (that is, new ways to quantify) to increase productivity. But benefits only accrue if businesses switch to them, at a potentially high cost.

    --
    After all, I am strangely colored.
  13. Re:Stop It! by ciggieposeur · · Score: 3, Insightful

    "Clojure" and "D"?

    Just shoot me now.

    Why are you so hostile to learning? Clojure is a modern "Lisp done right", with all of the syntactic power of LISP minus quite a bit of historical goop, running on a very modern JVM with the goodies that that provides (the massive portfolio of Java libraries and mostly platform independence). D is a very modern "C++ done right" that is very well-suited for applications where you need the ability to occasionally shoot yourself in the foot (i.e. high performance, constrained memory, low-level access) but most of the time would like to use higher-level conveniences like garbage collection and templates.

    One thing about the multiple sub-disciplines and "schools"...they all use English.

    Sure, they all use English, but they don't say the same thing. (And actually many of them don't. Business is global these days.)