Wednesday Aug 27, 2008

Firing up the engines for multiple languages



Have you seen the latest update from John on our efforts to make the JVM run multiple languages ? (I'm in a staff meeting writing this, but don't tell anyone :) ).

From one to many languages

For those of you who would like a little context around International Invokedynamic Day, for the last few years we've been on a path towards first class support for other languages on the JVM. No small feat this, since the Java Platform was originally designed with one language in mind. Now, we still believe that Java is the best language for robust, long lived code. But we know that developers like to mix in other languages that for special reasons: for particular applications, for particular styles of development. Just as important, we've spent 13 years creating an incredibly scalable and high performing runtime across a variety of operating systems. So for developers who create applications with other languages (and we hope there will be many who like JavaFX Script), we figure they would like to run those apps on the best runtime around.

So, as a matter of fact, do the creators of the engines for other languages like Ruby, Python, Groovy, Scala - they started creating the engines to run on the Java Platform.

Lining up the engines

So for Java SE 6, we provided a framework by which those interpreters could plug easily into the Java Platform. And the developer APIs by which the code from those other languages can be asked to execute. We even bundled a JavaScript engine into our own JDK. At the same time, more and more developers created the engines to run other languages on the Java platform.

Firing up the engines

Now, many of the languages that are attracting the buzz that have been invented since the Java language have a feature in common with each other, but not with Java: they are dynamically rather than statically typed. So the types of the variables, method parameters, return variables and so on are not known at development time, unlike in Java where you are required to declare them. All very nice for rapid prototyping and a more informal style of programming, but a big problem for compiling it down to the Java bytecode because the Java bytecode needs that type information filled out. So engines for dynamic languages have to create artificial interfaces or classes just to do the form filling. Making them brittle, difficult to maintain and slower than they could be. But not if we modify the bytecode to remove the need to fill out all the type information.

So back to the update: John has prototyped support for the modified bytecode in the HotSpot JVM !

What this means is that implementors of dynamic language engines are now free to try this out and prove the theory. I'm predicting that Charlie will be one of the first with his JRuby project, but the race is on.

Some of the newer languages have other features in common, like closures for example. There may well be other features we will build into the Java runtime to support such features better like tail call recursions, continuations and lightweight method handles. But we'll see how it goes with new bytecode and get some real data and decide how much further we need to go.

If, say, Ruby, Python and Scala run faster on the JVM than anywhere else, we may just be done. For now :)


Thursday Aug 21, 2008

Numbers that Count



For those of you who know me, I can still get a little freakish about numbers. So, from a really interesting article about mobile devices and Java ME I saw over the last week, two numbers stood out for me. For developers trying to figure out how to reach a wide audience for their application, those numbers are: 2.7 million and zero.

2.7 million is the number of mobile phones that were sold, on average, every single day in 2007 around the world. Now, I \*heart\* my iPhone, its a wonderful device, but the iPhone reached the million mark 74 days after its launch. That's 74 days to sell as many iPhones as it took just 9 hours to sell as many mobile devices.

Zero is the cost of entry to develop an application for Java ME, which is deployed today on many of that staggering number of devices (for a complete list, see here). No complicated agreements to get the Java ME SDK, the development of the platform is out in the open, so everyone sees it unfold at the same time. Better still, the free visual development environment for Java ME has been pretty great for some time now.

Two numbers that add up to a great way to reach a lot of people.


Tuesday Aug 19, 2008

Some of my favorite things about the JavaFX SDK Preview



I'm sure you all saw that our JavaFX team released a preview of the SDK at the end of July. I've been happily tinkering with it for the last few days. If you are hacking with AJAX, moonlighting with Silverlight, or fumbling with Flex, I think you should get up close and personal with it too, and see what its all about.

We've been talking about JavaFX in various ways for some time now, so you probably already know that its for building rich client applications, that it itself is built using Java, and that it will span multiple devices - from small mobile phones through TV settop boxes to the PC desktop and browser. Most importantly, if you are a traditional Java programmer (I include myself), you will notice there's a paradigm shift. A shift moving from the Java programming environment, whose generality spans quite an astonishing range of applications, to a programming environment specially designed for those amongst us with more developed visual design skills than technical ones (sadly, I cannot include myself). Those who are focused on one kind of application: interactive and fabulous looking.

Looking ahead a little, the plan here is to release the final version of the SDK for the desktop at the end of this year and a preview of the mobile version next March or so. I say or so, not just because schedules are schedules, but because we are ready to adjust based on the feedback we get from this preview release.

Anyhow, some of my favorite things about this preview release are:-

The Language: JavaFX Script

Described in full in the language guide included in the SDK, this new language is highly declarative (i.e. it says what its going to do, rather than saying how to do it), with features like data binding to let you to bind one variable to another variable. Like,

let oneVariable = bind anotherVariable;

(I did say it was declarative). Or like the triggers feature, so that when the value of one variable is replaced, you can have something else happen at the same time.

attribute oneVariable
    on replace doSomethingElse();

To a Java programmer its going to be an easy new language to pick up because it shares much of its syntax with the Java language. To a designer, its going to be an easy new language to pick up because its clean, straightforward and does on the screen what it says in the code. And it has no baggage to carry.

The APIs

Neatly divided into two profiles (which you can see here) - the common profile for all the APIs that will be available on every device, and the desktop profile for all the APIs that make sense only for applications on a desktop. There's a mobile profile to come of course in the mobile release next year, which will have the common profile plus APIs that make sense on mobile devices.

As part of the common profile, you have the scene graph and the media JavaFX APIs. The GUI of an application is modeled as a graph of visual nodes, (each node being a shape, line, piece of text, GUI widget or embedded media), that moves, twists, rearranges as the user interacts with it. The scene graph API in JavaFX is especially well suited to the transition effects and animations that make all the difference between a user experience and a captivating user experience. The media supported in the scene graph includes a player control and support for OS native formats. You'll remember we inked a deal with On2 to provide cross device media support in May. Well that will have to wait a little longer before we can put that in. But we're all crossing our scene graph nodes that it will be soon.

The desktop profile includes the common profile, plus some desktop specific extras like...many of the tried and tested Swing widgets we know and love: buttons, combo boxes, lists and so on. So no shortage of the basics you need there.

And of course, being built in Java and on Java, you can always reach down into the underlying Java APIs for your favorite Java API if you would like to use that in your application too.

NetBeans integration and Project Nile Plugins

Naturally, the SDK is available pre-integrated with NetBeans 6.1 which is how I've been looking at it, as have others. The language and APIs are supported in the IDE with all the things you would expect like syntax coloring and checking, debugging and so on. Together a tutorial and a range of samples. The samples are generally short and to the point. Want to see how to draw polygons ? There's a sample just for that. Want to see how to use keyframe animation to bring life to randomly moving particles ? There's a sample just for that. Transparency, color gradients, bounce a ball ? Check, check, check.

Also included in the SDK is a collection of plugins (codenamed Project Nile) to Adobe Photoshop and Illustrator so you can keep working on the art there, and use Project Nile to export it into your JavaFX application and bring some life to it.


My other favorite thing is that this is all running on Java SE. So applications created in JavaFX aren't just running on any old VM, its running on a supremely stable, scalable and high performing runtime. But I don't have time to tell you about all that just now.


There's more to the SDK than just my favorite things. If you've been curious about JavaFX, now is a good time to take a look for yourself.


Friday Aug 15, 2008

Makeovers for Java ME applications



One of my Top 10 Rich Client things from JavaOne this year was the Java ME Lightweight UI Toolkit (LWUIT). And the team just open sourced it yesterday.

If you're looking for a quick and easy way to add some fit and finish to a Java ME mobile application for use on the version of Java ME that is deployed today on billions of devices, you need to check it out.

It takes some of the familiar core ideas of Swing - some of the widgets, layouts, themes - and shrinkwraps them into something good looking, powerful, small and easy to get started with.

See it in action for yourself.


Thursday Aug 14, 2008

No Mojo Mojave



I'm wondering who's hiring the ad agencies up in Redmond these days.

Hot on the heels of the 'No-one wants to look dumb' campaign for MSN, the Mojave Experiment is squarely from the Pepsi/Coke taste test school of thought. You know, showing people like you and me reacting to the product, that kind of thing. This time, with the additional blindfold that the people testing Vista don't know that it is Vista, just that it is the next version of Microsoft's OS.

For the insomniacs amongst us, the underpinning of the campaign is of late night informercial genre - you know, the parade of unpaid customers of the product each of whom has some unique way in which the product for sale has touched their lives in a profound and meaningful way. You don't really believe that they are being truthful, but somehow you can't look away. Each echoing the same key messages of the previous one, like a rat caught in a wheel.

A blind test of an OS does not lend itself to before and after photos. Nor apparently in this campaign, of ever showing a single pixel of Vista in action. Instead, in the Mojave Experiment, the exposition is in the reality TV style, the reality being the reaction of ordinary people to it. Except that, as most reality TV shows, the reality is selectively edited. Of the claim of 22 hidden cameras (why hidden ? why 22?), only one or two ever appear to be in use. Worse, the captured reactions are mostly of the subject watching the screen while the off camera interviewer drives the demo. The subjects never touch the computer. They never have to figure out why their wireless connection isn't working, or where they saved their Word document, or whether they can trust a download that magically popped up in their face while they were reading PerezHilton.com.

You obviously never see them doing this.

The goal of this campaign is I suppose to show that Vista is surprisingly good. But it just acknowledges that, whether right or wrong, many people think its surprisingly bad.

Almost as surprisingly bad as the choice of campaign.


About

dannycoward

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today