Slashdot Mirror


Mirah Tries To Make Java Fun With Ruby Syntax

An anonymous reader writes "Java is performant, widely adopted and eminently portable, however, its syntax is largely inherited from C++ along with some of its esoteric unfriendliness. Mirah aims to place a friendly face on Java through the implementation of a syntax whose primary concern is developer friendliness (think Ruby/Python/Groovy), and route of least surprise. The result is a truly cogent alternative syntax delivering readability, expressiveness and some compelling new language features."

10 of 444 comments (clear)

  1. Why Mirah instead of Scala, Clojure, Groovy, JRuby by Ichoran · · Score: 5, Insightful

    Mirah looks to me so far like a waste of effort. It has somewhat nice syntax, granted, but if you really want to use Ruby syntax with the JVM, there already is something that does that: JRuby.

    If you just want simplified syntax, Groovy is just as simple and looks more familiar to Java programmers.

    If you want simplified syntax and powerful new programming tricks, Scala and Clojure do this far better. If you ignore the Scala libraries and half its features, you get everything that Mirah was designed to do.

    The language designers should do a better job explaining why this is worth paying attention to.

  2. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by pavon · · Score: 4, Informative

    From what I gathered on their website, Mirah was created by one of the main JRuby developers in order to create a language that fits in better with the JVM capabilities and Java ecosystem than a strait port of Ruby. The end result should offer better performance and cleaner integration with existing Java code then JRuby, while providing nicer syntax than Java.

    Groovy is slow as snot, and I wouldn't use it for anything other than perhaps a user scripting language for a java application, and even for that I think there are better options. No clue how Mirah compares to Scala. That was my first question as well.

  3. Re:Uh... by snookums · · Score: 5, Interesting

    "Prepend" isn't a word either, but technical people use it a lot because there is a specific meaning there that needs a word -- to append at the beginning. Strictly speaking you could use "prefix" as a verb, but that word has a connotation of adding a small fixed string to the beginning of one or more items. "Prefix all international phone numbers with a + symbol." "Prepend the header before sending the request."

    Similarly there is a need for a concise expression meaning "of adequate performance" without stretching to "high-performance" (especially since High Performance Computing has a specific meaning of its own). Unfortunately, in the modern language of hyperbole, terms like "adequate" and "acceptable" have negative connotations along the lines of "not really good enough but better than nothing". So, we, as an industry, have invented a jargon word "performant" to express the idea that a thing has a level of performance sufficient that you don't need to worry about it and can look for optimisations elsewhere in your system.

    --
    Be careful. People in masks cannot be trusted.
  4. Re:what. ever. by pavon · · Score: 4, Informative

    Objective-C and C++ were created at the roughly same time, with the early work done without any knowledge of each other. OPPC (the early version of Objective-C) was written around 1981-82. "C with Classes" (the early version of C++) was written around 1979-83. The first books documenting Objective C and C++ were released in 1986 and 1985 respectively.Objective-C was standardized (as part of OpenStep) in 1994, while C++ became an ISO standard in 1998.

    Apple didn't choose to use it because C++ wasn't different enough; they chose to use it because that is what the NextStep was written with back when Objective-C and C++ were both still in their infancy.

  5. Ruby and LEAST SURPRISE? by Dahamma · · Score: 4, Insightful

    This I don't get. If you want "developer friendliness" and "least surprise", use a syntax with the (relatively) minimal set of keywords/tokens to accomplish your task. Ruby has basically incorporated the syntax and conventions of every major programming language of the last 30 years...

    And I guess you could call it "developer friendliness" if you want to let people freeform program in whatever style they want, with no two developers tending to use the same syntax for the same implementation - but at this point in my career (ie having worked for half a dozen companies and realizing what you write now may exist for decades), I consider a major component of "developer friendliness" as "easily comprehensible and maintainable by the next developer".

  6. I like the Java syntax by jfbilodeau · · Score: 4, Interesting

    I may be the only programmer in the world that is willing to admit it, but having programmed in Java since version 1.0, I really like the syntax. And yes, I do find Java a lot of fun, especially for serious enterprise development. The thing I presently hate the most about Java is that new 'Oracle' thing.

    --
    Goodbye Slashdot. You've changed.
    1. Re:I like the Java syntax by mad.frog · · Score: 4, Insightful

      Really? You really like writing

      Stop right there: it's not a question of writing, it's a question of reading.

      I spend *waaaaay* more time *reading existing code* than I do writing new code. Designing a language to optimize readability is IMHO far more important than trying to save a few keystrokes.

      In the example above, I find the Java syntax completely readable, though clearly not as terse as it could be. The second example I find readable as well, but not vastly more so than the Java example.

      If you're optimizing for coding time, you're doing it wrong.

  7. Not even about syntax for me. (informative rant) by IBitOBear · · Score: 5, Interesting

    I am a guy who loves computer languages. I had a lot of fun with Ada for gawd's sake. I am pursuing erlang at the moment. Thought about haskell but it was just too big to play with...

    So keeping that in mind?.... Java and the JVM was a non-starter for me.

    Every time a new object oriented language comes out the purists start with "we don't need multiple inheritance" and so on, and they always end up having to hack it back in as some half-conceived junk (see "interfaces" providing, at a later date, all the much shat upon "complexity" of multiple inheritance with none of the ability to provide a default implementation, so then you add delegation which is all the default implementation with none of the inheritance etc...). "Java doesn't have pointers" my pasty white behind, every object is a pointer in java, you just can't use them properly, but they do manage to use pointers to prevent first class object copying, so then they added clone() etc.

    Then they "didn't need" proper destructor behavior, we have a finalize that would run at some time in the future, but really the code out to know when the last object reference is going out of scope so it can call a destructor manually if it wants. That was a stopper for me.

    See they coded their "every other language should have remained pure" hubris into their virtual machine, they encoded it into their hardware, from inception they designed their system to be limited and resistant to repair. So no thank you. So now Ruby fans want to take their niche language and cram it into the fundamentally flawed Java VM. Ooooohhh sign me up!

    I swear the language feels like it was designed on a dirty napkin by someone who had no grasp of scope or symmetry.

    Might as well be Python (I am old enough to remember RPG and COBOL Coding Forms, saving one apparent character, e.g. "}", (because in Python ":[newline]" is the same as "{" so what did we save again?) for the privilege of using white space, and counting tabs, as a control structure. And save the "but now we have editors to help us so that doesn't matter" tripe, we had coding forms to "help us" etc. And I suppose its okay to hack off a foot because you can alwasy get a peg-leg to help you too?

    Why is it that each new generation of "language designers" insist on reinventing the same old square-wheels of the previous generation and calling it new?

    Now get of my damn lawn... (yes, this rant makes me feel old, but come on people, imagine where we would be going if you would just stop trying to reopen the same tapped out mines...)

    --
    Innocent people shouldn't be forced to pay for inferior software development.
    --"Code Complete" Microsoft Press
  8. Re:Why Mirah instead of Scala, Clojure, Groovy, JR by Headius · · Score: 4, Informative

    The original goal of Mirah was to create a language that looked nice, compiled down to a form as direct and fast as Java, and did not require you to drag a runtime library along with you. You take Mirah code in and get JVM bytecode (in .class files) out. There's no extra dependencies; you're not shackled to an extra jar file just because you wrote "hello world".

    Mirah has much of Ruby's syntax only because we liked Ruby's syntax. The Ruby class libraries are not there, and Mirah is not Ruby. It's statically typed, with Ruby's clean syntax and some of Ruby's surface-level features (like simple iteration and closures).

    I guess you're right, we need to do a better job explaining why it's useful. I have an article coming that emphasizes that this is simply a "javac" alternative that happens to have Ruby syntax, and hope to clean up the web site too.

  9. Re:Pry my curly brackets from my cold dead hands by walterbyrd · · Score: 4, Insightful

    Problem is: when I look at your python code, I don't know if I'm looking at spaces, or tabs, or some combination of both. Not without a hex dump, or something. And one invisible character out of place, and god-only-knows what sort of unexpected results I get.

    Also, I probably can not cut-and-paste your code into mine, and have it work, without substantial modification.

    Then there is the serious issue of emailing code, or cutting-and-pasting from a web-site.

    Too bad that practically everybody on slashdot thinks of BASIC as GW-BASIC. Most versions of BASIC, that are less than 30 years old, actually have it right - no curly brackets, no counting spaces and tabs either.