Monthly Archives: November 2008

Javascript and C++, eh?

I can’t get my mind off of Dave Thomas’s keynote at Eclipse Summit Europe. His words made so many things crystallize in my mind. I’ve stated many times before in this blog and in my day job, I hate Java. It’s an incredible irony that I do my day to day coding in Java to support developers who focus so much on efficiency and performance and use C mainly to accomplish that with a sprinkling of C++ for good measure. And then to hear their constant complaints that Eclipse is too slow. My good friends in Java VM land tell me not to blame Java for that, but you know, it’s so tempting.

Dave mentioned that applications should be written in C++ and JavaScript. I dunno. C++ has it’s difficulties, there is no doubt. It’s hard to write good C++ programs. That’s why the mix with JavaScript made me think. Does it make sense to build an application where your hard core performance focused code and code that interfaces with the underlying system is written in C++, but all the code that manages interactions with the user is done in JavaScript?

I’ve started to take a look at Google’s V8 JavaScript engine. As they say in their videos, they’re built for embedding in C++ applications and they have implemented some interesting tricks to get JavaScript to run fast, such as a JIT compiler and some heuristics to make class property access faster. As well, they have an efficient memory management system which includes being able to persist snapshots of the heap, including the JITed code, out to the file system for faster startup.

That got me thinking of Eclipse, of course, or really IDE’s in general. What if you take a cross platform GUI toolkit like wxWidgets, add in a component model to allow for dynamic extensions, plus rewrite the CDT parsers in C++ for speed, plus …, and throw in a JavaScript engine like V8 to make it easy for users to program, wouldn’t that make for an interesting architecture? But we already have Eclipse so why would we do that all again? Just a question…

An Interesting Ottawa Demo Camp

The Ottawa Eclipse Demo camp was tonight and I thought I’d write about it before I went to bed. The demos were quite interesting, a different mix than before which keeps it fresh. And the hospitality of the Foundation staff was awesome again.

I was especially intrigued by Nick Edgar’s embedded web UI demo that he’s working on as part of Jazz. This is something I thought of doing for my talk at ESE. Present information in a web page using Eclipse’s embedded browser. And then have JavaScript on that page interact with the surrounding Eclipse environment. The workflow he showed was very clean and I think there are some pretty cool things we can do with this. The technique he used was quite a kludge and even he admits it (communicating through the status bar?) But the SWT guys are thinking of better ways and I can’t wait to try this myself.

The other interesting demo was from the Zeligsoft gang. I worked with some of the fellows that started Zeligsoft. We were part of the Rose RealTime development team. It was interesting to see the product they’ve come up with and the simularities it has with the stuff we did back then. They’re betting the farm on model driven development. I can’t say whether they’ll succeed or not, but they’ve done a few things better, but a lot is the same.

I also have to thank Boris and Eric for their demos on e4 and the model-based UI in particular. I have a better sense of what they are trying to accomplish. Whether it’s better or not than what we have today, I’m not sold yet. But I’ll have to give it some hands on before making a final judgement.

I also got some interesting feedback on my article on IBM and Eclipse. (BTW, it’s not whether we can survive, it’s that we better plan and make sure we can, which I think we’re finally doing). There were a lot of IBMers at the Demo Camp which was good to see. And there were as many ex-IBMers there too. I think it’s pretty healthy. The Eclipse expertise is spreading throughout our small and tight knit town and Ottawa has a great concentration of Eclipse expertise, which makes it a great place to be.

Long Live the Benevolent Dictator

The last few weeks I’ve been nose to the grindstone finishing up our first Wind River product release with a new p2-based installer. It’s been a while since I’ve been involved in commercial development and, though it’s been grueling and has taken me away from my CDT project lead duties, I can see the light at the end of the tunnel and it looks like we’ll be able to ship on time and with good quality, but maybe without all the bells and whistles I had hoped for when we started.

It’s good to work in the corporate structure again too. If there are any decisions to be made, we have the processes and organization in place to make sure those decisions get made and that all the loose ends get tied up. It’s the only way to succeed. You need that structure to make sure everyone is going in the same direction and has the same objectives.

So that got me thinking. Looking at my involvement with the CDT, I have had feedback that people looked to me as the guy to make the decisions, or at least to adjudicate any conflicts. To be the benevolent dictator at times. And we ended up getting a lot of things done over the years and everyone working on the CDT was going in the same direction. We sort of made up a structure where one didn’t really exist, because we needed it to be successful.

I have big fears for e4 on that front. McQ and the IBM gang has made it clear over and over again, including on today’s e4 call, that they are working on what they find important, and everyone else should do the same, or nothing will get done. And there are a few things going on. I’m leading the resources effort and we’re working on things that individually are important to us and our employers. And clearly the SWT team is doing the same. But as hard as I try, I can’t figure out what the UI guys are trying to accomplish. And then there are lots of things in the Eclipse Platform that no one is looking at. Debug, for example.

I firmly believe that even with open source projects, you need that benevolent dictator to actually deliver things. Where would Linux be without Linus? Where would Eclipse be without the early dictatorship of IBM? And there are countless examples. Where you see a successful open source project, you find an individual, or a small team, who make decisions and ensures everyone is working together. I get the sense that people think that’s anti-open, but I can’t see how a project, open or not, can succeed with out one.

Can Eclipse Survive Without IBM?

I bet you this title got your attention…

Let me tell you a story. It’s one a lot of us Eclipse “insiders” know from our trip to Ludwigsburg, Germany. If you look at the program for Eclipse Summit Europe, you’ll notice a distinct lack of Eclipse Platform committers, i.e. IBMers, presenting. And one of them was lucky enough to get his travel approval the Friday afternoon before the conference. The Summit was a resounding success despite that. The Eclipse community in Europe has gone well past caring about the traditional Platform and are looking at really cool technologies like OSGi with Equinox and Modeling (despite Dave Thomas’ decree that modeling sucks, which it does, at least UML-like modeling).

Now, I’m not sure if this year is any different from previous ESE’s. But with the discussions we’re having on the EclipseCon program committee about how many IBMers will be able to attend to give their presentations, it’s got me thinking. What happens if this apparent trend continues and we loose the commitment IBM has made to Eclipse. Can Eclipse survive without IBM?

Well, I can say Wind River is doing their part to help out. We have myself and Martin O working on the Platform Resources evolution for e4. And we have Pawel who’s now a Platform Debug committer. And as always, we’re doing major contributions to the CDT and DSDP projects. And the numbers show the Eclipse committer community continues to grow and a lot of projects are healthy.

So can we survive without IBM? Absolutely. In fact, I’d consider the Eclipse Platform feature complete, at least for the needs of IDE and RCP/OSGi vendors. Yeah, things could be cleaned up, and yeah, we could make Eclipse work with Web 2.0 (although I really question whether SWT is the right technology for that). But from what I saw in Germany, Eclipse is alive and well. There are some really cool things that are going on and while the platforms are stabilizing and are probably becoming less interesting (and I’ll sadly include the CDT in that list), I get the sense that those relying on the platforms will keep them alive. They have too.

Code Analysis and Refactoring with the CDT

For those that missed my talk at Eclipse Summit Europe, here are my slides. Unfortunately, that’s pretty much all the documentation we have on this capability, as I mention in the next steps slide. The community needs to step up and help with this if we want this capability to grow.

CDT at Eclipse Summit Europe

Well, the closing session is about to start and the vendors are packing up their displays. Another successful Eclipse Summit Europe is about to go off into the sunset. For me, it was proof again why I love coming to this show. The CDT community in Europe is strong and a lot of them are doing and want to do interesting things with the CDT.

The talk I gave was on the code analysis capabilities of the CDT introducing the things you can do with the CDT’s parsers and indexing framework. I also introduced the new refactoring engine that we have which really opens up a lot of cool automations you can do to analyze and refactor your code. The best part is that I had a few guys come up to me after to ask about certain analysis things they wanted to do. I’m glad I gave that talk and I hope more people take a look at what the CDT has to offer in this area.

I also had a number of people ask about the CDT managed build system. This is an area in a bit of trouble right now with the CDT. One of the key developers has left and we’re struggling understanding the code that he left behind. Hopefully these vendors who have concerns about the build system will join us and get us rolling again. The CDT build model can do some pretty cool things and I look forward to seeing the different build integrations people are thinking of working.

I had a discussion with someone interested in working on the Windows debug integration I have on my wish list. I’ve given it a couple of tries and there is a start of one in the Target Communication Framework (TCF) agent. Hopefully we can finally get this together and have full support for the Visual C++ compiler with the CDT.

Speaking of TCF, there was a lot of interest in it from various embedded system vendors. It’s a really good technology for building target agents with a clean communication protocol back to Eclipse and a services oriented architecture. I’ve been interested in component models for C/C++ applications and I can see how this agent could use something like that. I’ll have to give it some thought and see if others are interested in getting involved in that.

It’s been a fun and interesting week. Hopefully I talked to everyone who wanted to talk CDT with me. And hopefully we can get some momentum off of that to continue the growth of the CDT community. Those late nights in the hotel bar with the Eclipse gang was part of that community building and I’m going to sleep well on the flight home but it was worth it.

Thoughts on Dave Thomas’ Keynote

Ed Merks already gave a summary of Dave Thomas’ keynote yesterday morning here at Eclipse Summit Europe. It was the first time I saw Dave speak and I was warned he tended to say things that offended the audience. And to Dave’s point, that is kind of what a keynote speaker should do. Spark thought. Break through the assumptions that we tend to fall into when we get comfortable in our skin. And I think he raised some serious points that are making me wonder about what’s really happening in our industry.

I guess his main point is that Java for embedded has missed the boat. If you haven’t gone through the pain of doing Java for embedded devices, don’t worry, you didn’t miss anything. I’ve been waiting to see when I need to care about Java in this space and I’ve talked to some of the people here at Eclipse Summit Europe about this. I think they quietly agree with Dave. Those that have figured out how to do Java on embedded are doing OK with it. But there are a lot of issues to face. The worst of them is the bloat that the Java VM continues to grow from release to release. The embedded VMs are horribly crippled, and if you want to use the Sun VM, you are crippled from paring down that bloat. The discussion is interesting, and we may still be proven wrong, but for now, I can ignore Java for embedded and I can sleep at night.

There were some other messages from Dave that hit home as well. Programming is horribly complicated. Normal people will never be able to figure it out. Which means if you have figured it out, you’re not normal, and I guess that includes me. But it is true. I’ve blogged a lot about this in the past. We can barely get our programs to work as it is. Wait until you’re trying to program 100 threads running through your mess all at the same time. We’re doomed.

But there are some things we can do to give us a chance to survive. Dave talked a bit about how the lack of a software component model is making us look like fools in the eyes of the engineering community. Can you imagine if automakers had to custom build all the components that make up a car? Imagine now if we could go to a shop and pick up high quality software components and tie them together will few lines in a script.

Now Dave was be extreme in his position. There are a number of areas where component models are being used, OSGi is an obvious one, all these “Mash-ups” are doing things like this. But coming back to embedded, we can’t rely on Java to provide the solution. Dave’s answer was C++ with JavaScript. And I think that’s a great idea. Build components in C++ and tie them together with a scripting engine. Dave picked JavaScript, which is OK but he did mention he’s working with Google on their V8 JavaScript engine. Lua is another good choice. And actually Domain Specific Languages offer solutions as well (and I’m not just saying that because I’m sitting in Rich Gronback’s DSL talk right now ;).

It was really interesting to spend time with Dave Thomas in his keynote and with a group of us at the hotel bar. I could learn a lot from him. This week it was to open up my mind and challenge the assumptions. If you read this blog regularly you find that I tend to do that anyway, but it’s an important reminder to keep doing that and make sure we don’t make the same mistakes over and over again.

You want to see a busy mailing list?

Just check here:

I was looking to see when qemu, a very cool virtual machine for many hosts and many target CPU architectures, was going to come out with a new release. As part of that, I was checking to see if it was under active development. Well, with 55 e-mails on November 13’th when I looked, I guess it is :).

I did find a conversation back in October about 0.9.2 which will likely include some new technology called TCG that will eliminate qemu’s dependency on the gcc 3.x compiler. That’s good news since I want to release Wascana 1.0 with the gcc 4.x compiler and I want to use Wascana 1.0 as the base IDE for my EcilpseCon tutorial on working with cross-development environments. I hope it all comes together by March.

Speaking of which, only 11 more days until submissions close for EclipseCon. Get them in early and get them in often. And soon!

Now that’s small.

Just ran into this article on It talks about a tiny computer that looks like this:

That’s all there is to it. This ethernet jack has an ARM9 processor in it with 8 MB RAM, 4 MB Flash, and some interfaces that you can hook up electronic devices to. The idea is to add network connectivity to devices that normally don’t, like air conditioners and stuff. Apparently there’s even a WiFi version of the thing.

I found a couple of neat things about this device. First it gives you network access to pretty much anything allowing for centralized controllers to manage those things. This is probably old news to guys who work on building maintenance automation systems and stuff like that. But this device somehow made it all real for me.

The other thing to note is the memory size here. 4 MB Flash for the file system isn’t very big. And neither is the 8MB RAM you run with. If anyone ever asks if C is still important, I’ll just point to this thing.

And finally, I had to have a chuckle when I saw this: “the kit includes an IDE based on Eclipse 3.1.2 and CDT 3.0.2. It supports C/C++ devlopment, CVS code management, and visual debugging via Ethernet.” Yet another vendor using the CDT to build cool things :).

Design like you’ll be there in 10 years

I probably blogged about this a long time ago. I remember watching the news conference for the landing of the Mars Spirit rover. I had watched the landing live over the web and remember the jubilation of the team members as they received the first signal alerting to the safe landing. At the news conference one of the project managers mentioned he had been working on the project for 10 years (through one previous cancellation that is, but still pretty darn good). He was beaming to see the success. And it was well deserved.

That idea entered into my book of software design philosophy: design like you’ll be working on the project for 10 years. Think of the responsibility that would mean. In 10 years, you’ll be paying for the short cuts and short sightedness. So don’t.

Well preparing for my talk on static analysis and refactoring for Eclipse Summit Europe next week (yeah a bit of a late start, it’ll be great, though), I finally have my own version of this story to tell.

6 years ago, my good colleague and friend, John and I started down the road of building a C++ parser for the CDT. My mentor at the time thought it was a crazy idea but we had a feeling that we could do it and we plowed ahead and actually got it to work. The parser allowed us to build a more accurate way of populating the Outline View (via the CModel). It then lead the way to indexing to allow for C/C++ Search and Open Declaration to work well. It was tough and we fought the performance battles for most of it, but we soldiered on.

Somewhere along the way we started dreaming of C/C++ refactoring a la JDT. Everyone thought that was a crazy idea (despite secretly wanting it too). With all the madness of the C preprocessor mucking with the source code before it gets to the parser, how could you properly create the TextEdits that the LTK (which the JDT guys generously pushed into a common plug-in, BTW), needed to do the refactoring?

Well John put in a lot of effort and forethought and created a way to map AST nodes to location objects which allowed you to unravel where all the text came from to create the node. It wasn’t perfect, but it was a start. And unfortunately due to the untimely end of our funding, we never got to finish it.

Well, I finally got a deep look at the work that Emanuel and is team at the HSR Hochschule für Technik Rapperswil have done on the CDT refactoring engine and early refactorings. Following it through the debugger, I hit it, IASTNodeLocation – that work that John had started years ago but never got to see in action for what it was intended for. It’s been fixed up by Emanuel and CDT Indexer Master Markus, but it was doing what we had dreamed about many years ago. Weird, but it actually brought a tear to my eye.

But it really does prove the point. Design as if you’ll be working on a project for 10 years. Even if you end up not being there, someone will be, and your work will live on, and it will be much appreciated.