Messages per Month
|Neal Gafter||Feb 7, 2010 9:10 am|
|John Nilsson||Feb 7, 2010 2:50 pm|
|Neal Gafter||Feb 7, 2010 3:36 pm|
|John Nilsson||Feb 8, 2010 9:20 am|
|Neal Gafter||Feb 8, 2010 11:03 am|
|John Nilsson||Feb 8, 2010 2:44 pm|
|Neal Gafter||Feb 8, 2010 3:34 pm|
|John Rose||Feb 9, 2010 11:21 am|
|John Nilsson||Feb 9, 2010 12:21 pm|
|John Nilsson||Feb 9, 2010 12:50 pm|
|Neal Gafter||Feb 9, 2010 1:05 pm|
|John Nilsson||Feb 9, 2010 1:51 pm|
|Neal Gafter||Feb 9, 2010 1:54 pm|
|Subject:||Re: related link|
|From:||Neal Gafter (ne...@gafter.com)|
|Date:||Feb 8, 2010 11:03:19 am|
On Mon, Feb 8, 2010 at 9:21 AM, John Nilsson <jo...@milsson.nu> wrote:
In my, admittedly rather naïve, mind such a static construct could be modelled as transparent closures with the added restriction that it is to in-lined at compile time, and as such would disallow any treatment of them as run-time constructs. F.ex. moving references around would be a static error. The rather narrow goal in my mind being to allow "non-local returns" without the scary stuff ;) When you said "has been shown" did you have any particular paper in mind? (I'm rather curious about PL-research) BR, John
If you want to continue this discussion, please join the closures-dev mailing list.
Inlining at compile-time only works for very restricted kinds of APIs, and excludes many interesting and useful APIs that could be written using transparent lambdas. See, for example, my blog post on concurrent loops <http://gafter.blogspot.com/2006/10/concurrent-loops-using-java-closures.html>, which has been implemented by Mark Mahieu <http://markmahieu.blogspot.com/2008/08/for-eachconcurrently.html>. That is just not possible with the approach you suggest. Inlining also undermines binary compatibility, which is one of Java's strengths.
FYI, experience with languages that support "non-local return" (Scala, Ruby, etc) has resulted in a remarkable absence of scary things happening. They're really quite boring and ordinary once you try them.
For writings about the expressive power of transparent lambdas, one place to start would be Steele and Sussman's 1970's "Lambda the Ultimate..." papers <http://en.wikipedia.org/wiki/History_of_the_Scheme_programming_language#The_Lambda_Papers>.