F♯ has possibilities

A couple of months ago, Microsoft announced that they were buying a company called Xamarin, co-founded by the admirable Miguel “you can now flame me, I am full of love” de Icaza. (No sarcasm — I think Miguel is terrific, and the delightfully positive email linked above really stuck with me; if only I could have that attitude more often.)

As I understand it, Xamarin makes

  1. the Mono runtime, a portable third-party implementation of Microsoft’s .NET runtime for the C# and F# programming languages
  2. the eponymous Xamarin frameworks, which can be used with .NET to develop mobile apps for iOS and Android
  3. plugins for the Visual Studio IDE on Windows and the MonoDevelop IDE on OS/X to support mobile platform builds using Xamarin (the MonoDevelop-plus-plugins combo is known as Xamarin Studio).

Then a couple of days ago, the newly-acquired Xamarin declared

  1. that the Mono runtime was switching from LGPL/GPL licenses to MIT, allowing no-cost use in commercial applications
  2. that Microsoft were providing a patent promise (which I have not closely read) to remove concerns for commercial users of Mono
  3. that the Xamarin frameworks for iOS and Android, and the IDE plugins, were now free (of cost)
  4. that at some future point the Xamarin frameworks would be open sourced

I’m trying to unpick exactly what this could mean to me.

According to this discussion on Hacker News, the IDE plugins are remaining proprietary (which appears to mean that no IDE on Linux will be supported, since the IDE plugins are not currently available for Linux) but that “the Xamarin runtime and all the commandline tools you need to build apps” will be open sourced.

What this means

as I understand it,

  • Developers working on proprietary .NET applications will be able to build and release versions for other platforms than Windows, using Mono, at no extra cost
  • Developers working on open source .NET applications will be able to publish the ensemble with Mono under the MIT license if desired and will (apparently) be free of patent concerns
  • Developers will be able to make both proprietary and open source .NET applications for iOS and Android at no cost using Windows and OS/X
  • There is a possibility of being able to do builds of the above using Linux as well once the SDK is open, though probably without an IDE

Unrelatedly, there are separate projects afoot to provide native code and to-Javascript compilers for .NET bytecode.

What I’m interested in

I do a range of programming including a mixture of signal-processing and UI work, and am interested in exploring comprehensible, straightforward functional languages in the ML family (I wrote a little post about that here). Unlike many audio developers I have relatively limited demands on real-time response, but everything I write really wants to be cross-platform, because I’ve got specialised users on pretty every common platform and I have limited time and funding. (I understand that cross-platform apps are often inferior to single-platform apps, but they’re better than no apps.)

Xamarin doesn’t quite meet my expectations because it’s not really a cross-platform framework in the manner of Qt (which I use) or JUCE (which is widely used by others in my field). Instead of providing a common “widget set” across all platforms, Xamarin provides a separate thin interface to the native UI logic for each platform. It’s hard to judge how much more work this is, without knowing where the abstraction boundaries lie, but it may be a more relevant and sensible distinction on mobile platforms (where the differences are often in interaction and layout) than desktops (where the differences are mostly about how large numbers of individual widgets look).

An ideal combination of language and framework for me goes something like

  • strongly-typed, mostly functional, mostly immutable data structures
  • efficient unboxed support for floating-point vector types, including SIMD support
  • simple syntax (SML is nice)
  • low-cost foreign-function interface for C integration
  • high-level approach to multithreading
  • can work with gross UI layout in HTML5 (possibly DOM-update reactive UI style?)
  • good libraries for e.g. audio file I/O, signal processing, matrix algebra
  • can develop on Linux and deploy to all of Linux, Windows, OS/X, iOS, Android
  • free (or cheap, for proprietary apps) and open source (for open source apps)
  • has indenting Emacs mode

Where F# appears to score

F#, Microsoft’s ML-derived functional language for the .NET CLR, hits several of these. It has the typing, mostly-functional style, syntax, FFI, multithreading, libraries, deployment and licensing, and potentially the development platform (if the open source Xamarin framework should lead to the ability to build mobile apps directly from Linux).

I’m not sure about floating-point and vectors or about reusable HTML-style UI. I’d like to make the time to do another comparison of some ML-family languages, focusing on DSP-style float activity and on threading. I’ve done a bit of related work in Standard ML, which I could use as a basis for comparison.

Unless and until I get to do that, I’d love to hear any thoughts about F# as a general-purpose DSP-and-UI language, for a developer whose home platform is Linux.

My impression from the feedback on my earlier post was that the F# community is both enthusiastic and polite, and I notice that F# is the third most-loved language in the StackOverflow’s 2016 survey. Imagine a language that is useful no matter what platform you’re targeting, and whose developers love it. I can hope.

 

What laptop, tablet, or smartphone to buy? It’s a complicated business

My Dad asked me recently what sort of computer he should buy to replace his ten-year-old HP laptop. And what sort of phone should he get to replace his old Nokia? And while I was at it, should he get one of those tablet things?

There are a lot of possible options at the moment, because all kinds of devices from smartphones to traditional PCs have become broadly capable of doing the same work, and because a whole raft of new Windows 8 laptops and convertibles have just arrived to clutter up the shelves.

Therefore I’d suggest mostly ignoring the nominal capability and specs of any device, and considering instead how it feels to hold and operate and what ecosystem it is part of.

Let me explain, and then give some more concrete advice.

Ecosystems

This slightly absurd term describes a set of services and systems that work together, many of which are likely to have been provided by the company that made the device’s operating system.

Increasingly, when you buy a device, you are making a decision to participate in its maker’s ecosystem: it will make your life easiest if you are prepared to use backup, file and photo sharing, music download, email, mapping, browsing, app installation, and other services all from the same supplier.

For example, if you buy an Android device, you’ll be most content if you also use Google mail, maps, marketplace, etc. Buy a Mac or an iPhone, and you’ll have the happiest time if you use Apple services wherever they exist. Windows 8 and Windows Phone expect you to have a Microsoft account and to use it. If you have two devices, say a laptop and a phone, they’ll get on best if they’re both within the same ecosystem as well.

You can make a conscious decision to mix and match—I do that myself, somewhat, because it pains me to side with any one megacorporation more than I have to—but it can be heavy going. If the idea of understanding what you’re doing and why you’re doing it appeals to you more than having an easy life, then install Linux and subscribe to no single ecosystem; I’ll be happy to help out. But I’m guessing you don’t really want to do that.

So no, the usual thing seems to be to decide which company you dislike least, then let that one have your credit card details and as much goodwill as you can muster. And that means picking one of: Apple (with OS/X and iPhone/iPad), Google (with Android), or Microsoft (with Windows and Windows Phone).

“Feel”

Modern computing devices, from smartphones to PCs, are increasingly touch-driven (either through a multi-touch touchpad or a touchscreen), portable, and versatile. The way you hold and interact with them does matter.

I’d strongly suggest you start by trying out the best devices you can find from each ecosystem, hands-on, either by borrowing from a friend or in a very relaxed shop. Decide which one you enjoy the basic interactions with the most.

If the design, interaction and animation (and materials and heft, for specific devices) please you every time you pick it up, you’re probably going to be happy with it. If they annoy you, you’re not. If it’s ugly and inconvenient now, it’ll be ugly and inconvenient in five years’ time.

The options

These are the things you can buy at the moment.

Laptops you know. They run either Windows (if PCs) or OS/X (if Macs). Some of the Windows 8 ones now have touchscreens, but not all of them (and nor do any of the Macs).

Tablets such as Apple’s iPad, the Google/Samsung Nexus 10, or the Microsoft Surface are slatelike touchscreen devices in which a separate keyboard is strictly optional (there is a “virtual” one on the screen). They typically run one program at a time, full-screen, rather than having multiple separate windows side by side, and the programs are redesigned for touch rather than mouse operation (the buttons are bigger and they have fewer menus, for example). All software is installed from a central “app store” run by the operating system manufacturer.

Smartphones are small tablets that can make phone calls. Most mobile phones nowadays are smartphones.

Things to bear in mind

A modern smartphone is a computer. It can do practically anything, but it’s sometimes fiddly because of the small size, and it has amazingly awful battery life compared with a classic mobile phone—be prepared to charge it every day. If you buy a nice new phone and make use of it as a handheld computer, you’ll probably find you use your laptop less.

Tablets overlap with both smartphones and laptops. If you have a smartphone, the laptop or tablet is likely to take jobs like “reading long documents, and doing anything that needs a lot of typing”. Don’t buy both a tablet and a laptop, just make sure whatever you get has a good clear screen and you can stand it up on a desk and type with it.

Asus Transformer

Proper keyboards are available for every kind of tablet: you can always get something you can either plug in or attach wirelessly. But convertible tablets (with a keyboard stand included, like the Asus Transformer, right) are nice too. They’re very like laptops to use and can be folded up and packed away the same way, but you can also pull off the screen and sit on the sofa with it. Most run Android.

There are also small tablets, but… While the iPad, Nexus 10, Transformer series, and Surface are in the 10-11″ diagonal range, there are also several in the 7-8″ range like the iPad Mini or Nexus 7. The small ones are natty and better for carrying around, but less good for sofa-surfing and can’t really replace a laptop.

If you’re buying an Android device, look for Android 4 or newer and get a Google Nexus if you can. They sell a phone (the Nexus 4), a small tablet (Nexus 7) and a big tablet (Nexus 10) and they’re all pretty good. Being Google’s “own” devices, they have good compatibility and more updates. You can’t generally get them through mobile network contracts though.

Don’t buy an Amazon tablet. The Kindle Fire series are really designed for only one thing: consuming content from Amazon.

If you’re buying a Windows 8 laptop, get one with a touchscreen. Windows 8 makes very little sense without a touchscreen. You can still use a mouse as well.

Windows 8 is extra-confusing because of the existence of both Windows 8 and “Windows RT”. These are essentially the same, except that Windows RT can’t run any “legacy” Windows software apart from Microsoft Office: it only runs touch-optimised full-screen apps from the Windows app store, of which there are not all that many available yet. Windows RT is found on tablets and some laptops. It’s a perfectly capable operating system, but there’s a big risk of disappointment if you want to run arbitrary Windows applications from around the internet and discover too late that you can’t.

So the range of applications available matters, but it’s not the be-all and end-all. Off the top of my head: Apple’s iPhone has the most apps, then Android phones, then the iPad, then desktop operating systems (Windows, OS/X), then Android tablets, and in last place Windows Phone and Windows RT. Numerically the difference from first to last pretty big, but it can be oversold: in practice you won’t find many things you can’t do, nor run out of new stuff to try out, on any of them.

You can safely ignore any review in which the star rating appears to be correlated to how fast the computer’s processor is. That’s practically irrelevant nowadays. Do test how smoothly the screen scrolls and zooms though.

Don’t forget to check whether you use any software that absolutely must continue to run on whatever you replace your laptop with. In most cases, all you need is software that does the same sort of thing (it doesn’t have to be exactly the same software) but you don’t want to get caught out if there’s anything specific you rely on.

The whole mobile-network contract business is an extra layer or three of bafflement that I can’t really help with. I generally buy hardware unsubsidised and stick a pay-as-you-go SIM in it.

Some suggestions

Give each of the ecosystem contenders a test run, and then, from the options below, pick the phrase you most agree with and read that bit!

(Although by the time you’ve given each them a test run, you may well already know what you want. That would be a good outcome.)

I’m totally ignoring price here, although sadly the most interesting options almost always turn out rather expensive.

“I really like the way the Apple things work” Well, that was easy. If you’re dead set on having a laptop or you want as much flexibility and control as possible, then you want a MacBook Air (probably the 13″ size, although the keyboard is just as titchy as the one in the 11″). Otherwise, get an iPad and forget about the laptop. Either way, buy the laptop or tablet first, then think about phones (the phone to get is obviously an iPhone, it’s just a question of which one and that basically comes down to price).

“Windows 8 and Windows Phone appeal to me, and I don’t think of Microsoft as an objectionable enemy” You’d probably find a Windows Phone 8 phone (any one, though the Nokia Lumia 920 has the most lovely screen) and a touchscreen Windows 8 laptop a good combination. Look at the Lenovo Yoga 13, which is a fine laptop that I predict will sell half-a-dozen at best because of the weird way it’s being displayed on a stand in the shops (the screen flips back to make it resemble a large and heavy tablet, but it’s really a laptop). Or consider the Samsung Series 5 Touch laptop or possibly the ATIV SmartPC convertible. Although Microsoft’s Surface RT is a beautiful object that I’d like to recommend, it isn’t yet quite the laptop replacement it thinks it is. There’s a Pro version due out in a few weeks that might be worth a look, though.

“I use a few Google services already, and I’ve tried at least one Android device I thought was nice to use” An Android tablet convertible like the Asus Transformer series can in principle replace a laptop quite well. Try one out, but if you’re thinking “hm, maybe Android might work” it’s probably cheaper to give it a go with a phone first. Google’s Nexus 4 is the obvious choice if you can find one.

“Those touchscreen laptops and tablets are all a bit small, I like my bigger PC” There are some reasonable touchscreen laptops with somewhat larger screens, including several from HP like the Envy TouchSmart 14. I hesitate to recommend one because I’ve actually never seriously used Windows 8 with a touchscreen on a larger screen. It might be a bit tiring. Do try it though.

“This is still all too complicated” Then stick with what you’ve got. The new Windows 8 machines have only just come out, and everything will look a bit simpler in six months’ time when the disasters have subsided and the new-fangled things have got cheaper.

What would I do?

If: money was no object; I had no corporate loyalty and lacked my affection for open Unix-type systems; I wanted to be able to do anything except programming; I didn’t have a laptop, tablet or smartphone already; and I didn’t mind if my phone was too big to fit in a small pocket… I’d buy a Nokia Lumia 920 and a Lenovo Yoga 13.

That’s because I like the Windows 8 look and feel, the different Windows 8 devices work well together, and both of these are attractive well-made objects that are a pleasure to use. I’d pick the Nokia over the otherwise excellent HTC 8X because of its better screen and camera and the inclusion of Nokia maps with navigation.

But in real life, I couldn’t afford that. If I wanted to keep the price down a bit and avoid being too locked in to any one ecosystem, I’d look at a Samsung Series 5 touchscreen laptop and a second-hand unlocked Google Nexus S phone from eBay. But I would go and have a play with a Surface RT tablet in John Lewis first, just in case. It’s a nicer physical object, for all its limitations.

And if money was the object—if it was the main thing that mattered, but the other conditions were the same—I might buy the entry-level full-size iPad and nothing else. It’s much cheaper than a touchscreen laptop and has a lot of software. I don’t really go for the visual design, but it’s cheaper than the alternatives I do really like, the basic interaction and feel are fine, and having all those apps available counts for a lot.

Of course, being a typical human creature I’d really do none of the above. I’d just buy whatever I happened to like the look of on the day and rationalise it afterwards. I trust you’ll do the same!

Windows Phone: a bit like BeOS

Today’s possibly stretching-a-point Technology Analogy

In a previous article I compared the situation of Windows 8 on the desktop to that of OS/2 in the late 80s.

Windows Phone 8 is in a different position. While Windows 8 gets its awkwardness from the need to provide compatibility with the dominant platform—which in this case means earlier versions of Windows—the dominant platforms competing with Windows Phone are iOS and Android. And it’s totally incompatible with both.

So, why choose Windows Phone? Not because it has greater capabilities, all in all, than its competition. It doesn’t have any very significant platform-exclusive applications. It isn’t any more open (in either a useful or fun kind of way). There are two reasons you might choose it: a preference for its interaction design, or integration with some networked services.

BeOS is an operating system dating from the mid-90s developed, according to Wikipedia, “on the principles of clarity and a clean, uncluttered design”. (Sounds familiar?) It was pretty to look at and nice to use. It had decent networking support and made good use of the hardware available to it.

But it was always going to have niche appeal. By the time of its release, Windows 95 was dominant and generally tolerated by mass-market users, while Unix-based operating systems like Linux, FreeBSD, and NeXTSTEP were working their way down from higher-end workstations with hacker appeal. BeOS was incompatible, no cheaper, no more open, and ultimately more limited by lack of useful applications. It remains a likeable curio.

 

I quite like the Surface RT. It must be doomed

The Surface RT is the device Microsoft must hope will cause their Windows 8 strategy to start making sense to the world at large. It’s a tablet along the lines of the iPad, with an optional flappy felt keyboard cover and a cut-down version of Windows 8 on it. Microsoft Office is included, but it won’t run any other software from any prior versions of Windows.

I’ve been using one that we’ve acquired at work, and I rather like it.

The basic interface design is lovely and far more tasteful than iOS which, although very nicely executed, has always been a bit on the cheesy side.

Although Windows 8 on the desktop is made a bit awkward by the need to coexist with “legacy” Windows software, the RT version doesn’t bother with that: its classic desktop mode only exists for running Office and for carrying out the odd hack that you can’t readily do in the new interface, like installing fonts or mounting a network drive to play audio from.

The Touch Cover keyboard isn’t wonderful as a keyboard, but it’s good enough. Its main virtue is that it makes a good cover, so you always have it with you: a keyboard that won’t take up half of your on-screen space. And you can flip it back if you want to put the device on a soft surface (see picture, above) or prop it at a shallower angle than the built-in kickstand will allow.

Available software is very limited and even the included stuff doesn’t always work very well. It’ll often linger for ages over network accesses or even give up completely. It’s great to see my Flickr account as an integrated source of photos in the photo app, but most of the time it seems to give up while synchronising and just tell me “something went wrong”. Plug in a camera with a pile of photos on it, and you get a photo-picker app that spends a tedious age trying to load the photos into a preview pane before giving up and offering you 600 grey rectangles instead.

At the moment this thing seems most useful as a business accessory, good for pushing across the table to illustrate a point from a website or spreadsheet during a meeting. It’s nice to use, and I don’t find myself wishing we’d bought the full Windows 8 version instead (to be released in January, apparently). Rather, it makes me want to work out how to program it.

Microsoft have apparently tried to accommodate everyone in their development environments, allowing apps written in XAML/C#, XAML/C++, HTML5/JavaScript and probably some other things as well, with the result that nobody I talk to seems confident about how best to approach it. The C++ dialect has some extra Microsoft-isms in it as well, just to appease those programmers who feel there isn’t enough of C++ already.

But the tools are available, friendly, and free; a truly impressive stack of example code is available; and at least you don’t need to pay for developer deployments. With a free developer cert you can send your test builds from Visual Studio on a C++ to a Surface across wifi, and do “live” (but slow) interactive testing remotely. Promising then, if you can find the time, but given Microsoft’s record of changing their mind on the developer tools to use here it’s not surprising that uptake might be a bit slow.

(What’s even less clear is where this leaves the type of GPL-licensed open source software I’ve worked on. GPL software certainly wasn’t allowed in the Windows Phone 7 marketplace, the predecessor to the Windows 8 store–though I realise I haven’t checked the terms again recently–and open source has little meaning if the distribution channel is so locked down that nobody could do anything with the source anyway.)

But on the whole, I rather like it. The only thing I really wish for is the ability to uninstall the Arial font.

That I like it is probably a bad sign. I don’t have a history of going for wild commercial successes. If I like it, it’s probably a pointless bagatelle that the public generally won’t get on with. I praise the interface design because it isn’t cheesy, but what I think of as cheesy any normal person would find reassuring and comfortable: Apple know this and have sold stacks of stuff on the basis of it. And even I don’t really like the Surface all that much–I feel generally fond towards it, but I can’t imagine spending all that money on it myself. I’d like to have one, but not yet to the extent that I’d actually pay for it.

(I wrote this post, including importing and cropping the images, on the Surface. It was pleasant enough. I felt it took a bit longer than it would have on a laptop, but not that much longer.)

(p.s. This post feels like it might be in contradiction to my previous one, which was my response to using Windows 8 on a PC. What do you think?)

Windows 8: A bit like OS/2

Today in Technology Analogy Week…

In 1987, three years after the world’s perception of the possibilities of the PC had been changed by the Apple Mac and two years after the Mac’s cheap knockoff Microsoft Windows had been released, the world’s leading PC manufacturer released a new operating system.

OS/2 was the perfected pinnacle of many years’ development by serious software developers. Although IBM had initially worked on it with Microsoft, by the time of release it had become an IBM product alone. It was solid, sophisticated, fairly demanding of PC hardware of its time.

Given the resources, OS/2 worked well. But its compatibility with the popular software of the time—for MS-DOS or Windows—was always a bit awkward. Running such “legacy” software felt uncomfortable, as if you were ignoring the major part of the operating system and always on the verge of tripping up on the edges of its competent compatibility. But legacy software was almost all the software available: very few applications ever turned up in OS/2 native form.

The maddening problem of OS/2 was that it tried too hard to do everything. Its developers did all the right things, but it wasn’t different enough from the other popular operating systems of the time to be something you could choose for its strengths alone. It had to rely on compatibility with whatever everyone else was already using; but its compatibility with the technologically weaker market leader just wasn’t satisfying enough.

(You can see where this is going.)

In 2012, five years after iOS and its cheap knockoff Android, and two after the iPad, the world’s leading PC operating system manufacturer releases its new operating system…

Windows 8, like Windows Phone 7, is broadly a satisfying design—but only if you run nothing but native apps on it.

In the case of Windows 8, “native” means managed-code Modern UI software, a category so nebulously defined that nobody I know has yet explained to me the best method of developing for it. Meanwhile, Microsoft have effectively categorised every existing Windows application as a legacy app: they’re available only on the premium version of Windows (i.e. Windows 8 rather than Windows RT), and only in a subsidiary desktop mode.

Think about that for a moment. Windows 8 was released a few days ago. With it, Microsoft have designated every existing Windows application as a “legacy app”.

But Windows 8 isn’t a clean break. Like OS/2, it tries to do everything. It isn’t different enough from the other popular operating systems, iOS or Android, to be something you could choose for its strengths alone. It has to rely on compatibility with desktop Windows, and its compatibility isn’t very satisfying.

Next in Technology Analogy Week: How Nokia’s decisions during the last two years resemble British bands of the 80s and 90s whose managers have decided they must conquer America

SkyDrive: OK, let’s face it, it’s a bit pants

This is the second time I’ve been forestalled in writing a positive note about Microsoft’s SkyDrive cloud storage and apps service, by going to the site and finding it isn’t actually working at all:


I hadn’t asked for Hotmail. This is just where the site redirected me when I tried to log in to SkyDrive on my phone.

I must say this is nicely fitting, in light of Microsoft’s recent attack on the unpredictability of Google Docs: “Different… better… completely gone…” Perhaps they decided it was time to get ahead in the race to “completely gone”.

It’s a pity, as I kind of liked SkyDrive. I evaluated Office365 for business purposes a year ago, but gave up on it when I found it included no way to download your files—perhaps that was intentional for purposes of corporate control, or perhaps it’s fixed now, but it doesn’t seem to have been an issue with the SkyDrive office apps. In many ways I prefer the interface to that of Google Docs, and I think of Microsoft as the underdog nowadays in a way that makes me (dangerously) more inclined to trust them. And in fact, I probably will continue to use SkyDrive for the odd thing.

But it’s clear now that Microsoft aren’t really all that great at keeping it running. I’m afraid, despite my liking for the service, that it does appear to be just a little bit pants.