IWETHEY v. 0.3.0 | TODO
1,095 registered users | 1 active user | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Groovy, man.
[link|http://groovy.codehaus.org/|http://groovy.codehaus.org/]

Nice, nice, nice.

All the Java libs if you want them, none of the headaches.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Well, fewer headaches anyway.
Good find. :)

But anytime I see code like:

Binding binding = new Binding();

...I run away screaming. :D
New It doesn't need to be that way, though.
binding = new Binding()
is just as valid. Groovy uses dynamic dispatch if the object isn't constrained by type.

Example:
\ndynamicObject = "hello world".replaceAll("world", "Gromit")\ndynamicObject += "!"\nassert dynamicObject == "hello Gromit!"\n\nString staticObject = "hello there"\nstaticObject += "!"\nassert staticObject == "hello there!"\n


Also:
Classes are defined in Groovy similarly to Java. Methods can be class (static) or instance based and can be public, protected, private and support all the usual Java modifiers like synchronized.

One difference with Groovy is that by default things are public unless you specify otherwise.

Groovy also merges the idea of fields and properties together to make code simpler, please refer to the GroovyBeans section for details of how they work.

Each class in Groovy is a Java class at the bytecode / JVM level. Any methods declared will be available to Java and vice versa. You can specify the types of parameters or return types on methods so that they work nicely in normal Java code. Also you can implement interfaces or overload Java methods using this approach.

If you omit the types of any methods or properties they will default to java.lang.Object at the bytecode/JVM level.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Re: Groovy, man.
Does this mean I can avoid the horrible Java syntax completely? That's - groovy.
-drl
New Groovy was specifically designed
to appeal to J-heads - thus borrowing a lot of the syntax.

1) How is this better than beanshell?
2) WTF are these ass clowns doing pushing this as a JSR when they have no adoption and their stated justtification is to provide the "standard" scripting layer for the java platform.

YTF do we need a "standard scripting layer" for Java?

I dislike most standards. They're always the worst of all worlds.

Thumbs down.

For a perspective approximating my own: [link|http://www.jroller.com/page/fate/20040316|http://www.jroller.c...age/fate/20040316]



Java is a joke, only it's not funny.

     --Alan Lovejoy
Expand Edited by tuberculosis Aug. 21, 2007, 06:23:47 AM EDT
New Re: Groovy was specifically designed
1) Does beanshell script compile into classes?
2) I could care less about the politics. Groovy looks nifty, and if it works well, I'd use it when I had to program for a JVM. It fixes a lot of the shit you put up with in Java: closures, primitives, wonky regexp and collection APIs.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New 1) Yes
If you like it, by all means use it.

But lets not enshrine it with some "standard" label. That's lame.

Howabout we get another one with good (smalltalk-ish) syntax ala Bistro?



Java is a joke, only it's not funny.

     --Alan Lovejoy
Expand Edited by tuberculosis Aug. 21, 2007, 06:24:01 AM EDT
New I'll have to look at beanshell closer then
As far as Smalltalk goes, something written to "appeal to J-heads" is more likely to be allowed at work than something completely alien. :-P

Bistro looks cool... kinda like Objective C in some ways (type the vars, if you want to, etc), and not in other (blocks!). The benchmarks don't look so promising, however.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New I don't see where it compiles to classes
Everything looks completely dynamic and interpreted in BeanShell.

From the [link|http://www.beanshell.org/faq.html|FAQ]:
\t

Can I compile my beanshell scripts?


\t\tNot currently but this is planned for a future release.
\t\tSee "The BeanShell Parser" in the user manual for related information.\t\t

\t\tCan I subclass java classes using a scripted class?\t


\t\tNot currently but this is planned for a future release.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
Expand Edited by admin March 28, 2004, 03:47:46 PM EST
Expand Edited by admin March 28, 2004, 03:48:13 PM EST
New I was thinking of this feature
[link|http://www.beanshell.org/manual/bshmanual.html#Scripted_Objects|http://www.beanshell...#Scripted_Objects]

In BeanShell, as in JavaScript and Perl, method "closures" allow you to create scripted objects. You can turn the results of a method call into an object reference by having the method return the special value this. You can then use the reference to refer to any variables set during the method call. Useful objects need methods of course, so in BeanShell scripted methods may also contain methods at any level. For example:


foo() {
print("foo");
x=5;

bar() {
print("bar");
}

return this;
}

myfoo = foo(); // prints "foo"
print( myfoo.x ); // prints "5"
myfoo.bar(); // prints "bar"

------

Objects rather than classes really.



Java is a joke, only it's not funny.

     --Alan Lovejoy
Expand Edited by tuberculosis Aug. 21, 2007, 06:24:37 AM EDT
     Groovy, man. - (admin) - (9)
         Well, fewer headaches anyway. - (FuManChu) - (1)
             It doesn't need to be that way, though. - (admin)
         Re: Groovy, man. - (deSitter) - (6)
             Groovy was specifically designed - (tuberculosis) - (5)
                 Re: Groovy was specifically designed - (admin) - (4)
                     1) Yes - (tuberculosis) - (3)
                         I'll have to look at beanshell closer then - (admin)
                         I don't see where it compiles to classes - (admin) - (1)
                             I was thinking of this feature - (tuberculosis)

Better graphics than the Amiga!
57 ms