If Skynet Were To Happen Tomorrow - It Would Run On ARM

The Most Important IT Hardware Headquarters In The World

ARM Headquarters - Cambridge UK
Wikicommons: http://en.wikipedia.org/wiki/ARM_Holdings#mediaviewer/File:Cambridge_ARM_building_panorama.jpg
According to the latest punditry tablets will outsell PCs in 2015. Seriously though - smart phones are already more used and more powerful than PCs were only a few years ago. When you add the two together (after all, tablets are just big smartphones) then PCs are looking a small player in the user end of the IT market. Macs and Linux machines don't make much difference to the figures. Basically, phone/tablets (let's call them phablets) are taking over the world.

They run on ARM

Whilst AMD and Intel slog it out at the server side, they have precious little traction in the phablet market - only a few percent. Nothing is going to change this because... why should it? Intel is all about the x86 and x86_64 architecture as is AMD. This architecture is hopelessly bad at low power. Lots of work can make it a bit better - but it is always going to be playing catch up with ARM. 

ARM don't make chips - they license the intellectual property; but so what? The point is that the world is already owned by ARM technology. If Skynet were to happen tomorrow, it would run on ARM.

Now - I spend every working day squeezing nanoseconds from Intel based instruction sets. It is fun and it will continue to be critical because ARM has had little impact on the server side. The ARM architecture is not great for the server. New tech' like their silicon-photonics and super fast SSDs will all help Intel to consolidate their position on the server side. I hope AMD will do similar things as well. But - and it is a big BUT, that little office in Cambridge is the headquarters of the most important IT hardware company in the world right now.

Musings On A Year Of Living C++

Time to take to the high ground and get some perspective.
Copyright Dr Alexander J Turner all rights reserved.
It was just over a year ago that I started my first 100% pure C++11 project. What has it been like?

I had played with C++11 and versions of compilers which had many of the features of C++11. I had worked in C++ for years. But I had not had the amazing chance to write a complex system in C++11 from the ground up until this year.  Now that is a very very different proposition to patching existing code. A clean slate project allows new coding paradigms to form rather than inevitably evolving from the existing paradigms. The final piece of the picture fell into place just this last two weeks when I introduced a young programmer to C++ for the first time (in a commercial setting). He was introduced to C++11 and the effect was quite astounding. Coming from a more Java background, he did not just throw up his hands in despair at all the pointers and edge cases; no his found a safe, clean C++11 style and was productive immediately.

C++11 is a super set of previous C++. But, thinking of it this way completely misses the point. It is much better to think of C++11 as a cut down and cleaned up version of C++03. What! Yes, I really do mean that. We don't have to use as much of the language to achieve the same things. In older styles of C++ we had to jump through hoops to do relatively simple things. 

Consider functors for example. To customise a standard sort one had to define a functor which involved writing a whole class and overloading its () operator. All that has gone and we can simply define a lambda in line.

Similarly with move (std::move etc). Now, it is a bit complex to get ones head around how to implement move constructors and the like. However, most of the time we don't need to do that, we can just use them. The point being that in previous C++ version we might have had to jump through hoops to avoid making copies of objects. Now we do not need to worry. Say we are pushing strings onto a vector of strings, we can use push back with an rvalue or emplace back with the appropriate constructor arguments. No copying will happen, moving will instead. In other words the language directly expresses the intent of the programmer.

my_vector.emplace_back("Hello")

It is completely obvious what the programmer intended here. It is efficient and does not require a lot of superstructure to achieve that efficiency.

Which leads us to pointers. Well, most of the time we do not need them any more. They can be nice for some stuff. For example, they are a really handy way to keying things into maps. But in general, they are no longer required as a high speed technique in the way they once were. I really wish the std::reference_wrapper stuff in C++11 was just a little easier to use and a little less clunky; if that were the case then we would almost never need to explicitly use pointers (implicit stuff like std::string("This is actually represented by a pointer to const char") does not really matter). 

So back to showing someone with Java experience how to write something in C++11. I gave a few rules to make life easier and off he went:

1) Use const as much as possible
2) Use for(const auto& x: container) as a pattern were ever possible for iteration
3) Pass everything as const reference or reference unless there is a very very good reason not to. Copy parameters and pointers should be avoided.
4) Use auto as much as you can for variable definitions.
5) Write as many functions as you need, feel free to break up code into lots of little functions.
6) But if you go the 5 route - use an anonymous name space to hide all the little functions from the global name space.

Closing Thoughts
Well, this is not some detailed discussion; it is just musings. However, I do have some fairly clear thoughts. C++11 is a new language. Yes it contains the older C++ flavours, but it does not need to be written that way. It can be written in a much cleaner, and higher level fashion. What is more, it is more productive to the point where its productivity rivals that of Java (exceeds it in many ways).

C++11 is also well on its way to platform independence. I know that sounds daft, but because it now lends its self to higher level programming, it is much easier to avoid platform dependent code in the main logic. It can all be hidden in libraries. For example, standards like atomic and high resolution counters make these two classic areas of platform dependence go away.

C++11 marks the end of the 'inevitable decline' of C++. The language has proven its self to be an ongoing competitive development system. With the end of ever increasing clock speeds and some large problems being see with ever large memory consumption (bigger memory means more cache pressure which reduces performance) the basic advantage of C++ over something like Java - the ability to tune the heck out of it - is rightfully causing something of a resurgence of interest.


JSF - Crap For All The Wrong Reasons

The whole JSF (F350/Lightening 2) debate has made little sense to me - until now

The key realisation came when thinking about the Australian issue of pitching JSFs against SU30s or SU35s. It suddenly dawned on me that the idea is stupid in nearly every way. The Sukhoi was designed initially as the SU27 to be an F15 killer. It is a heavy weight, super-manoeuvrable air superiority fighter. Why on earth would someone send a single engined strike fighter up against one of these beasts? That the Sukhois kill the JSFs in simulations makes total sense to me. They should - that is kind of the point. If anyone wants any chance of taking out an SU35 (given the US have canned the F22) there are pretty much two choices, a Typhoon or another Sukhoi. The deficiencies of the F35's stealth and performance are such that the notion of first shot first kill does not apply. It might get a lucky shot in, but is just as likely to just give its self away and then follows its inevitable demise.

The F35 is pointless unless used where some other aircraft has achieved air superiority.

That makes sense. But then, why is it stealthy? The idea proposed is that it has survivability over target. But, it is not stealthy from behind. So, it has to ask ground forces to be really kind and not shoot it up the ass. Well, sorry to let you know guys, but the F35 would be A$$ F*ck by SAMs over hostile territory.

Then comes ground attack. An F117 was shot down using low frequency radar already. The F35 is much less stealthy - that huge blow torch at the back is an easy target for infra red. Put these together and we have a platform which is easy pray to a combination of low frequency radar (for general location) and infra-red (for close up) attack. If it gets even closer - for ground attack - it will be in optical range and it can just be shot at. It's thin skin and fuel tanks near the engine will make the F35 the Ronson of the 21st century: "Lights up first time every time".

Why then did the F35 happen?
My guess is it represents the sunk costs fallacy. It seemed a good idea at 2o% the current costs. But as the cost grows it either had to be cancelled or represent better value. The solution chosen by a cohort of customers and the manufacturers was to save face and not cancel. To do take the operational value of the F35 had to be inflated. Something that costly had to be good enough to go up against the SU35 and perform the same role as an A10; except it never could have been that good.