September 2, 2014, 2:14 pm

So XE7 came out today. I downloaded it and installed it, curious about some of the stuff I’d heard.

So first, the installation experience. I really have no idea why it’s so needlessly complicated, but in order to install Delphi with the Android support, you need to do the whole thing twice: once without it and then again for the “add-on”. (Yeah, I got it. Remember my complaint a year ago about Embarcadero’s handling of all this? Well, to my surprise they actually listened!) The second install doesn’t seem to be installing an add-on; it looks like it’s running the entire installation process again! Why?!?

But despite the excessively lengthy installation process, everything went smoothly, with no interruptions, errors, or requests after it started actually installing things. That’s a huge improvement over the early Embarcadero days!

Next, I opened up the \source folder in Beyond Compare, checking it against XE6’s RTL. It found changes all over the place, but the vast majority of them were minor refactoring things. The only significant thing I found (outside of the cross-platform stuff, which I admittedly didn’t look too closely at) was the addition of the System.Threading unit, which adds a thread pool, a Task class, a Future<T> class, and a TParallel static class offering two basic functions: For and Join. (Join, as near as I can tell, is a special type of parallel for loop that works on an array of function pointers. Not sure why that’s something distinct from the normal parallel for loop.)

Also, there have been some syntactic improvements in array handling. It’s possible to declare a new array literal surrounded by brackets rather than parenthesis, like DWS and Oxygene. But there seem to be a few quirks in it.

[code lang="Delphi"] const GOOD: array of integer = [1, 2, 3, 4]; //this works BAD: array of integer = (1, 2, 3, 4); //error GOOD2: array [0..3] of integer = (1, 2, 3, 4); //this works var values: array of integer; begin values := GOOD; //[dcc32 Error]: E2008 Incompatible types values := GOOD2; //[dcc32 Error]: E2010 Incompatible types: // 'Dynamic array' and 'array[0..3] of Integer' values := [1, 2, 3, 4]; //this works values := values + [5, 6, 7]; //this works too! Yay! end; [/code]

However, if “GOOD” and “values” are both defined as TArray<integer> instead, it compiles and works as expected. So it’s the ancient Pascal array identity problem rearing its ugly head once more. Delphi has improved on enough classic Pascal points where room exists for improvement; why doesn’t it just finally make “array of X” always assignment-compatible with itself and get it over with? DWS does that and it works just fine!

The array concatenation syntax is interesting, though to be perfectly honest I don’t see much of a use case for it. But being able to do it is kind of cool, I guess.

So that’s it for now. I think enough things have finally improved in the language to make it worth taking a serious look at updating the TURBU codebase (currently still on XE) to the new version. I’ll have to see what that process is like.

I’d also like to update DWS to run on Android. I’ve been poking around with Android development for a while now, and one thing I was a bit horrified to learn is that there’s no good scripting solution anywhere. Script engines in general are in very short supply in Java-land, and the few that exist appear to be JVM only, with little or no Dalvik support. Android has something it calls a script system, but that’s for running self-contained “script apps”; there’s essentially no such thing as an in-process script engine to automate a larger program, at least if you don’t want to use JavaScript. (And it should come as no surprise to hear that I don’t. James Iry was absolutely right about it in his satirical comments on the history of languages!) DWS still has a few rough edges, (hey Eric, when are we gonna get closures?!?) but it’s a very nice scripting system, especially for those of us with a Delphi background, and it would be awesome to get it working on Android.

So, what’s your first impression of XE7? As always, comments are welcome, but please note that it is not actually a first impression if you haven’t actually installed and used the product yet. 🙂