03:36 lucasb left 08:38 Ven`` joined 10:34 Ven`` left 10:41 Ven`` joined 10:48 Ven`` left 10:57 Ven`` joined 11:17 lucasb joined 12:35 Ven`` left 12:49 Ven`` joined 13:28 Ven`` left 13:54 Ven`` joined
masak Ven``: I've been thinking about regexes lately. 13:54
Ven`` hi!
do tell :)
masak briefly, 13:55
(a) they're absolutely _essential_ for the whole `is parsed` story -- of course. now, `is parsed` isn't currently on the shortlist of things to do Soon, partly because it's a big thing to tackle
(b) I'm more and more in the mind of sitting down and designing what we need from scratch 13:56
(c) I think we need four things, roughly: (i) strings, (ii) "references"/calls, more on which below, (iii) quantifiers and alternations, and (iv) capture groups 13:57
(d) I want to approach this design by identifying the broad use cases regexes will have. something like "match true/false", "substitute string", "match and then query capture groups", "`is parsed`" -- those are the ones I've been able to think of 13:58
(e) the "references"/calls will do multiple things. the obvious one being refer to other rules/regexes. <&regex> is the syntax to do it in the lexical scope; <.regex> is the syntax to do it in an ambient "context", typically the current 007 parser 14:00
(f) the <whatever> syntax uses something lexical if it can, otherwise the late-bound thing against the context. it also does a named capture, just like () does a positional one 14:01
(g) but the <whatever> syntax can also work with Str (to literal matching), Match objects (and we'll probably want a <$0> syntax or similar for the match objects already captured), and maybe some other types 14:02
(h) in the fullness of time, some regexes could be constructed at compile time. basically if they're "well-behaved enough" and don't return to anything else that's not available statically 14:03
.
one of the big unanswered questions in the `is parsed` story is "how does something like <EXPR> end up putting a Q.Expr in the Match object?" 14:05
in Perl 6, the answer is actions -- but I've always felt that answer makes sense for grammars, but not so much for `is parsed` 14:06
I think I'd just like for *something* to be there -- in the worst case, we can iterate that into something better
15:56 Ven`` left 17:36 lucasb left 18:04 lucasb joined