Category Archives: software development

Microsoft, Moonlight and open source

I was surprised by the announcement that Silverlight is being ported to Intel’s Moblin Linux, which I’ve already reported both here and on The Register. It feels like a u-turn from Microsoft, which had previously stated that while it would build Silverlight for both Windows and Mac, Linux support was to be done by Novell. This is from the 2007 press release:

Microsoft will work with Novell Inc. to deliver Silverlight support for Linux, called Moonlight, and based on the project started on mono-project.com … Microsoft is committed to ensuring that organizations have the best tools and resources to begin building Silverlight-based solutions with the broadest possible reach. The decision to work with Novell to offer Silverlight support for the Linux platform is in direct response to customer feedback, and both companies are optimistic about the impact this extended partnership will have in the industry.

Now, given that Microsoft has long expressed an intention to bring Silverlight to mobile devices, and that many mobile devices run some variety of Linux, you can argue that the Moblin announcement is merely in line with that strategy. This is what Brian Goldfarb told me – that the Intel deal is in the “mobile device” category, and therefore distinct from the work with Mono.

That said, if you look at the specs for something like Dell’s Mini 10v with Moblin – 1.6Ghz Atom CPU, 160GB hard drive, 1GB RAM, 10.1" 1024×600 display – it really has more in common with a traditional laptop than with, say, a mobile phone. Further, I’m getting the impression that this will be a full Silverlight 3.0 implementation, not a cut-down version like Flash Lite, complete with the Silverlight version of the .NET Framework.

If Microsoft had announced this kind of deal in the early days of Silverlight, it would have have been encouraging for open source advocates. Even though this Silverlight for Moblin is not an open source project, it extends support for a key Microsoft technology to Linux users. Silverlight developers may well prefer that the same code will be running on Moblin as on Windows or Mac, subject to whatever has to be done to make the port work.

Unfortunately at this point the announcement is having an opposite effect, casting doubt on Microsoft’s ability to work with open source partners. The impression is that Mono was a useful means of ticking the Linux box for Silverlight’s launch – though the version which includes .NET is still not complete – but that when it really wants to support a Linux OS, Microsoft is quick to find another route.

It is stating the obvious to say that the open source community is wary of Microsoft. Everything the company does is eyed with suspicion. Microsoft’s official support for Moonlight, along with great work from people like John Lam who works on IronRuby, was beginning to soften some of that hostility. Miguel de Icaza, leader of the Mono project, has been a great bridgebuilder between Microsoft and the open source community – so much so, that Richard Stallman recently called him “basically a traitor to the free software community”. Stallman has done his cause no credit with this remark. “I think we officially hit a new low here”, says OS news.

A terrible moment then for Microsoft to snub Moonlight by doing its own thing with Intel for Silverlight on Linux. What was even more striking is that the company seemingly had no idea of the impact of its announcement, and that it might be a sensitive matter, and apparently did nothing to prepare the Mono team in advance for the obvious questions that would be asked.

What is more important – that Silverlight works smoothly on Moblin, or Microsoft’s relationship with the open source community?

Microsoft brings Silverlight – not Mono – to Linux via Intel

Yesterday I speculated about what was meant by the inclusion of Silverlight among supported runtimes for Intel’s Moblin Linux, which is being used on netbooks using the Atom processor. I had assumed it was some new development of Moonlight, Mono’s Silverlight implementation, but apparently this is not the case. Here’s what Microsoft’s Brian Goldfarb, director of the Developer Platform Group at Microsoft, said:

Microsoft and Intel announced today that the two companies have agreed to work together to bring support for Silverlight 3 to Intel’s Atom-based Mobile Internet Devices (MID). These Atom-based devices run on Windows and Moblin, an open source, Linux-based operating system targeted at Atom-based devices. In order to help bring Silverlight content to these devices, Microsoft has provided Intel with Silverlight source code and test suites, and Intel will provide Microsoft with an optimized version of Silverlight for Moblin devices that Microsoft can then redistribute to OEMs.

There are a couple of curious aspects to this. One is why Microsoft would not simply feed optimisations into the Moonlight project, which would benefit Silverlight/Moonlight on all Linux systems. Goldfarb did add:

The Silverlight for Moblin announcement is independent from Microsoft’s work with Novell on Moonlight. The Intel/Moblin effort is specifically about building great out-of-box experiences for consumers on Atom-based devices. Microsoft’s efforts with Novell remain critical as they build an open-source, compatible, and broadly available Silverlight solution for Linux.

Another is whether Intel/Microsoft are devising some way for Silverlight to run as a desktop application, rather than just as a browser plug-in. I’m hopping to clarify these points soon.

Intel has a press release here.

Software development trends in emerging markets

I’ve just attended a webinar given by Evans Data on software development trends in emerging markets such as India, China and Brazil. Not many surprises, but still interesting. Here’s a quick summary:

  • The emerging market developers are much younger – a median age of 29 versus 41 in the rest of the world (ROW).
  • The developer population is growing faster in emerging markets – 25% per annum versus 9%.
  • Educational attainment is similar in emerging markets vs ROW – developers tend to be highly educated.
  • Developing for cloud computing and SOA is somewhat stronger in emerging markets than ROW

There are mixed signals when it comes to use of Microsoft technologies. On the one hand, we were told that Microsoft is strong, and a sign of that is that more emerging market developers are signed up to a paid developer program (presumably MSDN) than in the ROW. On the other hand, there’s more open source adoption in emerging markets: 74% vs 65% ROW.

Programming language trends are hard to nail, because emerging market developers tend to have multi-language skills. 60% of emerging market developers use Java, for example, vs 45% in ROW; but 48% use C#, vs 38% in ROW. The emerging market developers are ahead in every category here, despite (or because of) their younger age.

When it comes to host operating systems, Windows XP predominates in both groups. There’s less Mac in emerging markets: the number 5 OS is Windows 7, whereas it is OS X in ROW. The others are Vista, Linux, and Windows 2003.

What I’m not sure about (but would like to know) is how many of the developers surveyed in emerging markets were working for their own market, and how many for international customers.

My own observation is that aside from the remarkable age difference, the two groups are more similar than I would have guessed.

The desktop versus web application debate

I posted a piece entitled Desktop applications are dead which attracted the following comment:

Web apps have plenty of cons too. You seem to only be looking to the Pros.

There’s something in it; though the article is a little more nuanced than its title. There’s also another debate to be had around the question of what a web application really is. If thousands of lines of JavaScript are executing on the client, is it a web app? If it is running in Flash or Silverlight is it a web app? If it is running out of browser (Adobe AIR, Silverlight, JavaFX) has it crossed the border to become a desktop app? This last case is particularly interesting, since although something like AIR should probably be categorised as desktop, its programming model is normally that of a web application with an offline cache.

The semantic discussion can distract from the real issues. The ascendancy of web applications has a lot to teach software developers. The enforced simplicity, even crudeness, in the user interface of early web applications brought some surprising benefits: users generally liked the minimalist approach and ease of navigation. The page model, intended for documents, turns out to work for applications as well.

Another big lesson: users value zero-install extremely highly. The routine of go to the web page – run the app is easy to understand. Some find it easier than finding an application shortcut in the Windows Start menu, and that is after the potentially painful business of running setup.

Still, I am slipping into reiterating the advantages of web apps. What about their cons? What about the pros of desktop applications?

I still use desktop applications a great deal: Microsoft Office, Live Writer, Foobar, Visual Studio, Eclipse, all the things I listed in 10 Mac alternatives to Windows utilities. Doesn’t that prove that desktop applications are still important?

It does; but there is an important qualification. None of these are line of business applications of the type which occupy so much of the time of corporate software developers and contractors.

The real point: if there is a discussion about whether a particular project should be implemented as a desktop or web application, it is not the web application advocates who need to make their case. Rather, it is the desktop advocates who need to show the particular reasons (which may be good ones) why only a traditional local install will do.

It is also important to follow the curve on the graph. The list of things that can only be done by desktop applications gets shorter with every upgrade to the web platform – whether you think of that as HTML/AJAX, Adobe Flash, Microsoft Silverlight, or [insert your favourite web technology].

Ten years ago, a web version of Photoshop seemed an unlikely prospect. Today, here it is. Office and email is going the same way, even if it is not quite ready for all of us; Microsoft will have to accept that or lose its business.

I don’t follow Rich Internet Applications with such interest because they are cool, but because they are the future of the client – and increasingly the present as well.

Delphi and C++ Builder 2010 are out

I’ve installed the new Delphi from Embarcadero. I want to enthuse about this product, as a long-time Delphi enthusiast, but a few things have dampened my zeal:

1. The install on Windows 7 64-bit was not totally smooth. First Avira Antivir claimed that a file installed during setup, called convert.exe, contained a virus (not the fashionable new one, something else called DR/Delphi.Gen dropper). I thought this was most likely a false positive. I tested the file with with Kaspersky which declared it clean, and I’ve emailed Avira about the problem.

I’m not sure why I bother at all with running anti-virus software. It is very little use. After all, what is the point of having it, if when it claims to find something you ignore it? On the other hand, what is the chance that this is a real virus on Embarcadero’s new CD, that Kaspersky does not detect?

None of this is Embarcadero’s fault, of course, unless it has shipped a virus, which I doubt.

2. Next, on running and quitting Delphi 2010 for the first time, the Windows Program Compatibility Assistant was triggered. See this earlier post for what this guy looks like and what it does. This one made the same change, ELEVATECREATEPROCESS.

A minor niggle perhaps, but it looks bad. At this stage, the Delphi team should have come to terms with UAC and made RAD Studio properly UAC-aware. I’m guessing most of the team run with UAC disabled.

3. Another UAC issue. When the IDE starts up, you get a message:

Error executing ‘C:\ProgramData\{BBD31133-40F8-4B57-9BA6-DB76C03D153B}\Setup.exe’: The parameter is incorrect

This does not occur if you run as administrator.

4. I ran up the IDE and noticed there is a new documentation wiki with user contributions. I think this is a great idea. It seems to be built with mediawiki. Unfortunately it failed with “A database query syntax error has occurred”. Update: it’s working now.

5. I’d understood that Delphi 2010 is somewhat Windows 7 ready. It has great support for multi-touch and gestures. That’s fine, but I was interested to see how to support the Windows 7 Jump Lists. A Jump List is the menu that pops up when you right-click a taskbar icon.

Well, if support for this is there I can’t find it. There is support for the Windows 7 Direct 2D Canvas, and as I mentioned for multi-touch, but that’s about all I can find.

It’s a shame because only a few people will be using multi-touch in the near future, and Direct 2D is not a feature visible to users, but the new Windows 7 taskbar and its features – there’s also the ability to add controls to taskbar preview windows – is the thing that every Windows 7 user will notice.

Of course you can easily call the Windows API from Delphi, and the community will figure out how to support these features before long; there’s already an alpha “Windows 7 controls for Delphi” that Daniel Wischnewski has come up with. But I’d like to have seen it in the box, and it would have been a nice selling point.

Don’t let me put you off. There are other new features – including Firebird support, integrated code formatter, better thread debugging -  and no doubt the core of Delphi is as good as ever (no 64-bit yet, but it will come eventually).

Still, my impression is that Embarcadero still has to work a bit on that last degree of polish. One final gripe: why is the discussion forum so darn slow? It has also been in beta forever.

More information here.

Delphi developer virus exposes weakness in anti-virus defences

I found a real live instance of the Delphi-attacking virus W32/Induc-A yesterday. It was in the executable for FinalBurner Free from ProtectedSoft (ironic name in the circumstances), a decent freeware CD burning application. The file is burner.exe and I suspect the company has been shipping it for some time. I do not know if it affects the paid-for versions.

This malware was highlighted by Sophos though one thing Sophos does not make clear (as it is in the scaremongering business) is that the virus has only a mild affect. It only affects machines with ancient versions of Delphi installed – versions 5, 6 and 7 according to Marco Cantu – and its activity appears to be limited to replication. In other words, a successfully infected machine modifies Delphi’s runtime library so that it compiles infected executables, but does nothing else that I know of.

The implication is that the anti-virus companies, far from doing a great job at protecting us, have only just spotted a problem that has been around for months or possibly years. The burner.exe I found was dated 16 June 2009. If anyone has an older example, I would be interested to know; I’ve seen one report of an August 2008 infection.

Thus, when Delphi Product Manager Mike Rozlog comments to the Register’s report:

The best ways to combat these types of issues are to establish a deployment protocol that checks for viruses and trojans before shipping any applications

you have to ask: how? Clearly scanning with an anti-virus product would not have helped ProtectedSoft. Note that Sophos admits in its database that protection has been available only since 18 August 2009.

Despite the mild impact of W32/Induc-A (as far as we know so far) it is not something to take lightly. The attack looks like a proof-of-concept, to be followed by similar code with more serious impact, or possibly just an experiment that escaped into the wild. Maybe there are other more serious variants that the vigilant anti-virus folk will find in a month or two’s time.

How then can developers protect their machines? Another Reg reader says:

Instead, people should try to ensure the integrity of their development systems. Don’t connect them to the ‘net and don’t play games on them (duh!). Don’t have any foreign executables on them besides the OS and the compiler, transfer the sources there and compile them there. Run some kind of integrity checker to make sure that your compiler distribution hasn’t been tampered with. That sort of stuff.

Good advice, though not trivial to implement. A suggestion for Embarcardero: how about giving some thought to the problem and coming up with an easy means for developers to check the integrity of their runtime library files?

The disturbing aspect of this story is how malware can end up in shipping software from reputable companies; it could even be signed code. How long before something like this ends up in an executable shipped with an operating system itself, maybe with a timed payload so it lies dormant until well distributed?

UI design patterns for Rich Internet Applications

We are used to the idea of design patterns for software construction, following the great work of the gang of four – Design Patterns: Elements of Reusable object-oriented software by Erich Gamma, Richard Helm, Ralph Johnson and John M Vlissides. But what about patterns for user interface design? What about learning standard UI patterns and how to apply them well, so that you have an immediate head start when sitting down to create a compelling and usable application?

Ryan Stewart’s blog post on up-leveling the Flex User Interface Discussion links to the work of Theresa Neil, who spoke on Designing Rich Application at the DelveUI conference last week. She’s posted her slide show, which I’ve also embedded below:

I found it fascinating, and while I will never be a designer, this kind of methodical, structured approach to building a UI is one that developers can also appreciate.

She also has a matrix of essential controls showing which UI frameworks support them – page 21 above – though the slide only shows controls from A to D; the full set is described here.

While I’m on the subject, there’s also a thought-provoking post from Brandon Walkin on managing UI complexity. It seems Microsoft can still provide plenty of “how not to do it” examples.

C#-SQLite now published

Noah Hart has published his port of SQLite to C#. The project is called C#-SQLite. The main SQLite author, D Richard Hipp, originally said that the project should not include SQLite anywhere in its name, but has now relented:

I think I would be comfortable with a name like C#-SQLite. The prefix makes it clear that it is a reimplementation, not the original. People notice prefixes much more readily than suffixes. There is also precedent for changing a prefix for a reimplementation. Lucene, for example, was ported to C-Lucene. I’m sure there are others.

The whole point of this exercise it to avoid confusing people. Folks who use C#-SQLite need to be fully aware that what they are using is distinct and separate from the original SQLite. As long as that one condition is met, I am happy.

I downloaded the code, compiled in Visual Studio 2008 (requires project conversion), ran the shell and tried a couple of commands. It works!

Of course there are already a million ways to use SQLite from .NET, but they all require platform invoke to native code, which is not allowed in some scenarios for security and/or cross platform reasons – Silverlight being a prime example.

Next question: how hard will it be to get this working in a Silverlight project?

See also SQLite C# port raises hopes for a Silverlight local database manager which has some early performance results.

Technorati Tags: ,,

SQLite C# port raises hopes for a Silverlight local database manager

Yesterday programmer Noah Hart announced a port of SQLite to C#:

I am pleased to announce that the C# port is done to the point where others can look at it.

Unfortunately the code was taken offline almost immediately afterwards, thanks to the intervention of the author of SQLite, D Richard Hipp:

Noah, you are welcomed, even encouraged, to take the source code to SQLite and translate it in any way you want and do whatever you want with it. But you need to make it abundantly clear to everyone on your site and in the comments of your source code that your code is not the original SQLite … SQLite is a registered trade mark. If I don’t defend the trademark, then I could lose it. So, I really do need to insist that you not use the name "SQLite" for your product.

The reason given is that Dr Hipp does not want to receive support requests for the port, though the intervention is a little surprising since there are other 3rd party adaptions out there that do use the SQLite name, though these generally modify or wrap the original code rather than porting it completely.

Still, Hart has taken it in his stride and it looks as if the code may be back soon under the name sqlsharp – a Google code project with that name has been created. I hope this is the name since I suggested it, though it is rather an obvious one and I might not have been the first.

Why the interest? First, it’s always interesting to compare languages. Currently, Hart says his executable compiles to 528kb vs 506kb for the native version, and performs 3-5 times more slowly (results in rows per second):

Test SQLite3 C# SQLite3
Inserts 300K 1300K
Selects 1500K 8450K
Updates 60K 300K
Deletes 250K 700K

Although that may seem disappointing, SQLite is remarkably fast so even 5 times slower is still acceptable in many contexts; and there are no doubt many possibilities for optimisation.

What’s the point? Hart says it was a C# learning exercise, which is fair enough. Others are hopeful for a local database manager for Microsoft Silverlight, writing to isolated storage. Competitor Adobe AIR includes SQLite in the runtime, as does Google Gears.

Silverlight may a stretch for Hart’s port. Silverlight does not allow platform invoke or code marked as unsafe; and while there are apparently only a few p/invoke calls I’m guessing there may be many unsafe sections since the original SQLite makes heavy use of pointers.*

Although Silverlight is an implementation of the .NET Framework, it does not include the System.Data namespace. It does include System.Linq.

There are a few other efforts at creating a local database manager for Silverlight, including McObject’s Perst, db4o (work in progress), and Silverlight Database which works by persisting XML.

*Update: the project has now been published as csharp-sqlite, which is an excellent name; it looks as if Hipp relented to some extent. Now that I’ve seen the code I find I’m wrong about unsafe sections. In fact, I added C#-Sqlite to a Silverlight project and it failed to compile with a mere 53 errors, many of them related to file locking – possibly less necessary in isolated storage? A Silverlight port looks feasible.

After Microsoft deal, what next for Yahoo’s developer platform?

In May I attended a Yahoo Hack Day in London and wrote it up for the Reg. Although I found the business story unconvincing, I was impressed by the technology – things like BOSS, SearchMonkey, and especially YQL (Yahoo Query Language), which lets you treat the entire Internet as a structured database.

One thing all these services have in common is that they are search-related. If the Microsoft-Yahoo deal goes ahead, responsibility for Yahoo’s search engine moves to Microsoft. My high-level understanding is that Bing becomes the search engine, with some Yahoo engineers possibly moving to Microsoft, and others being let go.

There are big implications for Yahoo and the developers which depend on its services. Here’s the official statement quoted by Ashim Chhabra on the BOSS team:

This is the beginning of a process and we’ll be working with Microsoft to determine what makes the best sense for both us and developers. Regardless, we are certainly committed to continuing to innovate on the user experience of search all across Yahoo! and on continuing to engage with the developer community on several fronts, opening up leading audience experiences and data to third-party innovation. In that context, SearchMonkey can add a lot of value to how we help people get the most out of search and out of Yahoo!. Over the next several months we’ll determine what makes sense with our developer offerings and provide information when available.

though Chhabra adds:

Honestly the team is still absorbing the implications and we just don’t know. We can tell you that BOSS will remain live for the time being. There are many aspects still to be considered. Over the next several days we’ll be working hard to get clarity and will update the community as soon as we can.

A reasonable guess is that the APIs will continue to work – it is not usually that hard to map one set of APIs onto another – but that the focus of the development effort will change, and the actual results will be different when based on the new engine.

Bing’s engine is not bad, as one developer observes:

Do not take me wrong, have been using the Bing API since 2.0 and find it very similar to BOSS for integration purposes and results are good, but I guess my point is that Yahoo! Search Technology is pretty much dead from my understanding and hence the "real" BOSS is dead too.

There is another problem though, which is that the Yahoo culture, which draws on open source (Yahoo runs largely on PHP), is different from that of Microsoft. Some developers who use Yahoo APIs will likely feel uncomfortable with moving to Microsoft’s Live platform – prompting comments like this one:

Don’t use Bing please please please please please

Such folk may well find Google more congenial. Google’s search engine is far from open source, but the company supports a large amount of open source code (not least its web browser, Chrome/Chromium) and has been more successful than Microsoft in engaging with the open source community.

Although I suspect Yahoo gets little direct revenue from its developers, they are a dangerous group to disrupt, because of the influence they wield. If the Yahoo platform loses momentum, it is likely to impact its other initiatives as well.

Update:

See also this announcement:

For SearchMonkey and BOSS, we currently do not have anything concrete to tell you. Clearly, we’ll need to work with Microsoft to determine what makes the most sense for you and for us. For more details, please see Ashim Chhabra’s post to developers on the Yahoo! Search BOSS group. We’ve also received questions about the future of Yahoo!’s other developer offerings, such as YUI, YQL , and Pipes. We wanted to let you know that today’s news does not affect these products.