Monday, January 14, 2008

CICE/ARM prototype

As I mentioned a few days ago, I've been hacking around in javac recently in an attempt to get it to implement some of the ideas in the CICE and ARM proposals. The idea being that having a prototype available may help to highlight which aspects of the proposals really work in practice, and which do not.

I've put an initial cut here, which is based on the JRL licensed JDK codebase from 04-Dec-2007 (JDK 7 build 24). It hasn't had a great deal of testing, so don't expect it to be wonderfully stable at this stage. I'll attempt to fix any bugs that crop up however.

It's important to note that this initial prototype has been put together without consulting the authors of the two proposals, so I may well have misunderstood some of the ideas - apologies if so. I've also had to make a call on which aspects of the proposals to include, and which to exclude for now. I've opted for a pretty minimalist implementation to start with, and that pans out as follows:

CICE

CICE expressions, public local variables and implicitly final local variables should all be working. I've left out transient public locals and type inference.

At this stage, I also haven't provided any of the library additions or changes mentioned in section IV of the proposal.

Basically all of the examples in the CICE document should work (apart from those involving AbstractThreadLocal).

ARM blocks

ARM blocks can take one of two forms, both based on the do keyword only for now. The first allows you to declare the resources' variables as part of the ARM block itself:

do (InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dest)) {
// ...
}

The second form is where the resources are provided as a list of expressions:

InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dest);

do (in, out) {
// ...
}

Currently, all resources must implement java.io.Closeable. As the ARM proposal points out, Closeable is probably not a good choice in the long run, but it's a starting point.

An ARM block will attempt to call close() on all the resources, in the reverse order that they were listed. In the first form of the block the variables are not final so it is possible to reassign in and out to some other Input/OutputStream within the ARM block - the block will attempt to close whatever Closeables the variables refer to at the time the block ends. In the second form of the block, reassigning in and out has no effect.

In the first example, if in or out are set to null this effectively cancels the automatic closing of the variable in question, and does not cause a NullPointerException or any other runtime error. I don't know whether this is useful or not, as yet.

In the first form, it's possible to mark the variables as final. It's also possible to mark them as public, which is only really useful if reassignment should be allowed.

If exceptions are raised, whether by evaluating the variable initializers (in the first form), by executing the body of the block, or by the calls to close() at the end of the block, it should only ever be the first such exception which is ultimately thrown by the block, after it has attempted to close all the resources.

The proposal doesn't mention whether it should be possible to use 'break' statements within an ARM block so I haven't implemented that. I think it may be useful though - thoughts welcome.

Bug reports and the like can be sent to me directly at markmahieu at gmail dot com.

33 comments:

JodaStephen said...

I've been trying to code up a prototype of FCM at Kijaro - http://kijaro.dev.java.net.

I'd love to see your CICE/ARM prototypes hosted at Kijaro as well, but there may be a license problem. Kijaro uses the GPL JDK build, whereas you seem to have chosen JRL. Having the proposals in the same place would be a big win IMO. Would you consider a change of license?

Stephen Colebourne

PS. If you want to help finish me code up FCM closures that would be great too ;-)

Mark Mahieu said...

Hi Stephen,

I have no problem moving the code to Kijaro - it's only JRL at the moment because those were the sources I had to hand at the time. I'll look into what's involved when I get a chance.

Regarding FCM (and JCA), I'm conscious of the fact that I still need to read through the proposal in detail, which I'll try to do over the next couple of days. It does look like there are bits of the CICE prototype which may be reusable for FCM (more from Neal's prototype, mind), although you may have already implemented those areas... time for me to check out Kijaro (again) !

vfdvgf said...

We always Wow Power Leveling and world of warcraft gold

123 123 said...

Nice blog you got here. I'd like to read something more about this matter.
By the way check the design I've made myself Young escorts

Anonymous said...

Erectile Dysfunction Related Links :


Buy Cialis


Harvard

venn99 said...

make money online
internet tips
work from home
Video Tips
Shopping Tips
Car Tips
Computer Tips
Travel Tips
Finance Tips

anxin said...

Your blog is wonderful, I like it very much, thank you!
By the way, do you like polo shirts, which are very chic, especially the polo t shirts, I love them very much. I also like playing tennis rackets, it can keep healthy, what do you like to do?
polo t shirts women
polo t shirts on sale
polo t shirts for women
polo shirts on sale
polo shirts men
men's polo shirt
men polo shirt
mens polo shirts
mens polo shirt
cheap polo shirts
discount polo shirts
men's polo shirts
women's polo shirts
cheap tennis racket
discount tennis racket
prince tennis racquet
head tennis rackets
wilson tennis racket
babolat tennis racquet

kiara said...

Costa Rica Manuel Antonio Tours
Costa Rica Carara Biological
Arenal Volcano Costa Rica
Costa Rica Crocodile Aventure
Costa Rica Poas Volcano
Costa Rica Monteverde Tours
Costa Rica Sea Kayaking
Costa Rica Rafting
Costa Rica Atv Adventure
Costa Rica Tours Canopy
Costa Rica Rainforest Tour
Costa Rica Vacation Rentals
Costa Rica Groups Travel
Los Suenos Costa Rica Tours
Costa Rica Zip Line
Costa Rica Vacation Rentals
Costa Rica los Suenos Vacation Rentals
Costa Rica Wedding
Costa Rica los Suenos Fishing
Costa Rica los Suenos Condos
Costa Rica los Suenos Sportfishing
Los Suenos Resort
Costa Rica Whale Watching Tours
Costa Rica Dolphin Watching Tours
Costa Rica Dominical
Costa Rica Dominical Tours
Dominical Tours
Dominical Costa Rica Tours
Costa Rica DMC Incentive Travel
Costa Rica Honeymoon
Costa Rica Manuel Antonio Wedding
Costa Rica Manuel Antonio National Park

cara said...

Asics onitsuka tiger|onitsuka tiger by asics|onitsuka tiger mexico 66|onitsuka tiger australia|onitsuak tiger shoes|onitsuka tiger buy online

Green Parks said...

Hello.. Firstly I would like to send greetings to all readers. After this, I recognize the content so interesting about this article. For me personally I liked all the information. I would like to know of cases like this more often. In my personal experience I might mention a book called Green Parks Costa Rica in this book that I mentioned have very interesting topics, and also you have much to do with the main theme of this article.

andre12323 said...

dsquareddsquared
dsquared shoesdsquared shoes
dsquared shoes 2011dsquared shoes 2011
dsquared jeans womendsquared jeans women
dsquared t shirtsdsquared t shirts
dsquared jeans mendsquared jeans men
dsquared hoodiesdsquared hoodies
dsquared beltsdsquared belts
asics shoes saleasics shoes sale
asics shoesasics shoes
asics running shoesasics running shoes
asics mexico 66asics mexico 66
onitsuka kanuchionitsuka kanuchi
timberland bootstimberland boots
christian louboutin shoeschristian louboutin shoes
karen millen dresseskaren millen dresses
nike air max plusnike air max plus
maillot de football 2011maillot de football 2011

abercrombiefitch said...

the iconic sneaker was originally introduced on now.
Nike Air Max 2011
Nike Air Max Shoes
Nike Air Max
Nike Air Max Wildwood Supreme
Nike Air Max Turbulence
Nike Air Max Skyline
Nike Air Max Goadome
Nike Air Max Fitsole
Nike Air Max Zenyth
Nike Air Max Boots
Nike Air Max Zoom Kobe
Nike Air Max Tn
Nike Air Max LTD
Nike Air Max Presto
Nike Air Max BW
Nike Air Max 24 7
Nike Air Max 2010
Nike Air Max 2011
Nike Air Max 2009
Nike Air Max 95
Nike Air Max 91
Nike Air Max 87
Nike Air Max 180
Nike Air Max Griffey Max 1
Nike Air Max 90
Nike Air Max 1
Abercrombie and Fitch London
Abercrombie & Fitch Clothes
Vibram Shoes
Cheap Air Max
Nike Air Max Shoes
is available in a vivid array of colors, including, Jiffy Black, Pigeon Grey, Shell White, Dodger Blue, and Beaver Brown.

vibrams said...

The louboutin heels is designed for the ladies. Since the pumps was born, the ladies life become colorful. The christian louboutin thong sandals are the god's masterwork. Who invited thechristian louboutin pumps? Seldom people knew, but I think every lady would be grateful for him. Among the countless pumps, the christian louboutin platforms is the most outstanding ones. The elegant pattern, the delicate style all mold the ladies perfect leg profile. Flowers in the spring of 2011 creeping, up from hair to clothes continue to footwear, have had a brilliant up. In such a glamor, spring and summer flowers now here. Romance is a woman's mood, exquisite flowers just right of expression in our gestures, the woman, how can we not love the romantic temperament so that they distributed the flowers do? 2011 flowers bloom will enjoy different poses!The christian louboutin wedges also can adds the hright of the ladies, it bring surprise to the short lady. Especially the red sole of the louboutin heels, magic and sexy, many ladies are crazy. The red sole, the first feature of the Christian Louboutin stroe.

xiaofen said...

The Louboutin Shoes Sale is planned using the ladies. offered the fact that pumps was born, the ladies lifestyle turn into colorful. The christian Louboutin 2011 Pumps
will be the god's masterwork. Who invited the Christian Louboutin Wedges ? Seldom people knew, but I think each and every and every lady will be grateful for him. between the countless pumps,the Christian Louboutin Shoes
could be probably the most exceptional ones. The stylish pattern, the delicate design all mold the ladies perfect leg profile. Flowers inside the spring of 2011 creeping, up from frizzy hair to outfits hold on to footwear, have experienced a brilliant up. on this type of the glamor, spring and summer time flowers now here. Romance is really a woman's mood, exquisite flowers just appropriate of expression within our gestures, the woman, how can we not adore the romantic temperament to make certain which they distributed the flowers do? 2011 flowers bloom will get satisfaction from numerous poses! The Christian Louboutin New Sandalsalso can adds the hright in the ladies, it hold shock toward short lady. especially the red-colored lone in the louboutin heels, beauty and sexy, different ladies are crazy. The red-colored sole, andChristian Louboutin Mensis a very distinctive design, its design reflects its style. You put on it, that means you have its style.the earliest attribute in the Sale Louboutin stroe.

jelish said...

The Louboutin 2011 is planned using the ladies. offered the fact that pumps was born, the ladies lifestyle turn into colorful. The christian Louboutin 2011 Pumps
will be the god's masterwork. Who invited the Christian Louboutin Wedges ? Seldom people knew, but I think each and every and every lady will be grateful for him. between the countless pumps,the Christian Louboutin Shoes
could be probably the most exceptional ones. The stylish pattern, the delicate design all mold the ladies perfect leg profile. Flowers inside the spring of 2011 creeping, up from frizzy hair to outfits hold on to footwear, have experienced a brilliant up. on this type of the glamor, spring and summer time flowers now here. Romance is really a woman's mood, exquisite flowers just appropriate of expression within our gestures, the woman, how can we not adore the romantic temperament to make certain which they distributed the flowers do? 2011 flowers bloom will get satisfaction from numerous poses! The Christian Louboutin New Sandalsalso can adds the hright in the ladies, it hold shock toward short lady. especially the red-colored lone in the louboutin heels, beauty and sexy, different ladies are crazy. The red-colored sole, andChristian Louboutin Mensis a very distinctive design, its design reflects its style. You put on it, that means you have its style.the earliest attribute in the Louboutin 2011 stroe.http://www.sale-louboutin-shoes.us

xiaofen said...

Christian Louboutin Outlet Online shoe store is up for many years.A man who wants to play its expertise, it must fit the social environment needs. If you need from the social environment, their expertise will lose value. Therefore, we have according to community needs, determine their own actions, better to show themselves. Christian Louboutin Outlet Online shoes wear can make you look more beautiful, more attractive feet.

Comprare Cialis Generico said...

Nice post! Thanks for sharing!

Frank said...

Hey,
Loving your blog, awesome tips on blog you have here. I
would just like to ask you some questions privately, mind real player 11,IDM Free Download,function venues geelong,la Fitness,Nokia Mobile Prices in Pakistan

Nike Football Cleats said...

Ah good exciting content! Will always come to our attention. To bring you good news-works perfect! Nike Football Cleats best shoes 2011!! And Nike Mercurial Vapor Superfly.Nike soccer cleats with New nike soccer shoes or Nike mercurial soccer cleats .

latest sms said...

hello,
your articles are always informative and cool for learning, they always increase my knowledge just wanted to appreciate you and say thanks for sharing them with us chicken biryani recipe sms hindi friendship sms sms jokes

Mohtasham said...

its a pleasure reading all these informative things. I really appreciate your mindset man, please tell me how can i contact you, because your articles are always informative and cool for learning, they always increase my knowledge chicken biryani recipe sms hindi friendship sms sms jokes latest sms winrar free download

Mohtasham said...

Man I must say your mind works regarding all the this. I learned alot from your article keep teaching us more. I really appreciate you and want to talk you please tell me how can contact you? how to cook biryani l latest sms l la fitness

sport said...

http://markmahieu.blogspot.com/2008/01/cicearm-prototype.html
http://bernardavishai.blogspot.com/2009/05/pope-and-rubys-tuesday.html
http://jlmcharlottesville.blogspot.com/2008/12/upcoming-dem-events.html
http://joannagoddard.blogspot.com/2009/04/have-great-weekend.html
http://versusclucluland.blogspot.com/2008/12/year-of-being-there.html
http://googlenotebookblog.blogspot.com/2008/06/size-does-matter.html
http://ppelectro.blogspot.com/2009/11/pelskis-playlist-pt-ix.html
http://laurenmontgomery.blogspot.com/2008/07/wonder-woman-artwork.html
http://jianwang.blogspot.com/2008/05/mysterious-crm-lookup-i.html
http://octobersveryown.blogspot.com/2010/02/almost-time-again.html
http://gearbrain.blogspot.com/2006/11/redrock-m2-vs-cinevate-brevis.html
http://thehasbarabuster.blogspot.com/2009/12/gaza-greenhouse-effect.html
http://davidbrin.blogspot.com/2005/01/radical-notion-of-modernism.html
http://kevinrandle.blogspot.com/2009/12/betty-hills-star-map.html
http://laurenmontgomery.blogspot.com/2010/03/batgirl-year-one.html
http://pickwaynesbrain.blogspot.com/2007/10/how-much-is-trillion.html
http://bryanche.blogspot.com/2008/10/welcome-to-amqp-microsoft.html
http://michaelbane.blogspot.com/2008/03/tsa-stupidity-puts-pilots-at-risk.html
http://decision08.blogspot.com/2005/07/do-markets-know-something-we-dont.html
http://davidbrin.blogspot.com/2006/01/supporters-of-science-must-adapt_22.html
http://robertmaldon.blogspot.com/2006/07/recovering-passwords-from-websphere.html
http://thedailygrowl.blogspot.com/2007/02/dan-le-sac-vs-scroobius-pip-on-xfm.html
http://breakallchains.blogspot.com/2007/01/tony-serras-letter-from-prison.html
http://davidbrin.blogspot.com/2009/10/cool-science-reminders-were-living-in.html
http://evoandproud.blogspot.com/2009/11/was-roman-britain-multiracial.html
http://square-dancing.blogspot.com/2007/04/vexd-distance-metalstep-mix.html

Poker said...

Well written
"CICE/ARM prototype" blog article, well researched and useful for me in the future. I am so happy you took the time to make incredible Mark Mahieu's blog here. See you around
--------------------------
My site: Poker Money No Deposit Bonuses.

Poker said...

I really enjoy reading this one. Your have great insight about
"CICE/ARM prototype" of your post. Your online Mark Mahieu's blog is really excellent.
--------------------------
Free Sign up Bonus and Shark Poker and Latest poker bonuses.

Poker said...

I wonder how you got so nice content. This is really a fascinating blog and all your posts are awesome, lots of stuff that I can get into. One thing I just want to say is that your Blog is so perfect to me.
--------------------------
Our www: Holdem Poker for Free & Free Poker Bonuses & Poker Bankroll for Free

Poker said...

I just leave a comment here coz I have read a lots of goodies that makes me feel interesting when the time comes I visit here great
"CICE/ARM prototype" post guys.
--------------------------
Visit me: Bonus sans depot & Poker sans depot 50

London Crumpet said...

London escorts directory London Crumpet is created to expose Independent escorts and escort agencies in London. Everybody can post their advert on this directory for FREE.

London Oriental Escorts said...

London Asian Escorts is an Asian and Oriental escort agency operating in Central London. The agency provides escort service for a true gentlemen. Our escort models are carefully selected and are genuine.

One piece forums said...

Really impressed! Everything is very open and very clear explanation of issues. Your website is very useful. Thanks for sharing. Looking forward to more!
Anime forums
Naruto forums
Manga forums
Naruto Shippuden

Cheap Web Design Company India
Web hosting reviews
Web hosting Tips
Advertising network reviews

love supra said...

They are all beautiful and fashionable i have to say, and my friends told me they are of good quality as well. I have not see post good enough like yours here.
More tags:
wow gold | cheap wow gold | buy cheap wow gold | buy wow gold

china tours said...

Wow, wondeгful blog layout! It's really a nice and useful piece of info.You can learn more: China tour packages | China travel packages | China Travel Agency

Learn Chinese said...

AllMandarin is the only company that can give you an excellent alternative to learn Mandarin Chinese that is not only better, but also more efficient in terms of cost, flexibility and learning methods.I am a Chinese teacher,you can learn more about Free Chinese language info: Learn mandarin online | Learn mandarin Chinese | Mandarin Teacher