• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: 3rd Party Nonsense (was Re: Regular Expressions?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 3rd Party Nonsense (was Re: Regular Expressions?)


  • Subject: Re: 3rd Party Nonsense (was Re: Regular Expressions?)
  • From: glenn andreas <email@hidden>
  • Date: Sat, 07 Jun 2008 13:01:55 -0500


On Jun 7, 2008, at 12:37 PM, Kevin Grant wrote:

It is possible to link your application through C to an
interpreter like Python or Perl, and rely on the built-in
regular expression libraries to do your work.  If you
really wanted to, you could fire off a call to /usr/bin/egrep.


That last one would possibly be the worse of all possible ways - the cost involves spanning another process (potentially for each regex), sending a potentially large string to it, parsing the output back from it to get any sort of results, made all the more complicated by the fact that there are all sorts of weird involved when sending non-ASCII to another process (since environment variables get involved to determine encoding schemes - and you have no way of knowing what the user set up in the hand full of default encoding environment parameters that exist).


NSTask works great for some things - shlepping large amount of string data back and forth for a simple utility isn't one of them.

These are all part of the default Mac OS X platform, they
require no dependency on a bundled framework, and have no
license issues.

Can't speak for Perl, but the Python framework changes from OS version to OS version, which can potentially cause problems with linking to it, so suddenly this introduces an OS dependency. There is no "forward compatibility guarantee" that is implicit in various parts of AppKit (granted, there are occasionally problems there, but those tend to be the except




In all honesty, you wouldn't want Apple to "implement" this
itself, because they'd have to start from scratch and there
would be bugs.  I listed 3 implementations that are very
mature and powerful.

Except that there already is a very good regex engine as part of the OS (ICU) which is used by some parts of the system already - it's just not fully exposed in Cocoa (so it's not like they'd be implementing it from scratch at all). Asking that they take that last step seems like a very reasonable request (and it has been discussed for many-an-OS- release).





Glenn Andreas email@hidden <http://www.gandreas.com/> wicked fun! m.o.t.e.s. | minute object twisted environment simulation



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Regular Expressions? (From: "Cemil Browne" <email@hidden>)
 >Re: Regular Expressions? (From: Jason Stephenson <email@hidden>)
 >Re: Regular Expressions? (From: glenn andreas <email@hidden>)
 >Re: Regular Expressions? (From: "Stephen J. Butler" <email@hidden>)
 >Re: Regular Expressions? (From: Ilan Volow <email@hidden>)
 >3rd Party Nonsense (was Re: Regular Expressions?) (From: Jason Stephenson <email@hidden>)
 >Re: 3rd Party Nonsense (was Re: Regular Expressions?) (From: "Kyle Sluder" <email@hidden>)
 >Re: 3rd Party Nonsense (was Re: Regular Expressions?) (From: Kevin Grant <email@hidden>)

  • Prev by Date: Re: 3rd Party Nonsense (was Re: Regular Expressions?)
  • Next by Date: Re: Garbage collector vs variable lifetime
  • Previous by thread: Re: 3rd Party Nonsense (was Re: Regular Expressions?)
  • Next by thread: Re: 3rd Party Nonsense (was Re: Regular Expressions?)
  • Index(es):
    • Date
    • Thread