New-age Transactional Systems - Not Your Grandpa's OLTP
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
The content has been bookmarked!
There was an error bookmarking this content! Please retry.
Posted by Floyd Marinescu on Aug 21, 2006
For programming in the small, closures allow one to abstract an algorithm over a piece of code; that is, they allow one to more easily extract the common parts of two almost-identical pieces of code. For programming in the large, closures support APIs that express an algorithm abstracted over some computational aspect of the algorithm. We propose to add function types and closures to Java. We anticipate that the additional expressiveness of the language will simplify the use of existing APIs and enable new kinds of APIs that are currently too awkward to express using the best current idiom: interfaces and anonymous classes.Peter commented further on how anonymous classes aren't good enough to simulate closures. Gilad Bracha blogged a bit about why the proposal is coming now, saying that "the widespread adoption of scripting languages has exposed a lot of people to the idea of first class functions. It has also shown that another argument used against closures - that they are too abstract for ordinary programmers - is just as imbecilic as the one about customer demand."
Javalobby posted a link to the proposal on Friday which drew a large discussion of developers mostly supportive of the idea. Neal Gafter on saturday wrote a detailed justification of the benefit of closures, showing a set of code samples and how closures simplified them significantly. Neal's conclusion: closures "allow you to easily abstract away aspects of code that would otherwise require complex contortions.void(int) totalizer = (int i) : total = total + i;int total=0;
totalizer(1);
totalizer(2);
System.out.println(total); // Prints 3
But what you really want is to be able to do things like this:
int[] numbers = new int[] { 100, 200 };
numbers.each(totalizer);
System.out.println(total); // Now prints 303;
Improve Java Garbage Collection, Runtime Execution, and JVM visibility with Zing
Using Drools? See what you're missing! Get the Power of Drools with the Assurance of Red Hat
Monitor your Production Java App - includes JMX! Low Overhead - Free download
18 agile and lean practices for effective software development governance
Yeah, I think Sun should adopt the old Windows version convention of using years, so that nobody is confused about when they'll actually be able to use this.
If Sun wants to have ANY hope of keeping Java moving as fast as it needs to, here's what they need to do one thing:
Separate the release cycles of javac, java and rt.jar. In other words, let the Java language, the Java VM and the core class library evolve at different speeds. Obviously there will be dependencies, but with these three things, it's pretty easy to figure out:
JVM <- Java <- Core Classes
The nice thing is that most of the features I want in Java won't require a change to the JVM. Furthermore, the JVM changes the least often, then Java and the core class library changes the most -- usually with additions rather than changes.
I think this would dramatically increase the speed at which some of these features can be realized.
Closures will not require a change to the VM...so why do we need to wait 6 years before we see it?
Clinton
Clinton, that sounds like a fine idea. I suppose there could be questions about compatibility (would you have to version the JVM separately from the language and core classes?), but it could work.
Java has claimed to be best of breed of general purpose for a long time. Rather than me too, is there anything better about Java closures or is this just another game of catch up which not many people will be interested in?
the article starts...Modern Languages do THIS. Oh you mean except for Java. And we all made excuses for the lack of it for years as if we prayed to SUN to do it and noone did noone wanted it until the SHINE of Java wore off a bit and now its like a direction?
Sounds like a patch.
Back in 2001 when jsr 14 (generics) was in public review I consciously allowed myself to be idealistic/naive enough to give feedback to this review; I made the familiar argument that generics plus anonymous inner classes almost equals closures so only minimal syntactic sugar would be needed.
Gilad Bracha was gracious enough to react and say that he did not expect it to happen after arguing 6 yrs for closures.
I am not an expert on the subject but after reading for a while, it looked like C++ Function Objects or C function pointers. I don't see any good in making the language more complex with such constructs.
Apart from the API we have, it looks like the Java itself will endup C++ with GC.
IMHO, Java and C# are following the PL1 or C++ path, ie add complexity on every language revision without understand that there isn't a good language for everykind of work. Java and C# run over a VM, so you can use other specific languages for specific tasks, like VB.NET or Groovy or Lisp, is supported by desing.
So, why can we try to add complexity to a 'clear' language?
PS: with modern multi-language IDE like Eclipse is really simple for a developer to master multiple language artifacts per project like html, javascript, sql, java; add to this list groovy/jruby/jpyhon/jlisp/etc. and leave java (language) small and simple.
Ciao, Diego
>>Modern Languages do THIS. Oh you mean except for Java.
Hmmm...modern languages...
Like the 12 year old Ruby language?
Java was out of date the day it came out. Back then it didn't have to try hard, because it was competing against crap (VB and Perl). Sun failed to compete when they needed to.
Cheers,
Clinton
>>Modern Languages do THIS. Oh you mean except for Java.
Hmmm...modern languages...
Like the 12 year old Ruby language?
Java was out of date the day it came out. Back then it didn't have to try hard, because it was competing against crap (VB and Perl). Sun failed to compete when they needed to.
Cheers,
Clinton
Exactly
Often we talk about closures about simply logic over a collections when this logic is expressable with a single function.
So maybe it's sufficient something like FunctionalJ:
functionalj.sourceforge.net/
John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.
Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.
Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.
Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).
Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.
Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.
One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.
InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.
9 comments
Watch Thread Reply