13 December 2007

Not Invented Here Syndrome

This is something I definitely don't have. I'm a bit of a hoarder, a magpie maybe, collecting shiny things. When I encounter a seemingly useful piece of code on the Internet I would download it and dump it into my downloads directory. I've probably got gigabytes of the stuff.

I don't know what it is. I certainly feel that whatever I try to do someone must have at least tried it out before, so Google is my best friend in that respect.

You could say it is because C++ has so much not in the standard library that is available in frameworks like .NET and others. Maybe, but then that gives you choice and encourages you to think about the problem you are trying to solve and the best solution that you can come up with.

Fortunately loads of these tools and libraries are open-source so it is possible to help improve the baseline of thee libraries. Unfortunately you need to know where to look to find these as there is no central resource that can point you in the right direction to find the libraries that would be best for you. The closest I have found is the Free Game Development Libraries Page.

I think one of the skills I have picked up from being such a magpie is the ability to look at other people's code and to bend it to my own devices. Say for instance there is something useful, but not quite what I want on CodeProject, I'd refactor the code (way too much avoids encapsulation over there) and bring it in line with my own coding guidelines. I am then in a position to use and extend the code further.

Not Invented Here Syndrome I don't see as a good thing or at least a strict adherence to it is a weaknes. By reusing code you also have the possibility of giving something back as well to the potential "state of the art". Certainly not all code should be off-the-shelf and cookie cutter simplified implementations but it should provide the basis of what you are doing in order to avoid reinventing the wheel. I certainly see understanding someone else's code as an important skill in development.

STLPort Visual Studio 2005 Visualisers - autoexp.dat

Thanks to a comment on one of the posts about autoexp.dat and STLPort where I did a bit of a ham-fisted attempt at creating visualisers for STL containers in the Visual Studio 2005 debugger, I have been informed that there is a much better (and more comprehensive) version than my hack.

Now as part of the upcoming version 5.2 of STLPort there is a comprehensive and well written set of visualisers. This means debugging is now on parity with the in-built Microsoft containers. The version linked to in this post is for 5.2 but does work well with 5.1.

You can get the autoexp.dat edits here. It points to the Subversion repository head version. Since it will be part of the distribution it should be maintained and provides another excellent reason for using it (as well as the performance).

If anyone is using my hack then please use this version from the good people at STLPort - it is much better!

I suppose now it would be nice to have something similar for Boost...

07 December 2007

Multithreading - Make Me Parallel!

Sometimes even being multithreaded isn't even enough. Obviously running multiple processes simultaneously is great and all but it depends how heavyweight the processes are as you could be spending a lot of calculation time in a single process not giving much more than a responsive GUI during calculation (not making the most of the computing power). What you really want to do is divide those processes into their smallest components and parallelise those.

One of the tools freely available to C++ developers to accomplish these types of tasks is Threading Building Blocks which was open-sourced this year by Intel. In fact, I am pretty sure I mentioned this before, but I am nearly thirty so my brain ain't what it used to be. There are actually two parts to the library, a thread-safe set of allocators and the multithreading library including algorithms and thread-safe containers.

It is designed with the STL in mind (I suppose the developers would hope for an eventual inclusion into the standard library). It seems to be designed at a higher level semantically than a lot of other threading libraries and could help people to try it out much faster.

The most obvious place to try out some of the parallelisation is the "parallel_for" loop. It's interesting that speed optimisation can be tried out with a "grain size" as it is a trade off between the overhead of performing parallel operations and making use of the processor(s). It all works in a similar fashion to the normal STL algorithms and containers with some additional classes like "ranges" for the begin and end of your divided up operation. In fact it all seems so strangely easy to do, if you have to do calculations and construct new data, stick them in one of the thread-safe containers and you will be laughing. Admittedly if you do use "normal loops" in your code, you need to STL-ise them, but that is a fairly trivial operation to turn them into functors.

All in all though it looks quite good, and easy to use if you are parallelising simple loops. I am sure some programs will find substantial speed-ups and blow up a few CPUs with over-use from that. I could tell you a story that Intel tech support said we shouldn't run a Pentium III CPU at 100% use consistently back in the day...

03 December 2007

Cool Use For Virtualisation

Virtualisation is obviously the hot computing technology of the moment. We make good use of virtualisation where I work in order to really get around weird Windows limitations where it seems dislike multithreading.

The good thing now is VMWare Workstation is free so you can use images anywhere.

What impressed me though is that as part of the pursuit of X-Box Media Centre for Linux they have the entire development environment available as a VMWare image. That makes life so much easier for developers! It means you don't have to fiddle with your settings and deal with other potential conflicts.

It is just a great way to use the technology and lower the barriers for development and guarantee a consistent development environment. Obviously it is not the official way to do it but the fact it exists is pretty darn good.

13 November 2007

Visual Studio 2005 Intellisense Update

Ah, Intellisense, the bane of all C++ developers. I can't tell you how many times my Visual Studio has crawled into a hole and refused to get out or how many times the ncb has been corrupted by some arcane behaviour.

But rather than waiting for Visual Studio 2008 for some improvements the Visual Studio team have been good enough to release an interim patch. You can read about it here.

Hopefully this will make some developer's lives easier. You can download the patch from this link.

12 November 2007

Nerdwatch

The article du jour on the Internet for any self-respecting nerd is this one. It details the characteristics of computer nerds in a lighthearted and serious way. I guarantee you will see some of yourself in it as you are reading this blog and it is about development and programming (well, it tries to be).

I have a "Cave" but I rarely use it now after getting a Macbook Pro so I can be in the same room as my wife whilst using the computer. The article gets too many things right, although I hope I am more socially adjusted than the article suggests I should be ;)

The website Rands In Repose has plenty of good quality articles from management to interview techniques, so it is also worth going through his archive if that interests you.

11 November 2007

Official News On The MFC Update

http://www.blogger.com/img/gl.link.gifObviously I have been posting recently about the new native code and MFC updates that will be appearing in Visual Studio 2008. There is now some official news on the Visual C++ Team Blog.

You can see the posts here:
* Announcing a major MFC update plus TR1 support
* Channel 9: Pat Brenner – Overview of new MFC update
* Hola from Barcelona…and welcome to a major MFC update!
* Quick Tour Of New MFC Functionality

In the new year the native code improvements will be in beta and it will all be released in a service pack early next year. It'll be interesting to see what the code available will actually be like.

Anyway, now I'll be aiming for a change of subject...

09 November 2007

GUI Toolkits - MFC v9 - Visual Studio 2008 - Yet Another Update

Well, as it turns out the new features for MFC in Visual Studio 2008 are actually a license of the BCGSoft interface toolkits. I guess this might be similar to the deal with Dinkumware for the STL implementation that Microsoft license a version of and then bolt their own things into. Obviously it is not as good as having the actual implementation used by Microsoft in their modern products (Office 2007) but it is a start.

There is a thread on Codejock here explaining some of the history. I do agree with them that Codejock has looked better than BCGSoft when I evaluated them, but I suppose the tools that are free will always win out. Also it explains the lack of ribbon designer integration, although it is amazing MS don't have a pluggable back-end for the forms and ribbon designer.

08 November 2007

Developer Tools

This morning I went to the Joel On Software Fogbugz 6.0 talk that was hosted in Cambridge. It was an interesting presentation on the new features and capabilities of Fogbugz with some nice little anecdotes dropped in for good measure. Most of the time was spent on the new Evidence Based Scheduling feature which is quite nice and will help with estimation accuracy., taking some of the uncertainty away from that aspect of the development process.

Fogbugz makes a good thanks to the AJAX interface, although I won't say it looks awesome with the default skin. The AJAX features certainly makes the user interface have less friction for use and has some nice touches to minimise clicking and the such. It would probably make even more sense as one of the Adobe AIR type apps to make it integrate into the desktop or something along those lines with gadgets.

The thing that was lacking for me unless I am really weak with my Google searching is bug relationships. You can create links to other bugs and they are listed in the bug report, but in systems like Bugzilla you can have a rich relationship. This means you can create dependency graphs and define the types of relationships.

I'm afraid I would not recommend spending money on it for my situation. It is a tool that works best for developers and in the development situation, and not a company-wide tool (unfortunately, although it could theoretically work), but I am all for making developers lives easier. It is just I feel that if you have a technically adept development team then they will be capable of accomplishing the same goals with other tools. This is especially necessary as most development teams can never get financial approval for new or better tools (unfortunately it is still what I hear from most people since most developers have given up asking).

I suppose what I am getting round to saying is that if you are using Subversion or a supported version control system, you should try out Trac. The integration between source control, wiki (documents), issues, and more are excellent (and it looks good). It is a developer's tool though rather than a forward facing tool for customers, but it will improve the development team's workflow. It can do more or less everything Fogbugz can do with the default install plus the whole host of Trac Hacks. I've blogged about this tool before.

I must admit I am a big fan of Bugzilla because the bug reporting system is so rich and configurable. If it had the Subversion and plug-ins equivalent to Trac then it would be amazing. As things stand though Trac does work a treat, hell even open-source projects are using Trac to host their websites like OpenSceneGraph.

GUI Toolkits - MFC v9 - Visual Studio 2008 - An Update

I blogged a while back about the secret MFC features for VS2008 (MFC v9) here. The information was going to appear at Microsoft Technet Europe 2007in a talk by Ale Contenti.

Well, I think the talk must have now happened as there are a few posts out here on the Internet about it.

You can read one here and another translated here.

It amounts to lots of good stuff for native C++ developers on Windows:
* Docking windows
* Tabbed MDI
* Office 2007 theme
* Ribbon interface (no visual designer yet though)
* Lots of new controls
* Skins
* Vista specific enhancements
* And plenty more...

I actually can't wait to get my hands on this and have a play, unfortunately we do have to wait until next month for a release candidate as it will be an add-on. The interesting thing is the visual styles manager which will allow switching visual styles at runtime.

Apparently there will be a Channel 9 video soon that should appear here.

06 November 2007

C++0x

As the standard for the next version of C++ gets closer to being finalised, more details are emerging. In October was the Kona meeting for the C++ committee and you can read about it from Herb Sutter on this post.

Lots of good stuff has been voted in like nullptr, explicit conversion operators, atomic types, and a threading library. It's certainly a slow process but the improvements should all be pretty good, although not everyone is a fan of C++, but hey, I like it.

05 November 2007

wxWidgets 3.0 In The New Year

wxWidgets 3.0 will be released in 2008. You can read some details here.

Unfortunately (or fortunately depending on your viewpoint) this new major release will not be the radical rethink that has been mooted for the past couple of years. The major feature will be the full integration of unicode which would be the only build type (as there was also an ANSI configuration). This means that ANSI would get converted into unicode internally. This new version will also require minimal changes to existing code to get it to compile. I suppose people already working in unicode could potentially have no more upheaval than a point release.

This means all the plans which suggested the radical rethink for v3 have been moved under wxTNG on the wiki. Certainly noone ever agreed on direction for this and this does mean there will be no compatibility issues. Hopefully this means a gradual move to newer ideas rather than the complete redesign, which would be more likely to reap some results (eg, like improving the messaging framework would be one such thing). Another avenue I reckon which would make more sense is to use current wx as a backend for a more experimental API.

Anyway it certainly is an extremely comprehensive framework with a liberal license unlike some other options, also the Python bindings in wxPython are really very good.

Visual Studio 2008 - Out late November 2007

Microsoft have announced Visual Studio 2008 will be released at the end of November 2007. It was announced as part of Microsoft TechEd Europe in Spain.

A lot of the details about MFC and native development are still shrouded in mystery. Some of this I have outlined in a previous post. Hopefully in the next few days some more information will become public.

29 October 2007

Writing A Decent Library

When you are writing a shared library (DLL) you have to put a lot of thought into the public interface which your customer (another programmer) will be using.

What you have to work out is whether it is closed or open source, whether the binaries are supplied, and how you keep the user from having broken interfaces on different versions. All of this is from the point of view from a C++ programmer.

I think it is best to start with how not to write a closed-source library:
* Do not use templates.
* Do not have implementation half in the binary and half in the headers.
* Do not expose the innards of your program.

When creating a closed-source library you have to firewall the innards (which are probably commercially sensitive) from the interface. This would mean some use of the Pimpl Idiom.

You need to use solidly defined types like if you were binding to another language like Python. This means that the implementation can live in the binary and the interface is defined in your headers.

One of the problems it is easy to encounter is when STL is exposed in the library. The problem occurs when people use different implementations of the standard library which means you either need to maintain versions for that particular setup.

By making those two decisions you can massively simplify the maintenance and the headaches of people trying to implement it. You have to think carefully about the simplest interface for the developers who have to work out how to integrate it.

By not exposing the innards of the library you can also protect yourself from problems when the library loads/unloads because you can't have conflicting CRTs/libraries.

I suppose what I am suggesting is to have the most simple public interface and make sure that all implementation is hidden away. Almost only using a C interface for a library means you don't encounter the problems where you have to think about supplying a version for each version of the compiler your users have.

SPA Cambridge Talk - Windows Presentation Foundation (WPF)

The latest SPA Cambridge talk is coming on the 14th November, follow the link here to sign up. Here are the details:

Windows Presentation Foundation

Ian Griffiths Interact Software Limited

Synopsis

Windows Presentation Foundation (WPF) is a platform for building Windows desktop applications that can take full advantage of the graphical capabilities of modern PCs. Whereas many UI frameworks in the past have merely added yet another layer of abstraction on what was there before, WPF is radically different from its predecessors. This talk will discuss what possessed Microsoft to abandon the strategy of incremental tinkering that has served them well for over 20 years of Windows application development. WPF shifts away from many of the fundamental mechanisms that had been in place since the first version of Windows, and we will explore the new possibilities this creates.

Speaker Biography

Ian Griffiths is an independent WPF consultant, developer, speaker and Pluralsight instructor and a widely recognized expert on the subject. He lives in London but can often be found on various developer mailing lists and newsgroups, where a popular sport is to see who can get him to write the longest email in reply to the shortest possible question. Ian maintains a popular blog and is co-author of "Windows Forms in a Nutshell" and of "Mastering Visual Studio .NET".

25 October 2007

ACCU Cambridge Talk - Agile Development

Thursday 1st November is the next ACCU Cambridge talk. This month's one is about Agile Development:

So you want to do Agile software development? How, or where do you start?

In this talk Allan looks at the problem of changing your organization over to Agile software development. He gives some advice on how to go about introducing the ideas and which practice(s) to focus on first.


You can sign up through the ACCU website on this page. Once3 again it is hosted at DisplayLink on the top floor of Mount Pleasant House.

23 October 2007

Another Cambridge Talk - Joel Spolsky

As part of the FogBugz World Tour Joel Spolsky of Joel On Software will be doing a talk in Cambridge.

The main basis for it is to drum up interest for FogBugz v6.0 but it will involve some discussion of the software development process. You can sign up for the talk here.

20 October 2007

Static Code Analysis - PREFast

At work we use Gimpel PC-Lint to analyse our source code for defects that the compiler does not pick up. We use it on quite a strict level even after bolting it on to a legacy code-base. There are some tools to make your life a little easier when using it from Riverblade Software. Gimpel Lint is not a perfect tool for an IDE as it is commandline based and these types of checks should honestly be part of a good quality compiler as additional warning levels.

What I have found out though is that in Visual Studio Team System there is a static code analysis tool that isn't even available in the Professional version. It's internally called PREFast at Microsoft and apparently they use it to ensure code quality. Apparently in the Windows Driver Development Kit (WDK) it is available so it is possible to use that to do some code analysis. Check out this blog post for instructions. There are plenty of blog posts about it on the rest of Steve Dispensa's blog.

There is a small Microsoft Research Article available here about PREFast.

I've downloaded VS Team System to give it a go and to see how good it is. Or maybe I will try out the PSDK hack...

17 October 2007

Tools To Make A Developers Life Easier - Trac

Trac by Edgewall Software is at its most simplistic level an issue tracker that provides source control integration (mainly for Subversion). But it is much more than that, it also has a built-in wiki, source browser, and project management through the ticketing system.

It's a really decent tool for make developer's lives much easier and it looks nice too. As you start doing more with it you can really see the power in there. You can work out a roadmap/timeline from your tickets and also generate changelogs.

But all this isn'y new to the world out there, what I discovered today was Trac Hacks which is a repository of Trac add-ins and enhancements. There is a code review plug-in, a blog plug-in, and simply too many others to list.

So combine Subversion with Trac for a good experience, then add plug-ins to fill the holes in the development process.

16 October 2007

GUI Toolkits - Ultimate++

Ultimate++ is a GUI toolkit with its own IDE, GUI designer, build system, collections, and more. In the recent past it has improved its integration into the operating system with its Chameleon technology for native look and feel.

Unfortunately at the moment it is not 100% geared to be used as a library and you have to use the supplied IDE and development tools to use Ultimate++. Someone has been working on it though and maybe there will be a full released solution soon. If this does come to fruition it will be seriously interesting.

I had a quick read through the Ultimate++ forums recently and came across some interesting things that would make it a more desirable GUI toolkit to use.

First up you have an Office 2007 look skin. This won't be the full ribbon-based UI or anything but it should be interesting to see how it looks and maybe be extended.

Secondly there is the docking toolkit. This looks like a fairly comprehensive docking kit written very quickly. Some of teh examples even had the HUD style docking of Visual Studio. Also, if this does come to fruition this is a very important feature for people evaluating the system.

This toolkit will certainly be moving very fast in teh near future and if these features are suitably polished then it may look like a competitive toolkit to use.

15 October 2007

Build Systems

I was setting up the Visual Studio build system to target not only multiple build types but multiple platforms. This is the point I discovered hand editing the solution files is the only way to maintain consistency and accuracy of the builds. This is because the ue interface provided is antiquated, a struggle, and worst of all, unpredictable.

Build systems are really separated into two camps, text file based, or IDE based. The text file based ones give you the most control and flexibility, but in this day and age it is a real shame that they are the most useful. Also you may need an unknown macro language and will probably need to know every compiler setting that you want to set. The IDE based ones tend to require manual intervention in some undocumented or badly documented file format. This immediately negates any advantage you previously had.

I am amazed these parts of the IDE have been so neglected since without it you will not get predictable results. You want easy ways to compare different configurations or projects to see if they are out of step. There is also no way of batching changes to a set of projects (you can get some sort of batch changes with configurations although you are not really sure of what you are doing).

Maybe there is a better way? I don't know what else there is out there apart from premake systems (eg, CMake, Premake), script based build systems (eg, make, Boost.Build), and IDE based systems (Visual Studio et al). You almost want the equivalent of the Apple stye reimagining for debugging/profiling like XRay in the upcoming OS X Leopard.

One of the things I am dead proud of recently is the one touch build release kit from within the Visual Studio IDE. This means you just need to hit build and at the end you get an installer exe with no need for any jumping through hoops. It would be nice if you didn't need really work hard to get to that stage.

14 October 2007

C++ and 64-bits

When pursuing the development of a 64-bit native program you realise that everything is not what you thought it was. Somehow I had convinced myself of the wrong sizes for the built in types. This wasn't due to ignorance but due to the plethora of 64-bit implementations.

I'd somehow convinced myself the data model I was programming to was ILP64, but for Windows as it turns out uses LLP64. Normally you don't discover it until you get to the point your program collapses in a heap under heavy load.

Here are some relevant articles here, here, here, and here. The good thing is if you statically check your code with something like Lint pretty strictly a lot of the problems you would normally encounter don't exist.

For the data models have a look at this article. For some reason the table won't display correctly in my blog.

Complete Insanity In The World Of Computing

And now for something completely different...

I thought I would share some of the more insane things I have heard in the world of computing.

No Source Control

It's amazing to think that a company can get away without source control, let alone a company supplying closed-source library functionality. This meant that regressions happened at an alarming rate and a bugfix could result in previous bugfixes being undone. The "repository" was a copy of the source code on a server and developers would copy the files to their computer, edit them, and then copy the changed files back to the server.

C# Developers Must Be Expensive

To make it easier to maintain a product when it is written in C# but you have lots of Visual Basic developers, convert the product to VB... This was apparently done by taking the semi-colons off of the end of the lines then compiling to see where the errors are.

It seems to me that the process is completely insane and devoid of any merit. First you do not understand the code, this will adversely effect bugfixing. I am sure that the fallout from that kind of development will be felt for years.

Visual Sourcesafe Is Fine

It's easiest to witness the insanity of using Visual Sourcesafe from the sane world of proper revision control systems. Sourcesafe does not give any data integrity, can lose stuff, is impossible to script in any meaningful fashion, has a terrible architecture, and more...

I am talking about v6.0 and older here (I have no idea about the package that has inherited the name).

I see things like source control as integral to the development experience and productivity of your team.

The Phantom Build System

A developer on their own work computer has the only scripts that run the build kit. Once that person leaves noone can do it and there is nothing to reverse engineer from. It then takes perseverance and a small amount of brilliance to get to a working release installation kit.

EVERYTHING to build your program should be well documented and under source control as much as possible. It should be able to be run from any computer following the written instructions.

13 October 2007

SPA Cambridge Talk - Test Driven Development

After an extended summer break the SPA Cambridge talks are back. A change of venue to Anglia Ruskin University has now happened which is much better due to close vicinity to many pubs which was a problem with the Microsoft Research venue. Thee events are organised by Mark Dalgarno and you can read his blog here.

This month's talk was about Test Driven Development by Ivan Moore. It was an interactive session requiring a laptop and Eclipse. Unfortunately I discovered I must have the only copy of Eclipse in existence not set up for Java development (I have used it for Python and C/C++) a bit too late to rectify that.

The exercise was to solve a blocks world problem with test driven development. We used Java and JMock for this. I also got to show my Java ineptitude since I haven't used it for 7 years properly, so I was learning on the fly. To be honest now I go back to Java it is a lot more inelegant than I remember. At least after all that I managed to get the tests to pass...

The interactive sessions are a bit more fun when you are sharing a computer, especially when all three of us huddled around it have very little practical Java experience.

The next talk will be from Ian Griffiths about WPF (Windows Presentation Foundation) on the 14th November.

ACCU Cambridge Talk - Closing The Case For Groovy

Two weeks ago I attended the latest ACCU Cambridge meeting called Closing The Case For Groovy presented by Russel Winder. It was very kindly hosted by Displaylink again.

This talk was about dynamic languages concentrating mainly on Groovy. It is a dynamic language which is compiled into JVM bytecode meaning it can interact very nicely with Java. What was particularly refreshing about his talk was Russel not talking about language wars but how they can cooperate together. Overall the talk was entertaining and informative especially from the point of Closures which I really needed to learn about.

Obviously the pub visit afterwards was essential.

The next talk will be on Thursday 1st November by Allan Kelly. If you like technology and development and live in or around Cambridge then these talks are essential.

Virtualisation - An Understanding

It's amazing how many mistakes it is possible to make when attempting to understand a concept. Up until a couple of weeks ago I had some misconceptions about virtualisation. I've used it through VMWare and have viewed it as a way to have a virtual layer on top of your processor.

Then some concepts coalesced from various articles I was reading.

Virtualisation is the abstraction of resources away from their use. At the moment the most common use of virtualisation would be memory. You get a virtual address space from your operating system - this can be mad up of RAM, ROM, cache, hard drive, flash memory, and probably more. You don't know what you are accessing but the virtualisation of those resources and their access makes it easy to use.

One of the catalysts for my understanding was iD Software new iD Tech 5. There was mention of Megtexture which was texture virtualisation allowing the use of massive amounts of textures for the rendering. This would no doubt be a way of not needing to know about the basic building blocks of the textures, but to use them through a virtualised interface.

Then this comes to the processor virtualisation. My misconception was because of the examples I had seen from Parallels and VMWare. It allows you to run multiple computers on a single processor. But what processor virtualisation should do is abstract away the processor resources allowing the program to run. This would mean that you would not care about multiple cores or even computers, you could in their run one virtual machine which has a backend of a massive cluster of computers. I don't know if this is the case yet as when you do parallel processing you still nee to know too much about the parallelism in order to develop a solution but I imagine some solutions must be able to do it.

03 October 2007

GUI Toolkits - MFC v9 - Visual Studio 2008

This is a sad thing to get me excited but Microsoft seems to have been keeping something up its sleeve for Visual Studio 2008. Normally nothing is a surprise with Microsoft and I had assumed that we had seen all we would from VS2008 in the latest beta.

As it turns out they have a massive update for MFC dropping for Visual Studio 2008. It had been alluded to here and by Herb Sutter here. I assumed that we would have to wait for the version after VS2008 since the beta was largely the same as VS2005.

At Technet 2007 in Spain there is a talk:
Title/Code: TLA404 MFC Updates for Visual Studio 2008 and Beyond

Presenter: Ale Contenti

Abstract: This session will demonstrate the new features added to MFC in Visual Studio 2008, including support for Vista Common Dialogs, Vista Common Controls, the Microsoft Office 2007 Look and Feel (including support for an Office Ribbon style interface), Office and Visual Studio style Docking Toolbars and Tabbed Documents. We will also talk about our plans to evolve the MFC library for Visual C++ 10 and beyond. This is an in-depth session designed for experienced C++/MFC programmers. (C)


Do a search for the speaker here.

So it looks like the people using MFC will be getting some very powerful UI features as standard. I'm not so bothered about Vista standard controls but more powerful docking would be very nice and would go hand in hand with tabbed document interfaces. The most exciting part is the Office 2007 look 'n' feel along with the ribbon user interface (is it RibbonBar? I don't know...). I guess we will find out more in November but this is good news for people maintaining MFC systems.

01 October 2007

GUI Toolkits - Some thoughts

I mentioned a couple of posts back that I was going to put some thought into GUI subjects and maybe trying out writing a simple toolkit.

I was thinking abut which way to jump with trying to write a toolkit. First of all what should it be based on? Should it just wrap Win32? Cocoa? Should it be entirely implemented on top of OpenGL from scratch? Should it be cross-platform in design? Just these questions could cause anyone to run away screaming.

Thinking about building it on top of OpenGL I encountered a couple of interesting GUI libraries GLUI and GLOW. In these projects the windows are completely rendered by OpenGL which is an interesting approach. I suppose Juce is built from similar roots as well where it implements its own toolkits.

I was thinking about writing a nice C++ wrapper for Win32 but then I started to think even Microsoft products don't use the standard widget rendering. Then you start to think about built in custom drawn widget rendering, then you think why are you using standard widgets...

The whole idea about implementing a simple GUI toolkit is an education about the design decisions and pitfalls that you can get into. You also need to decide which subset you decide to implement first. The problem is most toolkits go for the same 10% and that is normally as far as they get.

The main idea I want to try out for an experimental GUI toolkit is some DSL (domain specific language). What I mean is embedding a language in C++ in order to implement the user interface in a readable fashion. It is certainly possible using modern C++ idioms as demonstrated in Boost. I suppose the type of thing I want to do is (in some kid of C++ like pseudo code):

dialog(...) +
widget("Number", sizeX, sizeY) | widget(RESIZE_X) ||
widget("Name", sizeX, sizeY) | widget(RESIZE_X) ||
widget("Blah", sizeX, sizeY, RESIZE_XY)
;
toolbar() +
button("image1", ...) |
button("image2", ...) |
separator() |
button("image3", ...) |
button("image4", ...)
;

Complete and utter insanity? Probably, but could be fun to try out. It would certainly be something different and would create a parallel in your source in comparison to what you would see on screen. I don't think anything quit like it has been tried before, so feel free to steal the idea - it would save me implementing it(!)

Enough rambling for today I think...

One Year Old

It's hard to believe this blog has been going for one year as of today. I can't believe I actually remembered this since I never managed to spot my 100th or 200th post.

It has been quite a year really. NC Graphics were taken over by PTC meaning I am now with a third employer working on the same codebase (in four separate stints).

Certainly the most popular items on the blog have been the TortoiseSVN and Visual Studio integration and recently the STLPort debugging in Visual Studio. Thanks to all the readers and all the comments.

I would promise something for the next year or some manifesto, but if it is as action packed as the previous year I somehow doubt I will live up to it. All I can promise is if I learn anything interesting about computers I will share it with the rest of the Internet.

Normal service will now resume.

27 September 2007

Useful Tools For VS2005

Visual Studio 2005 provides a very decent IDE to work with (if you overlook the crashing and disappearing into black holes). There hasn't been much focus on the native C++ side of the IDE for a while, which means it does lack some useful features.

One of those tools available for free on the internet is CodeWiz2 providing a number of very quick and simple additions to the IDE which makes coding a bit easier. Friend File lets you switch between header and implementation and Friend Member lets you switch between declaration and definition for a single function. I did have a script that did it, but this works much better (and will at least work on Vista as well since the Macro Explorer was broken last time I tried).

It is also scriptable in a manner of speaking meaning you can get common code structures or comments at the tap of a button. Oh yeah, did I mention it is free?

Another free tool available for Visual C++ is Refactor! which you will be surprised to hear offers refactoring for C++. Only the simplest functionality is available in the free version but it is quite interesting. I tend to refactor by hand myself, but one useful side-effect of this plug-in is when it highlights all instances of a variable which helps make the code a bit easier to navigate (and should really be a basic feature of the IDE).

26 September 2007

GUI Toolkits - The Forgotten Part Of My Blog

I have been doing this blog nearly a year now and certainly in 2007 I have neglected GUI coverage. The main problem is that there hasn't been a huge amount of impressive work on the open-source front and those libraries that showed the most promise are languishing in Sourceforge hell.

Maybe Winforms has caught on big-style? Maybe, but as far as I can tell when you get down to the OS level it still amounts to Win32 function calls, it is just the framework is built on top of that. Also, many more applications can now be run as web-based applications, with its own plethora of GUI toolkits.

Qt is obviously the leader but is only open-source for open-source applications unfortunately (and quite rightly as they do deserve to make money off it). wxWidgets is not making as massive strides as many would have hoped in order to have really good looking native Windows applications. The most recent substantial addition was wxAUI that added lots of good stuff like docking. None of the ideas floating around Boost got off the ground unfortunately, and Win32GUI Generics and Notus and many others are mothballed. Maybe there needs to be a "State Of The GUI Union" post...

I am thinking of doing a small GUI toolkit just to test out the theories and get a better appreciation of the difficulties involved in design and implementation. It would also mean I could play around with some of my memory allocation and multithreading ideas as part of it. I've been trying to pull together as much information about Win32 as posible and I'll definitely put them all together in one article.

ACCU Cambridge Talk - October

It's hard to believe it is nearly October. The bad part is getting older, the better part though is that the ACCU talk is coming up. See the website here.

This month is about dynamic languages and is called "Closing the Case for Groovy (and Ruby, and Python)" by Russel Winder. And apparently there will be a related book that may or may not be out in time for it.

Hopefully the week after will have the first BCS SPA Cambridge meeting since the summer as well.

11 September 2007

ACCU Cambridge Talk - The Missing Link

This month's ACCU Cambridge "The Missing Link" talk was held at the DisplayLink offices on the 6th of September. Presenting the talk was Peter Smith who is part of the linker team at ARM.

The Missing Link talk was about the role of the linker in software development. The talk detailed the history, the design of, and the use of linkers. The talk was about an hour long but could easily have gone on longer. Certainly from the tak I got the impression that the linker is a rather unloved part of the compilation process. In fact there is really only one book about linkers called "Linkers and Loaders" which is available online from this link.

The talk itself was entertaining and was at a suitably high level for everyone to understand. The actual architecture of compilation and linking really has not changed to much throughout its history. Some of the more interesting parts of the talk were the discussions about name mangling and the reasoning behind it, and the caveats that need to be implemented to get around things like templates in C++.

I think there is a plan for the slides to be available online via the ACCU website.

As always though after the event you can learn lots more by going to the pub. A good turnout for the pub was the icing on the cake.

The next talk will be about dynamic languages and will be held on the 4th October. Keep an eye on the .

10 September 2007

EASTL And Allocators

A few months back a document appeared on the Internet about EASTL. It details alterations to the STL that Electronic Arts implemented (as well as their own version of the STL) to meet its requirements for standard containers and algorithms. It has been published on the C++ standardisation website as a reference paper.

Some of the ideas in it are very interesting and some are a little naive and lack generality, but the document itself is thoroughly worth it. The main thrust of the document is efficiency in terms of memory and speed. This amounts to better allocators, better control of low-level memory (alignment and so on) and intrusive type containers.

It covers the deficiencies of std::allocator for EA's requirements like the copy semantics and the lack of alignment controls. It has got me thinking there is a lack of a generic allocator framework that makes it easier for writing pluggable allocators that could be thread local, or global, or thread-safe, or instance-based. But I'll come back to that later.

vector bool is not a bit-based array but there is an implementation of a bitvector that gives the same behaviour. That makes sense to me!

The ability to resize a containers capacity to a smaller size and for the storage to respect that as most STL implementations do not do this. Means memory can be returned back to the system.

Apparently the implementation is easy to debug through a simple debugger with no overhead. I don't know whether that is the case in reality but it certainly has its appeal, but I'm sure it would make plenty of sense in open-source implementations meaning there would be more people able to contribute.

Apparently some compilers struggle with inlining so the implementation reduces code complexity to allow less able compilers to inline more.

A lot of the motivation behind this is cross-platform in nature and part of that is that the platforms can be limited in memory and processing power. Some of the ideas brought up are possible in the current STL framework with some minor jumping through hoops, fortunately EA expended the manpower on implementing exactly what they want.

Now back to the allocators... The ideas make a lot of sense in this document and I wonder how many are available to coders from the current STL framework. One thing that requires clarity is what the alignment needs in order to align, by this I mean is it easily determined from the type you are using or is it a combination of that and the machine type. If so some of the work could be done via type traits like those available through Boost.

A lot of the allocator type suggestions do not even have an easy to use reference implementation in the open-source world. Allocators are so important but there is a lack of availability of those apart from simple HOWTOs for writing allocators.

This has got me thinking about actually writing some. Coming up with a good framework has lead me to reading big stacks of articles online about allocators, and I think there is a good way forward but 'll leave that to another post.

And there is some additional discussion on the Ogre forums here and here.

04 September 2007

Upcoming Computing Talks In Cambridge

There are a couple of talks coming up in Cambridge in the next couple of weeks. We're lucky here in Cambridge that there is anything like this to go to as I can't find many instances of this throughout the country.

First up we have ACCU a group striving for professionalism in programming (and there is a fair amount of emphasis on C++). They have journals released regularly throughout the year which makes membership pretty worthwhile (also membership gives you access to the entire archive online).

7:00pm Thursday 6th September 2007 - Peter Smith: The Missing Link, the role of a linker within a software development. You can sign up to the talk at this link.

Next up is the BCS SPA are going to start there monthly talk programme again after a summer break. At the moment the talk next week is not known but you can keep an eye out here.

Interestingly there will be a talk from Ian Griffiths about WPF (Windows Presentation Foundation) on the 14th November. He is one of the architects behind the whole new graphics interface in Vista.

30 August 2007

Visual Studio 2005 autoexp.dat for STLPort debugging

From the contents of my previous post I have created an autoexp.dat for download (Visual Studio 2005 only). You can get it here.

Simply copy the extracted file into C:\Program Files\Microsoft Visual Studio 8\Common7\Packages\Debugger

Visual Studio 2008 will work if you follow the instructions in my previous post but the autoexp.dat is a bit different between versions.

Debugging STLPort in Visual Studio - autoexp.dat

We use STLPort for our C++ standard library as it is substantially faster than the one supplied with Visual Studio 2005. I have expended quite a lot of energy trying to get the Microsoft STL to speed up more, with custom allocators and the suchlike. The reason I pursued it was to make debugging easier as there was no way (by default) to look inside the containers in a structured fashion.

Then I realised I was approaching the problem from the wrong angle. Perhaps Visual Studio allows us to customise the debugging visualisations, and that means using STLPort with all the debugging benefits of the in-built system. This was where I discovered the autoexp.dat which is more or less undocumented by Microsoft. The system allows you to create custom visualisers for any datatype in the debugger. Unfortunately it requires arcane rituals to make it work and I believe the format may have changed for VS2005.

Anyway on to the meat of this post! I will post here the code you need to visualise map, vector, set, and list in Visual Studio 2005. First go and open C:\Program Files\Microsoft Visual Studio 8\Common7\Packages\Debugger\autoexp.dat in a text editor. Locate the line featuring the text PROPVARIANT. Just above that line add the following:

;------------------------------------------------------------------------------
; STLPORT visualisers
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------

; stlp_std::vector
;------------------------------------------------------------------------------
stlp_std::vector<*>{
children
(
#array
(
expr : ($c._M_start)[$i],

size : $c._M_finish-$c._M_start
)
)

preview
(
#(
"[",
$e._M_finish - $e._M_start ,
"](",


#array
(
expr : ($c._M_start)[$i],
size : $c._M_finish-$c._M_start
),
")"
)

)
}

;------------------------------------------------------------------------------
; stlp_std::list
;------------------------------------------------------------------------------
stlp_std::list<*,*>{

children
(
#list
(
head : $c._M_node._M_data._M_next,
skip : &($c._M_node._M_data),
next : _M_next
) : #( *($T1 *)(sizeof(stlp_std::priv::_List_node_base)+((char*)&($e))) )

)

preview
(
#(
"(",
#list
(
head : $c._M_node._M_data._M_next,
skip : &($c._M_node._M_data),
next : _M_next
) : *($T1 *)(sizeof(stlp_std::priv::_List_node_base)+((char*)&($e))),

")"
)
)
}

;------------------------------------------------------------------------------
; stlp_std::set
;------------------------------------------------------------------------------

stlp_std::set<*> {
children
(
#tree
(
head : $c._M_t._M_header._M_data._M_parent,
skip : $c._M_t._M_header._M_data,
left : _M_left,
right : _M_right,
size : $c._M_t._M_node_count

) : ((_Node*)(&$e))->_M_value_field
)
}

;------------------------------------------------------------------------------
; stlp_std::map
;------------------------------------------------------------------------------

stlp_std::map<*,*,*,*> {
children
(
#(
[map]: [$c,!],

#tree
(
head : $c._M_t._M_header._M_data._M_parent,
left : _M_left,
right : _M_right,
skip : $c._M_t._M_header._M_data

) : *(stlp_std::pair<$T1,$T2>*)(((char*)(&((*((stlp_std::priv::_Rb_tree_node<$T1>*)(&$e)))._M_value_field))))
)
)
}


I am pretty sure I need to do some more tweaking to get it working even better. The map implementation is certainly the best part as it displays the list of items as pairs of (key, value) which is really useful. Some of the code for this was pilfered from the comments of this article - thanks to those people who blazed the initial trail.

25 August 2007

Lots of source code - GUIs and MFC

It has been difficult to find the time to blog recently, but this news is really interesting. One of the MFC extension toolkits Ultimate Toolbox has decided to give away its product for free on the CodeProject.

It provides MFC extensions for more modern looking MFC applications like the Office 2003 theme and spiffing looking menus and tabbed interfaces. The CodeProject now gives full access to the source code and all the articles are very useful for explaining how to use it. This isn't only the Toolbox (MFC classes) but also the Ultimate Grid (spreadsheet type interface) and Ultimate TCP/IP (networking).

The source code is out there now hoping the community can take it on and then develop it further. Unfortunately there are none of the cutting edge features like Vista support or ribbons but I bet the framework makes it much easier to develop than pure MFC.

Check out the links here:


Ultimate Toolbox Home Page - The Ultimate Toolbox
Ultimate Toolbox is now Open Source

Ultimate TCP-IP Message Mapper Demo - The Ultimate Toolbox
Ultimate TCP-IP Message and Encoding classes allow for Unicode representation of multiple character sets

Ultimate Toolbox URL Class - The Ultimate Toolbox
A simple URL/UNC composition class from the Ultimate Toolbox

Ultimate Toolbox COXToolTipCtrl Class - The Ultimate Toolbox
An extended tooltip control from the Ultimate Toolbox

Ultimate TCP-IP Design Page - The Ultimate Toolbox
The Ultimate Toolbox makes it easy to configure and customize a taskbar icon for your application

Ultimate Toolbox System Information Class - The Ultimate Toolbox
The Ultimate Toolbox provides a system info class that can query various aspects of machine and network settings

Ultimate Toolbox Static Text Control - The Ultimate Toolbox
A customizable CStatic derived class from the Ultimate Toolbox

Ultimate Toolbox Static Hyperlink - The Ultimate Toolbox
A subclassed CStatic control from the Ultimate Toolbox that provides hyperlink capabilities

Ultimate Toolbox Sound Manager - The Ultimate Toolbox
Classes from the Ultimate toolbox that allow configuring customized dialog item sound effects

Ultimate Toolbox Resource File - The Ultimate Toolbox
A class for enumerating and parsing file based resources from the Ultimate Toolbox

Ultimate Toolbox Physical Unit Edit Controls - The Ultimate Toolbox
The Ultimate Toolbox contains several predefined CEdit derived controls for physical unit input and conversion

Ultimate Toolbox Option Tree Control - The Ultimate Toolbox
An IE style option tree control from the Ultimate Toolbox

Ultimate Toolbox Net Browse Tree Control - The Ultimate Toolbox
A network browse tree control from the Ultimate Toolbox

Ultimate Toolbox Multi Combobox - The Ultimate Toolbox
A flexible multi-column combobox control from the Ultimate Toolbox

Ultimate Toolbox Masked Edit - The Ultimate Toolbox
The Ultimate Toolbox provides a generic masked edit control for validated input.

Ultimate Toolbox Layout Manager - The Ultimate Toolbox
The Ultimate Toolbox provides a Layout Manager that can be configured to manage control placement on resizing of forms and dialogs

Ultimate Toolbox HyperBar - The Ultimate Toolbox
The COXHyperBar control is an MFC control which will give the floating toolbar look seen in the Microsoft Expression 'Hyperbar' sample

Ultimate Toolbox Utility Classes - The Ultimate Toolbox
The Ultimate Toolbox Utility classes deal with Memory, Clipboard, Parsing, etc.

Ultimate Toolbox Shell Related Classes - The Ultimate Toolbox
The Ultimate Toolbox classes for Shell Namespace navigation, an Application Bar, and more

Ultimate Toolbox MAPI OLE Classes - The Ultimate Toolbox
Ultimate Toolbox classes for dealing with the Messaging framework and Addressbook APIs.

Ultimate Toolbox Intellimouse Classes - The Ultimate Toolbox
The Ultimate Toolbox Intellimouse classes make it easy to add advanced scrolling capabilities to your application.

Ultimate Toolbox Graphical User Interface Classes - The Ultimate Toolbox
The Ultimate Toolbox GUI classes offer a wide range of MFC control extensions.

Ultimate Toolbox Graphics Classes - The Ultimate Toolbox
Ultimate Toolbox classes that help with DIBs, MetaFiles, and more.

Ultimate Toolbox Graphic Format Classes - The Ultimate Toolbox
The Ultimate Toolbox contains classes for dealing with Bitmap and JPEG files.

Ultimate Toolbox File Management - The Ultimate Toolbox
Ultimate Toolbox classes that deal with Binary Difference, Search and Replace, Compression, and more.

Ultimate Toolbox Database Classes - The Ultimate Toolbox
Ultimate Toolbox Database classes include DAO and CSV file classes.

Ultimate Toolbox Communication Classes - The Ultimate Toolbox
The Ultimate Toolbox provides additional classes to help with serial and socket communication.

Ultimate Toolbox Font Pickers - The Ultimate Toolbox
Two convenient font selection controls from the Ultimate Toolbox for MFC

Ultimate Toolbox File Watcher - The Ultimate Toolbox
An easy to use file watcher from the Ultimate Toolbox

Ultimate Toolbox Extended Listbox - The Ultimate Toolbox
The Ultimate Toolbox provides an extensible COXListBox CListBox derived class that can be easily customized

Ultimate Toolbox Edit Control Extensions - The Ultimate Toolbox
The Ultimate Toolbox fetures a number of edit control extensions, some of which are described here


Ultimate Toolbox Date Time Picker Control - The Ultimate Toolbox
COXDateTimeCtrl provides a handy and flexible method of Date/Time entry and display.

Ultimate Toolbox Application Customization - The Ultimate Toolbox
Ultimate Toolbox provides a set of classes to allow for application state management and customization.

Ultimate Toolbox Color Picker - The Ultimate Toolbox
An easy to use Color Picker button included with the Ultimate Toolbox

Ultimate Toolbox Application Skins - The Ultimate Toolbox
The Ultimate Toolbox supports Office XP, Office 2003, and Classic application skins

Ultimate Toolbox 3D Tab Views - The Ultimate Toolbox
COX3DTabViewContainer can be used to provide tabbed window support to document views and control bars

Ultimate Grid Beginner's Guide - The Ultimate Toolbox
Getting started with the Ultimate Grid

Ultimate Grid Edit Functionality - The Ultimate Toolbox
The Ultimate Grid provides for built-in edit notifications as well as customizable edit functionality

Ultimate Grid Datasources - The Ultimate Toolbox
An introduction to using custom datasources with the Ultimate Grid

Ultimate Grid Cell Types - The Ultimate Toolbox
An introduction to using built-in and custom cell types with the Ultimate Grid

Ultimate Grid Home Page - The Ultimate Toolbox
The Ultimate Grid is now Open Source

Ultimate TCP-IP Home Page - The Ultimate Toolbox
Ultimate TCP-IP is now Open Source


Edit : Okay, all the links should work now...

09 August 2007

GUI Toolkits: Qt and Eclipse

There is now a Qt integration into Eclipse provided by the good folks at Trolltech.

You can check out the press release here.

There is a sneak peak article here and you can download it here. The best thing about it is certainly the integrated form editor.

There is a little run-through/review type thing here and even more info here.

Unfortunately I don't think I will ever get to use it in a commercial environment due to the cost, but it could be good to try out for cross-platform development.

Eclipse CDT For Windows - Wascana

Wascana is the name of the CDT for Windows project run by the excellent Doug Schaefer. It provides an installer with Eclipse, the compiler and loads of exras. The plan is to create a really good Windows desktop IDE.

Keep an eye on it over the next few weeks as it should be updating to GCC 4.2.1 and some form of wxWidgets support.

Certainly if it all comes together there is a powerful argument to use it instead of Visual Studio.

MinGW GCC 4.2 released

Well, it's not a full release, but a beta type release. MinGW has released GCC 4.2 on Windows is now available.

The first proper version 4 release will be 4.3 when it is released. This is because Windows will become a properly supported platform as historically MinGW have done loads of work making it work on Windows.

The jump from 3.4 to the version 4 codebase will provide massive improvements including OpenMP for multithreading, better and more powerful optimisations and better language support.

02 August 2007

More LLVM and Clang

Check out the Google Talk and slides about LLVM and Clang here.

C++ - Boostcon

Back in May Boostcon took placein May this year. I have posted previously about some of the already available talk slides (see the Adobe ones here). See my previous post here.

There are a couple of new articles here and here that make interesting reading. Also an attendee has some write ups here. Some more slides are also available. More write-ups here.

Fingers crossed one day I'll be able to attend something as interesting as this.

30 July 2007

TortoiseSVN and Visual Studio Integration - Visual Studio 2008

Finally, I am getting around to an update to the TortoiseSVN Visual Studio Integration. The catalyst for this is the release of Visual Studio 2008 (formally codename Orcas) Beta 2, and making sure I can still play with Subversion through the IDE.

I have made a new distribution ZIP file with a few more configurations inside.

Download it here.

It has a few more features than before including some for dealing with conflicts. The distribution itself has a few more files so you can decide whether you want to just have the menus, toolbars or context menus.



Supported operations

The following Subversion/TortoiseSVN features are covered in the integration:
  • Commit - Commit the files to the repository
  • Update - Update the current working version
  • History - Get the history for the selected file
  • Diff - Get the diff compared to the base version
  • Blame - Find out who committed the crimes in the file
  • Revert - Undo changes
  • Modifications - Check to see if any files have been modified
  • Edit Conflicts - Edit the conflicts that arise from merging/updating
  • Resolve - Mark the file as resolved for conflicts
  • Repository - View the repository on the server
  • Project History - Get the history of the entire project
  • Add Solution - Add the solution being edited to source control
  • Branch/Tag - Perform a branch or tag operation on the current working copy
  • Settings - Set up TortoiseSVN
SubversionInstall.vbs

This simply installs a set of External Tools into Visual Studio for common TortoiseSVN operations. It can be installed on versions above Visual Studio.NET (version 7.0). Currently it is configured for Visual Studio 2008 (version 9.0), to make it work on other versions change the variable "strVisualStudioVersionNumber" as outlined in the file's comments.

Also, if you have installed TortoiseSVN in a non-default location, make sure that you change the variable "strTortoiseSVNBin" to the correct binary path. Make sure that the backslashes are doubled up.

SubversionMenu.vssettings

This is a settings file for Visual Studio 2008.

This adds a menu to the IDE for TortoiseSVN with the appropriate icons.

SubversionMenuToolbar.vssettings

This is a settings file for Visual Studio 2008.

This adds a menu for TortoiseSVN as well as a toolbar using the appropriate icons.

SubversionMenuToolbarContexts.vssettings

This is a settings file for Visual Studio 2008.

This adds not only the menu and toolbar, but also adds the items to the appropriate context menus for files and solutions.

SubversionMenuToolbarContextsVS2005.vssettings

This provides the menu, toolbar and context menus for TortoiseSVN in Visual Studio 2005.

Unfortunately there is no good solution for file renaming (I always do it through Windows Explorer) since this integration uses the External tools and allows for it to work in Visual Studio Express.

25 July 2007

C Front-End For LLVM Open-Sourced

I covered LLVM briefly earlier. I did mention Apple were working on a new C front-end called Clang.

Now the C front-end has been open-sourced there is a small website for CFE/Clang here.

There is a post about it here. This is a good step in open-source tools, and hopefully will spur other tool developments on.

Intel Open-Sources Threading Bulding Blocks

Intel has just open-sourced their Threading Building Blocks library. Intel describe it as a "rich and complete approach to expressing parallelism in a C++ program".

With multi-threading in general being so immature when looking at other libraries, another solution can never hurt. So add it to Boost.Threads, OpenMP, wxThread and the myriad of others. Admittedly the way that all of the alternatives work is very low-level and means very careful design is required.

I'm interested to see the approach of the library to multi-threading as it looks quite complicated to wrap your head around. The best bit though is there is apparently a cache aligned memory allocator as part of it that can be used independently.

There is a Slashdot article about it here. Also a bog post here looks interesting covering the subject.

All I can say is let battle commence and lets see what multi-threading packages are left standing ;)

18 July 2007

Some Good Bazaar Reading

Some good articles about Bazaar can be read here:
* Part 1 - Version Control : The Future Is Adaptive
* Part 2 - It Takes A Community To Raise Great Software
* Part 3 - Wanted : Rock Solid Version Control
* Part 4 - Version Control: Plug-ins Versus Toolkits

The blogger Ian Clatworthy does work on Bazaar so it obviously has a slant that way, but he makes good points and knows what he is on about. Or maybe I am biased now after being pleasantly surprised by Bazaar...

Life Without Internet

Argh! The web has been down at work for over 24 hours. I now realise it is 100% essential for my job. Google has replaced a certain portion of my brain.... I can't answer any questions without it (okay, a slight exaggeration).

One tool I have now found indispensable now is del.icio.us. Up until recently I have used the Google Browser Sync for using my bookmarks at multiple locations. The problem I found is I am very selective about what I bookmark as current bookmarking UIs available in IE and FireFox do not scale very well. Then I get in the situation I haven' bookmarked something and I spend ages on Google tryin to find it again.

I decided to move to del.ico.us as there was a new tool for Firefox which replaces the bookmarking system in Firefox, so now I use it exclusively tagging webpages at will. Obviously the number of bookmarks I have is increasing rapidly especially since I can even tag individual articles.

As you can see on the sidebar you can see what I am currently bookmarking and what I have bookmarked. I have also added the ability to bookmark individual articles quickly if you want. I tend to find most web technologies a bit hollow (MySpace Facebook and the suchlike) but this is a tool that reallyhelps make the web a better place, and all users of the system are sharing what they know with their bookmarks.

17 July 2007

Great Free Software - MacPorts

Since getting my Macbook Pro one of the most useful pieces of software I have installed is MacPorts. It is a port package for OS X which used to be called DarwinPorts, this is package management much like Linux tends to provide. This makes it easy http://www.blogger.com/img/gl.link.gifto get updates and manage the software installed.

At the moment it has over 4000 pieces of software available. It is ultimately how I am running Python, wxPython, Bazaar and Mercurial.

MacPorts has just released version 1.5. You can see the changelog here.

What makes it particularly nice to use is the excellent Cocoa interface for it called Porticus. It makes it all simple and intuitive and wraps up all the major features.

16 July 2007

Bazaar and Visual Studio Integration

The Bazaar distributed source control system has some Google Summer Of Code Projects. One of which is the Visual Studio integration and recently there has been a status update on the mailing list talking about progress - read it here.

I think the distributed source control system that catches on will probably be the one which manages to get together the best external tools and UI. Bazaar seems to have a few projects that are actively developed that could deal with that and make it quite a contender.

Part of the development for this project though is wrapping the API in a Microsoft embeddable way. An interesting approach but I can think of a few other routes.

Distributed Revision Control And APIs

One of the reasons blogging has been quiet the past week or so is I've been fiddling about with some coding.

I've been trying out wxPython and using it as an interface to a distributed source control system. It's purely experimental, but it did show me some deficiencies and strengths in some of the ones available.

Here is what I learnt though... wxPython is a great way of hacking together a coherent UI fast, I am still relatively inexperienced in Python and wxPython but the resources out there on the Internet are very useful.

As for the source control systems... First I tried out Mercurial, but I am really struggling with the API and trying to write extensions. This is mainly due to the lack of documentation, and a lot of current tools like Qct simply parse the commandline. I did work out some of the parts of the API to wrap, but I found it hard going with limited Python knowledge and a lack of comments.

The other system I tried was Bazaar which I found a very different experience. The API is excellently documented and the plug-in API is excellent. Admittedly the criticism levelled at this source contrl system is the speed, but it gets so much right. It is built on a solid foundation of correctness and the barrier for entry is lowered thanks to the excellent documentation. I managed o get a working status dialog up and running in a very short period of time (although admittedly I got sidetracked afterwards fiddling around with wxPython).

One of the reasons I was using wxPython is that it looks native on my Macbook Pro as a lot of the available UIs are GTK based meaning they look pretty bad on OS X. Also I wanted to try it out on Windows which meant it looked pretty good on that platform as well.

Hopefully I can find the time to tidy some of this code up into a reusable form and actually see something like at least the status and commit dialogs through to completion.

06 July 2007

Distributed Revision Control Redux

Leading on from my previous posts here and here I have been doing a lot of research into the distributed revision control arena.

Admittedly I have got fixated on three, Git, Mercurial and Bazaar. All three projects are about the same age, but each have their own strengths and weaknesses.

Briefly to sum them up Git is fast, it has a large developer community behind it and seems to be developing at breakneck speed. The disadvantages are mainly due to the reliance on the POSIX systems which means cross-platform (well, Windows) support is weak. I know there are some initiatives to get it working on Windows but I can see it losing steam as there is not enough interest in it due to the POSIX platform supports being so strong. Also, Git is a bit more obscure than the others due to being a bit more low-level with plug-ins adding the ease of use.

Mercurial is written is Python and is easily cross-platform It is much simpler than the aforementioned Git to use and is close to it in speed and storage. The disadvantages which I must admit are not many are that the community is not as fast moving as Git, but new versions are very regular. I do see this as a better prospect than Git as it is better designed whereas as better design is being retroactively added to Git.

Bazaar (Bazaar NG to give it its full name) is sponsored by Canonical, the company running Ubuntu. Mark Shuttleworth has blogged about Bazaar recently which I mentioned in a previous post. Bazaar is also written in Python and is cross-platform with a nice Windows installer for those people scared of installing Python. It is very well designed with comprehensive renaming and merge support. The main disadvantage is that it is not as fast as Mercurial or Git. To be honest I am taking a liking to this system and have been investigating it quite deeply (but that is for another post).

These three young projects are really progressing fast though and they are already good enough to use providing you are not too tied to your current extras from more mature systems (like TortoiseSVN).

02 July 2007

Eclipse CDT For Windows

The Eclipse IDE (which is cross-platform and designed to have plug-ins written for) has a good C++ module called CDT (C/C++ Development Toolkit).

Recently version 4.0 was released in tandem with the Europa release of Eclipse. It has been massively improved and gives much better Windows support.

Now the lead developer of CDT, Doug Schaefer, has started a new project called CDT For Windows which aims to make it obscenely simple to install and run Eclipse+CDT on Windows. Check out his post announcing this here. This is a great step forward and I hope this works out well.

01 July 2007

LLVM - Low-Level Virtual Machine

Recently there has been a lot of development on the Low-Level Virtual Machine (LLVM). It provides a back-end for compilers to allow for optimisation for the entire lifetime of the program.

The GLSL in Mesa has been implemented using LLVM. You can read a little about it here. The OpenGL implementation in Mac OSX Leopard will be implemented using LLVM.

There is an interesting article here about the speed of LLVM. It is surprising how close it gets in speed as things currently stand to GCC.

Recently there was a development meeting for LLVM in May and the presentations are available here. Of particular interest is the presentation by Apple about a new C front-end for LLVM called Clang with plans to support Objective C and C++. You can read the slides here and see the presentation here. The new frontend is called Clang and probably won't be production ready for a while but it is interesting to see where compiler technologies are heading.

The most interesting area of LLVM is definitely the whole program optimisation potential of it. Anyone who has seen the performance gains from using it knows this is good thing.

29 June 2007

GPLv3 Released

GPL v3 has been released today. You can go and read it here. There is also the FAQ here. I'm looking forward to seeing its adoption.

In completely unrelated news Prince is going to give his new CD away for free with the Sunday Mail (linked to his upcoming 21 Days tour). I'm a big fan so I will definitely be checking out the new CD. Unfortunately the music industry is not so happy and are planning to drop him from record stores(!) The music industry is proving itself completely mad once more.

28 June 2007

Programming Articles

A couple of interesting articles about programming:
* What kind of development do you participate in?
* Top Ten Programming Advice Not To Follow.

All this makes me realise I haven't done any top tens - I'll have to rectify that as I feel left out.

Next up I am planning some a post about Bazaar.

26 June 2007

C++0x Google Presentation

Here is an interesting video from the Google Talks series which details some of the new features in C++0x.

Distributed Revision Control - Mercurial

Mercurial (hg) is one of the distributed revision control systems I looked at in a previous post. I've been looking more closely at these shttp://www.blogger.com/img/gl.link.gifystems and thinking about how they fit in to the different development methods (closed and open source don't normally need the same process).

Interestingly there is a talk at Google from last year by one of the main developers Bryan O'Sullivan on Google Video:



Version 0.9.4 of Mercurial was released today adding a fair amount of bugfixes and new functionality. It is a very interesting system as it is implemented in Python, is very efficient and is one of the best for cross platform support out of the distributed revision control systems (with an extension adding the support for Windows file endings).

The commandline syntax is simple and easy to use. It has a wide variety of additional tools and extensions. Although these are not as mature or in-depth as other systems (like Subversion/CVS/and so on) they are providing a good basis. Quite a few large projects are using Mercurial in production like Mozilla, OpenSolaris, Xine, and Xen.

There is a great book about using Mercurial here. It covers many of the concepts and simply how to use it. The wiki based website and the mailing lists are also great sources of information.

There seems to be lots of GUI tools but none providing full workflow support yet, but hopefully this will happen with time.

22 June 2007

The Tortoises Are Coming

Before I start I just want to say thanks to all the people leaving comments. This post actually comes out of what Frabcus has left in the comments about distributed revision control.

I've been having a serious look into all the distributed revision control systems out there (well, the free ones at least) not only to understand the concepts of them but to see how easy they would be to use since they tend to lack the UI tools.

Interestingly Mark Shuttleworth, Ubuntu founder has been discussing distributed revision control on his blog. There are four posts here, here, here and here.

But now to the subject of this post, the Tortoises. First there was TortoiseCVS which interestingly was started by an ex-NC Graphics employee Francis Irving. Then there is obviously TortoiseSVN.

So for these new distributed systems it looks like they are racing for Tortoise type implementations of user interfaces on Windows which would help to attract Windows developers.

There is TortoiseDarcs for Darcs. This is the most complete implementation for the distributed systems so far. There are some good screenshots on the TortoiseDarcs website.

For Bazaar (run by Canonical of Ubuntu fame and what Mark Shuttleworth was talking about on his blog) there is TortoiseBzr. It is using TortoiseCVS as a base to expand from. There is also a placeholder on the wiki for Visual Studio integration.

For Mercurial there was an announcement on their mailing list that someone has started on Tortoise-hg and they ave a small set of functionality. It hasn't been publicly released yet, but hopefully soon.

There is no TortoiseGit being looked at, but I think the Windows support requires work before that step is taken I suppose.