It's possible to implement synchronous closures without instances, and to make non-local returns in closures not subject to unchecked exceptions. This article explains why. I like using Google Docs as a word processor, but the last time I published to blogger automatically from it, I lost some formatting, and even a random backslash, so this time I'm not going to bother. The actual article is here. Comment on this blog.
General musings on programming languages, and Java.
Friday, January 12, 2007
Subscribe to:
Post Comments (Atom)
Blog Archive
- May (1)
- April (1)
- January (1)
- December (1)
- November (1)
- October (1)
- September (3)
- January (2)
- December (1)
- November (1)
- September (3)
- July (2)
- June (2)
- April (1)
- March (1)
- February (1)
- January (2)
- December (2)
- November (1)
- October (5)
- September (1)
- August (2)
- July (1)
- June (5)
- May (4)
- April (2)
- March (4)
- February (3)
- January (1)
- December (3)
- October (2)
- September (1)
- July (1)
- July (1)
- April (2)
- October (1)
About Me
- Ricky Clarkson
- A salsa dancing, DJing programmer from Manchester, England.
My Blog List
-
-
Error'd: Colophony3 days ago
-
Interoperability3 days ago
-
-
There’s no single error rate5 years ago
-
-
Thanks to the Clojure Community!10 years ago
-
-
Debug Mode is the Only Mode12 years ago
-
The Emperor's Garden13 years ago
-
HackWeek V15 years ago
-
-
-
3 comments:
The checked exception is quite clever, it just doesn't feel quite right. Surely it would essentially mean that no-one uses that construct?
Closures without instances is where I started on this many moons ago. When I spoke to the guys at Javapolis, they preferred to use hotspot to deal with this.
Stephen (Colebourne?),
You're right, because of Java's exception syntax, it would end up that way, but that's a good thing. Non-local transfers in closures that are not guaranteed (restricted) to run synchronously are predictable failures.
I outlined a way of handling it centrally anyway, allowUnsafeReturns.
I know where Neal is coming from about Hotspot, short-lived instances are extremely cheap, including short-lived exceptions.
But then, his solution doesn't actually allow javac to make the optimisation of removing the instance.
Post a Comment