What does Mirah offer over JRuby,Groovy and Scala?
Asked Answered
C

5

12

What does Mirah language offer over JRuby,Groovy and Scala?

Cryptonymous answered 23/11, 2010 at 2:2 Comment(5)
@pst: You think that languages being dynamic or static is such an overriding issue that nothing else is comparable?Haematothermal
@pst: No time to learn four languages :) , not to mention I doubt I will be able to smell the true scent of each language by having a quick sniff.Cryptonymous
@El Gusto I say "try", not "learn" (thoroughly) :-) In my experience, just a few days on a small "intro" project, lets me know if it's a language I want to pursue (e.g. I assign merit to it) or not. It doesn't mean the nuances are known or the code is idiomatic, but rather is enough to generally see "the big picture".Hindquarter
@JUST MY correct OPINION (awesome name, btw) - These questions come up quite a bit. Apples and oranges. It doesn't matter if it's a Red Delicious (ick!) or a Blood Navel.Hindquarter
@3lijandro: What is missing about the given answers? I would suggest either mentioning what is currently still missing IYHO or accept an answer, that would be nice.Fleshy
D
9

According to an interview with Mirah's creator the point of Mirah (which means "ruby" in Javanese) is to create a high-performance variant of Ruby. Enough Ruby-like syntax to make it comfortable to work with, but still close enough to Java and JVM semantics so that it can run without the overhead of a big runtime layer on top of the JVM.

Choice quote:

Much of the benefit of Mirah over similar languages comes down to being so lightweight. In Groovy, Scala, JRuby, Clojure, or Jython, the minute you write "Hello, world", you've shackled yourself to a runtime library. In Mirah, "Hello, world" is just as terse as in JRuby, but has the added benefit of not foisting any dependencies on you; source file goes in, class file comes out, and that's it. I believe the JVM needs a new dependency-free language, and Mirah is my attempt to deliver one.

While JRuby's performance rivals or exceeds other Ruby interpreters, the fastest JRuby code still lags pure Java performance by an order of magnitude. While you can expect the performance of JRuby to improve with the 1.6 release, Mirah is an attempt to break through the performance ceiling and provide an option for programmers looking for execution speeds on par with Java code.

Deathday answered 23/11, 2010 at 2:15 Comment(11)
Thanks but still cloudy to me.Cryptonymous
Executive summary: "What does Mirah language offer over JRuby,Groovy and Scala?" According to them, performance.Deathday
Scala is statically typed. Ruby/Groovy/Clojure adds a performance burden that Scala doesn't. Why is it in this list?Blase
@pedrofurla. I agree with you in that I do not agree that Scala should be in the list. Scala has a runtime library, but it probably does not add significant overhead performance-wise.Deathday
@El Gusto: Well, when you write a Hello World in Scala, you get 6.496.110 scala-library.jar (Scala 2.8.1), plus Java's own libraries (which, granted, put that file to shame). That Mirah does not bring any new libraries to the table is, indeed, interesting.Beebeebe
@Blase Actually, I didn't read anything about "performance" on their site. What they say is No current JVM language addresses the aesthetic goals of Mirah without also introducing a runtime library, often of a prohibitive size. Unless Thilo is going by a strange definition of performance.Beebeebe
@Daniel: Hey, I am just quoting the Mirah team here. How often do I have to say "according to them" before it stops becoming "my" strange definition of performance? ;-) Adding another quote from the interview.Deathday
@Deathday Ok, perhaps it was uncalled for, but that quote only refers to JRuby. I haven't seen any performance statements about other JVM languages -- which would include Scala. Alas, any such statements would be incorrect, as Scala generates the same bytecode as Java. It does come with a library, however, which is a fair point they make (as in the text I quoted).Beebeebe
Performance-wise, with the specialisation support available since Scala 2.8, Scala is able to produce better performing code than Java in a number of scenarios - by eliminating some boxing and unboxing of primitives. The cost of this is an increase in the size of compiled bytecode.Catton
@Blase Well, because it is my question. I didn't mention Clojure, so why it is in your list?Cryptonymous
Don't remember, it's been almost four years :)Blase
F
12

Unlike full-featured languages, which come with their own libraries, Mirrah is more like a different "frontend" to the Java libraries.

Mirrah code does not depend on it's own environment (except the Mirrah compiler at compile time).

That's the main benefit: A different syntax for Java.

Fleshy answered 23/11, 2010 at 9:21 Comment(0)
D
9

According to an interview with Mirah's creator the point of Mirah (which means "ruby" in Javanese) is to create a high-performance variant of Ruby. Enough Ruby-like syntax to make it comfortable to work with, but still close enough to Java and JVM semantics so that it can run without the overhead of a big runtime layer on top of the JVM.

Choice quote:

Much of the benefit of Mirah over similar languages comes down to being so lightweight. In Groovy, Scala, JRuby, Clojure, or Jython, the minute you write "Hello, world", you've shackled yourself to a runtime library. In Mirah, "Hello, world" is just as terse as in JRuby, but has the added benefit of not foisting any dependencies on you; source file goes in, class file comes out, and that's it. I believe the JVM needs a new dependency-free language, and Mirah is my attempt to deliver one.

While JRuby's performance rivals or exceeds other Ruby interpreters, the fastest JRuby code still lags pure Java performance by an order of magnitude. While you can expect the performance of JRuby to improve with the 1.6 release, Mirah is an attempt to break through the performance ceiling and provide an option for programmers looking for execution speeds on par with Java code.

Deathday answered 23/11, 2010 at 2:15 Comment(11)
Thanks but still cloudy to me.Cryptonymous
Executive summary: "What does Mirah language offer over JRuby,Groovy and Scala?" According to them, performance.Deathday
Scala is statically typed. Ruby/Groovy/Clojure adds a performance burden that Scala doesn't. Why is it in this list?Blase
@pedrofurla. I agree with you in that I do not agree that Scala should be in the list. Scala has a runtime library, but it probably does not add significant overhead performance-wise.Deathday
@El Gusto: Well, when you write a Hello World in Scala, you get 6.496.110 scala-library.jar (Scala 2.8.1), plus Java's own libraries (which, granted, put that file to shame). That Mirah does not bring any new libraries to the table is, indeed, interesting.Beebeebe
@Blase Actually, I didn't read anything about "performance" on their site. What they say is No current JVM language addresses the aesthetic goals of Mirah without also introducing a runtime library, often of a prohibitive size. Unless Thilo is going by a strange definition of performance.Beebeebe
@Daniel: Hey, I am just quoting the Mirah team here. How often do I have to say "according to them" before it stops becoming "my" strange definition of performance? ;-) Adding another quote from the interview.Deathday
@Deathday Ok, perhaps it was uncalled for, but that quote only refers to JRuby. I haven't seen any performance statements about other JVM languages -- which would include Scala. Alas, any such statements would be incorrect, as Scala generates the same bytecode as Java. It does come with a library, however, which is a fair point they make (as in the text I quoted).Beebeebe
Performance-wise, with the specialisation support available since Scala 2.8, Scala is able to produce better performing code than Java in a number of scenarios - by eliminating some boxing and unboxing of primitives. The cost of this is an increase in the size of compiled bytecode.Catton
@Blase Well, because it is my question. I didn't mention Clojure, so why it is in your list?Cryptonymous
Don't remember, it's been almost four years :)Blase
C
8

vs. Groovy

  • Syntax more familiar to existing Ruby/JRuby programmers
  • Statically typed

vs. JRuby

  • Statically typed

vs. Scala

  • Syntax more familiar to existing Ruby/JRuby programmers

The MAIN advantages are static typing (faster performance on the JVM and much easier interop with existing Java libraries) and a familiar syntax (if you come from Ruby).

When dependencies are a consideration (developing an android app, for example) then you shouldn't let this guide your language choice. Using a tool like Proguard will level the playing field.

If you're coming from Ruby, then Mirah is a good choice. If you're coming from Erlang or Haskell, then you'll want Scala. If you're a LISPer, then you'll want to take a look at Clojure.

If your only prior experience is Java then Shame on you! - and you should probably go for Scala - It's rapidly gaining a reputation as the heir apparent to Java, tool support is currently stronger and you'll be in a large community of others who made the same transition, so there are plenty of blogs/tutorials already available.

and Groovy? Groovy is almost never the right choice nowadays...

Catton answered 27/11, 2010 at 15:18 Comment(1)
@seymour - James Strachan (creator of Groovy) sums it up nicely in his blog: macstrac.blogspot.com/2009/04/…Catton
B
5

I use Mirah everyday on Google AppEngine.

Here are my reasons to use Mirah:

  • no runtime library
  • very nice syntax
  • as fast as Java

Having Java under the hood is very helpful too:

  • solid typesystem
  • well documented
  • known solutions for common problems

I did some Groovy, lot of JRuby and none of Scala. If you know these, try Mirah. If not, I'd go with JRuby.

Betti answered 14/12, 2010 at 11:35 Comment(6)
Thanks for sharing a production story.Cryptonymous
Not sure I understand that logic: go with JRuby if you haven't done any Groovy or JRuby. If you have done them then go with Mirah. I'd challenge that! If anything, there's a strong argument for choosing Scala unless you have specific needs for Ruby syntax or dropping dependencies without using proguard.Catton
I can recomend Ruby / JRuby to anyone beacuse it is easy to pick up and fun.Betti
@hakunin, Why not to go with Scala? I think that absence of std library is disadvantage. Because you have nice syntax, but still you have to use ugly Java library API. E.g. compare Collections.sort(l) { |a, b| a.c.compareTo(b.c) } to l.sort_by(&:c)Companionship
any tutorial how to do that? ^^ (mirah with GAE)Petronius
You can start here: code.google.com/p/mirah-on-gae (Disclaimer: I switched to Pythong for GAE, dunno what the state of Mirah is)Betti
I
-2

Mirah is just another rubyish syntax for java. IMHO not good at all. It knows nothing about generics, and also has poor tooling. Better try ceylon, xtend, scala, kotlin etc.
Mirah compiles to java classes (not sources anymore). Xtend compiles to java sources and so simpler to found out what it does under the hood. Ceylon and scala have their own stdlibs (nevertheless java interop is near to perfect in them both), not sure about kotlin. Kotlin is JetBrains' child and thus tied to IDEA.
JRuby I don't like too. It has too many bugs in java interop. And it also have too many reinvented wheels. I mean encodings (it does not use java strings and regexes but custom strings on top of raw byte buffers), IOs, exception handling, threads etc.
The only advantage of jruby is that it is ruby. Many ruby code will just work as it is.
Groovy OTOH does not reinvent the wheel, it uses well tested java libraries and just adds syntax sugar too them. Also groovy-java interop is great. It can generics. Threads, exceptions, strings, collections - are just java classes as they are in java.

Inborn answered 4/8, 2015 at 11:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.