By user12619391 on Mar 31, 2011
Well, almost blank. But definitely intentional.
If they were, then when I kill one of the ants that appear in my bathroom, the rest would immediately realize that the ant's mission was one of folly. That only an ant expecting death should enter my bathroom. That zipping across my counter means a swift execution and watery grave.
But alas, they aren't.
One of my biggest Java pet peeves is the fact that a pristine, platform-independent Java application will frequently be shipped wrapped in a diseased blanket of shell scripting. Nominally, this wrapper script is there to set up the class path and invoke Java, acting as "glue" between the curmudgeonly operating system and this denarian virtual machine technology. The typical wrapper script is far from so reserved, unfortunately acting as a lint trap for all manner of minor enhancements presumably made in the name of programmer efficiency. In the long term, gratuitous use of multiple languages when one will do is the antithesis of efficiency (I am, of course, thinking of the poor guy who has to debug or maintain this stuff after the original author has skipped town).
As it turns out, a couple operating systems have support for direct execution of Java binaries. Coupled with an appropriately constructed JAR manifest (which can specify things often relegated to the wrapper script, e.g. the class path), this lets us eliminate these unsightly wrapper scripts in many cases.
Not all operating systems are so fortunate, though. I noticed this evening that trying to directly execute a chmodded JAR file under MacOS X gives me a disappointing "cannot execute binary file" error. To avoid introducing yet another garbage-collecting monstrosity to the world, and to avoid needing to create a new script for each new JAR I added to my growing army of Java commands, I decided to borrow a page from the isaexec playbook:
#!/bin/ksh -p # # runjava.sh: executes the JAR file whose name is used to run this script # BASE="$(basename $0)" DIR="$(dirname $0)" JARFILE="$DIR/jars/$BASE.jar" [ -f "$JARFILE" ] && exec java -jar "$JARFILE" "$@" echo runjava.sh: $BASE: command not found exit 127
runjava.sh simply takes argv as the name of a .jar file in the jars subdirectory of the directory argv is in. Using it is as simple as creating a link to it. For example, I put mycmd.jar in ~/bin/jars, and linked ~/bin/mycmd to the script. Done.
Unfortunately, not all Java applications can be simplified in this manner. Class paths may vary from install to install (something like $ORIGIN here would be a dream come true), and LD_LIBRARY_PATH might be needed to find native libraries. I'm keeping my eye on JSR 277; hopefully it will provide the solution my fellow wrapper-script haters and I long for.
Alas, this comes a week late.
Dimas demos Looking Glass
Charlie talks about NetBeans
Eric talks to some new CS students
FISL continued to be a fantastic experience. While on the first day (ignoring our formal morning session) we pretty much just hung around and talked with whomever we could lure to our booth with the promise of free t-shirts, DVDs, and candy1 (not to mention software), we tried to make the second and following days a little more structured. There is a lot of cool stuff in Solaris, and we wanted to make sure that some of the lesser known technology saw the light of day. Though we quickly discovered we could have spent the entire conference demoing Project Looking Glass and DTrace, or chatting about OpenSolaris, we felt obligated to try to break the popularity feedback loop.
We broke the last three days down into hour-long segments, and assigned topics to each. For each topic we had2 a short presentation we expected to consume only about 15 minutes, and left the rest of the time open for questions and discussion. This of course varied from subject to subject (e.g. DTrace was demo-heavy, OpenSolaris was more interactive), but the idea usually held. We posted the next two hours of topics on a side outside our booth and waited. Sometimes people would show up, sometimes not. While it may have been the case that the Fault Management Architecture and the Service Management Facility topics simply were poorly scheduled against some of the larger conference presentations, I personally think they suffered most from the lack of sexy names (as an engineer, I have a subconscious aversion to anything having to do with "Management"). Certainly the people who attended each found them interesting enough to stay through our presentations and ask a lot of good questions; perhaps all it would have taken to draw a larger initial crowd would be if we had done some spontaneous marketeering. We'll have to try "The Hardware Bouncer" and "SMF: Booty Guru" next year.
The other topics were more successful. Talking about Open Solaris was, of course, a lot of fun. Since I didn't get too many questions on the development mechanics part of my pre-session talk, I left that part out of my booth talk. I don't think it was missed (which is a little disappointing, but also understandable -- it's hard enough for a native English speaker to follow the volume of terminology and acronyms introduced). My only awkward moment during the conference had to be when, in my first Open Solaris booth talk, I tried to illustrate the possibilities of what the community could do with Open Solaris that Sun would not. Needing an appliance to use as an example, I quickly chose TiVo. While very recognizable in the US, I can't imagine they exist at all in Brazil. Upon seeing a sea of blank faces, I quickly backpedalled to the generic "personal video recorder" which, judging by the unchanged gaze of the crowd, was still a lost cause. Then -- and I have no idea how I got there -- I said "or a car". Few people design software for their cars, and those who do so for a living apparently have a hard time of it. That's when I decided to cut my losses and move on to my next bullet. The following day I ditched the appliance idea entirely and instead used the example of a MIPS port which was easily understood by all.
Our booth was open and inviting, and spacious enough to allow multiple large simultaneous conversations. Unfortunately, this meant it was a difficult for one unmiced person to fill the space, especially with the high ceiling catching a lot of the ambient noise in the hall. Miraculously we all seemed to escape with our voices intact. We had a well-stocked fridge in our booth; after some experimentation I found that soda was much more effective at soothing my throat than plain water. Much to my chagrin, the local staff quickly (after only my second can) dubbed me "Coke Boy". It was certainly a misplaced nickname, as I very seldom drink soda back in the states3. That said, I found the taste of the local soda Guaraná very appealing; it's a shame it isn't common in the US (assuming you can get it at all -- something I need to check the next time I'm at BevMo).
CodeBreakers and Solaris
The high point of the conference was, without a doubt, the people we met. Going to an open source conference as emissaries from a not-yet-open-source operating system, I was concerned we would be facing a surly welcome. To the contrary, almost everyone I talked to seemed more focused on technology than dogma. A few were justifiably skeptical4, but most were eager to see what were about, if not install Solaris as quickly as they could. It is almost inconceivable that the original plan was to bring 10 DVDs; we went through enough of the couple hundred we brought on the first day that we had to carefully ration the remains5. Perhaps the most enthusiastic were Thiago, Iru, and others from CodeBreakers, who are already working to form an OpenSolaris user group in Brazil. Hopefully we'll be able to make it to CONISLI in November to see them again, and the group they have started.
As much fun as the conference was, it was exhausting. We all slept extremely well the last evening.
1As Eric quickly discovered, the metallic wrappers around the chocolate candies would make a silvery mess of anyone's hands who ate enough of them. This was not intentional.
2Often written the night before. Or sometimes just a few hours before. Interestingly, the more impromptu the materials, the better they seemed to be. It shouldn't be too surprising; this let us tailor the content to our audience, which is always a recipe for more effective communication.
3 I suppose it's better than "Crack Baby".
4 While Sun has a long history of contributing open source, Solaris is unlike anything we, or anyone else, have done before.
5 Which for me meant: give one to anyone who came up to me and asked.
Eric and I (and a cast of many blogless others) are currently in Porto Alegre, Brazil representing Sun at FISL 6.0. FISL is a ginormous Brazilian Open Source conference; it seems very fitting that we be here given the impending release of OpenSolaris. Over the next three days we'll be spending a lot of time in our booth giving mini-presentations about specific Solaris features and generally about OpenSolaris. Please stop by if you're around and have questions. Or even if you just want a t-shirt.
So far it has been an interesting experience for me; it's the first time I've seriously ventured into the southern hemisphere, to say nothing of Brazil. It's also strange, shortly after spending a few months in China clawing my way up the language ladder to the point where I could have simple conversations, read menus, and get myself around, to be once again thrust into a situation where the language is a significant barrier1,2. Fortunately, the fears of being unable to communicate with other conference attendees that were forming after my first, almost-exclusively Portugeuse 24 hours in Porto Alegre where dashed when at our pre-event session we had a sizeable English-speaking audience armed with lots of intelligent questions. At the left you can see Eric presenting new Solaris features in a pose deserving of a scribbled-in mustash and red armband -- all I can say is that it is better than the other photo I took, unpublished here, which will simply be referred to as "the action shot". In contrast, Tom Goguen, speaking about OpenSolaris, has clearly taken the SunU class on avoiding dictator-like poses. (No-one thought to take a picture of me, fortunately; my camera karma is quite bad).
For the rest of the day we hung around the booth, chatting with anyone who stopped by. The most common queries regarded Solaris features they've heard about, how much we were charging for the Solaris 10 DVDs and OpenSolaris t-shirts we were giving away for free, and how they could get OpenSolaris today. Obviously some people came away happier than others, but on the whole I think most people had a good time -- we certainly did. The questions we got were great, and it was fun to be able to talk to such a technically-savvy crowd. I'm definitely looking forward to the next couple of days.
1The existence of cognates is a welcome crutch.
2There have been many occasions where I have caught myself about to say "那个..." -- a sign that at some subconcious level my brain believes that speaking any foreign language would suffice.
Welcome, and thanks for stopping by.
I'm an engineer in the Solaris kernel group, currently living and working in Silicon Valley, USA. In my nearly six years in this group (and at Sun), I've worked on many things: consing up corporate LDAP database crawlers, carefully crafting Tektronix 4014-based multi-processor performance monitors, and occasionally making sure I can still boot the Brown Simulator (and run Weenix, of course) on our latest bits.
My more substantial (and alas, relevant) efforts include:
At the moment I'm working on/thinking about a couple things:
But the mind can't comprehend what the eye can't endure; the first order of blog business will probably be some aesthetic improvements. Stay tuned.