pugscode.org/ | nopaste: sial.org/pbot/perl6 | ?eval [~] <m oo se> | We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by diakopter on 11 July 2007.
moritz_ good morning 08:14
does anybody else has problems connecting to irc.perl.org?
connection times out 08:15
Aankhen`` Not here. 08:17
moritz_ dammit 08:21
sstanvir what is the regular expression for a range of numbers? 10:16
for example, 21-58 , the regular expression would be [21-58] ? 10:17
will anybody please answer..? 10:21
Juerd sstanvir: Regular expressions don't work like that. A regex has no concept of "number", only of characters. 10:27
fglock building a regular expression that recognizes all the possible strings in a range of numbers is possible, but it's complicated 10:28
Juerd sstanvir: To match 21..58, you'd need to come up with something that matches all possible combinations of digits: /^(?: 2[1-9] | [34][0-9] | 5[0-8] )\z/x
sstanvir: Clearly this is something you should not be using a regex for. 10:29
sstanvir Juerd, but I hv to hv some sort of regular expression 10:38
based on user's input I hv to prepare the expression
I can make if I know the start and end
like for 21-58: I can prepare 2[1-9]|(3|4)[0-9]|5[0-8] 10:39
but when I dont know the start and end.. is there any way ?
[$start - $end] is not the right RE for range?
sstanvir .... 10:47
spinclad you are right, that RE has nothing to do with a range of int values 10:49
spinclad how about something like: / $n := (\d+) { fail unless +$n ~~ ($start .. $end) } / 11:00
sstanvir: ^ 11:01
sstanvir :) 11:02
yes, spinclad
I was trying to prepare an algorithm
but I didnt understand ur algorithm
spinclad match a number, bind to $n; reject it if as a number it's out of range. 11:03
sstanvir actually I dont know the range.. 11:04
all I need is to prepare the RE based on user input
if user inputs min:100 max: 50005 the regular expression has to be something that matches 100-50005 11:05
spinclad oh, you need to match a range but you don't know its bounds? that could be harder, indeed.
sstanvir hmm
yes, whatever user inputs the Regular expression will be generated based on that
spinclad ok, so by the time you use the RE, you know the bounds. all set then, i think. 11:07
sstanvir its like if user inputs 21, 58 the RE would be 2[1-9]|34[0-9]|5[0-8] 11:10
but if user inputs 71, 93 11:11
spinclad well, if you don't like my way, have fun 11:11
sstanvir it has to be 7[1-9]|8[0-9]|9[0-3] 11:12
what is ur way spinclad, I didnt get u
spinclad $n := (\d+) { fail unless +$n ~~ ($start .. $end) } /
sstanvir but its not for checking.. I hv to generate the RE and save into DB
spinclad this is an RE that matches a range. save it to the DB with values for $start and $end. 11:13
or else you have more constraints than you've said as yet. 11:14
spinclad you are talking about Perl 6 RE's, yes? 11:15
sstanvir actually I am trying in php
spinclad oh. no idea. ask in #php maybe. 11:16
sstanvir sorry for not mentioning earlier
thnx anyway, spinclad 11:19
moritz_ kp6: say "back again" 12:44
exp_evalbot r18880: OUTPUT[back again␤]
fglock I and ruoso were talking about making MiniPerl6 a "stage1" compiler, and KindaPerl6 would be "stage2" 15:30
ruoso this basically mens that MP6 would then generate code targetting KP6 runtime 15:31
fglock this makes it possible to rewrite the MOP in MiniPerl6 15:31
ruoso and the kp6 bootstrap would be easier also 15:32
as there would be no runtime divergence
as there is today
fglock hmm - Haskell has a stage3 compiler
ah, gcc does too 15:33
fglock mp6-stage1 compiles MOP.pm, 15:56
mp6-stage2 uses MOP.pm,
kp6 is stage3
dlocaus 'allo! 16:01
fglock dlocaus: hi!
dlocaus fglock: I'm confused about a practice of yours. 16:02
Sometimes you use "$::meta_(something)" and other times you will do "my $meta_something" 16:03
dlocaus scratches his head
dlocaus fglock: here is an example of a global meta container 16:05
dev.pugscode.org/browser/v6/v6-Kind...er.pm#L162
here is an example of a lexical container
dev.pugscode.org/browser/v6/v6-Kind...er.pm#L206
are the meta_ values supposed to be lexical or global?
fglock dlocaus: looking 16:06
dlocaus: I'd rather use ::DISPATCH( $::Container, 'HOW' ) everywhere, instead of $mets_XXX 16:08
meta_XXX
dlocaus ah, ok. 16:09
pmurias_ i guess calling MiniPerl6 stage1 is sort of fine (as stage1 is the previous version) 16:21
pmurias_ mp6-stage-2 would be a diffrent code base? 16:21
ruoso pmurias_, calling mp6 stage 1 have a different meaning from what it is today 16:25
fglock pmurias_: mp6-stage2 would use the MOP calling conventions
ruoso as mp6 currently doesn't target kp6 runtime
fglock but it's the same code
ruoso mp6 stage 1 would generate mp6 with kp6 runtime
fglock same source code
ruoso: that's stage 2,
ruoso yep... yep... 16:26
fglock stage 1 is low level
ruoso sorry
moritz_ can kp6 compile mp6?
fglock yes, it should
moritz_
.oO( or is that a forbidden question? ;-)
ruoso in theory, we could make it completely in kp6 16:26
ruoso the problem is that kp6 is too complex to bootstrap 16:26
fglock which means, kp6 could do stage 1
ruoso and one of the reasons kp6 is so complex 16:27
is because mp6 is not a "stage 1" compiler
not today, I mean
fglock ruoso: how about making kp6-stage1?
ruoso we need kp6-kp6 working for that 16:28
ruoso which is a complicated task 16:28
fglock we just need a special emitter
ruoso ah... that.. yes
in fact
fglock :)
ruoso but without bootstrapping kp6, it won't be much usefull
moritz_ what's the problem with bootstrapping kp6? BEGIN blocks? 16:29
pmurias_ moritz_: parsing it
ruoso moritz_, incompatibilities between mp6 runtime and kp6 runtime
ruoso kp6 counts on mp6 runtime today 16:29
fglock ruoso: it's as useful as mp6-stage1, but possibly easier
ruoso it needs to be ported to be pure-kp6
fglock, mp6 already is the compiler for kp6 16:30
mp6-stage1 would just provide a different runtime to mp6-as-it-is-today
fglock yes, but kp6-stage1 would replace mp6
than we can implement kp6-stage2
ruoso fglock, only when you bootstrap it
fglock kp6-stage2 would compile kp6 to stage3 16:31
ruoso it won't replace it before that
fglock using the "kp6" runtime 16:31
it works the same, whether you use mp6 or kp6
ruoso hmmm
fglock but using kp6 is "cleaner" 16:31
ruoso putting it clearly... stage1 generates a "libkp6" which is the runtime used by "stage2" 16:32
used by the code generated by stage2 I mean
fglock yes, stage1 compiles the MOP 16:33
(stage1 doesn't use or need the MOP)
ruoso stage2 compiles itself using the MOP
fglock yes
ruoso to get to stage3, which is the final compiler
so, the compiler from stage1 needs to be bootstrapped 16:34
in stage2
to result as the stage3 compiler
fglock hmm - so in the end we really need mp6, because kp6-in-kp6 is not portable? but we can still cross-compile 16:35
so it's not a problem
pmurias is mp6 portable? 16:36
ruoso I was just saying that bootstrapping mp6 is easier than bootstrapping kp6
fglock it's reasonably portable
pmurias ruoso: you mean changing mp6 to emit kp6-calling-conventions code 16:37
ruoso and if we bootstrap from mp6, it will be easier to later bootstrapping kp6
pmurias ?
ruoso pmurias, that is the stage2 compiler
pmurias i think mp6 is bootstraped
ruoso pmurias, it is, but it is not a cross compiler 16:38
stage2 is a cross-compiler
it runs using the mp6 runtime, but generates kp6 runtime
fglock ok, I think keeping mp6 is saner 16:39
because kp6 won't recompile easily with a stage1/2 compiler
ruoso yep... that's the point...
on the other hand...
pmurias fglock: keeping mp6 in the long term or untill a working bootstrap?
ruoso it will be very much easier to bootstrap kp6 once we have a stage1/2 mp6
fglock pmurias: keeping it for future bootstraps 16:40
ruoso pmurias, after kp6 bootstrap, we can implement a cross-compiler in kp6
but it would be hard to do it before the bootstrap 16:41
fglock that's a plan :) 16:41
pmurias kp6 is a cross-compiler now 16:42
ruoso pmurias, not until it is bootstrapped
it can't compile itself
fglock all we need is to port kp6-emit-perl5 back to mp6
ruoso fglock, not exactly 16:42
the code mp6-stage1 should emit is different 16:43
because it's kp6-lowlevel
it just declares the data structures that the stage2 compiler will use
but it can't use it yet
mp6-stage1 can't use $::DISPATCH, as it is the one who will define it
it will use low-level runtime to declare what "$::DISPATCH" is 16:44
fglock ruoso: mp6-stage1 is the current mp6
ruoso fglock, kinda
the MOP is missing 16:45
I mean
the MOP source, so it can be a stage1 in a practical term
fglock yes, but that's a library problem - the compiler is ok
dlocaus wonders why he always has 3 computers and only 1 motherboard manual.
fglock you can develop and refine the MOP separately 16:48
ruoso but you need to recompile the entire compiler (all 3 stages) everytime you do it 16:54
dlocaus argh, I'll never buy a single processor MB again.
3.2Ghz, and these tests take forever. 16:55
fglock ruoso: from stage 2 and up
pmurias from stage 3 and up 16:57
fglock Namespace.pm still doesn't work :( 16:58
coffee & 17:02
pmurias won't mp6-stage2 be horribly slow? 17:21
dlocaus Is there a particular reason that we use perltidy to produce output to STDOUT? 17:27
forcing standard out in util/perltidyrc "-st" seams makes things awkward. Does anyone mind if I fix this?
moritz_: ?
pmurias dlocaus: where should perltidy output to then? 17:28
fglock re slow, maybe - but perl5rx should fix that until we have an optimizer 17:29
pmurias so we would also have to backport perl5rx?
dlocaus pmurias: in many places the xecution of perltidy is such
perl ... | perltidy -pro=util/perltidyrc > $@
when it could be
perl ... | perltidy -pro=util/perltidyrc -o $@
pmurias: by forcing "-st" it screws up internal perl "use Perl::Tidy" executions by causing havoc with the I/O 17:30
fglock pmurias: hmm 17:30
pmurias dlocaus: i think you could change it 17:31
dlocaus pmurias: ok
fglock pmurias: we have the option to keep the grammar compilation in stage1, which is more optimized 17:32
it almost makes sense
dlocaus all: I don't mean to seam all needy with these questions. It is just that in the "programming culture" I grew up in, messing around with another programmers code (uninvited) was just not done, unless it had to be fixed "now!". And if you messed around just to make "style" changes... omg. 17:33
fglock dlocaus: the reason to use Perl::Tidy was to keep diffs smaller,
but it actually messes up with some regexes 17:34
so it was disabled for kp6-kp6
dlocaus ok.. I'll see if I can find some place to note that. 17:34
fglock please do what you are pleased to do :) 17:35
dlocaus :)
pmurias fglock: re "style" why do you use }\nelse {? 17:36
fglock pmurias: how do you like it? 17:37
pmurias i can cope ;)
fglock I think I read it in a style guide smewhere
somewhere
how do I fix "A checksum mismatch occurred: ... Perl-6.0.0-STD.pm" (in my feather svk repo) 17:40
pmurias svk up?
fglock "svk up" gives no errors, but "svk up -s" does 17:41
pmurias fglock: did you fix it? 17:49
fglock no
pmurias fglock: i don't think i can help with that :( 17:53
fglock pmurias: np, that's not my main devel machine 17:55
Tene "}\nelse {" is recommended in PBP as I recall. 17:57
PerlJam cuddled elsed are frowned upon, yes. 17:58
pmurias is suprised 17:59
Juerd Frowned upon even. 18:02
Juerd Interesting 18:03