Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2008

Tip: Looking for answers? Try searching our database.

The Closure Controversy

Thread view: 
Jon Harrop - 28 Dec 2007 04:06 GMT
My day job is programming in modern statically-typed functional programming
languages like OCaml and F#. In my spare time in the evenings I like to
expand my mind by learning about really different languages like Java.

Tonight, I watched a fascinating lecture by Joshua Bloch called the "The
Closure Controversy":

 http://www.parleys.com/display/PARLEYS/The+Closures+Controversy

From my point of view, this lecture is absolutely mind boggling and I even
found myself shouting at the screen a couple of times.

My final feeling about Joshua's statements is one of agreement. Trying to
retrofit real functional features onto Java is completely futile and cannot
yield anything usable. To make such things usable you must completely
overhaul the language, fixing the fundamental problems first and, if you do
that, why not doing it properly by simply building a whole new language for
the JVM?

I thought Joshua's welcome slides that described how Java was built to be
used by industry and not as a PhD thesis in academia was right on the
money. Consequently, I was very surprised to see Joshua recommend the Scala
programming language, as this is academic research.

This got me thinking, industry would benefit enormously from the creation of
a modern statically typed functional programming language that combined the
tried and tested benefits of languages like OCaml and Haskell with the JVM
platform. Will Sun or someone else build such a thing?

Microsoft are already doing so for .NET with F#, of course.

Signature

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u

SadRed - 28 Dec 2007 04:41 GMT
> My day job is programming in modern statically-typed functional programming
> languages like OCaml and F#. In my spare time in the evenings I like to
[quoted text clipped - 29 lines]
> --
> Dr Jon D Harrop, Flying Frog Consultancy Ltd.http://www.ffconsultancy.com/products/?u

> fixing the fundamental problems first
What are the fundamental problems?
Jon Harrop - 28 Dec 2007 06:40 GMT
> What are the fundamental problems?

The single biggest omission is type inference, the absence of which is
compounded by Java's unsuitable syntax for types.

Joshua gives examples of some trivial functions written in Java+closures
syntax:

 static <A1, A2, R> { A1 => { A2 => R } } curry({A1, A2 => R} fn {
   return { A1 a1 => A2 a2 => fn.invoke(a1, a2) } };
 }

In OCaml this is just:

 let curry f a1 a2 = f(a1, a2)

As Joshua says:

 "Is this how you want Java programs to look?"

Due to the lack of type inference, the Java code is littered with lots of
types. In contrast, no types appear in the OCaml at all. As you can
imagine, trying to write anything non-trivial quickly becomes a practical
impossibility without type inference.

There are lots of other problems as well:

. Java's checked exceptions do not scale in the presence of closures.
. Syntactic burden for function-heavy code.
. Arrays don't work: need to fix Java's type system.
. Autoboxing doesn't work: the eight primitive types should not even exist.
...

There are also some more fundamental problems, like the lack of tail calls
in the JVM itself.

The only logical conclusion is that Java should be left alone and something
better should be implemented to replace it in the future. Scala is one
option but I'd rather see something tried and tested implemented on the JVM
rather than a completely new academic research language.

Signature

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u

Mark Thornton - 28 Dec 2007 08:39 GMT
> There are also some more fundamental problems, like the lack of tail calls
> in the JVM itself.

That one might be addressed by the MultiLanguageVM project. I suspect it
could be added with rather less anguish and controversy than changes to
the language.

http://mail.openjdk.java.net/pipermail/announce/2007-October/000016.html

Mark Thornton
Stefan Ram - 28 Dec 2007 15:46 GMT
>something better [than Java ]should be implemented
>to replace it in the future.

 Java now is the most successful language/platform
 (6 million developers, 3.3 billion Java devices)
 in the history of computing.

 Language implementations with what you ask for (tail call
 optimization, type inference, ...) already exist.
 So everyone is already free to replace Java by such
 an implementation right now.

 Many Poeple just have chosen not to use such »better«
 languages and to use Java instead.

 So your problem might not be technical but social.
 Technically, the »better language« already is there.
 Socially, people choose not to use it often.

 If you are sure you know a language that is so much
 »better« than Java, and you use it for your own projects,
 than you have a strong advantage over all the companies
 using Java.

 Wouldn't it be a good idea, then, just to use this advantage
 to create great products with less effort? Since it gives
 you such an edge, why do you want to help your competition
 by convincing them to use it too? Actually, you should
 keep it secret as long as possible.

 If you really want to convince them, the outstanding success
 of your projects with this »better language« should be more
 convincing than words and praise could ever be.
Jeff Higgins - 28 Dec 2007 18:49 GMT
Amen.  Well said.  Thank you.
Roedy Green - 28 Dec 2007 22:16 GMT
>  Java now is the most successful language/platform
>  (6 million developers, 3.3 billion Java devices)
>  in the history of computing.

It not so much Java the language that is so popular, it is Java the
class library suite and Java the JVM that runs on many platforms
without modification.

It should be relatively easy to redo the Java language, keeping
everything else the same.

At some point surely Sun will take a second run at generics, without
type erasure.  Just how does Sun then deprecate the first crack?

It might be a good time to introduce Java II that has many syntax
tidies and some incompatibilities.

Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Jon Harrop - 28 Dec 2007 22:30 GMT
>>  Java now is the most successful language/platform
>>  (6 million developers, 3.3 billion Java devices)
[quoted text clipped - 3 lines]
> class library suite and Java the JVM that runs on many platforms
> without modification.

Exactly.

> It should be relatively easy to redo the Java language, keeping
> everything else the same.

Hopefully.

Signature

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u

Jon Harrop - 28 Dec 2007 23:13 GMT
>>something better [than Java ]should be implemented
>>to replace it in the future.
>
>   Java now is the most successful language/platform
>   (6 million developers, 3.3 billion Java devices)
>   in the history of computing.

In terms of market share, that could be a lot better.

>   Language implementations with what you ask for (tail call
>   optimization, type inference, ...) already exist.

Not on the JVM.

>   So everyone is already free to replace Java by such
>   an implementation right now.

No. Until better languages are implemented interoperably with Java on the
JVM, replacing Java with something else is not "free" but prohibitively
expensive.

>   Many Poeple just have chosen not to use such »better«
>   languages and to use Java instead.

Actually, most programmers don't use Java.

>   So your problem might not be technical but social.
>   Technically, the »better language« already is there.
>   Socially, people choose not to use it often.

If the problem were social the Java community would not be working so hard
to adopt features like closures.

>   If you are sure you know a language that is so much
>   »better« than Java, and you use it for your own projects,
>   then you have a strong advantage over all the companies
>   using Java.

You are assuming that we compete with companies that use Java but we do not.

>   Wouldn't it be a good idea, then, just to use this advantage
>   to create great products with less effort?

Yes. We have used a variety of different languages (including Java) to
create products. However, many of our products cannot be written by hand in
a language like Java because it requires too much work to write and
maintain.

>   Since it gives
>   you such an edge, why do you want to help your competition
>   by convincing them to use it too?

We don't have any competition so that doesn't concern us.

>   Actually, you should keep it secret as long as possible.

I would rather build a better future for everyone: more choice of languages
and more JVM users.

>   If you really want to convince them, the outstanding success
>   of your projects with this »better language« should be more
>   convincing than words and praise could ever be.

That already happened.

Signature

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u

Stefan Ram - 28 Dec 2007 23:36 GMT
>If the problem were social the Java community would not be
>working so hard to adopt features like closures.

 Remarkably, Guy Steele claimed that once the Java community
 was working hard to /remove/ features like closures.

     »Guy Steele wrote:

           Actually, the prototype implementation *did* allow
           non-final variables to be referenced from within
           inner classes. There was an outcry from *users*,
           complaining that they did not want this!«

http://madbean.com/2003/mb2003-49/
Lew - 29 Dec 2007 01:26 GMT
Jon Harrop writes:
>> If the problem were social the Java community would not be
>> working so hard to adopt features like closures.

>   Remarkably, Guy Steele claimed that once the Java community
>   was working hard to /remove/ features like closures.
[quoted text clipped - 7 lines]
>
> http://madbean.com/2003/mb2003-49/

Who is this "Java community" really?  Do those who claim to speak for it
really do so?

There wouldn't be a "Closure Controversy", as this thread is entitled, if
support for it were so universal.

This Java programmer happens to like anonymous class syntax.  While I have
seen what closures can do for those who initially *write* code, it seems less
kind to maintainers.  Perhaps from being clean-up for so many code bases over
the years, I have grown leery of too-clever, too-compact idioms that require a
maintainer to hunt all over source just to see what "x,y => majorOp( x
).convolve( y )" means.  At the expense of initial verbosity on the part of
the programmer, who otherwise might be sorely tempted to leave out critical
self-documentation, Java maintainers get a literate, connected and somewhat
self-explanatory inner class.

Those who complain that the syntax is "ugly" are probably right, but it's hard
to put an engineering value on such an assessment.  Besides, properly indented
inner classes aren't so hard to read, and in the end are easy enough to
maintain for someone schooled in the idiom.

Arguably, closure syntax is just as transparent given similar familiarity.
The question is whether their introduction into Java provides enough benefit
to offset feature creep (leaving aside Java II, just when you thought it was
safe to dip into the JVM again), or whether current idioms do enough that we
will just live without closures.  It's not so much if they're better, as
whether they're better enough.

Perhaps those intimately familiar with the reasons why Guy Steele's "*users*"
raised such an outcry would share them with us.

Signature

Lew

Lew - 28 Dec 2007 06:09 GMT
> I thought Joshua's welcome slides that described how Java was built to be
> used by industry and not as a PhD thesis in academia was right on the
[quoted text clipped - 7 lines]
>
> Microsoft are already doing so for .NET with F#, of course.

Like MS, the new Java lives well with other languages.  Pretty soon we'll all
be singing at La Scala, I wager.

Puns aside, given the ability to blend with other languages, and its use of
non-functional idioma like anonymous inner claases to replace "true closures"
(everybody pause in reverence), there's no real reason for Java itself to
change.  Java  doesn't need to be the ideal language - just blend it with a
JVM-ized Rhino or Scala or what-all.  If the typical Java way doesn't suit,
you divide your app along domain boundaries that lend themselves to transition
into other languages.

Even that might not be necessary.  The Java idioms actually do support
creation, on time, of software that will fulfill requirements with
reliability.  While inner classes are a bit tricky and arguably ugly, they
work for pretty much anything you need, and frankly, are easier to read and
understand as a maintainer.  Closure syntax is slick as all get-out, surely it
is, but it's got its own readability challenges.

The object oriented syntax of a Java anonymous inner class can be made to work
for you, both for the self-documentation nature of the source and to help the
Hotspot optimizer see opportunities.  You see an override method, like
accept() for a FileFilter, that is going to iterate its operation over a whole
set of candidate File entries.  Very closure-like.  But instead of a mathlike
formula mapping a file to a boolean, you have a function-like accept() with
words describing the logical condition for the acceptance.  Those words will
refer to a private method that progressively shows more detail, thus not
hiding the purpose in a complex algebraic expression.

All in a hairy anonymous class declaration.  Except, not so hairy as all that
really, once one's actually trained oneself as a competent Java programmer.

So what if the Java inner-class idiom is but a clumsy, unsophisticated
workaround for the pristine elegance of true closures, and lacks in certain
arcane reaches - Java reaches far enough to get the job done.

Signature

Lew

Jon Harrop - 28 Dec 2007 06:28 GMT
> Java reaches far enough to get the job done.

In some markets perhaps but I don't believe that would be true for our work.
Everything we sell carves out a niche and, consequently, has no competition
in the marketplace.

If I wanted to redevelop our software in Java we'd need 10 Java developers
for each OCaml/F# developer. Even if we could afford that outlay and risk,
I doubt Java versions would ship enough units to make any profit!

Signature

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u

Lew - 28 Dec 2007 14:26 GMT
> If I wanted to redevelop our software in Java we'd need 10 Java developers
> for each OCaml/F# developer. Even if we could afford that outlay and risk,
> I doubt Java versions would ship enough units to make any profit!

Do you have, oh, I don't know, any actual, replicable evidence for that ratio?

Signature

Lew

Hunter Gratzner - 28 Dec 2007 18:11 GMT
> Do you have, oh, I don't know, any actual, replicable evidence for that ratio?

No, he hasn't. Remember, Dr. Jon Harrop's first appearance in this
group was to disseminate propaganda for the language Scala and then
some spam for a book about Scale he happened to (co)author.

Dr "I have a PhD in computational physics from the university of
Cambridge" Harrop is only here in this group to demonstrate his
alleged superiority and to show us stupid Java programmers how
superior beings would do things. I consider him to be in the same
group as Xah Lee and our broken record "implied insult deleted"
groupie.

There is much to be said about closures in Java, but I don't consider
Dr Harrop's biased comments a valuable contribution to such
discussions.
Joe Attardi - 28 Dec 2007 18:25 GMT
> I consider him to be in the same group as Xah Lee and
> our broken record "implied insult deleted" groupie.

None of the nasty things you have implied about Paul Derbyshire are in
any way true.

:-)

Kidding, of course...!
Wildemar Wildenburger - 28 Dec 2007 20:17 GMT
>> I consider him to be in the same group as Xah Lee and our broken
>> record "implied insult deleted" groupie.
[quoted text clipped - 5 lines]
>
> Kidding, of course...!
Not that i have any form of authority here, but I would like to see the
Twisted-bashing exclusively contained in the SWT-thread. Just so the
fire won't spread too much.

humbly,
/W
Jon Harrop - 28 Dec 2007 22:03 GMT
>> If I wanted to redevelop our software in Java we'd need 10 Java
>> developers for each OCaml/F# developer. Even if we could afford that
[quoted text clipped - 3 lines]
> Do you have, oh, I don't know, any actual, replicable evidence for that
> ratio?

Yes. That is the number of Java programmers who get replaced by each
OCaml/F# developer whenever a company takes the plunge to use these
languages.

Look at XenSource, for example. 30 Java programmers in the USA were replaced
by 3 OCaml programmers in the UK. The Java programmers failed to ship
anything at all in 3 years and the OCaml programmers shipped something of
such high quality in only 6 months that the company then sold for $500M.

Lots of companies have done similar things. We're one of them, reborn from
C++ development a decade ago.

This is nothing new. Java offers substantial productivity gains over C.

Signature

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u

Mark Thornton - 28 Dec 2007 22:43 GMT
> Look at XenSource, for example. 30 Java programmers in the USA were replaced
> by 3 OCaml programmers in the UK. The Java programmers failed to ship
> anything at all in 3 years and the OCaml programmers shipped something of
> such high quality in only 6 months that the company then sold for $500M.

It is most likely that this says more about the programmers than it does
about the languages concerned. As it seems common to find that 5% of
programmers are more productive than the other 95%, if you can find
those 5% you can 'prove' any reasonable language is the best. Java's
success has brought with it a large coterie of uninspiring Java programmers.

> Lots of companies have done similar things. We're one of them, reborn from
> C++ development a decade ago.
Perhaps your enthusiasm is as important as the chosen language.

> This is nothing new. Java offers substantial productivity gains over C.
That giant 'core' library is as important as the language itself. This
remains an advantage over many would be successors (other than JVM
hosted languages). .NET is even larger, but personally I would be
unhappy using it on anything but Windows.

Mark Thornton
Jon Harrop - 28 Dec 2007 23:19 GMT
>> Look at XenSource, for example. 30 Java programmers in the USA were
>> replaced by 3 OCaml programmers in the UK. The Java programmers failed to
[quoted text clipped - 8 lines]
> success has brought with it a large coterie of uninspiring Java
> programmers.

Exactly. Java is for the 95% but there's no reason the JVM couldn't be
reused to help the 5% do the other half of the work.

>> This is nothing new. Java offers substantial productivity gains over C.
>
> That giant 'core' library is as important as the language itself. This
> remains an advantage over many would be successors (other than JVM
> hosted languages). .NET is even larger, but personally I would be
> unhappy using it on anything but Windows.

Yes. We use F# extensively and I would like to see exactly that kind of
innovation on the JVM. The requirements seem quite mundane to me: the
research was done and dusted a long time ago...

Signature

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u

Lew - 29 Dec 2007 01:35 GMT
> Exactly. Java is for the 95% but there's no reason the JVM couldn't be
> reused to help the 5% do the other half of the work.

...
> Yes. We use F# extensively and I would like to see exactly that kind of
> innovation on the JVM. The requirements seem quite mundane to me: the
> research was done and dusted a long time ago...

The notion of the JVM hosting a variety of languages such as OCaml makes too
good sense to ignore.  Even if a language is "for the 5%", that's enough to
justify its existence, particularly in the JVM.

Besides any putative objective or statistical advantage, there is no doubt
that certain languages match a certain engineering style and others match a
different one.  As long as an organization can realistically find or train
maintainers for their code base in whatever languages they use, no mean
consideration, they should not dogmatically resist using them.

One would hope that the choice of language for specific projects in such a
shop would consider relative costs over the full lifecycle, as well as the
impedance matches between the language, the problem domain and the thought
styles of the practitioners.

Signature

Lew

Joshua Cranmer - 30 Dec 2007 21:09 GMT
> Exactly. Java is for the 95% but there's no reason the JVM couldn't be
> reused to help the 5% do the other half of the work.

Given your past statements, I've doubted you've looked too hard.

Buried in the amendments to the JVM spec, 2nd. edition for Java 5 (why a
 JVM spec 3rd edition hasn't been released is beyond me) is something
new. Occupying the spot that was previously good 'ol xxxunusedxxx is a
new instruction: invokedynamic. After reading its definition, it's clear
that it cannot be used in Java code. It was added, IIRC, solely for the
purpose of aiding the compilation of interpreted languages to the JVM
bytecode.

Signature

Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth

Daniel Pitts - 30 Dec 2007 22:28 GMT
>> Exactly. Java is for the 95% but there's no reason the JVM couldn't be
>> reused to help the 5% do the other half of the work.
[quoted text clipped - 8 lines]
> purpose of aiding the compilation of interpreted languages to the JVM
> bytecode.

A little digging shows tt was defined and added by JSR 292:
<http://jcp.org/en/jsr/detail?id=292>

The intent seems to be to support dynamically typed languages that
compile to JVM bytecode, as well as "hot-swapping".

Signature

Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>

Jon Harrop - 03 Jan 2008 17:33 GMT
>> Exactly. Java is for the 95% but there's no reason the JVM couldn't be
>> reused to help the 5% do the other half of the work.
[quoted text clipped - 8 lines]
> purpose of aiding the compilation of interpreted languages to the JVM
> bytecode.

That is a step in the wrong direction for me, being dynamic rather than
static.

Signature

Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?u

Joshua Cranmer - 31 Dec 2007 05:38 GMT
> My final feeling about Joshua's statements is one of agreement. Trying to
> retrofit real functional features onto Java is completely futile and cannot
> yield anything usable. To make such things usable you must completely
> overhaul the language, fixing the fundamental problems first and, if you do
> that, why not doing it properly by simply building a whole new language for
> the JVM?

Bloch--I would prefer to use the last name in this discussion, as
`Joshua' is an extremely common name and two people with said name are
now going to be involved in the discussion--notes at one point that the
decision to not make the primitive types extend from Object was perhaps
a bad one. Indeed, some of his dislike for BGGA closures comes from its
inability to handle auto{un}boxing.

True, pure functional programming (at least as Wikipedia describes it)
cannot succeed in Java:

Functional programming ... treats computation as the evaluation of
mathematical functions and avoids state and mutable data.

Since object-oriented programming emphasizes encapsulation of state and
mutability--indeed, methods without side effects should be rare in
OOP--functional programming is the exact antithesis of this. Even if
functional programming is the new "in" in programming, Java is, always
has been, and always be OOP; forcing this new paradigm onto it would be
painful and ultimately (IMHO) fatal.

But Bloch also points out that closures seek to solve several problems
(perceived or real) in Java:
1. Verbosity in anonymous inner classes
2. Difficulty in instituting callback
3. Inability to create pseudo-control structures
4. Verbose and error-prone resource management
5. Difficulty in parallelization

Closures, at least in the BGGA proposal, are the poorest way to tackle
all of these:
1. Verbosity is traded off into short-but-confusing code snippets.
2. Function pointers are helpful, but they are prone to extremely poor
documentation. Syntax is also barbaric.
3. The only two pseudo-control structures that seem to be pondered are
the ARM blocks similar to C#'s using and multivariate for loops. Of
these, the former could be solved with a simple syntactic-sugar
modification, and the latter isn't terribly high on my list of things
that I need. Tackling this also creates the most complexity.
4. See answer to point #3.
5. I don't really see how BGGA solves this problem.

I recall browsing a BGGA closure discussion which brought up that a
     return
can be different, in some cases, from a
     return;

The discussion here was telling. One proponent was saying that the
difference between the two can be easily remembered because the
semicolon version is doing a non-local return and the other the local
return (closures returning void are SERIOUSLY confusing). If the
presence or lack of the basic statement delimiter has two different
/compilable/ effects, then the proposal is *seriously* flawed.

Here I am also mostly in agreement with Bloch on this four points:
1. Not that much of a problem. Modern IDEs make it extremely easy to cut
through all of the overhead code. I don't use a modern IDE, but I abuse
the anonymous inner class syntax, and I don't complain about it's
verbosity. Au contraire, it can be beautiful.
2. Function pointers will do more harm than good unless done right. And
I don't really see how they can be done right.
3. Pseudo-control structures begin to risk fracturing Java into dialects
much the way C has. I see very little use for these structures, except
for...
4. ... this one. And Bloch's idea to solve this is good enough for me.
5. Simple but powerful parallelization techniques are still in the arena
of cutting-edge research. And I believe that what is research does not
belong in a production language.

Everything said, I believe that closures present a problem for Java. A
large community seems insistent on pushing closures into Java at the
expense of tackling other problems. I believe that the problem of
generics need to be solved before any other new feature can gain entry.
But the efforts that could be used to best fix these problems are going
into presenting three or four conflicting versions of closures and
expanding these versions to make Java more functional.

> I thought Joshua's welcome slides that described how Java was built to be
> used by industry and not as a PhD thesis in academia was right on the
> money. Consequently, I was very surprised to see Joshua recommend the Scala
> programming language, as this is academic research.

I, on the other hand, was not surprised: Bloch points out near the
beginning that Java was designed to be an operational language, a mixed
language (I forget his exact wording) as opposed to the research
languages. It seems to me that he is of the opinion that languages like
Scala are designed to be researched on, that is, to be sliced, diced,
cut, and mutilated for the purposes of deciding which features should
and should not be placed into a new language. It is in this vein that I
think he intends to recommend Scala.

> This got me thinking, industry would benefit enormously from the creation of
> a modern statically typed functional programming language that combined the
> tried and tested benefits of languages like OCaml and Haskell with the JVM
> platform. Will Sun or someone else build such a thing?

I do believe that someone has already built such a thing. However, I am
going to bring to mind one blog praising "The Next Big Language". What
will it be? Ruby, Javascript, Groovy, and others were tossed around
without consensus. But these languages are all similar in one way: they
gain a sizable following, generate a fair amount of hype, and then...
nothing happens. What industry really needs is for there to be one
language that specializes and focuses in this new area without strong
competition as opposed to competing jack-of-all-trades. After all, who
makes more: the master goldsmith or the jack-of-all-trade smith?

Signature

Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth

Lew - 31 Dec 2007 09:21 GMT
> Bloch--I would prefer to use the last name in this discussion, as
> `Joshua' is an extremely common name and two people with said name are
> now going to be involved in the discussion-

Well, there is another "Bloch" in the discussion, too, but the risk of
confusion there is more than a little remote.

Signature

Lew Bloch

Mark Thornton - 31 Dec 2007 10:14 GMT
> But Bloch also points out that closures seek to solve several problems
> (perceived or real) in Java:
[quoted text clipped - 3 lines]
> 4. Verbose and error-prone resource management
> 5. Difficulty in parallelization
...

> 5. I don't really see how BGGA solves this problem.
...

> 5. Simple but powerful parallelization techniques are still in the arena
> of cutting-edge research. And I believe that what is research does not
> belong in a production language.

What is proposed in this area is just making the fork-join framework
(proposed for Java7) easier to use.

http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166ydocs/

In particular the application of 'Ops' to ParallelArray's. I don't think
this counts as cutting edge research, rather it is an implementation in
Java of strategies long used elsewhere.

> Everything said, I believe that closures present a problem for Java. A
> large community seems insistent on pushing closures into Java at the
> expense of tackling other problems. I believe that the problem of
> generics need to be solved before any other new feature can gain entry.
Fixing an existing feature is always less glamorous than adding
something completely new.

Mark Thornton
Joshua Cranmer - 31 Dec 2007 17:27 GMT
>> Everything said, I believe that closures present a problem for Java. A
>> large community seems insistent on pushing closures into Java at the
>> expense of tackling other problems. I believe that the problem of
>> generics need to be solved before any other new feature can gain entry.
> Fixing an existing feature is always less glamorous than adding
> something completely new.

One of the most irksome issues I found with generics was that
java.util.List.class is of type Class<List> and not Class<List<?>>. Sun
refused to fix this because to fix this oversight would break existing code.

So fixing an existing feature risks breaking the hacks to get around the
broken code. For web developers intimate with CSS, this was the problem
with IE 7.

Signature

Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth

Ed Jensen - 01 Jan 2008 02:35 GMT
> I do believe that someone has already built such a thing. However, I am
> going to bring to mind one blog praising "The Next Big Language". What
> will it be? Ruby, Javascript, Groovy, and others were tossed around
> without consensus.

The NBL that blog was talking about is the next version of JavaScript
(technically EcmaScript).


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.