Bio
Gavin King is a Distinguished Engineer at Red Hat. He's the creator of Hibernate, a popular persistence solution for Java and of the Ceylon programming language. He contributed to the Java Community Process as JBoss and then Red Hat representative for the EJB and JPA specifications and as spec lead and author of the CDI specification. He's currently a major contributor to the design of Jakarta Data and Jakarta Persistence. He lives in Barcelona with his wife and three daughters. His active interests include theoretical physics and quantum technologies.
Tags
Authors
Haha! Try compiling this Java code:
A couple of days ago I spotted an interesting hole in Ceylon's type checker. I started out with something like this:
In connection with this discussion it's worth making explicit what I guess everybody knows, but that sometimes seems to get a bit mixed up in conversation: that Java's support for raw types (necessary for backward compatibility with pre-generics code) doesn't really have anything much to do with type argument erasure. In a hypothetical language:
Cedric recently brought up the topic of type erasure, concluding:
Over the last couple of days, I've exchanged a few emails with Stephen Colebourne regarding Ceylon, and some of the decisions we made in designing the syntax of Ceylon.
So my recent return to writing code in Java has been interesting. Most of my Java programming experience has been in web apps, where there is a lot of UI/declarative code, and state-holding classes, or in framework development where I need a lot of interception and reflective code, and in those domains I have often found that Java gets in the way. But now I'm writing a compiler (well, a type checker/analyzer to be precise), and I don't have much use for declarative code, interception, or reflection. And there is a lot more code that does stuff
rather than represents state or data. Java is honestly a quite different experience in this domain. My overall reaction is that Java is simply very reasonable and non-annoying for this kind of work. It just doesn't get in my way much. And in an IDE like Eclipse, Java's static typing saves me enormous gobs of time.
Built-in support for modularity is a major goal of the Ceylon project, but what am I really talking about when I use this word? Well, I suppose there's multiple layers to this:
Hrm, I notice it's been just over three months since I semi-accidentally announced the existence of the Ceylon project, and I guess I feel like you folks deserve some kind of progress report! At the time, I very much regretted the fact that the project became public knowledge before I was really prepared to socialize it, but in retrospect it was the best thing ever for us. That's where we got Stef and Tako and Sergej and Ben from, along with the other folks who are signing up to get involved in development. Unfortunately, we're still working in a private github repo, which is certainly not ideal, but it's helping keep us focused on getting actual code written.
So the comment thread of my previous post got me thinking again about the do/while statement. Frankly, it's difficult to see why we really need this as a first-class construct in modern programming languages. Here's my list of reasons for saying that.