Why Duby rather than Groovy?

I’m in the market for a Ruby-like dynamic language running on the JVM
and am
intrigued by Charlie’s work on Duby. It’s an appealing way of generating
Java class files in a Ruby-like language. But doesn’t Groovy already
accomplish the same thing? I’m trying to understand the dissatisfaction
with
Groovy that prompted the creation of a new language. Was it created
simply
to be a step closer to Ruby syntactically than Groovy already is?

But doesn’t Groovy already
accomplish the same thing? I’m trying to understand the dissatisfaction
with
Groovy that prompted the creation of a new language. Was it created
simply
to be a step closer to Ruby syntactically than Groovy already is?

Yes to the last question (I think). I think duby is faster than groovy,
though. So you could almost say that duby and scala are kind of close
in scope, but duby wants to be more of a “ruby-esque” syntax.

Then again, I don’t use them much, so others might have a better
opinion?

-r

On Mon, Feb 1, 2010 at 6:51 PM, Chris C. [email protected] wrote:

I’m in the market for a Ruby-like dynamic language running on the JVM and am
intrigued by Charlie’s work on Duby. It’s an appealing way of generating
Java class files in a Ruby-like language. But doesn’t Groovy already
accomplish the same thing? I’m trying to understand the dissatisfaction with
Groovy that prompted the creation of a new language. Was it created simply
to be a step closer to Ruby syntactically than Groovy already is?

Groovy doesn’t fulfill any of Duby’s design goals.

Groovy produces Java class files, but they can’t stand alone; you have
to have the Groovy jar along with then. This generally means a
several-megabyte ball-and-chain, regardless of how small your
application is. The class files Duby produces have no external
dependencies, and ideally Duby-produced code will never have any
external dependencies (there’s a chance we might introduce some
standard interfaces, but it would be a microscopic dependency).

Groovy can’t produce .java source. Duby can.

Groovy is not statically typed, and generally slows down if you
specify types. Duby is (currently) always statically typed, runs
exactly as fast as Java, and uses local type inference (a la Scala) to
reduce the typing noise. (There is some work happening to produce
statically-typed Groovy, but it removes many of the features that draw
people to Groovy in the first place, and still depends on the Groovy
runtime)

Duby looks (and often feels) like Ruby. Groovy looks (and feels) like
Java.

I believe we can get a statically typed language with much of Ruby’s
expressive power without requiring a lot of runtime tricks and
libraries. That’s Duby.

It’s worth noting that I don’t see Duby as a replacement for either
Groovy or JRuby. Dynamic languages offer a unique set of features that
even the most elegant, expressive, flexible static-typed language
can’t do.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thanks for the thorough explanation, Charlie.

Is Ryan the only one doing anything significant with Duby or have you
seen
any other sample apps?

I’ve been looking for other examples of it “in the wild”.

On Tue, Feb 2, 2010 at 8:36 AM, Charles Oliver N.

Wasn’t Duby renamed Surinx? Or did that get too confusing?

Phil H. just got a simple Duby app built for Android and
deployed to a device, so there’s that too…

On Tue, Feb 2, 2010 at 7:59 PM, Chris C. [email protected] wrote:

wrote:

simply
standard interfaces, but it would be a microscopic dependency).

can’t do.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Ikai, I think they’re still separate projects:

Roughly:

  • Duby is statically typed while Surinx is dynamically typed.
  • Surinx syntax is a strict subset of Ruby syntax (every syntactically
    valid
    Surinx program is also a syntactically valid Ruby program) while Duby is
    almost a syntactic subset, except for its mandatory method parameter
    type
    annotations.

Right, thanks guys. I get confused sometimes. I refer back to this
StackOverflow thread:

http://stackoverflow.com/questions/1337137/whats-the-difference-between-duby-and-juby-and-why-would-i-need-either-of-them

Ikai,

I think Surinx is new name for Juby (not Duby). See Charlie’s post:
http://blog.headius.com/2009/08/introducing-surinx.html

(btw- the anglicized Greek word might be syrinx, but even so, it looks
cool, and an atypical spelling is a great way get closer to the top of
search results.)

Hope that helps,

Gary

Ikai L. wrote:

Wasn’t Duby renamed Surinx? Or did that get too confusing?


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Ikai L. wrote:

Right, thanks guys. I get confused sometimes. I refer back to this
StackOverflow thread:

http://stackoverflow.com/questions/1337137/whats-the-difference-between-duby-and-juby-and-why-would-i-need-either-of-them

That question contains an answer from me:

http://stackoverflow.com/questions/1337137/whats-the-difference-between-duby-and-juby-and-why-would-i-need-either-of-them/1351895#1351895

Which you might find interesting. (I see that Chris C. already
quoted from my answer.)

It’s a little out of date (it doesn’t mention the intended merge of
Duby and Surinx), and also a rather lengthy, rambling rant, in which I
took a few liberties with history. (Although more on the “Schindler’s
List” end of the scale than on the “Inglourious Basterds” end.)

Anyway, enjoy! And don’t forget StackOverflow is a Wiki: edit away!

jwm


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Did I violate your copyright?

Do you demand an attribution whenever we discuss Duby here?

Good answer - and already linked to in this discussion - but it’s been
six
months. Time to move on, Jörg. This is open source.

2010/2/5 Jörg W Mittag
<[email protected][email protected]

Perhaps today’s Duby-related post on Hacker News was prompted by our
discussion of Duby here earlier this week:

http://news.ycombinator.com/item?id=1106071

On Sat, Feb 6, 2010 at 9:54 AM, Chris C. [email protected] wrote:

Perhaps today’s Duby-related post on Hacker News was prompted by our
discussion of Duby here earlier this week:

http://news.ycombinator.com/item?id=1106071

Very nice! I added a comment there.

And I must also apologize for my confusing naming of my pet languages.
Here’s the official breakdown.

Duby = statically typed, Ruby-inspired language with no runtime
library and pluggable types and syntax. On the JVM, it uses Java’s
type system and libraries exclusively.
Surinx (formerly Juby) = dynamically typed version of Duby; basically
the same thing, but you don’t declare any types. Depends on
“invokdynamic”, the new Java 7 bytecode for dynamic invocation.

To reduce the confusion, Surinx as a project is going away (it was
actually only a few hundred lines of code anyway) and Duby will gain
dynamic invocation at some point in the future. Duby will be your
one-stop shop for a, clean, expressive, fast, and runtime-free JVM
language.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs