Native code being promoted for once!

C++, Development, OGRE 23 Comments

Ok, so a new clause in the Terms of Service for Apple’s newly announced iPhone OS 4 is understandably causing some consternation around the internet:

“3.3.1 … Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).”

The common understanding is that this is a shot across Adobe’s bow, but also aimed at people creating emulation environments. Potential justifications for this could include performance concerns (given the new multitasking feature in 4), wanting to avoid shovelware ports from other platforms with no iPhone-specific features to make their platform stand out, or sheer bloody mindedness and wish to tie developers directly to their APIs to minimise the chance that they’ll deploy on competitors machines.

As a general principle, I don’t like this sort of thing – telling developers what they can and can’t do is stifling. But, I had to take away one positive from it – a company telling people to use native code, instead of the opposite which I’ve seen too much of lately. In recent years, the likes of Microsoft have insisted that developers use their intermediate VM layers to deploy on some devices (XNA, Windows Phone 7) – regardless that these environments have about 20 years less maturity (in terms of libraries and existing code) than what I already have in C & C++. Having them tell me that no, despite all these great battle-tested libraries that I’m used to using, instead I have to use comparatively immature ports and replacements of varying quality, just because they tell me so. That drives me nuts – sure, let’s throw away and re-invent hundreds of functioning & tested libraries just because…well, just because! They’re old and we’re new and awesome! Hmm.

So while Apple telling developers what they can and can’t use is still very wrong from a point of principle, I’m actually glad that someone is championing native code for once, rather than pushing a VM environment. I’d prefer they didn’t mandate anything at all, but I can’t deny a certain urge to fist-bump when native code was the one to get the seal of approval, after getting the impression from other companies that they’d rather no-one had access to the underlying workings of the machine. I like native code, there’s a certain purity about it – and maybe it’s like a sad old gear-head going on about how great the old V8’s used to be, but I don’t care :) Mostly it’s about my frustration with being forced to discard perfectly good native libraries and look for / build replacements for no good reason.

PS For the record, OGRE on iPhone isn’t affected by this new ToS because we’re 100% native, baby. :)

[edit]For those pointing out that C# and such eventually run on native code anyway – that’s not the point. The point is that on certain devices – XNA and Windows Phone 7 – you simply cannot use libraries that were not written in .Net originally, meaning that years worth of dev libraries are inaccessible and need to be (pointlessly IMO) rewritten in .Net. And yes, this is exactly the same as Apple are doing here (but in reverse), if you interpret it in the strictest sense that you’re only allowed to use code written in Obj-C, C and C++. I’m just taking a perverse delight in the fact that it’s C/C++ libraries from the last 20+ years that are on the winning side for a change, instead of being the ones that are excluded (which frankly I’m completely sick of).

News Mash-Up

Linux, OGRE, Personal, hardware 21 Comments

I’m busy, again. A ton of things just bunched up towards the end of the month, and I’m on-site with a customer in Cambridge some of next week, so I’m keeping my head down a little right now. Here’s a news-blast though.

I love Ubuntu server

I’ve been setting up my new server. I’ve probably said this before, but for servers, Linux rocks. I’m ambivalent about Linux on the desktop, where I believe consistency and usability are more important (the Mac floats my boat the most there, and Windows if only because of MSVC++), but for a server Linux really brings great things to the table. Rock solid server apps, ridiculously good performance for the hardware (a mere Intel Atom 330, goes like a greased whippet), easy and most importantly infrequent maintenance. When it comes to distros, I loved Debian for its sensible defaults and great package management, but Ubuntu server takes that and makes it even better.  The added bonus of a LTS version that I know will be supported with security updates until at least 2013 is welcome too, because I like to set these things up and mostly forget about them.

I’m glad Ubuntu’s default mail/IMAP servers are Postfix and Dovecot respectively – they’re just ridiculously easy to set up. I’d been using Exim4 on my Debian box, which was the default at the time, and learned to dislike it because of the over-complex configuration (I’d been used to Postfix when I ran a Gentoo server before that). I’m also planning on trying out Bacula as a replacement for my manual backup scripts this time around.

PSUs hate me

One of my jobs this week was building a machine around some customer hardware which I was testing an abberation on. Having built it, I realised I didn’t have a spare PSU rated highly enough, so I ‘borrowed’ one out of another GPU test machine I had. It ran all day, then decided to die – this just 2 weeks since my server’s PSU died and needed to be replaced. It’s just bad luck – my decent APC UPS should be providing ample power regulation. So, I’ve ordered 2 new PSUs to make sure I have enough stocked in future!

Excitement is infectious

I was happy to show off some shots of my new & improved core terrain system for Ogre, which isn’t entirely done yet but was usable enough to get some nice shots out of. I knew I had to move on to some other work for a while but I was still pleased to be able to show off some initial eye candy (which BTW, is still very early – I haven’t finished yet by any means). I was glad to get some positive & constructive feedback, but of course now people are rushing off an including it in their projects, since all the code is public in svn. Despite my slapping a big red warning sticker on it saying ‘handle with care – volatile material’  and that they shouldn’t assume it works properly yet, people are hacking on it already, with some nice results I have to say (such as Ogitor integration) – but of course with many questions and issues. Such is the nature of open source – it’s a blessing that you get instant, voluminous feedback, and it’s a curse that you get instant, voluminous feedback ;) I hope to get more time to deal with the fallout from that if not next week (because of my travels), then the week after.

The OGRE Patch Mountain

Our community is always active, and it’s great to get patches. I do have a quite high validation standard for the core though, and processing patches can often take a fair bit of time. I try to spend a few hours per week doing this, but mostly that’s only just enough to keep the level static, rather than reducing the backlog, and it still spikes up sometimes (as it has this week) – that’s because even if I get an afternoon on it, to review and test things properly can eat that up very fast.

If there are any experienced members of the Ogre community who would like to assist me with keeping the patch mountain down to a small hillock in future, and are willing to adhere to our high standards of review, please contact me at sinbad AT ogre3d DOT org.

iPhone 3G / 3GS port coming soon

We’ve had a fledgeling GLES rendersystem around for a while, and obviously the iPhone / iPod touch are the highest-profile targets of that. I’d been intending to have a go at it later in the summer, but masterfalcon on the forums has beaten me to it and already has it running (with a few small issues remaining to be ironed out) on the 3G and 3GS. There should be a public release of that in the relatively near future.

3D Web Browsing With OGRE

I love this video. Nice work princeofcode (aka ajs15822)

That’ll do for now I think.

WWDC 09 – Apple gets aggressive, in a fairly relaxed way

OS X, Tech 6 Comments

In the grand scheme of things, nothing really very surprising was announced at the WWDC 09 keynote; sure, we got a few hardware revisions and some more specific details on the next version of OS X, but there wasn’t anything singularly shattering about it. And yet, when taken as a whole, I think it was one of the most important WWDC’s yet.

iPhone 3GS

A speed increase, more memory, better battery life, better camera, addition of a compass so it can know which direction you’re facing as well as where you are. All fairly minor but no doubt welcome changes. But, in my view perhaps the more important fact is that following the release, the previous standard 3G revisions are being sold off for $99; I think that’s going to make a big difference in the number of people taking up the iPhone. I didn’t pick one up because of the price (especially because we get screwed on it over here, since we have no O2 to subsidise it), but had it been a $99 base price – well, that’s a lot easier. Being able to offer an iPhone to a wider range of buyers is certain to give more steam to the iPhone popularity train.

MacBook Pro

More speed & RAM, FireWire 800 is back (no use to me, but some people missed it), SD card slots are in, and perhaps more importantly, Lithium-polymer battery tech is in, for up to 7 hours on the go. Sweet. Interestingly, the entry-level MacBook is now replaced by the 13-inch MacBook Pro, with the same overall design but just lower specs. This allowed Apple to claim that the MacBook Pros now start cheaper, but really they don’t – the 15 inch (the one you’d really want to start at as a power user) is exactly the same price as before. [edit]Actually, it has dropped in price, but back to the same price as the 15″ MBP was in 2007, when I last bought one. 2008’s unibody design came with a price increase, so this decrease puts it back to how it was, hence my confusion.[/edit] But still, a faster chip, double the memory and bigger HD are welcome for the same price; I’m glad I didn’t buy a unibody yet, but I’ll definitely be tempted by the new ones.

The MacBook Air however did get a set of serious price cuts; they’re impractical for me still, despite being sexy as hell, but I’m sure people that don’t need so much local power and who desire sleek looks will be very happy.

OS X

We already knew that Snow Leopard would be basically a leaner, meaner version of Leopard with go-faster stripes and a few feature tweaks. The big announcement was that Apple would be releasing the upgrade for a mere $29 (or $49 for the multi-machine family pack), which was very well received. That basically makes it a no-brainer for all users, I know I’ll be upgrading soon after launch.

Most importantly, it’s a big contrast to the price that Microsoft want to charge for the Windows 7 upgrade, which contains roughly the same degree of change over Vista as Snow Leopard has over Leopard (although Leopard is a more efficient base than Vista is – does that make W7 worth more as an upgrade?). It’s rumoured that a Home Premium upgrade for W7 will be around $50, and a Professional upgrade about $100. Of course, OS X has no ‘graduations’ like Windows has, where you don’t get everything in the OS unless you buy an expensive ‘Ultimate’ version – OS X is just OS X (personally, that lack of fannying about with variable feature sets is attractive to me as a customer).  This is an obvious attempt to undermine Microsoft’s claim to be the ‘value’ player in the OS market, and frankly, it’s a good argument. Of course, you still can’t buy cheap-and-cheerful hardware to run OS X on like you can with Windows, but when I shell out $100 per machine for my Windows 7 Pro upgrade but only $29, or $49 for up to 5 Snow Leopard upgrades, hell yeah I’m going to notice the difference.

So, I think despite the lack of shattering announcements, this was an important WWDC for Apple, a consolidation move which in many ways is more important. Despite the often fiercely held opinions of people who haven’t even used them, Apple products are generally pretty damn good, and earn brand loyalty for a reason. Making them more accessible can only lead to more people trying them, and perhaps coming to conclusions for themselves, rather than just writing them off based on what they’ve heard from other people who haven’t used them either.  ;)

iPhone 3G – now we’re talking

Tech 6 Comments

I’ve always admired the iPhone purely because of it’s sleek looks and elegant design, but it was encumbered by an excessive price tag, a lack of 3G (which for the price was scandalous), and a ridiculous telco tie-in that meant you could only (officially) use it on O2 here in the UK, which made it even more useless to me since O2 do not operate where I live.

However, the new 3G instalment which made its widely anticipated appearance at WWDC 08 is looking much more interesting. Obviously there’s the 3G support, which really should be a given in a modern high-end phone, although I can understand that since the US cell phone networks have been very slow to deploy it, it might not seem as important across the pond. GPS is in too, which is good, and Exchange support is probably for those who are wedded to it. But more importantly, they’re slashing the price; it’s half what it was last time ($199 for the 8GB model). Even better, Jobs is claiming that people are not going to pay an inflated price outside the US – they’ve promised that you won’t pay more than the converted price. Of course, given the fluctuations in the dollar rate, I’m not sure what rate they’re going to pick, but it would be a refreshing change not to get ripped off so badly here in Europe if they deliver on it.

The final issue is whether they’re going to lock the phone to a provider again, something I considered to be manifestly stupid from an adoption point of view. In the US they’re still doing this, via AT&T again for a pretty inflated monthly price which I guess is the point of them doing it. If they repeat this in the UK with O2 they’ll once again make it pointless me getting one. Sure I could try to bypass the locks, but the potential for my device to be bricked by a future update isn’t exactly enticing.

So if they lock to O2 again it will be a shame, because otherwise the new iPhone would be a likely purchase for me. It’s a great device, and if I have an excuse to have one I’d love to get Ogre running on it – the SEGA Super Monkey Ball demo in the video was certainly pretty cool :)