Lambda the Ultimate

inactiveTopic New features proposed for Java 1.5 by Sun
started 12/5/2002; 6:36:05 AM - last post 12/11/2002; 12:09:22 AM
Adewale Oshineye - New features proposed for Java 1.5 by Sun  blueArrow
12/5/2002; 6:36:05 AM (reads: 5338, responses: 31)
Sun has recently posted a list of new proposed features for Java 1.5. These include:

1. A syntax for defining enumerated types. This syntax provides linguistic support for the Typesafe Enumeration pattern.

2. An automatic conversion from primitive types to their corresponding reference type wrappers. This conversion facilitates the integration of generics into the language, and reduces inessential clutter.

3. Enhanced for loops allow convenient iteration over collections, without the need for an explicitly defined iterator. This reduces the need for boilerplate iteration code and the corresponding opportunities for errors.

4. Static import. A mechanism to allow the use of unqualified constants.

Useful links: The JSR document describing these proposals in more detail http://jcp.org/en/jsr/detail?id=201 and the discussion on The Server Side.

It's interesting to note how these changes are mostly cosmetic alterations to syntax rather than deeper semantic changes such as adding blocks. There's an interesting wiki page I started a while back that offers some interesting proposals that would really shake up Java.

Noel Welsh - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/5/2002; 7:09:59 AM (reads: 5248, responses: 0)
Playing catch up with C# (though it is almost ludicrous to imply a few syntactic tweaks make C# a more advanced language than Java). I really like Adam Spitz's suggestions on Wiki.

Isaac Gouy - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/5/2002; 8:11:45 AM (reads: 5248, responses: 0)
As it runs on the JVM, the Nice language seems a good demonstration of what could (should?) be done. It already has generics and boxing, and full use of Java libraries... ho hum.

Has anyone here found design problems with the Nice language?
(Nice was discussed a while back)

Sam Gentile - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/5/2002; 3:14:50 PM (reads: 5213, responses: 2)
Gee, 4 straight features right out of .NET-). Gosling just gave yet another boring keynote at SD East and riducled .NET and C# as having "nothing" and this. Oh the irony....

This is hardly enough and way too late to save Java I'm afraid.

Paul Snively - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/5/2002; 4:31:25 PM (reads: 5152, responses: 0)
Thankfully, Java isn't in need of saving.

Adewale Oshineye - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/6/2002; 3:00:15 AM (reads: 4953, responses: 1)
I think it's highly inappropriate to talk of languages needing saving in a world where people are still building software in Cobol. Backwards compatibility and maintenance means that once you've had enough projects start there will always be momentum. No one is seriously expecting all those Java projects to be immediately scrapped overnight.

The 4 features are superficial alterations that make no real impact on the expressivity, complexity or type-safety of the Java language. Significant additions would have been blocks, higher-order functions (perhaps through syntactic sugar for the reflection API's Method class), default arguments to methods to reduce the need for method overloading (as seen in Nice), Python-style raw strings to simplify usage of regular expressions and an aggressive purging/refactoring of the standard APIs.

Ehud Lamm - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/6/2002; 6:57:02 AM (reads: 4895, responses: 0)
I recently read several papersa bout Icon/Snobol etc. At when point Griswold remakrs that SNOBOL4 is so different and more advanced than SNOBOL2/3 that choosing a new name would have been appropriate. He goes on to say that many people crticized SNOBOL4, solely based on their experience with SNOBOL2/3, without really looking at SNOBOL4 itself.

Paul Snively - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/6/2002; 9:14:51 AM (reads: 4700, responses: 0)
I think it's interesting that so many of the semantic features that people seem to want to see added to Java would lend it an even more distinctly functional flavor than it currently has. I also find it nice that Nice seems to be serving as the model for what Java could/should become. Couple this with the availability of the Boost Lambda Library, Phoenix, and/or FC++ in the C++ world, and it seems that the most popular OO languages in the world are headed firmly toward the Object-Functional paradigm. It's about time, and perhaps then people will feel more comfortable investigating some of the more esoteric languages such as Objective Caml, Oz, and E.

Patrick Logan - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/6/2002; 10:20:48 AM (reads: 4621, responses: 0)
The Clone Wars have begun.

Isaac Gouy - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/6/2002; 11:58:32 AM (reads: 4563, responses: 0)
We are so deeply involved in the detail of programming languages that sometimes we take for granted what they have in common with other artifacts.

Understanding programming language "success" in terms of disruptive technologies seems a useful step.

A complementary step is understanding programming languages as brands.

Given the continual feature accretion in mainstream programming languages (and corresponding complexity), language choice degenerates to brand choice. I had a good experience with a previous model of language x so I feel comfortable choosing the new model language x when it's available. Maybe I justify this by saying that the new model language x has all-the-latest-features (but then so does brand y!).

That seems to explain the existence of VB.Net - VB.Net is so different from VB6 (and so like C#) that it can only be an appeal to brand loyalty.

Sam Gentile - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/6/2002; 2:27:29 PM (reads: 4500, responses: 1)
>>That seems to explain the existence of VB.Net - VB.Net is so different from VB6 (and so like C#) that it can only be an appeal to brand loyalty.

Of course it is because all languages are immaterial in .NET as one aggainst another. I wrote an essay once that virtually everyone in the .NET community applauded. I've said it a million times and I'll say it agian: Languages in .NET *only* exist to express the semantics of the CLR and BCL. It's the Runtime and the Base Class Libraries that *are* .NET. Choosing a syntax and getting 60% more verbosity in the case of VB.NET is a matter of choice and one thats largely irrelevant. So it's not that VB.nET doesn't resemble VB, it's that .NET does not resemble Win32 programming.

rev - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/6/2002; 2:46:39 PM (reads: 4505, responses: 0)
That page on the c2 wiki is pretty interesting. A lot of the suggestions would amount to making a version of Smalltalk with that nasty Algol syntax. Classes as real objects? Class-side methods? Abandoning C++-like constructors in favor of using class-side methods like Object>>#new? Not only are blocks suggested, but abandoning the extra syntax of if/for/&c for using blocks for blow control! EGADS! lawd forbid they put anything good into Java... :)

Next thing we'll see, in Java 4 is everyone asking for a revamp of the syntax- how about a space for a method call! [ :p1 :p2 | code ] for blocks!

Ehud Lamm - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/6/2002; 2:58:14 PM (reads: 4541, responses: 0)
You point is well taken, since .Net is indeed a platform. But I wouldn't go as far as saying that languages are immaterial in .Net. They are just as significant is on any other platform. No more, no less.

Isaac Gouy - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/6/2002; 3:14:38 PM (reads: 4480, responses: 0)
it's not that VB.Net doesn't resemble VB, it's that .Net does not resemble Win32 programming
Let me just agree, so I can go back to the point I was trying to make ;-)

So why is there a VB.Net? Because VB is a brand. (As is C++, as is Java, ...)

rev - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/6/2002; 3:26:24 PM (reads: 4489, responses: 0)
I concurr, Ehud. MS could've implemented VB6 on top of .NET instead of creating what is VB.NET. There's nothing about C# (assuming they implemented VB.NET in C#) that makes one create a language thusly. Sure, VB6 would've had to undergo some minor changes to use the .NET libraries, but it wouldn't have to have become what is now VB.NET. VB6.NET programmers may not have been able to utilize the features of the .NET runtime as they would've in VB.NET, but since when were VB6 coders mostly concerned with having the most language/runtime features? :)

Patrick Logan - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/6/2002; 3:33:14 PM (reads: 4475, responses: 0)
The best languages available for dotNET in fact do not solely provide a dotNET model of programming. These languages (Mercury, Haskell, Scheme, etc.) just use the dotNET model as a LCD lingua franca.

It's funny to watch the Sun/MSFT war heat up into Java/C# "future featuritis" battles, when the real benefit of these virtual machines is the libraries that people continue to extend them with.

I do most programming in JScheme now because I can easily use all the libraries for Java in a more accomodating environment like Scheme.

I doubt much software at all will be written in Java or C# (or VB.NET) in a few years. They're too complex for most tasks. More and more people are realizing the benefits of simpler languages, it is just a matter of time.

Isaac Gouy - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/6/2002; 4:09:09 PM (reads: 4463, responses: 0)
Simpler languages or code generators?

I was going to use Sun Labs Ace Project as an example of a code generator, but now they seem to be calling it a new Java-based language...

Patrick Logan - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/6/2002; 4:35:09 PM (reads: 4466, responses: 1)
ACE is a simpler language than Java. Why not try it for that reason alone?

The question I have for ACE is, what are its bounds?

Some simple languages are so because they are not as expressive, they simply cut features.

Other simple languages are so because they are just as expressive, or more, just using simpler axioms.

mattias waldau - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/7/2002; 3:04:23 AM (reads: 4421, responses: 0)
ACE might be right from the programmers point of view, but it is stupid to generate code.

One of the biggest software systems created are ERP-systems, and all of the successful ones are data-driven. That means that the meta-data and the rules/commands/... are stored as DATA.

What we need is a language that make it easy to create data-driven systems, but where we still get benefits from a compiler like type-checking

Isaac Gouy - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/7/2002; 9:38:40 AM (reads: 4304, responses: 0)
but it is stupid to generate code
Isn't that what compilers do?

data-driven systems & compiler like type-checking
Is there some technical issue preventing this?

The question I have for ACE is, what are its bounds?
The 4GL problem again?

Paul Snively - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/7/2002; 10:21:33 AM (reads: 4310, responses: 1)
What we need is a language that make it easy to create data-driven systems, but where we still get benefits from a compiler like type-checking

That would be essentially any member of the family of strongly-typed functional languages: Standard ML, Objective Caml, Haskell, Concurrent Clean, Oz, Erlang... One of the features of these languages that I think is underappreciated is their rich data structuring and DE-structuring (pattern-matching) facility. It's perhaps noteworthy that in "Essentials of Programming Languages" one of the first things the authors do is implement a nice abstract data type facility, with pattern matching, for Scheme, their chosen pedagogical vehicle. No such effort is necessary using Scheme's cousins.

Patrick Logan - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/7/2002; 2:12:20 PM (reads: 4290, responses: 0)
in "Essentials of Programming Languages" one of the first things the authors do is implement a nice abstract data type facility, with pattern matching, for Scheme, their chosen pedagogical vehicle. No such effort is necessary using Scheme's cousins.

Which is the whole point of Scheme, of course: to provide a small set of mechanisms in which to build all the rest with relatively little effort. That's why Scheme is a good language for that book as well as for SICP.

Patrick Logan - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/7/2002; 2:29:05 PM (reads: 4235, responses: 0)
<me>The question I have for ACE is, what are its bounds?</me>

The 4GL problem again?

Potentially. I don't know the range of ACE's expressiveness or how ACE supported dropping into Java.

Paul Snively - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/7/2002; 3:48:31 PM (reads: 4248, responses: 0)
Which is the whole point of Scheme, of course: to provide a small set of mechanisms in which to build all the rest with relatively little effort. That's why Scheme is a good language for that book as well as for SICP.

Patrick, hopefully you of all people know that I wasn't being critical of Scheme or the EOPL authors' choice to use it, but rather pointing out why I was recommending other functional languages to Mattias. The development of interpreters and compilers is a heavily data-driven task, which is why EOPL recommended itself as an example and why the authors chose to add the data structuring/destructuring macros that they did to Scheme. It's a testament, I think, both to the power of those constructs, and to Scheme's elegance, that that was all that they felt necessary to add to Scheme for EOPL's purposes!

Patrick Logan - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/7/2002; 7:04:48 PM (reads: 4226, responses: 0)
Paul - no, I was not interpreting your message as critical. I was trying to elaborate, but your most recent message did a better job of it, i.e.

Learn the fundamentals, don't just jump to the popular language or the one that has the one feature you desire, whether it is objects, concurrency, pattern matching, backtracking, etc.

(Neither was I trying to suggest we all program in Scheme: I'd love to see more people become even familiar with at least one language in your list. They're all worthwhile.)

I hate that we're "training" the present legion of programmers to be "object-oriented" and not much else. It's like training U.S. citizens to be "consumers" without educating them in the constitution, how we got it after 20k years of cultural development, and how we might make it last beyond the present "war on terrorism".

We are just on the early edge of losing legions of programming and engineering position in the U.S. to less expensive regions of the world. I have no problem with that, but a so-called "advanced" society has to be able to innovate to avoid stagnation.

Innovation comes from boldness and deep understanding. Whether that innovation is applied to the attaining the ideals of the "American Dream" or simply getting to the next generations of information technology.

(Apologies for the drawn-out political analogies.)

Sam Gentile - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/8/2002; 5:52:06 AM (reads: 4122, responses: 0)
Yes, Issac VB is a brand-)

Sam Gentile - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/8/2002; 6:16:27 AM (reads: 4167, responses: 0)
rev said: I concurr, Ehud. MS could've implemented VB6 on top of .NET instead of creating what is VB.NET. There's nothing about C# (assuming they implemented VB.NET in C#) that makes one create a language thusly. Sure, VB6 would've had to undergo some minor changes to use the .NET libraries, but it wouldn't have to have become what is now VB.NET.

I agree and disagree-). I agree that it is technically feasible for VB6 to sit on top of the CLR and I disagree both that it is practical or useful (and the rest of what you said)-)

Knowing the internals of VB6, I know that the internals of VB6 are completly and utterly implemented in COM. That was good when the underlying object system was COM but real bad now-) Why? Because the COM binary memory layout and the CLR's memory layout are totally different. My slides on COM Interop on my web site go into the many differences but there are big huge differneces: COM and other legacy code sits on top of unmanaged memnory heap, they use v-table binary "contracts", on and on, whereas the CLR is managed and thus the CLR chooses a layout for types and objects at runtime targeted to the specific machine. And there are dozens of other differences you can check out if you are interested.

What's the point? The point is that all COM "stuff" has to go through the COM Interop layer in .NET to transition the stack from a unmanaged stack to a managed one (they exist in totally seperate worlds - seperate processes, etc). During this transition, which is a minimum of 30-40 x86 assembly instructions, types get marshaled, identies have to be presereved, and the the processor has to go through a "transition thunk" to go from one stack to the other. Long story short: COM Interop is fraught with problems (see this for more detail. So with this mess, the VB team made the same logical choice that the VS team made: it was impossible.

Then, addressing your other points that "about C# (assuming they implemented VB.NET in C#) that makes one create a language thusly.", I totally disagree. And this "Sure, VB6 would've had to undergo some minor changes to use the .NET libraries, but it wouldn't have to have become what is now VB.NET.", even more. This doesn't reflect the understanding of the CTS and CLR that I have. Let me explain. Microsoft, in their design, took all that we expect a modern programming language to do and absracted most of those notions into the CTS (The Common Type System). The CTS defines at the metadata level what types are and logical constructs. The model is an OO one, for better or for worse. More so, the model for the BCL libraries are totally OO, that's how you use them. So, of course, it was chosen that C# should best reflect this model. C# is the CLR language, defined along with the CLR, that best expresses the CLR and CTS semantics. There were choices made also for developer productivity: that most people were far more productive with one OO programming model versus dozens of models for programming to Win32 before.

Back to VB.NET. In order to express the CLR and BCL best, VB.NET had to change radically to be an OO language that expressed the CLR and CTS semantics and allowed easy access to the BCL. It made sense and it makes sense now.

As to how that plays with the standard VB6 developer, time will tell. I agree with you and others, that this is not the programming model that many VB "seat of the pants" coders know or are currently productive in. Thats why there has only been about a 8% conversion rate. But a lot of that is when developers are faced with the learning curve of the CLR and BCL, and that the majority of examples are in the lingua franca of .NET, C#, just say forget it, I'll just use C#. The rest who don't want to learn those skill sets stay with VB6.

Sam Gentile - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/8/2002; 6:30:33 AM (reads: 4112, responses: 0)
Oh, conclusion I put on my blog: So VB is in a tough position: either adopt the same model and semantics of the other CLR languages closely (like C#) and alienate the group of productive developers who want to stay with what they know or give up and stop. To be in the .NET world, forces them to change.

Sam Gentile - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/8/2002; 6:41:32 AM (reads: 4118, responses: 0)
Correction: Where I said "I agree that it is technically feasible for VB6 to sit on top of the CLR", that should read "I agree that it is technically not impossible but..."

mattias waldau - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/8/2002; 6:46:58 AM (reads: 4180, responses: 0)
++ What we need is a language that make it easy to create data- ++ driven systems, but where we still get benefits from a compiler ++ like type-checking That would be essentially any member of the family of strongly-typed functional languages: Standard ML, Objective Caml, Haskell, Concurrent Clean, Oz, Erlang... One of the features of these

No strongly-typed languages are not the answers, unless they can compile during run-time. If you look at data-driven system, 95% of the domain-dependent stuff can be handled by data, but sometimes code is needed. So actually the problem is how can you have compilation during runtime and still type-checking (the standard answer for this is script languages, but has anyone seen big systems created using script-languages :-)

In many ways, probably COM + script languages is one of the attempts to solve this problem, however no one can build a big system that should be used for 20 years on top of something that always changes (like MS's stuff).

I think the problem is that programming languages are designed by programmers who think that the biggest problem in the world is writing a compiler or creating smart data structures. (It might be an interesting problem to solve if you required that there should be at least 100 people designing and writing the compiler :-)

Paul Snively - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/8/2002; 10:49:30 AM (reads: 4102, responses: 0)
No strongly-typed languages are not the answers, unless they can compile during run-time.

Functional programming languages have a long and time-honored history of blurring the distinction between compile-time and runtime. Indeed, to this day, Lisp is often still described as an "interpreted language" because it is interactive, in spite of the number of implementations that don't even bother to include an interpreter. Some languages, e.g. Oz, explicitly include a compilation API.

If you look at data-driven system, 95% of the domain-dependent stuff can be handled by data, but sometimes code is needed.

Sure, but this leaves open the question as to whether this code needs to be generated at runtime or not.

So actually the problem is how can you have compilation during runtime and still type-checking (the standard answer for this is script languages, but has anyone seen big systems created using script-languages :-)

Well, if you have a strongly-typed language with a compiler available at runtime, then you obviously have type-checking, so perhaps I'm still missing something. Regardless, there's more than one way to skin this cat: you could use the language to implement a rule system as an interpreter, then write a compiler from the rules to bytecodes and interpret the bytecodes. Or you could write a self-applicative partial evaluator for your target language, and then apply the partial evaluator to your rule interpreter, thereby deriving a rule compiler. Etc. etc. etc.

mattias waldau - Re: New features proposed for Java 1.5 by Sun  blueArrow
12/11/2002; 12:09:22 AM (reads: 3561, responses: 0)
Of course you can build something on top, and that is the way people are doing it now. It would be nice if there was a simpler way.

Maybe model-based computing is the answer:

http://www2.parc.com/spl/projects/mbc/