InfoQ

News

Mark Mahieu Creates CICE Closure Prototype

Posted by Charles Humble on Jan 22, 2008 09:19 AM

Community
Java
Topics
Code Analysis,
Language
Tags
Java SE
One of the hottest topics in Java in recent years has been around adding full closure support to the Java language. Given the complexity that closures could introduce however, it is difficult to judge their full impact without being able to experiment with prototypes for the various proposals.

Now, joining Neal Gafter's BGGA proposal prototype, Mark Mahieu has begun putting together a prototype implementation of the CICE/ARM proposal written by Bob Lee, Doug Lea, and Josh Bloch. Concise Instance Creation Expressions (CICE) simply provide a more compact syntax for instantiating instances of an inner class with a single abstract method such as Runnable, Callable, or Comparator. Automatic Resource Management (ARM) blocks support one of the main use cases for closures; the scoping of resource use within a block such that when you exit the lexical scope of the block you automatically call the close method on the resource.

Mahieu's initial implementations are limited in scope. For CICE, just expressions, public local variables and implicitly final local variables are implemented; public locals and type inference are not. The ARM block implementation supports only the do() { } form of ARM block and relies on java.io.Closeable as a starting point. As noted by Mahieu and in the ARM specification itself, using Closeable is problematic since many existing types - java.sql.Connection, Statement, ResultSet and so on - could not be made to implement it in view of the fact that they throw other unchecked exceptions.

The prototype is already helping to drive out some details in the proposals with a newer build of the ARM implementation changing the default semantics of the do() { } form for checked exceptions.

With Stephen Colebourne working on a prototype for FCM we should be able to start getting much more of a feel for which aspects of the proposals work or don't over the next year.

No comments

Reply

Exclusive Content

Agile in Practice: What Is Actually Going On Out There?

Scott Ambler talks about actual data resulting from surveys made during 2006-2008, showing how Agile is perceived and implemented within organizations.

Building Smart Windows Applications

From QCon 2008, Daniel Moth presents on using Visual Studio 2008 and .NET 3.5 to create compelling rich Windows applications.

Joshua Kerievsky about Industrial XP

Joshua Kerievsky, founder of Industrial Logic, talks about Industrial Extreme Programming which extends XP by including practices dealing with management, customers and developers.

Jeff Barr Discusses Amazon Web Services

Amazon Web Services (AWS) Evangelist Jeff Barr discusses SimpleDB, S3, EC2, SQS, cloud computing, how different Amazon services interact, origins of AWS, AWS globalization and the March AWS outage.

More Than Just Spin (Up) : Virtualization for the Enterprise and SaaS

Cloud services have helped bring virtualization to the forefront. Its full power however, also includes other benefits such as high availability, disaster recovery, and rapid provisioning.

Ruby Beyond Rails

John Lam talks about his path to dynamic languages, some of the problems of making IronRuby run fast, and how the DLR helps with implementing languages.

VMware Infrastructure 3 Book Excerpt and Author Interview

VMware Infrastructure 3: Advanced Technical Design Guide and Advanced Operations Guide provides a wealth of practical insights into setting up virtualization in todays corporate environments.

Architectures of extraordinarily large, self-sustaining systems

Can a system that is so large it cannot be comprehended be "designed" in a conventional sense? The foundations of computing are about to change. In this talk, Richard P. Gabriel explores why and how.