View previous topic :: View next topic |
Author |
Message |
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Mon Jan 23, 2006 7:34 am Post subject: Regex |
|
|
Hi Sean;
I gave some thought to the regex issue. Perhaps it's best for Ares to not bother with it for now (unless you have explicit plans for it)? I say this because (a) it doesn't extend readily to wchar or dchar (b) it's possible that a templated solution would be better, and (c) there's Ragel to consider also. For the time-being, I'm just going to bundle a char-only version of Regex with the mango.text package instead.
Spent some time over the weekend trying to make Walter's regex work for dchar, but some of the pattern matching is embedded within the pseudo-instruction stream. Rather than introduce errors, I thought about using Eric's template approach ~ that should operate more cleanly given the latest compiler fixes.
2 cents. |
|
Back to top |
|
|
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Tue Jan 24, 2006 11:50 am Post subject: |
|
|
I'd like to have regex parsing in eventually, and adding the Phobos implementation seemed like a quick way to do so until I got around to messing with it. So I don't mind keeping it in, though I'd be quite happy to replace it with something a bit more flexible as I expected I'd want to do that anyway. |
|
Back to top |
|
|
Don Clugston
Joined: 05 Oct 2005 Posts: 91 Location: Germany (expat Australian)
|
Posted: Wed Jan 25, 2006 7:42 am Post subject: |
|
|
If you are considering a template-based regexp, that brings up the question of whether my 'meta' library should eventually find a home here.
So far, 'meta' has mostly consisted of proof-of-concept stuff to identify language bugs and explore possible new features. It's been full of workarounds. But D templates have matured a lot in the last few releases. This part of D is not yet stable enough for inclusion in a real library, but the day is not far off.
(In contrast, I think the way that you'd write DTL would change dramatically once implicit function instantiation was included).
If this were the case, I would begin to adjust the structure of 'meta' to more closely mirror ares as it evolves. Something to think about.
(You don't seem to have many formal contributers to Ares, but please think of my 'meta' and 'MathExtra' libraries as unofficial contributions-in-progress). |
|
Back to top |
|
|
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Mon Jan 30, 2006 1:27 pm Post subject: |
|
|
Quote: | If you are considering a template-based regexp, that brings up the question of whether my 'meta' library should eventually find a home here. |
It would be nice. I'd intended to add a type traits module at the very least, but the more tools to work with in this area the better.
Quote: | (In contrast, I think the way that you'd write DTL would change dramatically once implicit function instantiation was included). |
I agree. And this is one reason I've been slow to investigate container libraries--I'm hoping that if I stall long enough, Walter will let us know for sure whether implicit instantiation will make it into 1.0.
Quote: | (You don't seem to have many formal contributers to Ares, but please think of my 'meta' and 'MathExtra' libraries as unofficial contributions-in-progress). |
Thanks It was a bit daunting to think I might have to do everything myself.
As for regex... I think it would be nice to have both compile-time and run-time tools to work with. If the module you're working on with Eric can handle both then so much the better, but I'll take what I can get One thing--I noticed in your recent post to d.D that you were suggesting a Ruby-like syntax (I assume anyway, I've never used Ruby). Why not the 'traditional' syntax, with a trailing dot for one-or-more, trailing star for zero-or-more, etc? Does the other make for simpler expressions or more flexibility? I'll admit that to this point most of my experience with regular expressions has been in lexer definitions, so I haven't been exposed to most of the alternate forms. |
|
Back to top |
|
|
Don Clugston
Joined: 05 Oct 2005 Posts: 91 Location: Germany (expat Australian)
|
Posted: Tue Jan 31, 2006 2:44 am Post subject: |
|
|
Quote: | And this is one reason I've been slow to investigate container libraries--I'm hoping that if I stall long enough, Walter will let us know for sure whether implicit instantiation will make it into 1.0.
|
I hope so too. Seems to me that the big future features are:
1. implicit instantiation
2. the new 'auto' syntax for RAII
3. array literals
4. array operations.
It's clear that #4 is a 2.0 feature, because it requires changes to the back end. I think it would be dreadful for #2 to happen after a 1.0 release because it would break a lot of code. We can live without #3. But #1 affects everything.
Quote: | One thing--I noticed in your recent post to d.D that you were suggesting a Ruby-like syntax (I assume anyway, I've never used Ruby). Why not the 'traditional' syntax, with a trailing dot for one-or-more, trailing star for zero-or-more, etc? Does the other make for simpler expressions or more flexibility? I'll admit that to this point most of my experience with regular expressions has been in lexer definitions, so I haven't been exposed to most of the alternate forms. |
Actually, I'd just copied the line from Matthew's post. I have no idea what the right way to go is, I was just illustrating the fact that it's possible for us to provide almost any desired syntax (unlike the compile-time regexps in boost, which are tied to the C++ operators and therefore horrible). My role in the library is just to make the primitives, I'm only a novice regexp user. |
|
Back to top |
|
|
Don Clugston
Joined: 05 Oct 2005 Posts: 91 Location: Germany (expat Australian)
|
Posted: Tue Feb 07, 2006 7:47 am Post subject: News flash! |
|
|
Quote: | And this is one reason I've been slow to investigate container libraries--I'm hoping that if I stall long enough, Walter will let us know for sure whether implicit instantiation will make it into 1.0. |
I got an answer!
Walter wrote:
Quote: |
I thought I'd have
implicit function template instantiation by now, but haven't even started on
it. I'd spent a lot of time working on the other template problems you
uncovered. I'd say hold off on designing a template library without implicit
function template instantiation. |
There are some major implications of this for Ares, I think. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|