[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Java



Well, to start out, these weren't really "my gripes" at all. I was just
pointing out to Paul that there are many more crucial issues to gripe about
than the lack of chdir or the deprecation of System.getenv (since his issues
can all be fixed with libraries, whereas mine cannot).

Of the three things I listed, lack of generics is the only one that has
really bothered me over the last six years. Yes, it's coming soon, but
considering there have been alternative (researchy) Javas that support
generics for almost as long as there has been Java, it seems to me that
parameterized types should have made it into the language sooner (but, then
again, I know very little about the issues involved; I'm sure Sun had its
reasons for waiting).

> Pugh has some good points about how the memory model could be
> improved, but he's mainly talking about improving Java rather than
> comparing Java to other programming languages.  Most languages don't
> even *have* a memory model in the sense that Pugh means.

I definitely agree that Java is leaps and bounds ahead of the rest of the
world in this regard. The problem is that Java *sought* to have a
language-level memory model that behaved consistently across all
architectures, but failed. The original memory model is too lax in some
places, so it doesn't offer the sorts of guarantees necessary for many
common, reasonable, efficient constructs. It's unnecessarily strict in other
places, so it doesn't account for many common architectural optimizations,
and requires JVMs to enforce memory consistency guarantees that have
horrible performance repercussions. And, most importantly, there's no
consistency across current JVMs; the Java memory model has failed. People
want to fix this, not defame Java.

> Common Lisp,
> for example, never even tried to address these issues (about
> multi-thread access to shared memory in the presence of caches and
> compiler optimizations).

Same with most languages. You just have to deal with the memory model of
your architecture, and if you're writing for multiple architectures, you
have to write more conservative could with more explicit memory
synchronization.

> 	 You can't download a little library that gives you tail calls or a
>    reasonable memory model.
>
> See, here you (collectively) go again.

I don't (collectively) go anywhere. I'm stating that something is wrong with
the Java spec, and you're taking it a defamatory affront to the language.

> Even Pugh doesn't use words like "broken" and "unreasonable".

Well, his Java Grande paper (http://www.cs.umd.edu/~pugh/jmm.pdf) was called
"Fixing the Java Memory Model." The verb "fix" rather implies brokenness (as
opposed to "Improving the Java Memory Model"). But I feel this is just
semantics, and is neither here nor there. (Then again, I never get emotional
or worked up about anything, so maybe my dictional indifference is invalid).

> This is what I mean about "trashing".

Sorry if my word choice was inflammatory; again, this wasn't my intent. I
don't really care too much about the Java memory model (though I've been
lurking on the mailing list for some time). I certainly don't care enough to
"trash" Java over it. I love Java to death. Really.

> The implication is that Java is *bad* because it has an
> *unreasonable* memory model, with the implication that some unnamed
> other language is *good* because it has a *reasonable* memory model.

Here I think you're off. You design some new language, X. It's a very clever
language, and supports a brand new feature called Y that no other language
supports. But you screw up your design, so Y is somehow fatally flawed. I am
perfectly entitled to say, "X's Y is broken." This doesn't imply that every
other language has a better Y, just that what you claimed about Y isn't
true.

I think you're seeing propagandism where there is none. When I say "The JMM
is broken" and provide a link, it's because I'd like other people to know
about the issue, not because I want to deprecate Java and surreptitiously
encourage programmers to switch to Cobol.

> Please tell me more about how other languages provide better solutions
> than Java to the problems that Pugh is trying to solve.

I don't see any mention of "other languages" anywhere in my original
message, or on Bill's JMM website. You're seeing propagandism where there is
only a dialog between programmers, implementers, and architects.

As I mentioned above, very few languages have memory models, and most
programmers have to deal with architectural memory models.

,steven.

,steven.