By John.Rose-Oracle on Oct 12, 2015
- “Reified void”
- “Access denied”
I mean a man whose hopes and aims may sometimes lie (as most men's sometimes do, I dare say) above the ordinary level, but to whom the ordinary level will be high enough after all if it should prove to be a way of usefulness and good service leading to no other. All generous spirits are ambitious, I suppose, but the ambition that calmly trusts itself to such a road, instead of spasmodically trying to fly over it, is of the kind I care for. It is Woodcourt's kind. (John Jarndyce to Esther Summerson, Bleak House, ch. 60)Woodcourt is, of course, one of the heroes of the story. It is a heroism that is attractive to me. Here is a similar idea, from the Screwtape Letters. In the satirically inverted logic of that book, the “Enemy” is God, the enemy of the devils but the author of good:
The Enemy wants to bring the man to a state of mind in which he could design the best cathedral in the world, and know it to be the best, and rejoice in the, fact, without being any more (or less) or otherwise glad at having done it than he would be if it had been done by another. (C.S. Lewis, Screwtape Letters, ch. 14)Though I will be happy with a good Bazaar, I also dream of Cathedrals. Put whatever name you like on it, as long as I get some part in the fun of building a good one.
This is a good time to consider new options for a “native interconnect” between code managed by the JVM and APIs for libraries not managed by the JVM.
This article describes some of the many questions related to native interconnect, along with some approaches for solving them. We will start Project Panama in OpenJDK to air out these questions thoroughly, and do some serious engineering to address them, for the JDK…
I think the general, basic, idealistic goal is something like this:
If non-Java programmers find some library useful and easy to access, it should be similarly accessible to Java programmers.
That ideal is easy to state but hard to carry out…[Read More]
This note explains how a notion of “value types” for the VM should protect the integrity of that value type’s invariants, and points out important differences, in memory effects, between “struct-like” and “persistent” designs for values.[Read More]
Lately I’ve been enjoying audio transcriptions of electromagnetic field measurements taken by NASA’s Voyager probe, which I got from iTunes. (My son David, who has a degree in psychoacoustics, turned me on to this.) As has often been noted, the sounds of space are unearthly yet somehow natural, often pleasant and sometimes eerie. There is some sort of deep structure which our earth-trained senses can still respond to. I suppose it has something to do with auto-correlations and self-similar structures at multiple scales in both frequency and time domains. Composers have sometimes chosen to create sounds like this to suggest “spacey” or other-worldly environments. For example, the NASA recordings sometimes remind me, vaguely, of the creepy electronic beeps and bumps heard in Forbidden Planet. The actual sounds from space are less dramatic, as one might expect. But even when they are a little creepy, the NASA sounds provide a very pleasant and unobtrusive background for me as a I hack away on my code.
So why am I not working, but writing a blog entry instead? Well, starting at minute 12 of the track “Sphere of Io”, there are sounds which resemble a women’s choir singing (wordlessly) in rising tone clusters. You can also find this on YouTube, where the tone clusters start at about 7:30.
Recently I have also been listening to Gustav Holst’s The Planets Suite. Planets, of course, is great listening for nerds, both for its own sake and because of the links to astronomy and also (via John Williams) to movie music. I love the first movement, “Mars, the Bringer of War”, for its rowdy energy, and have learned to appreciate the other movements also. But I find the final movement, “Neptune the Mystic”, to be frustratingly anticlimactic. It doesn’t stride triumphantly to an dramatic conclusion, but rather slowly fades out into a women’s choir, which sings (wordlessly) in rising tone clusters.
That’s what suddenly ripped my attention away from work: I heard Io doing a cover of Holst’s final fade-out. You can hear Holst’s choral fade-out at the end of “Neptune”, from about 5:42 onward in the Boston Pops recording. You can also hear it on YouTube, where the fade-out starts at about 6:02.
The most remarkable thing about this, I suppose, is that in reality Holst is not imitating Io (since he wrote it a century ago), and nor is Io’s behavior patterned after Holst. Either the two of them are following a common pattern, or I am indulging in a common human behavior of seeing patterns in noise. I think both of the latter alternatives are true; we humans usually require some basic phenomenal structure to prompt us before we begin to see patterns. In this case, I think the basic structure has to do with slightly dispersed audio-range tones, modulated to wander on the 1-second scale, as I hinted above. (I wonder: If air-breathing extraterrestrials exist, would we enjoy their songs? It seems likely to me at the moment.) The most enjoyable thing for me about this is to contemplate the unity of physical laws as we experience them personally, and as they operate in unearthly places like Io. The proof of this unity made Isaac Newton a rock star and launched modern science, but it has been pondered since humans were human, and is still puzzling today. The ancients called it the music of the spheres, and so do I.
For the record, I posted my talk about Java 8.
The OpenJDK software development team at Oracle is hiring. To get an idea of what we’re looking for, go to the Oracle recruitment portal and enter the Keywords “Java Platform Group” and the Location Keywords “Santa Clara”. (We are a global engineering group based in Santa Clara.) It’s pretty obvious what we are working on; just dive into a public OpenJDK repository or OpenJDK mailing list.
Here is a typical job description from the current crop of requisitions:
The Java Platform group is looking for an experienced, passionate and highly-motivated Software Engineer to join our world class development effort. Our team is responsible for delivering the Java Virtual Machine that is used by millions of developers. We are looking for a development engineer with a strong technical background and thorough understanding of the Java Virtual Machine, Java execution runtime, classloading, garbage collection, JIT compiler, serviceability and a desire to drive innovations.
As a member of the software engineering division, you will take an active role in the definition and evolution of standard practices and procedures. You will be responsible for defining and developing software for tasks associated with the developing, designing and debugging of software applications or operating systems.
Work is non-routine and very complex, involving the application of advanced technical/business skills in area of specialization. Leading contributor individually and as a team member, providing direction and mentoring to others. BS or MS degree or equivalent experience relevant to functional area. 7 years of software engineering or related experience.
Or, enduring values for a changing world.
A value type is a data type which, generally speaking, is designed for being passed by value in and out of methods, and stored by value in data structures. The only value types which the Java language directly supports are the eight primitive types. Java indirectly and approximately supports value types, if they are implemented in terms of classes. For example, both
String may be viewed as value types, especially if their usage is restricted to avoid operations appropriate to
Object. In this note, we propose a definition of value types in terms of a design pattern for Java classes, accompanied by a set of usage restrictions. We also sketch the relation of such value types to tuple types (which are a JVM-level notion), and point out JVM optimizations that can apply to value types.
This note is a thought experiment to extend the JVM’s performance model in support of value types. The demonstration has two phases. Initially the extension can simply use design patterns, within the current bytecode architecture, and in today’s Java language. But if the performance model is to be realized in practice, it will probably require new JVM bytecode features, changes to the Java language, or both. We will look at a few possibilities for these new features.
[Posted 3/21/2012, updated as marked 3/24/2012 and 3/05/2014.][Read More]
Sometimes we need to commit a number to short-term memory, such as an street address or parking garage berth. More important numbers (for phones or credit cards, PINs or birthdays) call for long-term memorization although smart phones increasingly fill that gap. But even with a smart phone it is pleasantly useful to have the option to use one’s own brain for such things. To do this, I rely on something I call the Sweet Numerology Keyfob. Before I explain that outlandish phrase, here is some background... [Read More]
Two questions came up during reviews, one about the equivalence of wildcards and named type parameters, and one about the best way to handle creation of an array of generic element types.
Here's the quick summary of how to write arrays of generics:
In the common case where desired type parameter is wild, there is no need to suppress warnings:@SuppressWarnings("unchecked") // array creation must have wildcard List<String> lss = (List<String>) new List<?>;
List<?> lqs = new List<?>; Class<?> cs = new Class<?>;
Note that every use of
@SuppressWarnings should have a comment.
@SuppressWarnings should be placed on the smallest
possible program element, usually a local variable declaration.
Here's an example of removing a deprecation warning. A typical deprecation warning is:
Here a the corresponding fix:Foo.java:876: warning: [deprecation] String(byte,int) in String has been deprecated String x = new String(new byte, 0); ^
The clarifying comment is a useful way to record any extra information (if known) why the deprecated method is being used.@SuppressWarnings("deprecation") // String(byte,int) in String has been deprecated // and this is actually useful because the fremdish preskittler was exsufflated String x = new String(new byte, 0);
Maxim M1: Observe, respect, and imitate the largest-scale precedents available. (Preserve styles of whitespace, capitalization, punctuation, abbreviation, name choice, code block size, factorization, type of comments, class organization, file naming, etc., etc., etc.)
Maxim M2: Don't add weight to small-scale variations. (Realize that Maxim M1 has been broken many times, but don't take that as license to create further irregularities.)
Maxim M3: Listen to and rely on your reviewers to help you perceive your own coding quirks. (When you review, help the coder do this.)
Maxim M4: When you touch some code, try to leave it more readable than you found it. (When you review such changes, thank the coder for the cleanup. When you plan changes, plan for cleanups.)
On the Hotspot project, which is almost 1.5 decades old, we have often practiced and benefited from such etiquette. The process is, and should be, inductive, not prescriptive. An ounce of neighborliness is better than a pound of police-work.
Reality check: If you actually look at (or live in) the Hotspot code base, you will find we have accumulated many annoying irregularities in our source base. I suppose this is the normal condition of a lived-in space. Unless you want to spend all your time polishing and tidying, you can't live without some smudge and clutter, can you?
Final digression: Grammars and dictionaries and other prescriptive rule books are sometimes useful, but we humans learn and maintain our language by example not grammar. The same applies to style rules. Actually, I think the process of maintaining a clean and pleasant working code base is an instance of a community maintaining its common linguistic identity. BTW, I've been reading and listening to John McWhorter lately with great pleasure.
(If you end with a digression, is it a tail-digression?)
These honors arise from a huge amount of teamwork. Together we introduced fundamentally new instructions and data types into the Java Virtual Machine, an undertaking that was both ambitious and complex. Carrying out this work required the dedicated efforts of the JSR 292 Expert Group members, our fellow engineers, corporate sponsors, and the Da Vinci Machine community. It has been and continues to be a pleasure to work alongside such excellent colleagues. Thank you all!
Let's continue to invest in Java standards, building out great computing platforms to run our future on.
Thanks, everyone, for your help!
John R. Rose
Java maven, HotSpot developer, Mac user, Scheme refugee.
Once Sun and present Oracle engineer.