CICE and ARM --> Closure, how?

Discussion in 'Java' started by Jan Burse, Oct 7, 2011.

  1. Jan Burse

    Jan Burse Guest

    Dear All,

    I am just reading on the Wiki page of Josh Bloch:

    Bloch has proposed the extension of the Java
    programming language with two features: Concise
    Instance Creation Expressions (CICE) (coproposed
    with Bob Lee and Doug Lea) and Automatic
    Resource Management (ARM) blocks. The combination
    of CICE and ARM formed one of the three early
    proposals for adding support for closures to Java.

    By ARM I understand the try-with-resource. Can somebody
    explain me how this together with CICE is related to
    closure? In a few sentences without looking much at
    other proposals. I don't have any clue from the hip.

    Bye
    Jan Burse, Oct 7, 2011
    #1
    1. Advertising

  2. On 10/7/2011 4:04 PM, Jan Burse wrote:
    > Dear All,
    >
    > I am just reading on the Wiki page of Josh Bloch:
    >
    > Bloch has proposed the extension of the Java
    > programming language with two features: Concise
    > Instance Creation Expressions (CICE) (coproposed
    > with Bob Lee and Doug Lea) and Automatic
    > Resource Management (ARM) blocks. The combination
    > of CICE and ARM formed one of the three early
    > proposals for adding support for closures to Java.
    >
    > By ARM I understand the try-with-resource. Can somebody
    > explain me how this together with CICE is related to
    > closure? In a few sentences without looking much at
    > other proposals. I don't have any clue from the hip.


    CICE+ARM was Bloch (and other)'s counterproposal to the other two main
    closure proposals, BGGA (the acronym comes from the authors' names), and
    FCM (First-Class Methods) (I think--I know a lot less about this than
    the other two).

    To call it a closures proposal is a slight misnomer, since it's more
    like a "we don't want closures, but we can lighten up on necessary
    syntax today." The ARM part is a response to BGGA's trumpeting of the
    ability to do `withLock(lock) { }' via closures, by solving the
    most-requested (and pretty much only requested) new control flow idiom,
    which is the largest source of BGGA's complexity.

    CICE, on the other hand, points out that Java already has limited closures:

    new Thread(new Runnable() {
    public void run() {
    System.out.println("Look at me!");
    }});

    It proposed to "satisfy" demands for closures by reducing the syntax of
    that expression to just:
    new Thread(new Runnable() { System.out.println("Look at me!"); });

    In other words, CICE+ARM boils down to the following things:
    1. Reduce verbosity of anonymous inner classes (which are already a
    light form of closures)
    2. Add the automatic resource management idiom to reduce the desire for
    creating custom control-flow graphs.

    It really isn't adding anything new in the realm of closures, it is
    merely about syntactic sugar to satisfy most common use cases.

    --
    Beware of bugs in the above code; I have only proved it correct, not
    tried it. -- Donald E. Knuth
    Joshua Cranmer, Oct 7, 2011
    #2
    1. Advertising

  3. Jan Burse

    Jan Burse Guest

    Thanks for the explanation.

    Joshua Cranmer schrieb:
    > On 10/7/2011 4:04 PM, Jan Burse wrote:
    >> Dear All,
    >>
    >> I am just reading on the Wiki page of Josh Bloch:
    >>
    >> Bloch has proposed the extension of the Java
    >> programming language with two features: Concise
    >> Instance Creation Expressions (CICE) (coproposed
    >> with Bob Lee and Doug Lea) and Automatic
    >> Resource Management (ARM) blocks. The combination
    >> of CICE and ARM formed one of the three early
    >> proposals for adding support for closures to Java.
    >>
    >> By ARM I understand the try-with-resource. Can somebody
    >> explain me how this together with CICE is related to
    >> closure? In a few sentences without looking much at
    >> other proposals. I don't have any clue from the hip.

    >
    > CICE+ARM was Bloch (and other)'s counterproposal to the other two main
    > closure proposals, BGGA (the acronym comes from the authors' names), and
    > FCM (First-Class Methods) (I think--I know a lot less about this than
    > the other two).
    >
    > To call it a closures proposal is a slight misnomer, since it's more
    > like a "we don't want closures, but we can lighten up on necessary
    > syntax today." The ARM part is a response to BGGA's trumpeting of the
    > ability to do `withLock(lock) { }' via closures, by solving the
    > most-requested (and pretty much only requested) new control flow idiom,
    > which is the largest source of BGGA's complexity.
    >
    > CICE, on the other hand, points out that Java already has limited closures:
    >
    > new Thread(new Runnable() {
    > public void run() {
    > System.out.println("Look at me!");
    > }});
    >
    > It proposed to "satisfy" demands for closures by reducing the syntax of
    > that expression to just:
    > new Thread(new Runnable() { System.out.println("Look at me!"); });
    >
    > In other words, CICE+ARM boils down to the following things:
    > 1. Reduce verbosity of anonymous inner classes (which are already a
    > light form of closures)
    > 2. Add the automatic resource management idiom to reduce the desire for
    > creating custom control-flow graphs.
    >
    > It really isn't adding anything new in the realm of closures, it is
    > merely about syntactic sugar to satisfy most common use cases.
    >
    Jan Burse, Oct 8, 2011
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Konrad Eisele

    Arm clone version 0_8

    Konrad Eisele, Apr 7, 2004, in forum: VHDL
    Replies:
    0
    Views:
    660
    Konrad Eisele
    Apr 7, 2004
  2. Konrad Eisele
    Replies:
    0
    Views:
    2,502
    Konrad Eisele
    Apr 10, 2004
  3. msn
    Replies:
    9
    Views:
    328
  4. Steve Jasper
    Replies:
    0
    Views:
    2,989
    Steve Jasper
    Nov 20, 2003
  5. Julian Mehnle
    Replies:
    0
    Views:
    227
    Julian Mehnle
    Jul 17, 2003
Loading...

Share This Page