Re: [jug-discussion] Groovy and JRuby
Just saw this...thought it might be an interesting look at an actual application of JRuby: http://eclipse-shell.sourceforge.net/screencasts.html Kit On Jun 8, 2008, at 5:46 PM, Thomas Hicks wrote: At 03:49 PM 6/8/2008, you wrote: On Sun, Jun 8, 2008 at 11:43 AM, Thomas Hicks <[EMAIL PROTECTED]> wrote: > One thing that has turned me off from Ruby in the past is the fanatical > and proselytizing behavior of the community members. Instead of > just setting up strawmen and snidely knocking them down, why don't you > put down the Kool-aid and educate us. Hmm, other people say that Ruby has an especially nice community. I think the Ruby open source community is interesting, especially projects like Rubunius that are turning the whole "ego based" open source paradigm on it's head. In Rubinius for example, one accepted patch gets you full commit rights. I wrote more about this here [1]. Cool idea. I'm glad to hear that the community has mellowed. So, anyone else (or nobody else) is welcome to answer these. I was just stirring things up, didn't want to actually do any work, other than possibly making some Old Pueblo Developers consider looking into Ruby and the world of Kool-Aid Flavored Happiness that awaits. You know I love you all :) Yea, we know you, dude. We know your style of asking provocatively phrased questions to see what people react with. And, if it had been someone I didn't know asking, I wouldn't have given them as much grief. And you probably know that I really would like to know the answers to the questions I askedI am (almost :) always interested in learning new things. Perhaps someone listening has more experience w/ JRuby and can enlighten us both cheers, -tom > 1) Have you actually used JRuby for any real world applications? > 2) What is it best at? What is it worst at? > 3) How well does it integrate with Java? > (Groovy and Java are highly integrated in several different ways. > At a minimum, Groovy classes can extend Groovy and Java classes > and interfaces. Java classes can also extend Groovy classes and interfaces. > The Groovy MOP protocol adds even more power to the integration). > 4) How does JRuby resolve the conflict between Java and Ruby data types? > 4a) Does it support coercion? Autoboxing and unboxing? > 5) How faithful is it to the Ruby language? > 6) Does it implement all of Ruby? > 7) Can JRuby use Ruby libraries? > 8) Is JRuby up-to-date with mainline Ruby development? > 9) How fast is it? > 10) How good is the tool support (IDEs and so on)? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jug-discussion] Groovy and JRuby
At 03:49 PM 6/8/2008, you wrote: On Sun, Jun 8, 2008 at 11:43 AM, Thomas Hicks <[EMAIL PROTECTED]> wrote: > One thing that has turned me off from Ruby in the past is the fanatical > and proselytizing behavior of the community members. Instead of > just setting up strawmen and snidely knocking them down, why don't you > put down the Kool-aid and educate us. Hmm, other people say that Ruby has an especially nice community. I think the Ruby open source community is interesting, especially projects like Rubunius that are turning the whole "ego based" open source paradigm on it's head. In Rubinius for example, one accepted patch gets you full commit rights. I wrote more about this here [1]. Cool idea. I'm glad to hear that the community has mellowed. So, anyone else (or nobody else) is welcome to answer these. I was just stirring things up, didn't want to actually do any work, other than possibly making some Old Pueblo Developers consider looking into Ruby and the world of Kool-Aid Flavored Happiness that awaits. You know I love you all :) Yea, we know you, dude. We know your style of asking provocatively phrased questions to see what people react with. And, if it had been someone I didn't know asking, I wouldn't have given them as much grief. And you probably know that I really would like to know the answers to the questions I askedI am (almost :) always interested in learning new things. Perhaps someone listening has more experience w/ JRuby and can enlighten us both cheers, -tom > 1) Have you actually used JRuby for any real world applications? > 2) What is it best at? What is it worst at? > 3) How well does it integrate with Java? > (Groovy and Java are highly integrated in several different ways. > At a minimum, Groovy classes can extend Groovy and Java classes > and interfaces. Java classes can also extend Groovy classes and interfaces. > The Groovy MOP protocol adds even more power to the integration). > 4) How does JRuby resolve the conflict between Java and Ruby data types? > 4a) Does it support coercion? Autoboxing and unboxing? > 5) How faithful is it to the Ruby language? > 6) Does it implement all of Ruby? > 7) Can JRuby use Ruby libraries? > 8) Is JRuby up-to-date with mainline Ruby development? > 9) How fast is it? > 10) How good is the tool support (IDEs and so on)?
Re: [jug-discussion] Groovy and JRuby
On Sun, Jun 8, 2008 at 11:55 AM, Kit Plummer <[EMAIL PROTECTED]> wrote: > I do believe there are upsides to JRuby, or just Ruby that should influence > people to take a look. Like the fact that there is Ruby without the J. > IronRuby, Rubinius, and the like are intriguing in that Ruby is closer to > the write once, run anywhere than the original attempt, Java. Profound statement. Especially coupled with the (admittedly unproven-by-me) ability of JRuby to call existing Java libraries. As I said in the other thread, I've found the open source culture in ruby to be more fun, prolific, and productive than I ever found Java's to be. I think this is partially because of the community, and partially because of the language itself. -- Chad - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jug-discussion] Groovy and JRuby
On Sun, Jun 8, 2008 at 11:43 AM, Thomas Hicks <[EMAIL PROTECTED]> wrote: > One thing that has turned me off from Ruby in the past is the fanatical > and proselytizing behavior of the community members. Instead of > just setting up strawmen and snidely knocking them down, why don't you > put down the Kool-aid and educate us. Hmm, other people say that Ruby has an especially nice community. I think the Ruby open source community is interesting, especially projects like Rubunius that are turning the whole "ego based" open source paradigm on it's head. In Rubinius for example, one accepted patch gets you full commit rights. I wrote more about this here [1]. > 1) Have you actually used JRuby for any real world applications? Nope. I think JRuby is still getting the kinks worked out, but coming along very well (Runs Rails now, so I hear). The closest I got was that I tried to convert an existing production app to run on JRuby. I ran into a couple of bugs. Patched one, and reported the other one (which was fixed in the next release). After that I lost interest (or rather focused on more interesting non-Jruby stuff). So, I'm not qualified, nor motivated, to find the answers to the following questions. All I had time for at this point was to give Groovy a (probably unfair) chance with the above test (what operations are available on an array?). As I said, that experience did not make me want to explore further, and definitely didn't entice me in the least to stop programming in Ruby. So, anyone else (or nobody else) is welcome to answer these. I was just stirring things up, didn't want to actually do any work, other than possibly making some Old Pueblo Developers consider looking into Ruby and the world of Kool-Aid Flavored Happiness that awaits. You know I love you all :) > 2) What is it best at? What is it worst at? > 3) How well does it integrate with Java? > (Groovy and Java are highly integrated in several different ways. > At a minimum, Groovy classes can extend Groovy and Java classes > and interfaces. Java classes can also extend Groovy classes and interfaces. > The Groovy MOP protocol adds even more power to the integration). > 4) How does JRuby resolve the conflict between Java and Ruby data types? > 4a) Does it support coercion? Autoboxing and unboxing? > 5) How faithful is it to the Ruby language? > 6) Does it implement all of Ruby? > 7) Can JRuby use Ruby libraries? > 8) Is JRuby up-to-date with mainline Ruby development? > 9) How fast is it? > 10) How good is the tool support (IDEs and so on)? > > I look forward to learning more about JRuby. > cheers, > -tom > > [1] http://pivots.pivotallabs.com/users/chad/blog/articles/430-evan-phoenix-at-mountain-west-ruby-conf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jug-discussion] Groovy and JRuby
I think Bashar's point is more accurately why I favor Groovy over JRuby. Sure - they both are integrated, etc etc. But in my current position - I'm a Java developer who would like to sneak in or slip through some dynamic language implementation of algorithms when helpful. I favor the Groovy syntax. Though I won't claim I've taken to Groovy without frustration and serious annoyance. It's just less annoyance than my forays into learning, playing, and developing in Ruby. I also agree with Tom's perspective. The Ruby community's approach is one that I find a bit off-putting. I feel like there is some "click" or change where people see this difference in Ruby that seems to fuel a passionate fervor for the language. Like I said, it hasn't "clicked" for me. So I'd love to see answers to Tom's list of questions. On Sun, Jun 8, 2008 at 11:31 AM, Bashar Abdul <[EMAIL PROTECTED]> wrote: > I think most people on this list were interested in a Groovy presentation > because JRuby is targeted more towards Ruby developers who want to run Ruby > on a Java stack, while Groovy is targeted more towards Java developers who > want to use an easy to learn dynamic and agile language with a syntax close > to Java. Since I believe most people here are more familiar with Java than > Ruby there is a bigger interest in Groovy. > > Bashar > > - Original Message > From: Chad Woolley <[EMAIL PROTECTED]> > To: jug-discussion@tucson-jug.org > Sent: Sunday, June 8, 2008 12:17:15 AM > Subject: Re: [jug-discussion] Groovy and JRuby > > On Sat, Jun 7, 2008 at 10:26 PM, Thomas Hicks <[EMAIL PROTECTED]> wrote: > > To partially answer your original question: I use Groovy because it is > > built on top of a mature and immense language platform, so I don't > > have to reinvent the wheel every time I sit down to code. > > How does JRuby not meet this requirement? It can call Java classes, > and using a different (superior in my opinion) interpreted/dynamic > language is not reinventing the wheel, plus Ruby predates Groovy > anyway, by quite a while [1] :) > > -- Chad > > [1] http://www.levenez.com/lang/ > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: [jug-discussion] Groovy and JRuby
Hmmn. Like Chad I've waited a bit for this topic to get beat down before replying. I'm really neither a Java or Ruby developer - just a "code integrator" or API implementor depending on your perspective. That said I will take the environment that is the easiest to get in bed with. Because Groovy kind is just abstract Java I'd only be interested in that if I am focused on Java the language as a requirement. I do think what is coming out of this discussion (one-sided as it may be) is that comfort is definitely a subjective matter - however, based on experience. Syntactically, there are definitely differences - otherwise there'd be no discussion. I just think it is cool that we are talking about alternatives to Java on the JVM. I do believe there are upsides to JRuby, or just Ruby that should influence people to take a look. Like the fact that there is Ruby without the J. IronRuby, Rubinius, and the like are intriguing in that Ruby is closer to the write once, run anywhere than the original attempt, Java. Kit On Jun 8, 2008, at 11:12 AM, Thomas Hicks wrote: At 12:08 AM 6/8/2008, you wrote: On Sat, Jun 7, 2008 at 10:26 PM, Thomas Hicks <[EMAIL PROTECTED]> wrote: > Really? It's pretty similar in Groovy: > > groovy> [].class.methods*.name.toList() > ===> [get, add, add, indexOf, clone, clear, lastIndexOf, contains, addAll, OK, that seems to work. Can't say that would have been my first guess though. Whats up with the "*"? It's pretty straighforward, if you don't approach it with an already closed mind: The 'spread' operator '*.' is used since the preceding chain of calls returns an array of Method objects. You must distinguish whether you want to call a method on the array (using '.') or, in this case, call a method on each element of the array (using '*.') The spread operator is equivalent to: list.collect{ item -> item?.member } It still not pretty, nor intuitive. A totally subjective statement. For example, look at the following train wreck resulting from playing around in groovysh. I'm sorry you're having so much trouble with the tools but perhaps it is groovysh that you don't like. Have you tried groovyconsole or the plugin support for Groovy in IntelliJ? -tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jug-discussion] Groovy and JRuby
At 12:17 AM 6/8/2008, you wrote: On Sat, Jun 7, 2008 at 10:26 PM, Thomas Hicks <[EMAIL PROTECTED]> wrote: > To partially answer your original question: I use Groovy because it is > built on top of a mature and immense language platform, so I don't > have to reinvent the wheel every time I sit down to code. How does JRuby not meet this requirement? It can call Java classes, and using a different (superior in my opinion) interpreted/dynamic language is not reinventing the wheel, plus Ruby predates Groovy anyway, by quite a while [1] :) Uhok, but the "mature and immense language platform" I was referring to is Java. And so your point about JRuby might be a good one. One thing that has turned me off from Ruby in the past is the fanatical and proselytizing behavior of the community members. Instead of just setting up strawmen and snidely knocking them down, why don't you put down the Kool-aid and educate us. 1) Have you actually used JRuby for any real world applications? 2) What is it best at? What is it worst at? 3) How well does it integrate with Java? (Groovy and Java are highly integrated in several different ways. At a minimum, Groovy classes can extend Groovy and Java classes and interfaces. Java classes can also extend Groovy classes and interfaces. The Groovy MOP protocol adds even more power to the integration). 4) How does JRuby resolve the conflict between Java and Ruby data types? 4a) Does it support coercion? Autoboxing and unboxing? 5) How faithful is it to the Ruby language? 6) Does it implement all of Ruby? 7) Can JRuby use Ruby libraries? 8) Is JRuby up-to-date with mainline Ruby development? 9) How fast is it? 10) How good is the tool support (IDEs and so on)? I look forward to learning more about JRuby. cheers, -tom
Re: [jug-discussion] Groovy and JRuby
I think most people on this list were interested in a Groovy presentation because JRuby is targeted more towards Ruby developers who want to run Ruby on a Java stack, while Groovy is targeted more towards Java developers who want to use an easy to learn dynamic and agile language with a syntax close to Java. Since I believe most people here are more familiar with Java than Ruby there is a bigger interest in Groovy. Bashar - Original Message From: Chad Woolley <[EMAIL PROTECTED]> To: jug-discussion@tucson-jug.org Sent: Sunday, June 8, 2008 12:17:15 AM Subject: Re: [jug-discussion] Groovy and JRuby On Sat, Jun 7, 2008 at 10:26 PM, Thomas Hicks <[EMAIL PROTECTED]> wrote: > To partially answer your original question: I use Groovy because it is > built on top of a mature and immense language platform, so I don't > have to reinvent the wheel every time I sit down to code. How does JRuby not meet this requirement? It can call Java classes, and using a different (superior in my opinion) interpreted/dynamic language is not reinventing the wheel, plus Ruby predates Groovy anyway, by quite a while [1] :) -- Chad [1] http://www.levenez.com/lang/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jug-discussion] Groovy and JRuby
At 12:08 AM 6/8/2008, you wrote: On Sat, Jun 7, 2008 at 10:26 PM, Thomas Hicks <[EMAIL PROTECTED]> wrote: > Really? It's pretty similar in Groovy: > > groovy> [].class.methods*.name.toList() > ===> [get, add, add, indexOf, clone, clear, lastIndexOf, contains, addAll, OK, that seems to work. Can't say that would have been my first guess though. Whats up with the "*"? It's pretty straighforward, if you don't approach it with an already closed mind: The 'spread' operator '*.' is used since the preceding chain of calls returns an array of Method objects. You must distinguish whether you want to call a method on the array (using '.') or, in this case, call a method on each element of the array (using '*.') The spread operator is equivalent to: list.collect{ item -> item?.member } It still not pretty, nor intuitive. A totally subjective statement. For example, look at the following train wreck resulting from playing around in groovysh. I'm sorry you're having so much trouble with the tools but perhaps it is groovysh that you don't like. Have you tried groovyconsole or the plugin support for Groovy in IntelliJ? -tom
Re: [jug-discussion] Groovy and JRuby
On Sat, Jun 7, 2008 at 10:26 PM, Thomas Hicks <[EMAIL PROTECTED]> wrote: > To partially answer your original question: I use Groovy because it is > built on top of a mature and immense language platform, so I don't > have to reinvent the wheel every time I sit down to code. How does JRuby not meet this requirement? It can call Java classes, and using a different (superior in my opinion) interpreted/dynamic language is not reinventing the wheel, plus Ruby predates Groovy anyway, by quite a while [1] :) -- Chad [1] http://www.levenez.com/lang/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jug-discussion] Groovy and JRuby
On Sat, Jun 7, 2008 at 10:26 PM, Thomas Hicks <[EMAIL PROTECTED]> wrote: > Really? It's pretty similar in Groovy: > > groovy> [].class.methods*.name.toList() > ===> [get, add, add, indexOf, clone, clear, lastIndexOf, contains, addAll, OK, that seems to work. Can't say that would have been my first guess though. Whats up with the "*"? It still not pretty, nor intuitive. For example, look at the following train wreck resulting from playing around in groovysh. The best part is that I end with the original, working, expression... NOT WORKING ANYMORE! I don't even know what groovysh is trying to tell me with the error "No signature of method: [Ljava.lang.reflect.Method;.multiply() is applicable for argument types: (java.util.ArrayList) ". Whaa? This does not meet the Principle of Least Surprise for me. I remain - unconvinced. chadmac:groovy-1.6-beta-1 woolley$ bin/groovysh Groovy Shell (1.6-beta-1, JVM: 1.5.0_13) Type 'help' or '\h' for help. --- groovy:000> [].class.methods*.name.toList() ===> [get, add, add, indexOf, clone, clear, lastIndexOf, contains, addAll, addAll, size, toArray, toArray, set, remove, remove, isEmpty, trimToSize, ensureCapacity, hashCode, equals, iterator, subList, listIterator, listIterator, toString, containsAll, removeAll, retainAll, getClass, wait, wait, wait, notify, notifyAll] groovy:000> [] ===> [] groovy:000> [].methods ===> [] groovy:000> [].class.methods ===> [Ljava.lang.reflect.Method;@1bcd49 groovy:000> [].class.methods* groovy:001> [].class.methods*.name ERROR groovy.lang.MissingMethodException: No signature of method: [Ljava.lang.reflect.Method;.multiply() is applicable for argument types: (java.util.ArrayList) values: {[get, add, add, indexOf, clone, clear, lastIndexOf, contains, addAll, addAll, size, toArray, toArray, set, remove, remove, isEmpty, trimToSize, ensureCapacity, hashCode, equals, iterator, subList, listIterator, listIterator, toString, containsAll, removeAll, retainAll, getClass, wait, wait, wait, notify, notifyAll]} at groovysh_evaluate.run (groovysh_evaluate:2) ... groovy:001> [].class.methods*.name.toList ERROR groovy.lang.MissingPropertyException: Exception evaluating property 'toList' for java.util.ArrayList, Reason: groovy.lang.MissingPropertyException: No such property: toList for class: java.lang.String at groovysh_evaluate.run (groovysh_evaluate:2) ... groovy:001> [].class.methods*.name.toList() ERROR groovy.lang.MissingMethodException: No signature of method: [Ljava.lang.reflect.Method;.multiply() is applicable for argument types: (java.util.ArrayList) values: {[get, add, add, indexOf, clone, clear, lastIndexOf, contains, addAll, addAll, size, toArray, toArray, set, remove, remove, isEmpty, trimToSize, ensureCapacity, hashCode, equals, iterator, subList, listIterator, listIterator, toString, containsAll, removeAll, retainAll, getClass, wait, wait, wait, notify, notifyAll]} at groovysh_evaluate.run (groovysh_evaluate:3) ... groovy:001> [].class.methods*.name.toList() ERROR groovy.lang.MissingMethodException: No signature of method: [Ljava.lang.reflect.Method;.multiply() is applicable for argument types: (java.util.ArrayList) values: {[get, add, add, indexOf, clone, clear, lastIndexOf, contains, addAll, addAll, size, toArray, toArray, set, remove, remove, isEmpty, trimToSize, ensureCapacity, hashCode, equals, iterator, subList, listIterator, listIterator, toString, containsAll, removeAll, retainAll, getClass, wait, wait, wait, notify, notifyAll]} at groovysh_evaluate.run (groovysh_evaluate:3) ... groovy:001> ahhh let me out of here! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jug-discussion] Groovy and JRuby
At 09:42 PM 6/7/2008, Chad wrote: The challenge is "show me all the operations you can perform on an Array". Here's how you do it in (J)Ruby: chadmac:~ woolley$ jruby --command irb irb> [].class => Array irb> [].methods => ["frozen?", "sort", ...] irb> [].methods.sort => ["&", "*", "+", "-", "<<", "<=>", "==", "===", "=~", ...] # almost, but still has the methods from Object irb> [].methods.sort - Object.methods => ["&", "*", "+", "-", "<<", "[]", "[]=", "all?", "any?", ...] # Ah, just the methods from Array Now, I tried to do this same thing in Groovy (with groovysh), and I failed frustratingly and miserably. Really? It's pretty similar in Groovy: groovy> [].class.methods*.name.toList() ===> [get, add, add, indexOf, clone, clear, lastIndexOf, contains, addAll, addAll, size, toArray, toArray, remove, remove, isEmpty, set, trimToSize, ensureCapacity, hashCode, equals, iterator, subList, listIterator, listIterator, toString, containsAll, removeAll, retainAll, getClass, wait, wait, wait, notify, notifyAll] groovy> Object.class.methods*.name.toList() ===> [hashCode, getClass, equals, toString, wait, wait, wait, notify, notifyAll] groovy> [].class.methods*.name.toList() - Object.class.methods*.name.toList() ===> [get, add, add, indexOf, clone, clear, lastIndexOf, contains, addAll, addAll, size, toArray, toArray, remove, remove, isEmpty, set, trimToSize, ensureCapacity, iterator, subList, listIterator, listIterator, containsAll, removeAll, retainAll] And, notice that since I'm building on top of Java, I may not have had to explicitly filter out the Object methods (depending on the problem). I might have just been able to call java.lang.Class.getDeclaredMethods: groovy> [].class.declaredMethods*.name ===> [get, add, add, indexOf, clone, clear, lastIndexOf, contains, addAll, addAll, size, toArray, toArray, remove, remove, writeObject, isEmpty, readObject, set, trimToSize, ensureCapacity, removeRange, fastRemove, RangeCheck] And, of course, I could have sorted any of these with one more call: groovy> [].class.methods*.name.toList().sort() ===> [add, add, addAll, addAll, clear, clone, contains, containsAll, ensureCapacity, equals, get, getClass, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, notify, notifyAll, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray, toString, trimToSize, wait, wait, wait] To partially answer your original question: I use Groovy because it is built on top of a mature and immense language platform, so I don't have to reinvent the wheel every time I sit down to code. regards, -tom
Re: [jug-discussion] Groovy and JRuby (was Re: [jug-discussion] next month's meeting)
On Fri, Jun 6, 2008 at 4:14 PM, William H. Mitchell <[EMAIL PROTECTED]> wrote: > As I've mentioned before, I liked Groovy from a distance but I found it to > be frustrating to use. My experience with Ruby was the opposite -- blah at > first, but I quickly came to love it. Thanks William. I was waiting for someone who agreed with me to chime in before I responded on the thread. I've been using Ruby full-time, professionally for over two years now, and a hobbyist for a while before that. I used Java for several years before that, some of them with Scott and crew. To sum it up, Ruby makes me happy. I enjoy programming Ruby more than any other language. Many other people who work with Ruby say the same thing. This is not surprising, because Matz had this goal in mind when he created Ruby. Here's some quotes from him: "Does the world need another language? In theory, no. We just need the Turing machine to solve all of our problems, in theory. Humans require more sophisticated tools to program. It's a matter of human need. As long as some people feel happy using Ruby, that's enough of a reason for another language for me." [1] ""For me the purpose of life is partly to have joy. Programmers often feel joy when they can concentrate on the creative side of programming, So Ruby is designed to make programmers happy." [2] So, philosophy is fine, but lets see some code to prove this example. Here's an example. Say I'm on a plane, and I am playing with (J)Ruby and Groovy to compare them (which I was). No interenets or reference books, just the interactive interpreters. The challenge is "show me all the operations you can perform on an Array". Here's how you do it in (J)Ruby: chadmac:~ woolley$ jruby --command irb irb> [].class => Array irb> [].methods => ["frozen?", "sort", ...] irb> [].methods.sort => ["&", "*", "+", "-", "<<", "<=>", "==", "===", "=~", ...] # almost, but still has the methods from Object irb> [].methods.sort - Object.methods => ["&", "*", "+", "-", "<<", "[]", "[]=", "all?", "any?", ...] # Ah, just the methods from Array This is a beautiful experience which follows the Principle Of Least Surprise. For example: * Everything just prints out through the magic of duck typing, no class cast exceptions * [] IS an instance of an array * If I want the class or methods of this Array instance, I just ask it * If I want to sort the resulting array, I just call #sort * The "-" (subtract) operator does the logical thing, which is subtract the elements of one array from another. So, [].methods.sort - Object.methods gives me just the methods for Arrays Now, I tried to do this same thing in Groovy (with groovysh), and I failed frustratingly and miserably. I could get to the point of println'ing the methods of an Array (which is really an ArrayList in lipstick), but could see no way to do the nifty array subtraction to get rid of Object's methods. Not to mention the numerous exceptions when groovysh evaluates something that is not a string, and I have to println to get anything shown. Overall, confusion and NOT happiness. As a challenge, why don't the Groovy fans attempt this same thing and post it? I'll wager you write a lot more (ugly) code, and as William says, this is because Groovy is just too close to Java. Now for the unsubstantiated uninformed rant (couldn't get by without one of those): As for Grails, why use a substandard Rails clone built on a substandard Ruby clone? Check out Merb, that's the latest shiznit in Web Frameworks, and it is pretty sweet: http://merbivore.com/ It is similar to Rails, except they are doing all the things right that Rails does wrong. And for the ORM fans, check out DataMapper from the same crew: http://datamapper.org/ Sorry I'll miss the meeting, but I'll make it to another one soon to wax pedantic and give you Java guys grief ;) -- Chad [1] http://www.linuxdevcenter.com/pub/a/linux/2001/11/29/ruby.html [2] http://www.artima.com/intv/rubyP.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jug-discussion] Groovy and JRuby (was Re: [jug-discussion] next month's meeting)
On Fri, Jun 6, 2008 at 4:14 PM, William H. Mitchell < [EMAIL PROTECTED]> wrote: > Re getting together for a group discount for NFJS in Phoenix, count me in. I'm about, say, 70% committed to going this year. I really enjoyed it last year, so if we could get the price down from the early-bird special - I'd be 100% committed.
Re: [jug-discussion] Groovy and JRuby (was Re: [jug-discussion] next month's meeting)
I vote for the JRuby DSLs presentation. I attended a couple of Brian's Hibernate presentations at NFJS last summer. He's an excellent speaker, BTW. As I've mentioned before, I liked Groovy from a distance but I found it to be frustrating to use. My experience with Ruby was the opposite -- blah at first, but I quickly came to love it. I think Groovy's greatest strength and weakness is it's closeness to Java. My prediction is that in five years (ten years, too) Ruby will still be far more popular than Groovy, but maybe something else will overrun both. (I'll take lunch bets on Ruby vs. Groovy at the next JUG meeting! :)) Re getting together for a group discount for NFJS in Phoenix, count me in. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jug-discussion] Groovy and JRuby (was Re: [jug-discussion] next month's meeting)
On Thu, Jun 5, 2008 at 5:44 PM, Todd Ellermann <[EMAIL PROTECTED]> wrote: > > What are your (collective) reasons for being more interested in Groovy > than JRuby? Just interested... > > The ruby switch hasn't clicked for me yet. I feel the same way about ruby as I do smalltalk, I know they're both virtuous languages - though I don't feel comfortable in either. I'm able to be more productive with less effort in groovy.
Re: [jug-discussion] Groovy and JRuby (was Re: [jug-discussion] next month's meeting)
- Original Message From: Chad Woolley <[EMAIL PROTECTED]> To: jug-discussion@tucson-jug.org Sent: Thursday, June 5, 2008 4:36:52 PM Subject: [jug-discussion] Groovy and JRuby (was Re: [jug-discussion] next month's meeting) On Thu, Jun 5, 2008 at 2:26 PM, Andrew Lenards <[EMAIL PROTECTED]> wrote: > Groovy please. What are your (collective) reasons for being more interested in Groovy than JRuby? Just interested... -- Chad Grails. Bashar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jug-discussion] Groovy and JRuby (was Re: [jug-discussion] next month's meeting)
At 04:36 PM 6/5/2008, you wrote: On Thu, Jun 5, 2008 at 2:26 PM, Andrew Lenards <[EMAIL PROTECTED]> wrote: > Groovy please. What are your (collective) reasons for being more interested in Groovy than JRuby? Haven't we had this discussion before? Just interested... rabble-rouser. :) -tom p.s. IMHO, Groovy is Java done right.