gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRegularExpression uses unreleased ICU api


From: David Chisnall
Subject: Re: NSRegularExpression uses unreleased ICU api
Date: Mon, 29 Nov 2010 15:11:44 +0000

Since NSRegularExpression is currently iOS-only, it's probably not a big deal 
if it's not part of the default build for now (4.6 is due for release this 
week, so it should be packaged in a few weeks).  

Most of the UText stuff seems to have been added with 4.4 as a technology 
preview, and will be properly supported in 4.6.  This stuff is really important 
for good performance with strings, because ICU now uses an abstract data type 
for strings, meaning that we can simply expose Objective-C strings as ICU 
strings and vice versa, without the need to copy.  Without this stuff, we need 
to use UTF-16 strings as an intermediate format, so we end up with lots of 
redundant copying just to cope with interface mismatch (which will get really 
expensive when, for example, using NSRegularExpression for the find panel in a 
large text document).  

There's already some really horrible fallback code in NSRegularExpression to 
let it compile with GCC (this will break anything that tries to subclass it, 
but that's unavoidable until gcc gets blocks support), so I'd rather not 
complicate it any more than is absolutely required - adding fallback for older 
versions of ICU would mean that we'd need 4 different code paths, which is not 
really maintainable.

David

On 29 Nov 2010, at 15:00, Stef Bidi wrote:

> I took a quick look at some of the functions you used and in the ICU 4.4.1 
> documentation is states: "Do not use. This API is for internal use only. ICU 
> 4.4 technology preview".  Maybe there should be some fall back code?
> 
> Since we've started requiring libicu recently (NSLocale and 
> NSRegularExpression) it might be a good idea to pick a particular version to 
> be compatible to.  If a newer version is required for a particular feature a 
> check should be made at compile time.  If I'm not mistaken, NSLocale requires 
> 3.8 or above (most functions are stable since 2.0, but a few require higher 
> versions).  I would say requiring 4.0 to build libicu stuff would be a good 
> idea and we can check for 4.4 or 4.6 for additional features.
> 
> Stef
> 
> On Mon, Nov 29, 2010 at 7:16 AM, David Chisnall <address@hidden> wrote:
> On 28 Nov 2010, at 23:29, Eric Wasylishen wrote:
> 
> > Hey David,
> > Compiling base on Ubuntu 10.10 fails because NSRegularExpression is using 
> > ICU 4.6 API (the regex_*UText) functions. We should probably not use these 
> > yet as ICU 4.6 isn't yet released. Otherwise, configure needs to be tweaked 
> > to require 4.6.
> > Eric
> 
> That's weird - I have 4.4 installed on FreeBSD and it WorksForMeâ„¢.  Maybe the 
> Ubuntu packages do something odd?
> 
> In theory, we could avoid using them, but we'd be turning a lot of O(1) stuff 
> into O(n) stuff, which I'm not especially keen to do...
> 
> David
> 
> --
> This email complies with ISO 3103
> 
> 
> _______________________________________________
> Gnustep-dev mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gnustep-dev
> 
> _______________________________________________
> Gnustep-dev mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/gnustep-dev


-- Sent from my STANTEC-ZEBRA




reply via email to

[Prev in Thread] Current Thread [Next in Thread]