BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

Interview: Neal Gafter Discusses Closures, Language Features and Optional Typing

by Ryan Slobojan on Aug 13, 2008 | NOTICE: The next QCon is in San Francisco Nov 3-7, Join us!

In this interview from QCon London 2008, Neal Gafter discusses upcoming language features in Java 7, superpackages, what closures are, the differences between the three major closures proposals (CICE, FCM and BGGA), optional typing systems for dynamic languages, and the next major language.

Watch Neal Gafter Discusses Closures, Language Features and Optional Typing (26 minutes).

From the interview, Gafter gives a brief overview of what closures are:

Closures are sort of an umbrella word to talk about a group of related features in the same way that generics is not a thing, but it describes a group of related features. The most important is anonymous functions; it's an expression that's an anonymous function. Computer science theory folks would call it a lambda expression and it is actually not a new idea at all, it dates back to the theoretical work from the 1930s and the lambda calculus and the most important early implementations were in the Scheme programming language and in Smalltalk.

And we have closures or lambda expressions or anonymous functions in many many programming languages today, almost all of the dynamic languages, all of the functional programming languages, pretty much almost every language that has been introduced in the past ten years, for example, has something like closures. So the idea is, it is a function, it is an expression that designates a function, it identifies the parameters, and you say here is the code of the function, it could be statements or it could be just a result expression.

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

JDK8 by Michael Neale

Oh I will be an old man by then... come on - surely closures are more important then that?

Uhmm, that's called... by Thom Nichols

Scala. As much as I'm not used to Scala's syntax, they already do the optional typing, closures, and gobs of other things now. I admit the learning curve is very steep (I much prefer Groovy for its simplicity and near-zero learning curve if you're coming from Java.)


But it sounds like Java (10-ish years from now :) ) is just going to turn into Scala. What's the point in that? You can write Scala now, and easily integrate it into your existing Java codebase since it all compiles down to the same bytecode.

Re: Uhmm, that's called... by Jesse Kuhnert

Did you watch the video? I think scala was addressed already.

Whether or not you use or like scala though, both it and the java runtime would benefit from the vm enhancements required to fully implement the proposal.

One of the comments was that a language can be successful so long as it res by Sara Jay

"One of the comments was that a language can be successful so long as it resists the temptation to innovate" - That statement was made by Josh Bloch in the future of java development discussion forum. Not Erik Meijers.

closures by serge ----

I personally like BGGA but would be open to other proposals. I don't particularly like CICE because I just don't think it's enough to warrant a language change.

Re: One of the comments was that a language can be successful so long as it by Ryan Slobojan

"One of the comments was that a language can be successful so long as it resists the temptation to innovate" - That statement was made by Josh Bloch in the future of java development discussion forum. Not Erik Meijers.


Whoops, my mistake - thanks for catching that!



Ryan Slobojan

Fork Join framework? by Sara Jay

Neil, could you explain a little more about the fork join framework which was done by Doug Lea that is expected in Java 7? I think that was not discussed about in this interview.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

7 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT