The Artima Developer Community
Sponsored Link

Java Community News
Sun's JRuby Move

33 replies on 3 pages. Most recent reply: Nov 2, 2006 7:22 PM by Steven Shaw

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 33 replies on 3 pages [ « | 1 2 3 | » ]
Isaac Gouy

Posts: 527
Nickname: igouy
Registered: Jul, 2003

Speaking of "flawed hierarchies" Posted: Sep 12, 2006 4:15 PM
Reply to this message Reply
Advertisement
Todd Blanchard wrote ... and got to collections and went "oh no!".

imo it's good to remember that there are well known problems with Smalltalk's collection hierarchy.

"Interfaces and specifications for the Smalltalk-80 collection classes" William R. Cook, OOPSLA '92
http://doi.acm.org/10.1145/141936.141938

(Summarized in section 2.1 http://www.informatik.uni-ulm.de/es/projekte/proglang/colllib.ps )

Vincent O'Sullivan

Posts: 724
Nickname: vincent
Registered: Nov, 2002

Re: Sun's JRuby Move Posted: Sep 12, 2006 11:59 PM
Reply to this message Reply
> You have a small dynamic core that encompasses the
> "brains" (agile, flexible, dynamic language) of your
> application coordinating a much larger mass of "muscle"
> (rigid, inflexible, but high performance code written in C
> or C++).
>
> Ruby is like this, Python is like this, Smalltalk is like
> this, Java is kind of like this only the Java language is
> designed like a RIGID language and thus officially in that
> class of languages known as a PITA language to work with.

Are you saying that these languages are only suitable for writing part of an application and that the "much larger mass" has to be written in C or C++?

Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

Re: Sun's JRuby Move Posted: Sep 13, 2006 12:39 AM
Reply to this message Reply
>Are you saying that these languages are only suitable for writing part of an application

In that the part that isn't suitable is stuff that needs to be high performance or just pointlessly complex and fiddly. This is an old pattern.

Programmers used to write application code to position the read heads on the disk platter. We don't anymore. As we develop code that gets repetitive, the tendency is to abstract that part away as a callable interface. This is how we got "operating systems".

The VM/scripting language runtimes already have a bunch of muscle you're coordinating from the scripting language.

Kay Schluehr

Posts: 302
Nickname: schluehk
Registered: Jan, 2005

Re: Sun's JRuby Move Posted: Sep 13, 2006 12:44 AM
Reply to this message Reply
> Are you saying that these languages are only suitable for
> writing part of an application and that the "much
> larger mass" has to be written in C or C++?

This is at least the basic idea of "scripting" which had been once the self-selected niche of dynamic languages ( with Lisp and Smalltalk as exceptions ). In this niche they could survive the C++/Java winter and had a marginal existence. Now this existence is echoed back to them by more conservative minded people who naturalize their contingent historical condition and wish they will stay marginal forever.

Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

I don't believe I ever said "flawed hierarchies" Posted: Sep 13, 2006 1:08 AM
Reply to this message Reply
> Todd Blanchard wrote ... and got to collections and
> went "oh no!".


> imo it's good to remember that there are well known
> problems with Smalltalk's collection hierarchy.

Hierarchy is pretty irrelevant to the discussion WRT the broken typing discussion. However I will address it.

First, Smalltalk is so amazingly malleable that the absence of something like an OrderedSet is trivial and can be rectified in minutes.

Second, I'm not sure how "TYPE" got to be such an obsession in software, but I view it as a minor topic of study. Not at all central to software design. Coincidentally, Smalltalk takes a similar view. Inheritance in Smalltalk is more about code sharing and is not the Is-A subtyping idea that C++ and its decendants embrace.

Third, a class library was developed that would have met the authors criteria but, as it encoded the implementation of the collection within the collection's type via parameterized typing it suffered from loss of substitutability and excessive complexity. In the end it never got any traction.

http://portal.acm.org/citation.cfm?id=97947&coll=portal&dl=ACM

Third, I agree that the Smalltalk collection hierarchies are not so clean as one might like but they work well enough considering there were multiple facets to combine in different ways and only one mechanism of extension - single inheritance. FWIW, the streams library is similarly challenged/mangled. From the standpoint of an application developer this is not a problem and you hardly notice as you are mostly working with the leaf classes.

Furthermore, I view the implementation facet (underlying implementation as choice) as bogus complexity. My observation of how Java developers select List implementations backs this up. Nobody cares and they just keep picking their favorite (mine is ArrayList BTW).

Fourth, unlike everybody else, Smalltalkers are doing something about it that I expect the rest of the world will copy (like everything else the Smalltalk world invents) once they fully understand it in about oh seven years I guess.

http://www.iam.unibe.ch/publikationen/techreports/2002/iam-02-008

This is way off topic though.

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: Sun's JRuby Move Posted: Sep 13, 2006 1:11 AM
Reply to this message Reply
> > Perhaps the Java language's days are numbered, but I'd
> > expect it is a big number.
>
> Yeah sure, they still write COBOL too I hear.
>
Yep. And a lot of C++.

> > The Java language is a
> > workhorse. It allows developers to get stuff done, and
> it
> > has huge momentum.
>
> Momentum implies inertia. Like a boat anchor. You can
> get stuff done, but it takes forever relative to what you
> can get done using more dynamic tools.
>
Well, by momentum I meant ecosystem momentum. Because a lot of people are involved in Java right now, a lot of people tend to do things that add more value to Java. That does tend to sustain itself. Perhaps it has inertia, but that just means value tends to keeps getting added.

> > Moreover, I think the Java language can still be
> improved.
>
> Here we disagree. I think Java the language is BBD
> (Broken By Design) and cannot be fixed without breaking
> everything else. Many core tenets/base beliefs in the
> design are simply wrong.
>
> > Also, even though one of the difficulties of adding
> > closures to Java is that the Collection
> > interface is already set in cement using the
> > Iterator approach, and that it would add
> more
> > bulk to come up with a different collections hierarchy
> > that uses closures, that is still possible if it
> is
> > deemed a net win. All the concrete collections classes
> > could potentially be made to implement both interfaces.
>
> You just made my point.
>
That was kind of my point too in my Joy of Java blog post. As any language or API matures, and to the extent backwards compatibility is maintained, it becomes harder and harder to add things to it. My point here is that despite those difficulties, it is possible.


> > new code need not include the redundancy in
> > statements like:
> >
> > int i = 1;
>
> But the Java type system itself is broken. Adding smarter
> compilers to do more syntactic sugar (which is all they've
> done since version 1.1) won't fix it. I mean, why is
> there int? You don't need it. Make it an object and let
> me extend it.
>
The reason there's an int, as I understand it, is for runtime performance.

> >I think you can nowadays
> > safely use EJB3 and ignore the EJB2 and EJB1 stuff.
>
> Again, opportunity lost. EJB1 was an abortion. EJB2 was
> a different abortion. EJB3 - (fingers in ears) I'm not
> listening (/fingers) but what I can see it looks a bit
> like - well WebObjects. But I don't build apps that way
> anymore either.
>
How do you build apps?

> I work for the worlds largest online retailer. I've got
> friends at some of the other big 5 web sites. None of us
> have architectures that look anything like EJB[123]. They
> do not scale.
>
Could you elaborate on the actual problems with scaling these architectures? And what I'm really curious about: what to you and your friends at the other big 5 do instead?

> The best thing that can come from this dynamic languages
> on the JVM move is the enabling of the "rigid outside
> liquid center" pattern. You've seen it a dozen times -
> most good long lived apps are built this way.
>
> You have a small dynamic core that encompasses the
> "brains" (agile, flexible, dynamic language) of your
> application coordinating a much larger mass of "muscle"
> (rigid, inflexible, but high performance code written in C
> or C++).
>
> Ruby is like this, Python is like this, Smalltalk is like
> this, Java is kind of like this only the Java language is
> designed like a RIGID language and thus officially in that
> class of languages known as a PITA language to work with.
>
I haven't seen it a dozen times. Which good long lived apps are built this way? Can you elaborate with some examples?

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: Todd and Bill are unconvincing Posted: Sep 13, 2006 1:23 AM
Reply to this message Reply
> Bill's i = 1;
>
> is a example of WHEN NOT TO USE automatic type generation.
> Bill, if your example of "speed and productivity" is
> s horriby ambiguous code subject to misinterpretation and
> bugs, you aren't going to convert me. Please provide a
> better example.
>
I don't have a better example. Gregor Zeitlinger pointed out in this discussion the reason Gosling was suggesting the := assignment instead was to remove the ambiguity you are concerned about. Of course, this is done all the time in Ruby and Python (minus the semi-colon) and people don't seem to be running for the hills.

The way they solve the ambiguity in Scala is to have a "var" in front when you're declaring:

var i = 1;

Different from

i = 1;

Gregor also posted here that C# was going to get this var syntax.

Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

Re: Sun's JRuby Move Posted: Sep 13, 2006 2:59 AM
Reply to this message Reply
> Well, by momentum I meant ecosystem momentum. Because a
> lot of people are involved in Java right now

And yet - a lot of luminaries are moving on. Like Bruce Eckel.

> > I mean, why is there int? You don't need it. Make it an object and
> let me extend it.

> The reason there's an int, as I understand
> it, is for runtime performance.

False God. I have a GIGA Hz machine on my lap just now. When I started in this game 8MHz was wicked fast. So this is over a HUNDRED times faster and you mean to tell me the cost of the extra bit shift on add matters?

In the 70's they figured out how to have unlimited precision arithmetic using objects through and through by cleverly bit tagging ints in the VM and doing a tiny bit of extra work. The Smalltalk VM cheats in very subtle ways with 16 special classes- and I can still add methods to int. In the 90's this knowledge was thrown aside to do the naive thing and make all of our lives more complicated.

> >. But I don't build apps that way
> > anymore either.
> >
> How do you build apps?

Depends on the app. My employer uses Perl/Mason for the liquid center and C++ for the rigid bits BTW.

(This is not a secret http://masonhq.com/?MasonPoweredSites )

My consulting and personal work is done in Seaside using continuation based development.

> They do not scale.
> >
> Could you elaborate on the actual problems with scaling
> these architectures?

Rigidty has quite a bit to do with it. We shoot for zero downtime. Tricky if you've got a big rigid system that has to be fully verified/type checked at build time. Loose coupling is VERY important. A site like my employers requires massive parallelism to do its thing and we really do require maximum performance code.

> I haven't seen it a dozen times. Which good long lived
> apps are built this way? Can you elaborate with some
> examples?

Really? So people aren't embedding Groovy/Beanshell in their Java apps?

Anyhow, my employer's is one. WebObjects originally shipped with WebScript. People would build the domain model and business logic in conventional code, then script the UI.

FScript is a scripting language for ObjectiveC - it has a number of adopters as well - see http://www.fscript.org/. Its great because you can change the app behaviors quickly and just ship an updated script for certain things.

I worked on a workflow management system where the flows/state machines were defined in TCL - a popular choice for awhile for embedded interpreters.

Lua is used more and more for embedded scripting and an awful lot of games include the interpreter that handles the game's overall logic so they can tweak game scenarios quickly and provide loadable modules. http://www.lua.org/uses.html

Its a very common pattern.

Isaac Gouy

Posts: 527
Nickname: igouy
Registered: Jul, 2003

Re: Sun's JRuby Move Posted: Sep 13, 2006 6:52 AM
Reply to this message Reply
Kay Schluehr wrote
> This is at least the basic idea of "scripting" which had
> been once the self-selected niche of dynamic languages (
> with Lisp and Smalltalk as exceptions ).
-snip-

I usually forget that there are also explicitly typed "scripting" languages, for example
Pike http://pike.ida.liu.se/
Sawzall http://labs.google.com/papers/sawzall.html

And let's add Erlang to the exceptional dynamic languages :-)

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: Sun's JRuby Move Posted: Sep 13, 2006 4:31 PM
Reply to this message Reply
> > Well, by momentum I meant ecosystem momentum. Because a
> > lot of people are involved in Java right now
>
> And yet - a lot of luminaries are moving on. Like Bruce
> Eckel.
>
Bruce writes books, not code. I'm talking about people like Terrence Parr, who writes ANTLR in Java, or Doug Cutting, who wrote Lucene in Java, or IBM and Sun and IntelliJ, who have poured money into creating nice IDEs for Java, IBM and Sun and BEA, who have poured money into optimizing runtimes for Java. To me, the most compelling reason to use Java is that, its ecosystem.

Although, I'm wrong about that. Bruce is actually a good example, because books are part of the ecosystem. Even though Bruce really loves programming in Python, he's spent most of his time that past few years updating Thinking in Java. That adds value to the Java ecosystem, and he did it because of the momentum of the Java ecosystem. It was a business decision based on his perception that he'll get the best return from investing in his Java book at that time. (I can't say what books he'll be working on in the future, but this was recent past he was still doing the Java book.)

> > > I mean, why is there int? You don't need it. Make it
> an object and
> > let me extend it.
>
> > The reason there's an int, as I understand
> > it, is for runtime performance.
>
> False God. I have a GIGA Hz machine on my lap just now.
> When I started in this game 8MHz was wicked fast. So
> o this is over a HUNDRED times faster and you mean to tell
> me the cost of the extra bit shift on add matters?
>
> In the 70's they figured out how to have unlimited
> precision arithmetic using objects through and through by
> cleverly bit tagging ints in the VM and doing a tiny bit
> of extra work. The Smalltalk VM cheats in very subtle
> ways with 16 special classes- and I can still add methods
> to int. In the 90's this knowledge was thrown aside to do
> the naive thing and make all of our lives more
> complicated.
>
Well I think it matters sometimes, but not most of the time. The usual thing is that 80% to 90% of a program's time is spent in 10% to 20% of the code. So certainly for that non-critical 80% or 90% of your code, you really don't need that speed. But for the 10% to 20%, you just might. It depends on the situation.

I think that this usual 80/20 split for performance critical code is another justification for the liquid center, hard outside approach of which you speak. It would be nice if you could use whatever technique or language helps you maximize productivity for the 80% of code that doesn't matter to performance. One way to do that is to write the whole thing in a dynamic language, then run it. If there's a performance problem, profile it, identify slow spots, and replace them with static code that is more amenable to optimization.

I think the question is really about cost. It costs money to pay programmers to write programs, and it costs money to buy and manage sytems to run programs. Sometimes it will be cheaper to buy and manage more systems. Sometimes it will be cheaper to spend more money on programming.

> > They do not scale.
> > >
> > Could you elaborate on the actual problems with scaling
> > these architectures?
>
> Rigidty has quite a bit to do with it. We shoot for zero
> downtime. Tricky if you've got a big rigid system that
> has to be fully verified/type checked at build time.
> Loose coupling is VERY important. A site like my
> y employers requires massive parallelism to do its thing
> and we really do require maximum performance code.
>
Could you elaborate on that one? I'm asking because I'd really like to understand the difference.

If I'm building a scalable architecture, then surely I'll have multiple servers serving up the same application. Can't I design it such that I upgrade one batch of servers while the other batch is running the application, then tell the load balancer to send new requests to the new batch, and finish old requests to the old one? Once the old requests have all finished, I can upgrade the other batch of servers?

Is what you're saying that it is easier with a non-compiled language because you can just replace a source file on the deployment machine, and it gets used (interpretted) the next time someone hits that area of the code?

> > I haven't seen it a dozen times. Which good long lived
> > apps are built this way? Can you elaborate with some
> > examples?
>
> Really? So people aren't embedding Groovy/Beanshell in
> their Java apps?
>
I'm sure they are. I just haven't seen it. I was just asking because I'd like to know some examples, so thanks for those. I'll continue thinking about these tradeoffs. My main reason for using Java is the ecosystem, which is just wonderful. But I want more productivity and more fun, so I'm still trying to figure out how to get that.

Isaac Gouy

Posts: 527
Nickname: igouy
Registered: Jul, 2003

not so clean Posted: Sep 13, 2006 8:13 PM
Reply to this message Reply
I don't believe I ever said "flawed hierarchies"
I never intended to suggest you did say that - it's the title of a posting on the Squeak list which contains a reference to William Cook's old article.

Hierarchy is pretty irrelevant to the discussion WRT the broken typing discussion.
I disagree - broken hierarchies are relevant to discussion of broken types.

First, Smalltalk is so amazingly malleable that the absence of something like an OrderedSet is trivial and can be rectified in minutes.
For how many decades can we use that as an excuse? These days the mantra is batteries included.

Second, I'm not sure how "TYPE" got to be such an obsession in software...
I'll just quote an old Smalltalk paper in answer "... it is nevertheless advantageous for the programmer to be informed of such a problem when the code in question is being compiled, rather than later when it is being used."

Alan Borning and Dan Ingalls "A Type Declaration and Inference System for Smalltalk" 1982
http://portal.acm.org/ft_gateway.cfm?id=582168&type=pdf&coll=&dl=ACM&CFID=15151515&CFTOKEN=6184618#search=%22A%20Type%20Declaration%20and%20Inference%20System%20for%20Smalltalk%22


Third, I agree that the Smalltalk collection hierarchies are not so clean as one might like ... From the standpoint of an application developer this is not a problem...
But an ordinary Smalltalk application developer is also a library developer - who else will implement OrderedSet?

Fourth, unlike everybody else, Smalltalkers are doing something about it that I expect the rest of the world will copy...
That Traits paper is from 2002 - 4 years on which Smalltalk implementation has a library based on Traits?

Instead we find a library based on Traits in Scala - statically typed, and on the fringes of the Java ecosystem.

Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

Re: not so clean Posted: Sep 13, 2006 10:02 PM
Reply to this message Reply
> First, Smalltalk is so amazingly malleable that the
> absence of something like an OrderedSet is trivial and can
> be rectified in minutes.

> For how many decades can we use that as an excuse? These
> days the mantra is batteries included.

That was Smlltalk's mantra for a long time. It got dinged for it. Still, if you're absolutely sure it ought to be there. Implement it and submit it.

> Second, I'm not sure how "TYPE" got to be such an
> obsession in software...

> I'll just quote an old Smalltalk paper in answer "... it
> is nevertheless advantageous for the programmer to be
> informed of such a problem when the code in question is
> being compiled, rather than later when it is being used."

Advantageous somehow became "required or else". I don't disagree that its useful. I quite like ObjectiveC's optional static typechecking.

> But an ordinary Smalltalk application developer is also a
> library developer - who else will implement OrderedSet?

Who needs it?

> That Traits paper is from 2002 - 4 years on which
> Smalltalk implementation has a library based on Traits?

Traits was developed in Squeak. Which is pretty much where all innovations are developed these days, then ported somewhere else in a diluted form.

Squeak 3.9 will have Traits as first class citizen - it's in final candiate phase (gamma?) just now. Why so long might you ask? Its taken this long to provide the tools support across the extensive set of browsers, interactive debugger, and inspectors, plus a lot of people are building production systems on Squeak so it has been hard to find a time when enough people are willing to take the hit.

Traits has been available as a loadable option for at least a couple years, but until it is baked in, people have been reluctant to use it.

> Instead we find a library based on Traits in Scala -
> statically typed, and on the fringes of the Java ecosystem.

And probably stillborn. Are there supporting tools? Source debugger? Auto-completing editors? Without full tool support including interactive debugging, I worry that Scala will become about as popular as Bistro.

http://bistro.sourceforge.net/overview.htm

Isaac Gouy

Posts: 527
Nickname: igouy
Registered: Jul, 2003

got dinged Posted: Sep 14, 2006 10:36 AM
Reply to this message Reply
> > batteries included
> That was Smlltalk's mantra for a long time. It got dinged
> for it. Still, if you're absolutely sure it ought to be
> there. Implement it and submit it.

Smalltalk 'got dinged' for lack of modularity. Should we acknowledge the influence of Java on the late-90's implementation of namespaces in Smalltalk ;-)

("Implement it and submit it" from that I guess you are talking about Squeak in particular rather than Smalltalk in general.)


> > "... it is nevertheless advantageous for the programmer
> > to be informed of such a problem when the code in
> > question is being compiled, rather than later when it
> > is being used."
>
> Advantageous somehow became "required or else". I don't
> disagree that its useful.

You don't disagree that its useful, just whether or not it should be used? :-)


> > But an ordinary Smalltalk application developer is also
> > a library developer - who else will implement
> > OrderedSet?
>
> Who needs it?

OrderedSet was your example, and just an example - the ordinary Smalltalk application developer is also a library developer.


> Traits was developed in Squeak. Which is pretty much
> where all innovations are developed these days, then
> ported somewhere else in a diluted form.
-snip-
> plus a lot of people are building production systems
> on Squeak
-snip-

Squeak has been around for quite a few years now - are there examples of Squeak industrial use on a similar scale (JP Morgan, VW, Texas Instruments, ...) to older Smalltalk implementations?


> > Instead we find a library based on Traits in Scala -
> > statically typed, and on the fringes of the Java
> ecosystem.
>
> And probably stillborn. Are there supporting tools?
> Source debugger? Auto-completing editors?

imo When you don't know if there are supporting tools writing "And probably stillborn" is obnoxious.

On Artima Jun 10, 2006
"There is actually a pretty decent Eclipse plugin for Scala.
It has syntax highlighting, automatic project builds, completion, but (not yet) refactoring. It will have debugger integration real soon now.
See: http://scala.epfl.ch/downloads/eclipse/index.html "

Todd Blanchard

Posts: 316
Nickname: tblanchard
Registered: May, 2003

Re: got dinged Posted: Sep 14, 2006 11:33 AM
Reply to this message Reply
> Smalltalk 'got dinged' for lack of modularity.
> Should we acknowledge the influence of Java on the
> late-90's implementation of namespaces in Smalltalk ;-)

You mean VisualWorks. It is the only one with namespaces I know of. FWIW, the addition of namespaces to VW has been widely viewed as a bad move (although it might be the implementation rather than the idea in general).

> > Advantageous somehow became "required or else". I
> don't
> > disagree that its useful.
>
> You don't disagree that its useful, just whether or not it
> should be used? :-)

No, I disagree that it should be REQUIRED.

> > Traits was developed in Squeak. Which is pretty much
> > where all innovations are developed these days, then
> > ported somewhere else in a diluted form.
> -snip-
> > plus a lot of people are building production systems
> > on Squeak
> -snip-
>
> Squeak has been around for quite a few years now - are
> there examples of Squeak industrial use on a similar scale
> (JP Morgan, VW, Texas Instruments, ...) to older Smalltalk
> implementations?

It takes a long time to get to that level of use. But it is increasing. There are commercial systems in use. You are, I believe, familiar with the boys in Vancouver. Some stuff in Europe. I maintain a web based system for a university that is growing in users daily. Then there are the interesting new desktop apps like Sophie
http://futureofthebook.org/index.php?frame=http%3A//futureofthebook.org/projects/%3FPHPSESSID%3D091b34645ffbcb38269e0f6a74bfe614

and Croquet.
http://opencroquet.org

It is definitely in a growth cycle.

Isaac Gouy

Posts: 527
Nickname: igouy
Registered: Jul, 2003

Re: got dinged Posted: Sep 14, 2006 8:19 PM
Reply to this message Reply
> > Smalltalk 'got dinged' for lack of modularity.
> > Should we acknowledge the influence of Java on the
> > late-90's implementation of namespaces in Smalltalk ;-)
>
> You mean VisualWorks. It is the only one with namespaces
> I know of.

GST ? VAST ?

> FWIW, the addition of namespaces to VW has
> been widely viewed as a bad move
Doesn't tell us who thinks so or why they think so or where we can find out more. More interesting would be an explanation of the mechanisms Squeak provides to avoid name conflicts.

> No, I disagree that it should be REQUIRED.
By now I'm not sure either of us remember what "it" meant - probably "it" meant the programmer being informed of such a problem when the code in question is being compiled.

Flat View: This topic has 33 replies on 3 pages [ « | 1  2  3 | » ]
Topic: Sun's JRuby Move Previous Topic   Next Topic Topic: Test Categorization for Agile Builds

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use