Tag Archives: delphi

Embarcadero promises Delphi everywhere: Mac, iOS this year, Android, Blackberry, Windows Phone to follow

I noticed the following remark from Embarcadero’s David Intersimone regarding Delphi, its application builder based on Pascal.

We are putting Delphi (and C++Builder) everywhere this year and over the next 5 years. Today you can use Delphi for Desktop, Client/Server, Multi-Tier, Cloud, Web, Web Services (REST and SOAP). This year you will also be able to build for Macintosh and iOS. Linux is also on the roadmap for the coming years along with Android, Blackberry and Windows Phone 7.

Welcome news; though Delphi enthusiasts are all too familiar with bold promises. Two years ago I interviewed Embarcadero’s CEO Wayne Williams and he promised cross-platform Delphi in 2010; but when Delphi XE appeared last year neither Mac nor 64-bit (another longstanding request) was included.

That said, I am still a big Delphi fan. Mobile is a particularly interesting prospect. I have tried numerous cross-platform mobile toolkits and they all have problems; on the other hand they are improving fast and in a couple of years things like Appcelerator’s Titanium and  Nitobi’s PhoneGap may be hard to catch.

Update: what will Delphi’s Android support look like? I would be interested to know whether Embarcadero is working on its own compiler, or whether it is partnering with RemObjects and that what Intersimone is referring to is Project Cooper:

“Cooper” is a new and exciting research project going on in the RemObjects Software Labs, to bring the Oxygene language to the Java and Android platforms. The original Oxygene for .NET set out to bring a modern and “next generation” Object Pascal to the .NET world; Project “Cooper” is taking this endeavor to the next level, expanding the reach of Oxygene to the second big managed platform.

In other words, Project Cooper will compile Delphi code to Java.

Note that Embarcadero officially adopted Oxygene and offers it as its own product called Prism. It seems plausible that the same will happen with Project Cooper. Since Windows Phone is a .NET platform, there is also potential for Oxygene/Prism to target Microsoft’s mobile platform:

Windows Phone 7 – Microsoft’s new Windows Phone 7 uses Silverlight for application development,  and did I mention Delphi Prism does Silverlight?

says Jim McKeeth at RemObjects.

What about Delphi on the Mac and on iOS? There is also a possible Oxygene/Prism route here, via MonoMac: Delphi to .NET/Mono to Mac. However, I suspect Delphi developers would be disappointed if this turned out to be Embarcadero’s approach to Mac and iOS support. Programmers choose Delphi because they like compilation to native code.

Using SQLite 3 with Unicode in Delphi

I’ve updated my SQLite3 Delphi wrapper for Unicode in Delphi 2009 and higher. Previous versions of the wrapper ducked the issue by using Ansi strings throughout.

image

I actually used Embarcadero Delphi XE for the development, but I would expect it to work in Delphi 2009 and higher, since it was in that version that Delphi first properly supported Unicode. Converting older Delphi projects is meant to be seamless, except in cases where you are using pointers or doing interop with native DLLs; of course this wrapper does both.

The SQLite 3 API expects either UTF8 or Unicode strings. To be more precise, some functions have Unicode versions indicated with a “16” suffix, and some do not, in which case they expect UTF8 if they accept string values. Although UTF8 strings support Unicode characters, most characters generally occupy a single byte just as in Ansi strings, so one of the things I discovered was that I could not simply rely on PChar, Delphi’s null-terminated string type, which from Delphi 2009 is a Unicode type with double-byte characters. Instead, for cases where the SQLite 3 API expects a UTF8 string, I have used PAnsiChar as before.

It is all somewhat confusing, and there are a few cases where Delphi does not do quite what you would expect. I recommend Marco Cantu’s paper Delphi and Unicode [pdf], one of the best resources I found. This article by Nick Hodges on Unicodifying your code is handy too.

Finally, in the example I keep an object in memory and it is easy to end up with code paths that do not free it. I love this feature of Delphi (since at least 2007) which informs you of your mistake when the application closes:

image

I have uploaded the code and you can find it linked here.

Update: My assumption that Delphi 2010 would work the same way as Delphi XE was incorrect. I have some code that reads a blob field containing a UTF8 string and returns it as a string. I read the stream into a byte array and then cast it to a UTF8String:

str := UTF8String(bytes);

where str is a UTF8string variable. This worked in Delphi XE, but in Delphi 2010 I got garbage. I have modified the code to use a TStringStream and now it works in both.

Updated SQLite wrapper for Embarcadero Delphi (and Free Pascal)

A while back I worked on a Delphi wrapper for SQLite 3, which I published on this site as an open source project. Others amended it to support Free Pascal and Lazarus, so you can use it on Linux and on the Mac. I’ve not touched it for a couple of years; but recently received an email requesting support for the SQLite 3 backup API. There are only a few functions involved so I added them to the wrapper, and also updated the Sqlite DLL to version 3.7.5.

Although I used Delphi XE to work on the wrapper, I did the build for the repository with Delphi 7, running in a virtual machine, because I know this version still has plenty of use. The problem though is that Delphi 2009 introduced full Unicode support, causing compatibility issues. My wrapper is compromised because it uses the old AnsiString, so that it works with all Delphi versions. I have in mind to fix this so you get full Unicode support when I have time to do so.

There is no support for Delphi’s data binding, and the wrapper appeals to developers happy to code their own SQL. Of course it works like lightning.

Delphi XE includes licenses for older versions back to Delphi 7

I’ve just picked up that Delphi XE, the latest RAD Windows development suite from Embarcadero, includes licenses for older versions going back to Delphi 7.

There’s an explanation and list of what’s on offer here. Delphi 7 was the last version to use the old fully native code IDE and is delightfully fast and lightweight by today’s standards. Delphi 2007 was the last version before big Unicode changes in Delphi 2009, which often broke code, so could be useful for older projects.

The FAQ includes a few points of interest. Embarcadero is dismissive of the old Delphi for .NET (before Prism) and will not supply it:

That is an old technology that was replaced by Delphi Prism and we don’t want to encourage use of that old product.

If you have purchased XE and want to take advantage of the offer, you must do so within 180 days.

Delphi XE still not quite ready for Vista/Windows 7

I’ve successfully installed Embarcadero RAD Studio XE (including Delphi). I’m running Windows 7 64-bit. On first quitting RAD Studio (which is still called bds.exe – it stands for Borland Development Studio) I got this message:

image_thumb2

Fortunately I know exactly what this means. Read here for my earlier explanation. And if I go to the registry editor I can see these entries:

image_thumb4

I also still get the error:

Error executing ‘C:\ProgramData\{7DE921C9-42C8-4DA3-8A44-043C3349FD1D}\Setup.exe’: The requested operation requires elevation

In one sense the error is not important, and the dialog does not reappear. It is still an ugly dialog, and as you can see from my Registry Editor, not a new one. Maybe next time?

Measuring start-up time for .NET, Java, C++

A comment here points me to this comparison by Decebal Mihailescu of start-up times for processes on Windows using different runtimes: .NET in several versions, Java 1.6, Mono 2.6.4, and Visual C++ 2010 (native code).

image

It is notable that native code is much faster than the runtimes, and that .NET is ahead of Java – to be expected, perhaps, since Windows is its native environment.

The test application is tiny and when we are talking about a time of less than a tenth of a second, users are unlikely to care much. I would like to see tests based on a larger application; on the other hand it becomes increasingly difficult to make a fair comparison.

It’s a shame Embarcadero Delphi was not included, though I’d expect similar figures to those for Visual C++.

Start-up time is critical to perceived performance. One reason I use an ancient version of Paint Shop Pro for simple image manipulation is that I can double-click an image and be editing it instantly, whereas alternatives like Adobe PhotoShop or the free paint.net make me wait. Unless I need the extra features these provide, I stick with fast and simple.

New Delphi, RAD Studio XE announced

Embarcadero has announced RAD Studio XE and will be showing a number of “sneak peaks” during August prior to release in “early September”. You can see the previews and further information here.

The suite includes Delphi XE, C++Builder XE, Delphi Prism XE (Delphi for Visual Studio and .NET) and RadPHP XE.

The first preview focuses on integrated Subversion support, a nice feature but hardly a game changer – most IDEs have had this for years, though this looks comprehensive with differencing, file history and so on within the IDE.

image

There’s also a look at RadPHP, which is a new version of Delphi for PHP. It is reminiscent of ASP.NET Web Forms, in that it gives a drag-and-drop visual designer and lets you quickly hook up code to event handlers such as a button click. There’s also a component model and the ability to set breakpoints for debugging. We even get the old listbox and editbox demo which I recall from Delphi 1 days.

image

Embarcadero’s Mike Rozlog blogs about the new product here.

I am a big fan of Delphi and C++ Builder, but my initial reaction is that developers are going to say, where is cross-platform for Mac and Linux that was talked about last year, where is 64-bit Delphi? None of this looks remotely cutting-edge.

The published Roadmap is short on dates, but I’m guessing some of this may come next year.

What next for Embarcadero Delphi? Roadmap with Mac, Linux support published.

Embarcadero has published an updated roadmap for its Delphi development tools: Delphi, C++Builder and the RAD Studio shared IDE. These tools combine the Object Pascal (Delphi) or C++ language with a visual component library and native code compiler for Windows.

Chief Technical Architect Michael Rozlog outlines four products which are being worked on, including “Fulcrum”, “Wheelhouse”, “Commodore” and “Chromium”. He says work is being undertaken on all of these, so the exact release schedule is not specified. Embarcadero has an annual release cycle for these products so you might reasonably project that Fulcrum is set for release later this year, Wheelhouse for 2011, and Commodore for 2012. Delphi 2010 came out in August 2009.

Delphi “Fulcrum” introduces a cross-compiler for Mac OS X, with the emphasis on client applications. The IDE will run only on WIndows. Rozlog also talks about integration with Microsoft Azure so that Embarcadero can tick the Cloud Computing box.

Delphi “Wheelhouse” adds Linux support, on a similar basis where the IDE runs only on Windows. It also adds a focus on server applications for both Linux and Mac OS X, including support for Apache modules.

Delphi “Commodore” is the 64-bit release, with 64-bit and easier multi-core development on all three platforms. Rozlog also tosses in “Social Networking integration” and “Better documentation”.

2012 is a long time to wait for 64-bit, particularly as the Windows server world is now primarily 64-bit. Embarcadero is promising a 64-bit compiler preview for the first half of 2011, though this will be command-line only.

Delphi “Chromium” is a revamp of the Visual Component Library with a new look and feel and “natural input integration” – location, voice, video motion.

In addition, Rozlog talks about updates for Delphi Prism, which is loosely the Delphi language plus a .NET compiler, and integrates into Visual Studio. Prism 2011 will work with Visual Studio 2010, and includes support for Mono. This extends to working “with MonoTouch to create Apple iPhone ready applications.” Rozlog doesn’t state whether this has been cleared with Apple’s Steve Jobs, who is opposed to use of languages other than Objective C for iPhone or iPad development.

Is Embarcadero doing enough to keep Delphi current? I’m not sure. Delphi is a fantastic RAD and native code compiler for Windows; in the past it suffered when Borland tried to extend it beyond that, to Linux and .NET, distracting development effort from its core role. The risk here is that the Mac and Linux effort may be more of the same. Of course this will be nice to have, though running the IDE on Windows and compiling for Mac is a limitation that means it will not appeal to Mac developers, only to Delphi Windows developers hoping to extend their market. But there are other ways to do cross-platform now –  Silverlight, Flash, web applications – and I wonder if the time for this has passed.

A compiler for iPhone and iPad would now be bigger news, especially since Silverlight and Flash are not available on these platforms, but for this Embarcadero would need to overcome Apple’s cross-compiler restrictions as well as solve the technical problems.

Windows 7 has breathed some new life into Windows client development. I hope Embarcadero is not neglecting areas like great RAD support for features like Jump Lists and thumbnail previews, for the sake of the uncertain cross-compiler market.

There is a discussion of the new Roadmap in the Delphi forums here, and Marco Cantu also comments.

Jewels from the loft: launch of Delphi, Netscape’s Constellation, HTML to die, Longhorn for developers

It’s the Easter holiday in the UK and I’ve suffered a bout of spring-clean fever. It is time, I decided, to clear out a mountain of old books and magazines.

A job like this always prompts reflections, the first of which is the sad decline of print journalism in the field of software development. It hurt to send piles of Byte, Exe, Dr Dobbs’s Journal, Application Development Advisor and others off for recycling.

image

A few things caught my eye. Exe June 1995, and there is a young Anders Hejlsberg talking to Will Watts about his new creation: Borland Delphi:

Before Delphi, you always had to make a choice. Do I go for the performance of a native code compiler, or the ease of use of a visual development environment? Do I go for a powerful object-oriented language, or a proprietary 4GL client/server tool? What programmers really want is all of the above, in one package. That’s what we set out to do.

What is striking about Delphi is that this was not hype. It delivered on that promise. It was better than its obvious rival, Microsoft’s Visual Basic, in almost every way (I will give VB a point for sheer ubiquity, especially in VBA guise). Delphi is still with us today, not bad after fifteen years. However, it never came close to VB’s market share, which shows that quality has never been the sole or even the most important determinant of sales success.

Next up is Byte, March 1998. “Reinventing the Web”, the cover proclaims. “XML and DHTML will bring order to the chaos”.

image

Inside there is a breathless description of how XML will change everything, and a quote from Jon Bosak:

HTML, this so-called ‘hypertext markup language,’ implements just a tiny amount of the functionality that has historically been associated with the concept of hypertext systems. Only the simplest form of linking is supported – unidirectional links to hard-coded locations. This is a far cry from the systems that were built and proven during the 1970s and 1980s.

Indeed. “We need to start replacing simple HTML with more powerful alternatives”, the article concludes. “The migration to XML must begin. The future of the Web depends on it.”

Here’s one thing that mostly did not work out as planned. The W3C tried to retire HTML, failed, and is now belatedly engaged in specifying HTML 5.

Byte March 1997 is also intriguing. Netscape’s Marc Andreessen smiles out of the cover.

image

Jon Udell, in the days before he disappeared into some Microsoft corridor, writes about Netscape’s “Constellation: the network-centric desktop”:

Netscape’s Constellation takes a less Windows-centric approach and puts more emphasis on location-independent computing, regardless of the platform. No matter what kind of system you’re using or where you are, Constellation presents a universal desktop called the Homeport. Although the Homeport can appear in a browser window, Netscape usually demonstrates it as a full-screen layer that buries the native OS – certainly one reason Microsoft is not embracing Constellation.

Netscape got a lot of things right, a true pioneer of what we now call cloud computing. What went wrong? Well, Microsoft went all-out to conquer Netscape by removing its browser dominance. Microsoft’s weapon was the free Internet Explorer.

It is all a pre-echo of what is happening now with Google and Microsoft, the difference being that Google has huge financial power thanks to its marriage of internet search and internet advertising. Unlike Netscape, Google is winning.

This blog is long enough; but I’ll give a brief mention to another jewel from the archives: a book given out at PDC 2003 entitled Introducing Longhorn for Developers.

image

It describes Microsoft’s vision for Longhorn: a radical new application model for Windows, building on XAML, WinFS and “Indigo”, the communication framework. It bears little resemblance to what eventually appeared as Vista, which is a shame as it was compelling in many ways.