Interview with Attila Szegedi



Please welcome this year's speaker at the JPrime Conference, the real JVM guru Attila Szegedi!

Hi Attila! Can you please introduce yourself?

Hi, I’m Attila. I program computers since I was 11, which is funny as I didn’t even have a machine of my own before I was 14. After obtaining a MSc in Computer Sciences from University of Szeged in Hungary, I worked for a local software development company for some years. I eventually started contributing seriously to open source projects, became somewhat noticed internationally because of that, went freelance for seven years, then moved to US to work for Twitter where I was mostly doing JVM performance work. After two years there I made the jump to Oracle’s Java LangTools group, as I wanted to work on the Java platform above all else.

You are an essential part of the Oracle Nashorn team, can you please tell as a bit more about your involvement there? How does it feel to be a part of a distributed team?

I joined Oracle in February 2012, and have worked basically on Nashorn exclusively since. I went to Oracle wanting to further enhancethe Java platform support for dynamic languages, and Nashorn was great for figuring out what we need. Nashorn uses my Dynalink library under the hood for interoperability with Java objects, and Dynalink was itself developed tremendously driven by requirements coming from Nashorn.

As for distributed teams, I worked in a distributed team for seven years in the aughties. We had people in two places in UK, two places in US, and me (back then) in Hungary. Still we built and operated a very complex distributed system together and we did it communicating over phone, e-mail, Skype chats, issue trackers, and shared code repository. I also worked on open source projects before, where I haven’t met my collaborators in person for years. I think it comes pretty naturally for me. We are somewhat less distributed these days in the Nashorn team than we used to be, though. Back then I lived in US and so we had one member each in US, Canada, India, Austria, and Sweden. Then I moved from US to Sweden, so since then we have two people sitting next to each other in Sweden.

For how long have you been involved in your current project?

Three years and counting. The big milestone was releasing the first Nashorn version with the initial Java 8 release. We’re refining it ever since. It feels like a JavaScript runtime is never done, there’s always something to improve, new optimizations to be added. Since the initial release, I wrote a static type inference engine in the compiler, and Marcus and I jointly implemented the feature we call “optimistic typing” that results in JavaScript code compiling to JVM bytecode that is mostly as efficient as if it were compiled from a fully typed equivalent Java code.

You are quite experienced in the field of dynamic languages over JVM. What was the hardest (programming) challenge you have ever met?

With dynamic languages on JVM there’s always issues with trying to make language features click with the underlying VM. Hardest challenges usually crop up around fitting a dynamic language’s type system into JVM’s (considerably more static) type system. Figuring out the logic for selecting a Java method from a set of identically named ones (that is, overloaded method selection) when called from a dynamic language must be one of the hardest issues. More recently, with optimistic typing we needed a system where we can stop execution of a function that’s currently running, recompile its code, and resume it running with new code, a technique known as on-stack code replacement, all without resorting to JVM tricks, that is, retaining fully portable bytecode. Getting all bits and pieces of it right was at times quite taxing on my sanity.

What is the message you would like to bring to the JPrime conference audience? Please tell us a bit more about the talk you are going to make in Sofia this May.

I’m bringing a talk that demonstrates best practices of using Nashorn in a performant way. We’re working hard on making sure that using Nashorn doesn’t face you with too many tradeoffs in the performance arena, but as I said earlier, this work is really never done. I think the main message is: feel free to mix in some JavaScript into your Java-based systems, it’s fun and works well.

And finally - please tell us a bit more about your hobbies, besides coding and hacking?

I’m an avid runner. It’s actually a fairly recent development, I started running about three and a half years ago, mostly because of health related reasons. I never did any regular physical activity before in my life. It was a hard start, and it took some effort to not abandon it in the first few months, but I persisted and these days I’m out there for an 8km run thrice a week. I’m considerably more healthy at 40 years of age than when I was a 30-years old couch potato. Making it into a habit is the single best decision I ever made. Aside from that, I read a lot, watch movies, and love traveling to new places (first time in Sofia, too!); most recently my wife and I spent this spring break showing our two teenage kids around Tuscany. I also play computer games when I find the time; the Civilization series is my all-times favorite, and I’m logging some hours in Elite: Dangerous as well recently.

Thank you!
See you in Sofia next month!