»ö« | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, alpha:, pugs:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend! Set by moritz_ on 25 June 2010. |
|||
alksentrs | So you don't have to put parens in ( ...long expression... ).perl.say | 00:00 | |
masak | alksentrs: .perl.say given ...long expression... | 00:01 | |
alksentrs | rakudo: .perl.say given 3 + 5 | ||
p6eval | rakudo f8e959: OUTPUT«8» | ||
00:02
Psyche^ joined
|
|||
TimToady | rakudo: 3+5 ~~ .perl.say | 00:03 | |
p6eval | rakudo f8e959: OUTPUT«8» | ||
alksentrs | Perl 6 has a steep learning curve | 00:04 | |
TimToady | in spots | ||
alksentrs | When I was learning it, anything involving : as syntax was incomprehensible | 00:05 | |
e.g. :a<b> | |||
TimToady | yes, : is one of the highly context sensitive characters | ||
masak | alksentrs: you are not alone in that. | 00:06 | |
00:06
jhuni left,
Patterner left,
Psyche^ is now known as Patterner
00:08
Italian_Plumber joined
00:10
risou joined
|
|||
alksentrs | In something like say(2 + * + (* + 4)), how does Perl know how far to extend the implicit block? | 00:10 | |
TimToady | to the first approximation, it's only defined over infixes | 00:11 | |
with *.foo as a special case | |||
alksentrs | right | ||
TimToady | and unaries, I mean | ||
00:12
risou left
|
|||
alksentrs | ok | 00:12 | |
TimToady | rakudo: sort -*, <3 5 2 59 382 7> | ||
p6eval | rakudo f8e959: ( no output ) | ||
TimToady | rakudo: say sort -*, <3 5 2 59 382 7> | ||
p6eval | rakudo f8e959: OUTPUT«382597532» | ||
TimToady | rakudo: say ~sort -*, <3 5 2 59 382 7> | 00:13 | |
p6eval | rakudo f8e959: OUTPUT«382 59 7 5 3 2» | ||
TimToady | arguably *.foo is just a unary | ||
but the args have to curry correctly | 00:14 | ||
00:14
azert0x left
|
|||
TimToady | re steep learning curve, we hope that for most people that turns into a long learning curve, where they learn things only as they need them, and can get away with cargo-cult programming where they don't understand completely yet | 00:15 | |
Quadrescence | rakudo: say ~sort ***, <3 5 2 59 382 7> | ||
p6eval | rakudo f8e959: OUTPUT«===SORRY!===HyperWhatever (**) not yet implemented at line 22, near "*, <3 5 2 "» | ||
TimToady | some people insist on marching straight up the cliff, though :) | 00:16 | |
Quadrescence | rakudo: say ~sort 2**, <3 5 2 59 382 7> | ||
p6eval | rakudo f8e959: OUTPUT«===SORRY!===Confused at line 22, near "say ~sort "» | 00:17 | |
TimToady | ** is an operator | ||
Quadrescence | yes indeed | ||
rakudo: say ~sort 2*(*), <3 5 2 59 382 7> | |||
p6eval | rakudo f8e959: OUTPUT«2 3 5 7 59 382» | ||
Quadrescence | good work good work | ||
let's take a look at ambiguity | 00:18 | ||
rakudo: say ~sort 2***, <3 5 2 59 382 7> | |||
00:18
lichtkind left
|
|||
p6eval | rakudo f8e959: OUTPUT«2 3 5 7 59 382» | 00:18 | |
TimToady | not really ambiguous under LTM rules | ||
Quadrescence | This reminds me of Mathematica's pure functions, kind of. (<expression-containing-#>)& | 00:19 | |
(#+1)& ==> (lambda (x) (+ x 1)) | |||
00:20
azert0x joined
|
|||
TimToady | x +? | 00:20 | |
oh, lisp | |||
:) | |||
Quadrescence | (: | 00:21 | |
TimToady | -> $x { $x + 1 } hereabouts | ||
is how we spell lambda | |||
well, that, and *+1 | |||
and { $^x + 1 } | |||
and { $_ + 1 } | |||
and...and...and... | |||
alksentrs | On perlcabal.org/syn/, would it be possible to have better link descriptions than "X tags" and "C tags"? Not everyone knows POD. | ||
TimToady | um, yes? | 00:22 | |
alksentrs: would you like a pugs commit bit so you can fix it? | 00:25 | ||
alksentrs | I've never used SVN before... (I have used Git) | ||
TimToady | we're probably switching it to git pretty soon | ||
Quadrescence | TimToady: I dare you to use ⍵ instead of * as the formal parameter. ;) | 00:27 | |
TimToady | why? is there prior art? | 00:28 | |
Quadrescence | Should I leave "why?" as an exercise? | ||
TimToady tends not to have read math papers | |||
TimToady prefers his greek to come the classical way | 00:29 | ||
Quadrescence | I guess you tend not to read APL either. ;) | ||
(neither do I) | |||
00:30
ruoso joined
|
|||
alksentrs | Why are there 2 versions of Term::ANSIColor on modules.perl6.org/ ? (Perl6-Term--ANSIColor and perl6-Term-ANSIColor.) | 00:30 | |
00:30
_macdaddy left,
azert0x left
|
|||
masak | rakudo: my @a = 1, 2, 3; my %h = :@a; @a = (); say %h.perl # sometimes I expect cloning behavior in the second statement | 00:31 | |
p6eval | rakudo f8e959: OUTPUT«{"a" => []}» | ||
masak | or maybe in the third one. | 00:32 | |
TimToady | maybe you should program in a language without side effects | ||
masak | :) | 00:33 | |
alksentrs | rakudo: {}[-1] | 00:34 | |
p6eval | rakudo f8e959: OUTPUT«Null PMC access in get_string() in 'Any::postcircumfix:<[ ]>' at line 1659:CORE.setting in main program body at line 1» | ||
masak submits rakudobug | |||
Quadrescence | rakudo: {{}}[-1] | 00:35 | |
TimToady | std: {}[-1] | ||
p6eval | rakudo f8e959: ( no output ) | ||
std 32122: OUTPUT«===SORRY!===Unsupported use of [-1] subscript to access from end of array; in Perl 6 please use [*-1] at /tmp/wdmhyaF1XE line 1:------> {}[-1]⏏<EOL>Parse failedFAILED 00:01 115m» | |||
alksentrs | rakudo: {}() | 00:36 | |
p6eval | rakudo f8e959: OUTPUT«invoke() not implemented in class '' in main program body at line 22:/tmp/7rA5fvKgZR» | ||
masak | rakudo: {}[2] | ||
p6eval | rakudo f8e959: ( no output ) | ||
alksentrs | "class '' "? | ||
TimToady | usually means a parrot type leaking through | ||
masak | moritz_++ submitted a very similar ticket today. | 00:37 | |
Quadrescence | rakudo: {}[({{2}}[0])[0]] | 00:38 | |
p6eval | rakudo f8e959: ( no output ) | ||
alksentrs | rakudo: grammar G {}; G.parse('') | 00:39 | |
p6eval | rakudo f8e959: OUTPUT«Method 'TOP' not found for invocant of class '' in 'Grammar::parse' at line 5871:CORE.setting in main program body at line 22:/tmp/fVBDHf3NAX» | ||
00:45
espadrine left
|
|||
masak | Rakudo really sucks at reporting the right names of classes. | 00:46 | |
rakudo: class A {}; A.foo | |||
p6eval | rakudo f8e959: OUTPUT«Method 'foo' not found for invocant of class '' in main program body at line 22:/tmp/IiczNZ8QJZ» | ||
dalek | psi: da2dcaa | masak++ | / (2 files): [Yapsi] Detect variable use before declaration A semi-substantial patch. Keeps track of the 'currently visible variables' to detect a use-before-declaration. This unbreaks two previously failing tests. |
00:50 | |
psi: 5f23b48 | masak++ | t/runtime.t: [t/runtime] uncommented one more test This test has been working since before last release, as a matter of fact. |
00:56 | ||
pugssvn | r32123 | colomon++ | [t/spec] Unfudge two tests that now work. | 00:57 | |
01:02
masak left
|
|||
dalek | psi: 6baad9f | masak++ | t/ (2 files): [t] whitespace therapy |
01:03 | |
01:05
meppl left
01:09
cjk101010 left
01:21
alksentrs left
01:23
yrgd left
01:31
yrgd joined
01:36
jferrero left
01:37
hercynium left,
whiteknight left
01:45
hercynium joined
01:52
masak joined
|
|||
masak | did you know that you can now use 'when' as a statement modifier? www.effectiveperlprogramming.com/blog/543 | 01:55 | |
std: my $a = our $a | 02:04 | ||
p6eval | std 32123: OUTPUT«Potential difficulties: Useless redeclaration of variable $a (see line 1) at /tmp/QdzuD4bQpC line 1:------> my $a = our $a⏏<EOL>ok 00:01 117m» | ||
02:08
agentzh joined
|
|||
masak | another use case for the $obj.&subroutine() form: inside an interpolated string, when you're too lazy to use curlies ;-) | 02:08 | |
TimToady | gah, they put break semantics on the statement modifier. I wish they'd follow Perl 6's lead here instead of just making stuff up. | 02:11 | |
tylercurtis | O.o while (...) { ... when ...; } | 02:13 | |
masak | TimToady: you should go talk to them. | ||
colomon | oooo! to maximize something, one should not use min! | 02:14 | |
FurnaceBoy | colomon++ | ||
masak | colomon: I think I read a theorem about that once. | ||
colomon couldn't figure out how he'd broken the weasel evolution algorithm.... | |||
masak | colomon: did yours try to produce the diametrical opposite of METHINKS IT LOOKS LIKE A WEASEL? :P | 02:15 | |
colomon | yes, exactly. | ||
FurnaceBoy | lol | 02:19 | |
Shakespeare refudiated? | |||
colomon | "QFDCATVXGTHKZXTPWIZWUGRDGKRI" | ||
masak | yes. that is the diametrical opposite. | 02:20 | |
FurnaceBoy blinks | |||
masak | it has no characters in common in the appropriate locations. | ||
FurnaceBoy | ahhh a derangement ? | ||
masak | not at all. | ||
simply optimized for not being like the target string. :) | |||
FurnaceBoy | ic | ||
colomon | and since it was the initial string, it never got any worse or better, it just stayed there. | 02:21 | |
masak | of course. it's optimal :) | ||
colomon | slowly recalculating, desperately looking for a string which was even worse. | ||
masak | :) | 02:22 | |
can't improve on perfection. | |||
02:24
leprevost joined
02:27
jhuni joined,
Italian_Plumber left
02:32
flatwhatson left
02:36
flatwhatson joined
02:40
bluescreen joined
02:41
bluescreen is now known as Guest97742
|
|||
colomon | my version of the weasel: gist.github.com/560146 | 02:46 | |
masak | colomon: (^($target.chars)).map({ @chars.pick }) | 02:52 | |
that looks odd to me. | |||
@chars.pick($target.chars) would have worked fine. | 02:53 | ||
colomon | ooooo, better! | ||
and looked nicer. | |||
masak++ | |||
masak | hm, { fitness $_ } or *.&fitness ? :) | 02:55 | |
the 'say' line should be moved to the start of the while loop to avoid duplication. | 02:56 | ||
oh, belay that. | |||
colomon | masak: I've been trying to figure out the right approach for that. | ||
masak | then you won't get the last one, of course. | ||
colomon | yeah, it needs to come before and after. | ||
masak | we need an NOW_AND_LAST block :P | 02:57 | |
s/an/n/ | |||
erghbl. | |||
s/an/a/ | |||
colomon | eerr, wait, it needs :replace | 03:00 | |
masak | oops. sorry :/ | ||
colomon | next step: optimize max? | 03:02 | |
right now it does twice as many calls to $by (in this script) than it actually needs to. | 03:04 | ||
masak | why? | ||
tylercurtis | It does $by($a) cmp $by($b) every time with a unary $by instead of caching the transformed values. | 03:05 | |
colomon | you don't need to cache. | ||
you just need to keep track of the least result from $by as well as the input value that got that least result | 03:06 | ||
masak | colomon++ | ||
colomon | I've been meaning to get around to implementing that for about five months, I think. :) | 03:07 | |
03:07
dju left
|
|||
colomon | afk # bed | 03:08 | |
masak | 'night, colomon! | 03:09 | |
03:09
FurnaceBoy left
03:15
dju joined
03:27
Transformer joined
03:29
isBEKaml joined,
Transformer left
|
|||
isBEKaml | yapsi: say 42 | 03:29 | |
p6eval | yapsi: ( no output ) | ||
03:29
hercynium left
|
|||
isBEKaml | ehh. p6eval yapsi borken? | 03:29 | |
masak | seems so. :/ | 03:30 | |
morning, isBEKaml :) | |||
isBEKaml | morning, masak! | ||
masak is attempting to implement 'our' declarations | |||
03:31
jaldhar joined,
colomon left
|
|||
isBEKaml | great! I see you also fixed the variable declaration thingy. | 03:32 | |
03:32
_jaldhar left
|
|||
masak | I did. that's tonight's results so far. | 03:33 | |
03:39
molaf joined
03:40
REPLeffect left
|
|||
lue | ohai o/ | 03:42 | |
masak | hello lue | ||
rakudo: say ?( any(Bool::True, Bool::False) ) | |||
p6eval | rakudo 2ac5fe: OUTPUT«1» | ||
masak | rakudo: say so any(Bool::True, Bool::False) | ||
p6eval | rakudo 2ac5fe: OUTPUT«any(Bool::True, Bool::False)» | ||
masak submits rakudobug | |||
03:54
REPLeffect joined
|
|||
isBEKaml | masak: I see. | 03:57 | |
masak | this 'our' variables business is a bit funny too. | ||
isBEKaml | bbiab # coffee | ||
03:58
ash_ joined
|
|||
masak | so far I have this: I need to create a SIC block which is never actually executed. call it 'package'. all it contains is directives for all the 'our'-declared variables in the program. | 03:59 | |
lue | Is there a Perl 6 Pod interpreter out there already? [I'm going to write one anyway, just curious] | ||
masak | lue: there's three that I know of. | ||
Util | perl6: my @x = 1, 2, 3; my ( $first, *@rest ) := |@x; say [ :@x, :$first, :@rest ].perl; | ||
p6eval | pugs: OUTPUT«*** Wrong number of binding parameters: 1 actual, 2 expected at /tmp/ygSvi6KIGA line 1, column 18-46» | ||
..rakudo 2ac5fe: OUTPUT«["x" => [1, 2, 3], "first" => \(1, 2, 3), "rest" => []]» | |||
masak | lue: see gist.github.com/500732 | 04:00 | |
Util: I'm not sure binding of a list of things has been correctly implemented in Rakudo yet. | 04:01 | ||
std: label1: say "OH HAI"; label1: say "OH HAI again!" | 04:03 | ||
p6eval | std 32123: OUTPUT«===SORRY!===Illegal redeclaration of 'label1' at /tmp/ntrRpTkFQO line 1:------> label1: say "OH HAI"; label1: ⏏say "OH HAI again!"Illegal redeclaration of symbol 'label1' (see line 1) at /tmp/ntrRpTkFQO line 1:------> label1: say "OH | ||
..HA… | |||
lue | .oO(I remember being specifically told 'not to worry about it' when I coded := a while ago, likely because it's more difficult than I would imagine.) |
04:04 | |
masak | std: if 1 { if 2 { label1: say "OH HAI" } }; if 3 { if 4 { label1: say "OH HAI again" } } | ||
p6eval | std 32123: OUTPUT«ok 00:01 116m» | ||
masak | TimToady: ^^ | ||
ash_ | is that wrong? | ||
masak | lue: indeed. don't worry about it. :) | ||
ash_: I maintain that it is. | 04:05 | ||
ash_ | how/why? | ||
masak | ash_: let's say you want to goto label1. which one do you end up with? | ||
04:05
fitnerd joined
|
|||
ash_ | none, you shouldn't be able to jump into a conditional block scope, imo | 04:06 | |
masak | well, you can. | ||
as long as the block doesn't require params. | |||
Util | masak: thanks! | ||
masak | np | ||
the odd thing about labels is that they're not only visible to their enclosed scopes, but also to their surrounding scopes. | 04:07 | ||
ash_ | err, really? | ||
masak | in other words, you can goto both outwards and inwards. | ||
ash_ | thats going to be confusing... | ||
masak | the only restriction being the parameters thing. | ||
ash_ | hmm | ||
masak | because of that, I think that my second program is as illegal as my first one. | ||
ash_ | well, under those conditions, then std seems to be off | ||
i still am not sure i'd want to be able to jump into a block, can you jump into a loop? | 04:08 | ||
TimToady | I want to be able to go from one when block to the next with goto | ||
the conflicting labels will be caught when we start hoisting labels up into parent blocks | 04:09 | ||
we don't do that now, so we can't see the conflict | |||
masak | ok. | ||
lue | masak: being a TI-BASIC programmer, that kind of scope-jumping seems perfectly alright to me [that doesn't mean I support labels, of course :)] | 04:10 | |
masak | ash_: you can jump into a while loop (one without -> and params), but likely not into a for loop. | ||
lue: :) | |||
lue: most BASICs solve this by not really encapsulating the call stack. | 04:11 | ||
ash_ | so... you can jump into: loop { }, while { }, until { } style loops? | ||
masak | right. provided they don't do -> $a, $b stuff. | ||
04:11
molaf left
|
|||
masak | which they might. | 04:12 | |
isBEKaml | masak: sorry, I didn't notice your ping. seemingly we were typing at the same and I went off. :/ | 04:13 | |
masak | no worries. | 04:14 | |
isBEKaml | masak: talking about the 'our' business, if we were to go by the way you describe, wouldn't it be cumbersome to write find-declarations or find-variables within 'package'. | ||
lue | .oO(in TI-BASIC, you're allowed to be lazy and in many cases leave off the final quote or parenthesis. I'm glad I found Perl 6. |
04:15 | |
isBEKaml | masak: basically, leaving the whole set of 'our' declared variables and blocks in the 'package' would mean we have to find ways to jump around to them when called from elsewhere in the program. | 04:16 | |
masak | isBEKaml: I've been thinking about that in the past few days. | 04:17 | |
isBEKaml | am I sorely wrong here? (I won't be surprised) | ||
masak | isBEKaml: the amazing thing is, lexical lookup stays the same. | ||
it's being done through the exact same mechanism as with 'my'. | |||
the only thing that's different is that the container that the variable points to happens to reside in the special never-called 'package' block. | 04:18 | ||
TimToady | rosettacode.org/wiki/One-dimensiona...ata#Perl_6 | ||
masak | so all wee need to do is to provide the runtime with enough information to know when a declared variable should be bound to a variable in the package block. | 04:19 | |
isBEKaml | masak: I guessed as much about the lexical lookup. I was more concerned about variable state with 'our'. They are mutable everywhere, right? :) | ||
lue | masak: I would love to help out with rakudo's parsing of Pod. My idea is a standalone program, like P5's perldoc. | ||
masak | well, neither more or less than 'my' variables :) | ||
isBEKaml | but _not_ everywhere. | 04:20 | |
masak | lue: then you might enjoy checking out mberends++' module. | ||
lue | [One reason I'm interested in it is so I can read S26 nicely formatted :)] | ||
masak | isBEKaml: well, neither are 'our' variables, viewed in that light. | ||
std: { our $b }; say $b | |||
p6eval | std 32123: OUTPUT«Potential difficulties: $b is declared but not used at /tmp/Xbufh2uJOg line 1:------> { our $b⏏ }; say $bok 00:01 117m» | 04:21 | |
masak | hm. | ||
maybe I do have the wrong mental model, after all. | |||
isBEKaml | rakudo: { our $b } say $b; | 04:22 | |
p6eval | rakudo 2ac5fe: OUTPUT«===SORRY!===Confused at line 22, near "{ our $b }"» | ||
isBEKaml | rakudo: { our $b }; say $b; | ||
masak | TimToady: ain't you glad we added .rotate now? :) | ||
p6eval | rakudo 2ac5fe: OUTPUT«===SORRY!===Symbol '$b' not predeclared in <anonymous> (/tmp/UZTaRlfTea:22)» | ||
masak | TimToady: which one is right, STD or Rakudo? | 04:23 | |
TimToady | hmm. | ||
std: { our $b }; say GLOBAL::<$b> | |||
p6eval | std 32123: OUTPUT«Potential difficulties: $b is declared but not used at /tmp/kz2poooqe_ line 1:------> { our $b⏏ }; say GLOBAL::<$b>ok 00:02 117m» | 04:24 | |
s_mosher | TimToady, these concise examples on rosettacode are becoming more and more readable to me. I'm not sure if that's my fault, yours/whomever's, or Perl6's. | ||
TimToady | surely the current package is GLOBAL... | ||
s_mosher: you are doubtless being corrupted by the dark side of the duct tape. | |||
masak | TimToady: you mean that the lookup happens on the $b in GLOBAL::, so it's not an error? | 04:25 | |
TimToady | std: { our $b }; say OUR::<$b> | ||
p6eval | std 32123: OUTPUT«Potential difficulties: $b is declared but not used at /tmp/YjGJWYZ04w line 1:------> { our $b⏏ }; say OUR::<$b>ok 00:01 117m» | ||
s_mosher | that would explain some other things I've been noticing too ;) | ||
TimToady | std: { our $b }; say $GLOBAL::b | ||
p6eval | std 32123: OUTPUT«Potential difficulties: $b is declared but not used at /tmp/wtcFqXz8Vp line 1:------> { our $b⏏ }; say $GLOBAL::bok 00:01 117m» | 04:26 | |
TimToady | oh, it's not complaining about the use, but the lack of use inside the block | ||
s_mosher | in some of the examples the Perl6 code comes off as more or less equally readable as the problem statement | ||
TimToady | s_mosher: that's one of our nefarious plans | ||
s_mosher | I can't say the same for (in this case) say the picolisp example that invariably follows | ||
masak | I think I will not worry about this for the first iteration of 'our' declarations. Rakudo doesn't seem to. | ||
04:26
cjk101010 joined
|
|||
isBEKaml | rakudo: {our $b = 42; say $b; }; $b = 24; say $b | 04:27 | |
p6eval | rakudo 2ac5fe: OUTPUT«===SORRY!===Symbol '$b' not predeclared in <anonymous> (/tmp/dnghhC1WQB:22)» | ||
s_mosher | I think it's great that it's working out that way. I never would have expected that. | ||
masak | Rakudo follows the mental model I had just moments ago. | ||
TimToady | I coulda done Z+ with shift and unshift, but then I'd've had to supply extra 0s | ||
masak | s_mosher: I hope we'll be able to surprise more people that way. | ||
04:27
Italian_Plumber joined,
Italian_Plumber left
|
|||
s_mosher | the big advantage is the Perl6 code is quicker to read than the problem statement is | 04:28 | |
TimToady | well, people say the same about Haskell, but I'll be darned if I can see it | ||
s_mosher | well, in this case | ||
I can't read haskell, even when I can, I can't | |||
isBEKaml | TimToady: "Perl6 quicker to read than the problem statement." Another slogan? :) | ||
TimToady | Perl 6: just ignore the comments... | 04:29 | |
04:29
Raihjken joined
|
|||
Raihjken | lolwow umm hi. First time here :) | 04:30 | |
TimToady | "self-documenting code" where have I heard that before... | ||
howdydoo | |||
Raihjken | lawlz maybe in class | ||
I know my teacher spoke about it a couple times :D | |||
lue | .oO(Perl 6: Do * you want.) |
||
Raihjken | Anyway was just lookin at Perl6, saw a link "come here to get started" | ||
Soo.. yeah | |||
TimToady | and here you came | 04:31 | |
Raihjken | yeah | ||
TimToady | what sort of things are you interested in? | ||
Raihjken | I've programmed with perl before, I'm not a total noob, well.. mostly. | ||
masak | Raihjken: welcome! | ||
Raihjken | I think the only thing I made that worked, was a program that could read and write little text files, and play the music you wrote :) | ||
as beeps :/ | |||
TimToady | beeps are a good start | 04:32 | |
masak | rakudo: say ~<beep boop>.pick(3, :replace) | ||
p6eval | rakudo 2ac5fe: OUTPUT«beep beep boop» | ||
masak | :) | ||
Raihjken | lol umm I'm guessing I got a whisper or something from Masak, how would i go about replying (never being in an irc thing before) | ||
lawl | |||
lue | beeps are what all the cool 80's equipment used. Hello Raihjken o/ | ||
Raihjken | I used the Audio::Beep Module | ||
and some simple code | |||
:P | |||
So you guys work on Perl6? | 04:33 | ||
TimToady | we pretend to | ||
Raihjken | :P | ||
masak | we like to think we are | ||
TimToady | we're really just playing | ||
Raihjken | nice. | ||
brb Shadow is shoving his face into his foot guessing he wants his litterbox changed >.> | |||
my foot* | |||
I think he's hinting XD | |||
TimToady | my brother-in-law's critter is also named Shadow | 04:34 | |
Raihjken | kewl | ||
TimToady | mine isn't, but I'm quite certain she wants her litterbox changed | ||
Raihjken | I have two cats that are actually mine, Shadow and Ashes, were fostering a cat named spark that we helped out (he bit an electrical cord as a kitten and umm it wasn't pretty especially with the resulting mouth infection) | 04:35 | |
Bella is my parents >.> | |||
THen we have the 3 dogs, and the weird dog I Dunno it's name but it looks kinda weird, were fostering it | |||
TimToady | are you familiar with any other programming languages? | ||
Raihjken | <3 | ||
Umm | |||
tylercurtis | TimToady: does the :: sigil impose a type constraint? | ||
TimToady | :: isn't really a sigil | ||
masak | more like a collection of dots :P | 04:36 | |
Raihjken | I know HTML, some JavaScript, some CSS, very little Java/C++ and not a whole lot of perl but enough to do the little things I need it to do | ||
masak | \o/ | ||
Raihjken | I've read extremely little of the jargon file >.> | ||
lulz | |||
I haven't had time this summer to do much been at my girlfriends camp, I just turned 18 a couple weeks ago | 04:37 | ||
masak | congratulations. | ||
it's a nice age. | |||
isBEKaml | jargon file in catb? We don't use too many jargons here. ;) | ||
TimToady | ah, sorear++, who hangs around here, is just a bit older | ||
Raihjken | she kinda leaves the computer stuff to me, ice skating and bead-art are more her thing <3 | ||
thans | |||
TimToady | I'm a bit older than that | ||
Raihjken | lawl yeah the one on catb | ||
XD | |||
Everyone here works on Perl6? | 04:38 | ||
masak | isBEKaml: we don't use jargon here? that's an interesting statement. | ||
Raihjken | like.... Everyone? | ||
XD | |||
masak | Raihjken: no. | ||
isBEKaml | masak: :P | ||
TimToady | when jnthn comes back from vacation, you'll find a kindred lolcat | ||
Raihjken | XDXD | ||
caturday is better imo. | |||
isBEKaml | masak: I said "We don't use too many jargons here" | ||
masak | Raihjken: we have many people here who never say anything. when we need to vacuum, we just lift them gently. | ||
tylercurtis | Does the :: not-really-a-sigil impose a type constraint? | ||
Raihjken | umm | 04:39 | |
masak | isBEKaml: how much is too much in this case? | ||
tylercurtis: sometimes. | |||
TimToady | tylercurtis: depends on how you're using it | ||
Raihjken | the only things I know that you put before code would be | ||
use Tk | |||
isBEKaml | masak: well, that depends on how much is too much. :P | ||
Raihjken | use Strict | ||
and use warnings | |||
XD | |||
tylercurtis is wondering if he can treat self in methods without explicit invocant parameters as ::self. | |||
Raihjken | :P | ||
TimToady | I doubt it | ||
std: ::self | 04:40 | ||
p6eval | std 32123: OUTPUT«ok 00:01 114m» | ||
Raihjken | XD | ||
what was that S: | |||
masak | Raihjken: I think you'll blend in here just fine. we need to find a way to direct your youthful energy into a project. | ||
Raihjken | kewl | ||
TimToady | and suppress about half of the XDs | ||
Raihjken | only one thing | ||
masak | Raihjken: maybe talk to lue too, when he's around. | ||
Raihjken | I start school next wing | ||
lue | hai o/ | ||
Raihjken | week* | ||
wow | |||
huge typo | |||
masak | oh, there's my lue <3 | 04:41 | |
Raihjken | :) | ||
TimToady | lue is also one of our loose cannons | ||
masak | that's why I thought of him :) | ||
Raihjken | lawl so now I'm a loose cannon :P | ||
masak | XD | ||
lue | .oO(I do have a certain fondness for bullet bill's) |
||
Raihjken | So is their any kind of .. | ||
ETA for Perl6? | |||
TimToady | it's already here, in spots | 04:42 | |
masak | Raihjken: last Christmas. didn't you get the memo? :) | ||
Raihjken | lol | ||
last christmas my mom gave me a mickey of vodka and told me to get lost | |||
XD | |||
lue | depends on which parts of Perl 6 you want :) | ||
Raihjken | nice | ||
TimToady | but all of the examples on rosettacode.org/wiki/Category:Perl_6 run under rakudo | ||
Raihjken | This might sound kinda odd | ||
but I've noticed almost every "nerd" (pardon) has a cat :O | |||
or at least the ones I know | 04:43 | ||
rakudo? | |||
TimToady | we need cats to keep us humble | ||
masak | Raihjken: rakudo is a Perl 6 implementation. | ||
tylercurtis | It occurs to me that given that I plan to use STD as the parser for Bennu, there's no reason to worry about that. | ||
TimToady | rakudo: say "Hi, Raihjken!" | ||
p6eval | rakudo 2ac5fe: OUTPUT«Hi, Raihjken!» | ||
Raihjken | the only thing i remember was a site I came across with a parrot on the page, screaming "I RUN PERL6 pick me!" lawl can't remember what it was claled | ||
called* | |||
is that Rakudo? | 04:44 | ||
masak | aye. | ||
isBEKaml | Rakudo runs on parrot, yes. And, parrot is a VM. | ||
Raihjken | mmk | ||
*is barely keeping up* | |||
Parot is a Virtual Machine... like Java? | |||
or like | |||
fake-linux on a windows box | |||
XD | |||
masak | yes, like the JVM. | 04:45 | |
TimToady | Java is the language, JVM is the, er, Java VM | ||
Raihjken | mk | ||
TimToady | or like C# to .NET | ||
Raihjken | is Rakudo truly perl6 then? | ||
TimToady | a goodly part of it | ||
Raihjken | cool | ||
I'm not a super-nerd sometimes I wish I was tho | |||
TimToady | have you studied math? | ||
Raihjken | I suck at math | ||
TimToady | what do you like to do? | 04:46 | |
Raihjken | But my girlfriend is really good in french, and I used to write poetry frequently | ||
in english of course | |||
:P | |||
ash_ | rakudo: say [+] 1, 1, * + * ... 21; | ||
p6eval | rakudo 2ac5fe: OUTPUT«54» | ||
Raihjken | English and Music have kinda always been my thing i guess still got my clarinet and guitar sitting here | ||
TimToady | I've done guitar but never the licorice stick | 04:47 | |
Raihjken | lol | ||
masak | Raihjken: how did you learn about Perl 6? | ||
TimToady | but mostly now I play the drums | ||
violin is what I'm good at, though... | |||
Raihjken | umm I kinda got bored of perl, now I'm kinda just plain bored, so I figured wth, lets take a fresh look at perl, and then this link for perl6 was at perl.org and I figured wth, lets see whats up maybe my dumb luck as a noob could help someone | 04:48 | |
tylercurtis | Raihjken: If you're interested in trying out Rakudo, github.com/rakudo/star/downloads or try.rakudo.org/ for an online shell. | ||
04:48
_sri joined
|
|||
masak | Raihjken: your dumb luck as a noob can definitely help someone! | 04:48 | |
ash_ | try.rakudo.org should be getting an update, (tonight/tomorrow) if i can figure out whats wrong with ipc::run :-( | ||
TimToady | it would probably be helpful to the people writing the documentation to have feedback on where you find it confusin | ||
masak | Raihjken: we need much of that kind of help around here. | 04:49 | |
tylercurtis | alternately, as TimToady demonstrated earlier, there's an evalbot here in the channel. | ||
masak | ash_++ | ||
04:49
cjk101010 left
|
|||
Raihjken | evalbot? | 04:49 | |
04:49
cjk101010 joined
|
|||
ash_ | rakudo: say "Hi from an evalbot"; | 04:49 | |
isBEKaml | rakudo: say 42; # evalbot. | ||
TimToady | pugs: say "me too" | 04:50 | |
p6eval | rakudo 2ac5fe: OUTPUT«Hi from an evalbot» | ||
rakudo 2ac5fe: OUTPUT«42» | |||
pugs: OUTPUT«me too» | |||
Raihjken | "Hi from evalbot" | ||
masak | rakudo: say "hi Raihjken! XD" | ||
Raihjken | XD | ||
p6eval | rakudo 2ac5fe: OUTPUT«hi Raihjken! XD» | ||
lue | .oO(do I dare?) |
||
ash_ | std: say "i validate syntax too" | ||
p6eval | std 32123: OUTPUT«ok 00:01 115m» | ||
Raihjken | lol | ||
masak | std: "two terms" "in a row" | ||
p6eval | std 32123: OUTPUT«===SORRY!===Two terms in a row at /tmp/NaJY05ZXh5 line 1:------> "two terms" ⏏"in a row" expecting any of: bracketed infix infix or meta-infix statement modifier loopParse failedFAILED 00:01 116m» | ||
Raihjken | lol | ||
error | |||
in the face. | |||
anyway | |||
lue | perl6: say "Hello Raihjken, from the P6 world!" | ||
Raihjken | SO you guys want me to read documentation | ||
TimToady | it's sorry | ||
p6eval | pugs, rakudo 2ac5fe: OUTPUT«Hello Raihjken, from the P6 world!» | ||
masak | "Perl 6: it's sorry" | 04:51 | |
TimToady | "when all else fails, read the directions." | ||
Raihjken | lol you guys need people to read your documentation and make it make sense eh? | ||
Alright any links to the documentations | |||
any emails I can send my progress too? | |||
I can do it whenever I'm bored at school | 04:52 | ||
ash_ | perlcabal.org/syn/ is a good starter, maybe? | ||
Raihjken | I just spent 500 bucks on a laptop >.> | ||
TimToady | or the book | ||
ash_ | that or a the book | ||
Raihjken | and a 140 on a 20" monitor,. and then got a 500 GB Hard drive and Lightscribe burner XD | ||
lawl | |||
ash_ | github.com/perl6/book/downloads | ||
has a downloadable version of the perl6 book, its a pdf | |||
Raihjken | "The official Perl 6 Documentation" | ||
alrighjt | |||
04:52
fitnerd left
|
|||
Raihjken | just read all that stuff then eh? | 04:53 | |
kewl | |||
TimToady | sure, that's all :) | ||
Raihjken | ummm | ||
is their some sort of admin | |||
or heiarchy? | |||
masak | not really. | ||
Raihjken | Would I email stuff to someone? | ||
ash_ | you can talk about it in here | ||
TimToady | we're a careful organized anarchy | ||
Raihjken | umm | ||
ok | |||
ash_ | or the mailing list | ||
Raihjken | lol | ||
TimToady | *carefully | ||
Raihjken | thats a paradox, anarchy is never organized, anarchy itself is the definition of chaos | 04:54 | |
isBEKaml | "organized anarchy". TimToady++ | ||
TimToady | if you don't like paradoxes, you don't wanna hang around here | ||
Raihjken | lol I don't mind em | ||
some are fuin | |||
fun* | |||
TimToady | where are you going to school? | 04:55 | |
ash_ | is ^* a valid range? | ||
lue | .oO[ we're an autonomous anarcho-syndicalist commune :) ] | ||
Raihjken | Korah Collegiate | ||
ash_ | rakudo: say ^5; | ||
p6eval | rakudo 2ac5fe: OUTPUT«01234» | ||
TimToady | rakudo: say (^*).WHAT | ||
p6eval | rakudo 2ac5fe: OUTPUT«Can't take numeric value for object of type Whatever in 'Any::Numeric' at line 1341:CORE.setting in 'prefix:<^>' at line 6774:CORE.setting in main program body at line 22:/tmp/IR9YoqcGSN» | ||
Raihjken | I've just finished grade 12, but it was too late to apply for college so I'm kinda just taking whatever courses to fill time until applications are accepted again | ||
is this room itself run in Perl? | 04:56 | ||
That'd be pretty cool, just sayin | |||
TimToady | that's okay, many of us are late bloomers | ||
ash_ | rakudo: for ^5 { say $_; } | ||
masak | "Paradoxes are only conflicts between reality and your feelings of what reality ought to be" -- Feynman | ||
p6eval | rakudo 2ac5fe: OUTPUT«01234» | ||
Raihjken | lol | ||
ash_ | rakudo: for ^* { say $_; last if $_ > 5; }; | ||
p6eval | rakudo 2ac5fe: OUTPUT«Can't take numeric value for object of type Whatever in 'Any::Numeric' at line 1341:CORE.setting in 'prefix:<^>' at line 6774:CORE.setting in main program body at line 22:/tmp/sqs1VA_D0x» | ||
ash_ | eh, just curious | ||
std: for ^* { say $_; last if $_ > 5; }; | 04:57 | ||
Raihjken | lol | ||
p6eval | std 32123: OUTPUT«ok 00:01 118m» | ||
ash_ | rakudo bug? | ||
TimToady | in theory should mean the same as either { ^$_ } or 0..^* | ||
but not both | |||
masak | agreed. | ||
Raihjken | umm *clearly has alot of reading of Perl to do* | ||
:S | |||
I dunno I've pretty much used it like it's C++ XD | 04:58 | ||
TimToady | no pain, no gain :) | ||
Raihjken | Only with easier syntax | ||
:P | |||
tylercurtis | rakudo: my @a = 1, 2, 3, 4; .say for @a[^*]; | ||
p6eval | rakudo 2ac5fe: OUTPUT«Can't take numeric value for object of type Whatever in 'Any::Numeric' at line 1341:CORE.setting in 'prefix:<^>' at line 6774:CORE.setting in main program body at line 22:/tmp/O9CqNLHBnA» | ||
TimToady | Perl 6 is even easier, except when it isn't | ||
masak | Perl 6 has easy syntax. | ||
Raihjken | and finally something that doesn't take 300 lines to make a simple window D: | ||
masak | one just needs to know it, then it's easy. | ||
TimToady | there's just lots of it | ||
tylercurtis thinks he recalls seeing use of ^* as a { ^$_ } in the spec somewhere. | 04:59 | ||
Raihjken | umm anyway it is like quarter after 1 AM here | ||
lue | masak: speaking of paradoxes, can I cause one with your debugger yet? | ||
Raihjken | lol! | ||
I've never used debuggers | |||
masak | lue: I was planning to avoid that. | ||
Raihjken | never got the hang of em | ||
but that sounds like fun | |||
masak | lue: something like the old future being invalidate if you change the present. | ||
Raihjken | but I'm gonna head to bed, maybe play some Mabinog ifirst | ||
TimToady | o/ | ||
masak | Raihjken: it was nice to meet you. | ||
come back soon. | 05:00 | ||
Raihjken | ty nice to meet you guys too | ||
alright | |||
well | |||
isBEKaml | o/ | ||
masak | \o | ||
Raihjken | I'm going back to lake superior this weekend | ||
but I'll be sure to check in once in a whil | |||
while* | |||
when I have internet | |||
TimToady | don't sink | ||
Raihjken | (and not Megan's weird dialup bs either) | ||
masak | TimToady: from lake superior, the only way is down :P | ||
Raihjken | lol | ||
lue | I suppose you could solve it by having tardis [that's the name of the debugger] only rewind time, instead of jumping back. | ||
Raihjken | well ttyl guys | 05:01 | |
masak | lue: that's the plan. | ||
05:01
Raihjken left
|
|||
masak needs to go offline for a while | 05:01 | ||
bbl | |||
05:01
masak left
|
|||
TimToady | o/ | 05:01 | |
isBEKaml | \o | ||
TimToady | I note that an 18-year-old guy was not put off by seeing Camelia on perl6.org. :) | 05:08 | |
ash_ | i like the Camelia logo | ||
05:08
kaare joined
|
|||
ash_ | i am only 24 | 05:09 | |
05:09
kaare is now known as Guest86362
|
|||
tylercurtis is another 18-year-old male who is not bothered by Camelia. | 05:09 | ||
TimToady | we just need to work on the turtle graphics a bit more, and we can get the 8-year-olds too | ||
ash_ | could i bug someone with linux, perl5 and rakudo to see if they can help me find out whats wrong with this program? | 05:10 | |
will need a cpan module too, IPC::Run if your willing to help | |||
i get 2 different functionalities on 2 different OS's, this wasn't happening with an earlier version of rakudo, but i can't think whats changed to cause the problem :-( | 05:11 | ||
TimToady | what does it do? | ||
ash_ | on OS X, sub processes run fine, and are controllable via IPC::Run, on linux though, when I try to write to the stdin of the subprocess, it gives me "> " like rakudo was started as the parent process and blocks | 05:13 | |
os x and linux have identical versions of parrot, perl, rakudo, and IPC::Run :-\ | |||
TimToady | is the sub-process running rakudo? | 05:14 | |
maybe it's REPL running is getting spooked somehow | |||
s_mosher | ash_, I have those things | 05:15 | |
ash_ | its a parent perl process making a subprocess that is an instance of rakudo's repl | ||
TimToady | like maybe it thinks there aren't any args, or some such | ||
05:16
cls_bsd joined
|
|||
TimToady | oh, you *want* the repl | 05:16 | |
ash_ | s_mosher: gist.github.com/560253 is a gist of the problem, if that can run to the end, then it should work, it works on OS X, you'll need to correct the path to perl6 though | 05:17 | |
TimToady | sounds more like your subprocess's STDIN is getting closed or redirected somehow | ||
ash_ | TimToady: ya, i do want the repl, its how try.rakudo.org will work, if i can fix this problem | ||
s_mosher | ash_, I'll give it a shot. | 05:19 | |
TimToady | maybe a close-on-exec flag is wrong | ||
ash_ | hmm, perl -e "print $^F" prints 2 on both systems | 05:21 | |
the thing is, rakudo from like 2 weeks ago didn't cause this problem | |||
if i change it to use perl5, it works too, and python works | 05:22 | ||
so, i am wondering if its a change in parrot/rakudo thats causing my issue | |||
TimToady | seems like it must be | ||
s_mosher | ash_, it runs to completion here | ||
ash_ | s_mosher: really? what os? (and revision of rakudo) | 05:23 | |
i assume linux since i asked for it, but which one :P | |||
s_mosher | I rebuilt rakudo from git last night or today some time. Linux is 2.6.32 amd64 | 05:24 | |
it's Debian if that matters | |||
oh, have version string: This is Rakudo Perl 6, version 2010.08-26-g6ccdcda built on parrot 2.7.0 r48628 | 05:25 | ||
ash_ | which commit if you do: git log | ||
k | |||
thanks | |||
05:27
[Coke] left
|
|||
ash_ | same parrot revision... i wonder if it was the change to make FORBID_PIR work | 05:27 | |
i am going to revert to your build and see if the problem goes away | 05:29 | ||
s_mosher | I might have been less than hygenic when updating rakudo btw | 05:31 | |
I don't think I left anything dangerous laying about when updating, but I didn't look as hard as I do when I'm being paid | 05:32 | ||
ash_ | lol, its fine | ||
05:33
[Coke] joined
|
|||
s_mosher | I know, I'm just paranoid that something weird happened and you'll get a different result | 05:33 | |
05:38
wtw joined
|
|||
ash_ | almost done rebuilding, my test server is running on an intel atom, so its kinda slow :P | 05:39 | |
s_mosher: by completion, it printed 'done' with some other stuff, right? | 05:42 | ||
its still doing it for me | |||
s_mosher | yeah | 05:43 | |
05:43
au|irc joined
|
|||
s_mosher | aside from that, was there anything specific you were looking for in the output? | 05:43 | |
ash_ | no, just that it didn't block waiting on input | ||
for me, it blocks and only does the first print and never finishes | 05:44 | ||
s_mosher | oh huh | 05:45 | |
um... well bad news sorta | |||
okay I updated, rebuilt, tried again | 05:46 | ||
because I'm curious | |||
and it runs to completion, but I get different (more) output | |||
ash_ | how different? | ||
s_mosher | an added line: "print 2" | 05:47 | |
ash_ | ah, that should be there | ||
something like: "print 2\n> 2" ? | 05:48 | ||
s_mosher | sec | 05:49 | |
05:49
redicaps joined
05:50
redicaps left
|
|||
s_mosher | oh well this isn't so different then | 05:50 | |
print 2... and whatever is to follow gets cut off | |||
sometimes I get nothing, sometimes just p, sometimes whatever | 05:51 | ||
usually just "p\ndone\n" at that point | |||
ash_ | hmm | 05:52 | |
s_mosher | I scanned the $p in the script and thought nothing of it at first | ||
ash_ | odd | ||
i haven't had it just do "p\ndone\n" before | |||
hmm | |||
i need to test it more | |||
s_mosher | I was getting that even before rebuilding | ||
sorear | hello #perl6 | 05:53 | |
ash_ | hi sorear | 05:54 | |
s_mosher: now its working occasionally and then not other times | 06:01 | ||
i am confused | |||
s_mosher | ash_, I'm going over it with strace | 06:02 | |
to see whether (and if so maybe why) the repl is going away early | |||
06:03
jhuni left
|
|||
s_mosher | I'm seeing a hilarious volume of calls to brk() | 06:03 | |
ash_ | i don't know what brk does | 06:04 | |
s_mosher | it gets memory from the system | 06:05 | |
ash_ | those might be from pump | ||
IPC::Run uses the pump sub to check if std in, out, or err need to be updated and updates them | 06:06 | ||
s_mosher | okay, I found the part where it's reading chars in | 06:07 | |
06:09
uniejo joined
|
|||
s_mosher | well it's writing the result | 06:09 | |
or it writes a "2" for some reason anyway, but no newline apparently. then the prompt again | 06:10 | ||
oh right, you didn't have a newline in the code you sent over | 06:11 | ||
sorear | don't use strace with iphd | 06:12 | |
the reparenting screws things up | |||
s_mosher | oh dang | ||
sorear | it's easier just to boot a freebsd vm and use ktrace instad, less intrusive | ||
s_mosher | but I love strace | ||
heh | |||
sorear | oh, I misread | ||
you probably aren't using iphd | |||
thought you were ash with the trace | 06:13 | ||
moritz_ | good morning | 06:16 | |
tylercurtis | :( Rakudo blows up with the profiling runcore for me. | 06:17 | |
ash_ | lol, i tried redirecting the output from the perl6 sub process to /dev/null and it still ends up on stdout of the parent process, thats not right | 06:18 | |
s_mosher | ash_, from what I'm seeing the parent is getting all the data | ||
ash_ | moritz_: well, if feather3 ran OS X, i think i'd have try.rakudo.org ready to go, but IPC::Run seems to be acting funny with recent versions of rakudo, i haven't figured out why (this problem doesn't show up with perl5, or python interps) | 06:19 | |
oh, it only shows up in linux as far as i can tell too, so i am having trouble tracking down the problem | 06:20 | ||
06:21
cxreg left
|
|||
sorear | good morning moritz_ | 06:22 | |
seen pmurias? | |||
s_mosher | ash_, your print $out comes one statement too early | 06:23 | |
and I spent all this time not noticing it | |||
ash_ | s_mosher: no, thats probably spill from the child process ending up on the parent processes stdout, (probably) | 06:24 | |
take the print $out, out and see if it still happens (i bet it does) | |||
s_mosher | is it supposed to start printing $out before "pump$p until $out [...]" ? | 06:25 | |
I took it out, and no output from the repl | |||
sorear | niecza: say "hi" | ||
p6eval | niecza 1d65d67: OUTPUT«Can't locate STD.pm in @INC (@INC contains: /home/p6eval/niecza/src /opt/perl-5.12.1/lib/site_perl/5.12.1/x86_64-linux /opt/perl-5.12.1/lib/site_perl/5.12.1 /opt/perl-5.12.1/lib/5.12.1/x86_64-linux /opt/perl-5.12.1/lib/5.12.1 .) at /home/p6eval/niecza/src/Niecza/Grammar.pm | ||
..line 3.… | |||
06:26
masak joined,
cxreg joined
|
|||
s_mosher | ash_, if I move it down one, I get expected results. if I match 2 instead of >\s it even chops off the prompt | 06:27 | |
it really looks like the "sometimes working sometimes not" behaviour is just a... race product (?) | 06:28 | ||
ash_ | you can move it to after the $p->finish if you want, that should be fine, and take out the $p->pump until line | ||
sorear | o/ masak | ||
ash_ | ya, it sounds like it might be a race condition happening | ||
masak | [backlog] a real good turtle graphics module would be interesting. preferably coupled with tutorial/SVG/web capabilities somehow. lurkers, take note. | ||
sorear: \o | |||
sorear: just got 'our' variables to work in Yapsi :) | 06:29 | ||
s_mosher | ash_, I have it just before the finish line. | ||
just after the last pump | |||
ash_ | $p->finish waits until the subprocess exits, | ||
so there shouldn't be any changes to the $out var after that time | |||
s_mosher | right. | 06:30 | |
dalek | psi: 095c93b | masak++ | / (3 files): [Yapsi] 'our'-scoped variables The compiler declares a block 'GLOBAL' containing only the 'our'-scoped variables. The runtime then makes sure the appropriate variables are bound to the variables in this block. |
||
psi: 94758a5 | masak++ | doc/ChangeLog: [doc/ChangeLog] updated for 2010.09 |
|||
s_mosher | I mean the problem is gone when I start outputting at the correct time | 06:31 | |
ash_ | well, in the repl server, i need to not finish the processes until i absolutely have to, (for instance if they become inactive for more than 60 seconds), so i need to be able to write and read from them without killing them | 06:32 | |
in theory, if i do $p->pump until $out =~ /\n>\s/m; it should wait until it gets the "\n> " that means the rakudo repl is waiting for input again, so it should be done processing the old input, thats when i know to read | 06:33 | ||
sorear | masak: neat! did niecza help at all? | ||
masak | haven't checked how niecza does it. but I'm willing to compare notes now. | 06:34 | |
s_mosher | ash_, yeah.. that isn't the problem though | ||
06:34
dju_ joined,
dju left
|
|||
s_mosher | check line 18 | 06:34 | |
it should come after line 20 | |||
you're just printing it before you get it, then moving on | 06:35 | ||
masak | sorear: notably, I'm curious about the case C< { our $b }; say $b > discussed in the backlog. | ||
moritz_: good morning. it seems p6eval's yapsi target is less-than-functional. | 06:36 | ||
06:37
dju joined,
dju_ left
|
|||
sorear | masak: that case is an error, $b in the outer scope doesn't resolve to anything | 06:38 | |
06:38
tadzik joined
|
|||
sorear | GLOBAL:: and UNIT:: are disjoint | 06:38 | |
masak | right. | ||
tadzik | hello | 06:39 | |
masak | the only save I could imagine was if GLOBAL:: was nested outside of UNIT:: | ||
but it isn't. | |||
tadzik: hi! \o/ | |||
06:39
rgrau__ left
|
|||
masak | std: { say our $b }; say $b # this shouldn't work, but does | 06:40 | |
p6eval | std 32123: OUTPUT«Potential difficulties: $b is declared but not used at /tmp/Przv78_ZFb line 1:------> { say our $b⏏ }; say $b # this shouldn't work, but dook 00:01 117m» | ||
masak | also, it gives a warning about declare-but-not-use even when I use the variable... | ||
std: { our $b say $b }; say $b # this shouldn't work, but does | |||
p6eval | std 32123: OUTPUT«===SORRY!===Two terms in a row at /tmp/nEoFF8iFIK line 1:------> { our $b ⏏say $b }; say $b # this shouldn't work,  expecting any of: bracketed infix constraint infix or meta-infix statement modifier loop | ||
..traitParse failedFAILED 00:… | |||
masak | er. | 06:41 | |
ash_ | s_mosher: gist.github.com/560253 here, i updated this to be close to what i am using on my server | ||
masak | std: { our $b; say $b }; say $b | ||
p6eval | std 32123: OUTPUT«ok 00:01 117m» | ||
masak | sorear: so we agree that the above shouldn't parse? | ||
sorear | yes. | ||
masak | good. now we just need to convince TimToady :) | 06:42 | |
06:43
dju left
|
|||
s_mosher | ash_, that works as expected here | 06:43 | |
are you still having problems? | 06:44 | ||
ash_ | ya | ||
its not working here | |||
i get timeouts | |||
and the output is very different | |||
sorear | there's something weird and wrong with either JSON::Tiny or viv | 06:45 | |
parsing 1 copy of sample.json: 4.1 seconds | |||
2 copies: 12.9 seconds | |||
06:45
dju joined
|
|||
masak | huh. | 06:47 | |
06:48
f00li5h left
|
|||
ash_ | my test server and feather3 have the same response, with nearly the same version of rakudo | 06:49 | |
s_mosher | I'm trying with this now: 2010.08-28-g2ac5feb built on parrot 2.7.0 r48628 | 06:50 | |
what could I have done while building to make rakudo behave differently? | 06:51 | ||
ash_ | i don't know | ||
i might have something configured wrong, i haven't a clue at this point | |||
s_mosher | I suspect something else is at play, but I'd rather not assume my build is sane | ||
moritz_ | sorear: viv runs JSON::Tiny? | ||
niecza: say "alive" | |||
p6eval | niecza 33f66ad: OUTPUT«alive» | 06:52 | |
sorear | moritz_: I had to change \, to "," in a couple places | ||
also I just extracted the grammar, not the whole module | |||
neat, I made JSON::Tiny 4x faster with a few :: | |||
moritz_ | sadly rakudo doesn't understand those | 06:53 | |
sorear | and it's not O(n^(>1)) anymore | ||
60kb in ~9s, I have a baseline for "viv speed" | 06:54 | ||
sorear goes back to the niecza regex rewrite (which will add ::, among everything else) | 06:55 | ||
600kb in 94s, definitely O(N) now | |||
ash_ | s_mosher: i am checking out rakudo's latest build and last months tag to see if there is any difference between the two | 06:57 | |
feather3 is also giving me problems, so i seem to have 2 systems configured oddly | 07:00 | ||
lue | goodnight o/ | ||
masak | 'night, lue | 07:01 | |
07:04
cxreg left
07:05
cxreg joined
|
|||
cxreg | rakudo: eval "did I get utf8 working in irc?" | 07:09 | |
07:09
justatheory left
|
|||
p6eval | rakudo 2ac5fe: ( no output ) | 07:09 | |
tylercurtis | \o lue, goodnight. | 07:10 | |
cxreg | rakudo: say say ^5 | 07:11 | |
p6eval | rakudo 2ac5fe: OUTPUT«012341» | ||
cxreg | whoops | ||
moritz_ | rakduo: say "møøse in UTF-8" | ||
cxreg | that's odd, the chevron thingies worked, but it's still partially broken | ||
s_mosher | ash_, it seems to be hanging on me when I try it with python... | ||
moritz_ | raukdo: say "møøse in UTF-8" | ||
moritz_ can't type "rakudo" | 07:12 | ||
rakudo: say "møøse in UTF-8" | |||
p6eval | rakudo 2ac5fe: OUTPUT«møøse in UTF-8» | ||
ash_ | s_mosher: what about changing it to: my $p = start [ $^X, '-pe', 'BEGIN { $| = 1 }' ], \$in, \$out, timeout(5); (also you need to remove the pump until | ||
that will make a perl5 interp that echos stdin to stdout | |||
s_mosher | yeah that works fine | 07:15 | |
ash_ | i can get it to work with python by doing a few minor tweeks, only to what its starting and the input its sending python | ||
07:15
wamba joined
|
|||
s_mosher | yeah, what happens here is that unless I give python garbage (to make it vomit and die) it continues to wait on input after I send it data | 07:16 | |
moritz_ | news.perlfoundation.org/2010/09/hag...ta-mo.html \o/ | 07:17 | |
ash_ | woot, jnthn++ pmichaud++ | 07:18 | |
s_mosher | oh right, my mistake. python works too when I keep my wits about me. | ||
ash_ | tpf++ | ||
s_mosher | yeah, that's good to see | 07:20 | |
cxreg | moritz_: so what is the character before the »? | ||
it's coming out goofy | |||
ash_ | ? | ||
cxreg | yeah that | ||
ash_ | .u  | ||
phenny | U+2424 SYMBOL FOR NEWLINE () | ||
moritz_ | right, it's an N/L | ||
many fonts render it weirdly | 07:21 | ||
cxreg | oh, it's /supposed/ to look like that?! | ||
moritz_ | it's sufficiently rare in "normal" text or code that we can use it indicate newlines | ||
ash_ | it doesn't hurt that it is unicode for the symbol for newline too :P | 07:22 | |
s_mosher: thanks for the help, i think i might start looking into other ways of handling this since ipc::run is acting so weirdly | 07:25 | ||
s_mosher | ash_, no problem. | 07:26 | |
ash_ | any thoughts on a sub-process management tool? or am i going to have to make one from scratch :-( | 07:27 | |
s_mosher | it's a shame ipc isn't doing it. | 07:28 | |
moritz_ | ash_: IO::Pty::HalfDuplex | 07:29 | |
ash_ | i don't get why it worked for python and perl5 though, but perl6 is acting odd | ||
s_mosher | nothing comes to mind, though. I've never had a pleasant time dealing with the output of other interactive programs. | ||
yeah, that is odd | 07:30 | ||
ash_ | moritz_: will do | 07:31 | |
07:33
jhuni joined
|
|||
s_mosher | well, I'm off to Zzzz-land | 07:35 | |
ash_ | me too | 07:37 | |
thanks again | 07:38 | ||
s_mosher | sure, any time | ||
'night | |||
moritz_ | sleep well | 07:39 | |
masak | time for me to sleep too. :) | 07:42 | |
'night, #perl6 | |||
isBEKaml | goodnight, masak! | 07:43 | |
tadzik | masak: isn't that a morning for you? | ||
masak | sun-in-sky-wise, yes. subjectively, no. | ||
tadzik | I see | ||
masak | later today, there'll be a Yapsi release! | ||
masak zzz | 07:44 | ||
tadzik | sleep well then :) | ||
07:44
masak left
|
|||
tadzik is the same TZ and has just woke up | 07:44 | ||
isBEKaml | tadzik: +2? | ||
tadzik | isBEKaml: yep | ||
isBEKaml | tadzik: :) | ||
tadzik | well, not just, 3hs ago :) | 07:45 | |
sorear | tadzik: masak traditionally only stays awake for a few minutes at a time | 07:49 | |
tadzik | heh | 07:51 | |
07:55
happig joined
07:57
cognominal left
07:58
drbean left
|
|||
happig | clear | 07:58 | |
08:08
azawawi joined
|
|||
azawawi | hi | 08:08 | |
phenny | azawawi: 30 Aug 00:14Z <sorear> tell azawawi I've solved a couple problems you were facing; check out STD 32116 on CPAN | ||
dalek | kudo: 606c5fb | moritz++ | src/core/operators.pm: prevent not and so from autothreading |
08:10 | |
kudo: dc99008 | tadzik++ | src/Perl6/Grammar.pm: Added more info to an error message for <> Signed-off-by: Moritz Lenz [email@hidden.address] |
|||
azawawi | sorear: ping | 08:16 | |
08:20
tylercurtis left
08:21
espadrine joined
|
|||
tadzik | rakudo: say $_ for <> | 08:24 | |
p6eval | rakudo 2ac5fe: OUTPUT«===SORRY!===Unsupported use of <>; in Perl 6 please use lines() or () at line 22, near "<>"» | ||
tadzik | nah | ||
moritz_ | update will start in 11min | ||
and take another ~20min or so | |||
08:25
zag joined
08:27
mberends joined
08:28
drbean joined
|
|||
azawawi | phenny: tell sorear Does that mean that syml_search_path is absolute since it is not taking the given values. | 08:35 | |
phenny | azawawi: I'll pass that on when sorear is around. | ||
08:39
Guest86362 is now known as kaare_
08:40
dakkar joined,
drbean left
08:43
azawawi left
08:45
drbean joined
|
|||
sorear | phenny: tell azawawi Pronoun resolution error | 08:50 | |
phenny | sorear: I'll pass that on when azawawi is around. | ||
sorear: 08:35Z <azawawi> tell sorear Does that mean that syml_search_path is absolute since it is not taking the given values. | |||
08:56
drbean left
08:59
tadzik left
09:03
proller joined
09:11
daxim joined
09:13
happig left,
tadzik joined
09:34
jhuni left
|
|||
moritz_ | hugme: add sorear to json | 09:52 | |
hugme hugs sorear. Welcome to json! | |||
moritz_ | sorear: you're welcome to maintain your copy of json's Grammar.pm in a branch in my repo | ||
10:00
meppl joined,
Italian_Plumber joined
10:05
wallberg joined
10:15
cotto_work left
10:16
agentzh left
10:26
colomon joined,
leprevost left
10:40
Italian_Plumber left
10:52
M_o_C joined,
ruoso left
10:57
Italian_Plumber1 joined
|
|||
colomon | rakudo: grammar A { regex B { \w+\D }; method C($a) { $a ~~ m/ <B> / }; }; say A.new.C("fred1").perl | 10:57 | |
p6eval | rakudo dc9900: OUTPUT«Method 'B' not found for invocant of class 'Cursor' in <anon> at line 22:/tmp/W2L3AqZjZQ in 'Cool::match' at line 2421:CORE.setting in 'A::C' at line 22:/tmp/W2L3AqZjZQ in main program body at line 22:/tmp/W2L3AqZjZQ» | ||
colomon | help? | 10:58 | |
11:10
elekt joined
11:11
f00li5h joined
11:15
jferrero joined
11:19
azert0x joined
11:21
Mowah joined
11:26
kjeldahl joined
11:33
Guest97742 left,
envi^home joined,
sftp joined
11:37
daemon left
|
|||
moritz_ | colomon: self.parse($a, :rule<B>) | 11:49 | |
11:56
snearch joined,
broquaint joined
12:08
takadonet joined,
stepnem left
12:11
stepnem joined
12:13
hudnix left
12:14
hudnix joined
12:16
drbean joined
|
|||
moritz_ | journal.stuffwithstuff.com/2010/08/...-language/ | 12:17 | |
12:18
M_o_C left
|
|||
colomon | moritz_++ | 12:23 | |
does that work externally as well? | |||
moritz_ | yes | ||
colomon | rakudo: grammar A { regex B { \w+\D }; method C($a) { self.parse($a, :rule<B>); }; }; say A.new.C("fred1").perl | ||
p6eval | rakudo dc9900: OUTPUT«Match.new( from => 0, orig => "fred1", to => 4,)» | ||
colomon | rakudo: grammar A { regex B { \w+\D }; method C($a) { self.parse($a, :rule<B>); }; }; say A.new.parse("fred1", :rule<B>).perl | 12:24 | |
p6eval | rakudo dc9900: OUTPUT«Match.new( from => 0, orig => "fred1", to => 4,)» | ||
moritz_ | (it's even specced, iirc :-) | ||
pmichaud | good morning, #perl6 | 12:26 | |
phenny | pmichaud: 31 Aug 18:00Z <moritz_> ask pmichaud in trace output from NQP-rx with <DEBUG(1)>, whas is the second number in the second column? ie the /1 in 1283276995.944721 17/1 START comment | ||
frettled | moritz_: *lightbulb* — aha! | 12:29 | |
pmichaud | moritz_: first number is string offset, second number is line number | ||
12:30
azawawi joined
|
|||
kaare_ | pmichaud: Your august rakudo start announcement wasn't picked up by planetsix.perl.org or any other aggregator I follow. | 12:30 | |
12:30
espadrine left
|
|||
pmichaud | kaare_: I noticed that also. I'm not sure what happened there. | 12:30 | |
oh, I didn't post it to use.perl.org, I bet. | |||
and rakudo.org doesn't have a working rss feed. :-( | 12:31 | ||
kaare_ | yep, ony rakudo.org | ||
pmichaud | should I go ahead and post it now to use.perl.org ? | ||
12:31
zulon joined
|
|||
kaare_ | I would vote yes. | 12:31 | |
azawawi | phenny: tell sorear Thanks for the latest STD syml inclusion. Fixed S:H:P6 to re-use it. padre.perlide.org/trac/changeset/12415 | ||
phenny | azawawi: I'll pass that on when sorear is around. | ||
azawawi: 08:50Z <sorear> tell azawawi Pronoun resolution error | |||
12:31
espadrine joined
|
|||
kaare_ | If I didn't search for it, I wouldn't know it was announced. | 12:31 | |
12:31
azawawi left
|
|||
kaare_ | Not sure that use.perl.org's rss feed is much better though :-/ | 12:33 | |
12:34
snearch left
12:35
yrgd left
12:36
_jaldhar joined,
jaldhar left,
__rnddim__ joined,
lue left
|
|||
pmichaud | use.perl.org/~pmichaud/journal/40518 | 12:37 | |
colomon | rakudo: grammar A { regex B { \w+\D }; method C($a) { self.parse($a, :rule<B>); }; }; say A.parse("fred1", :rule<B>).perl | ||
pmichaud | (use.perl.org's rss feed) well, I know that articles I post there tend to make it to the aggregators | ||
p6eval | rakudo dc9900: OUTPUT«Match.new( from => 0, orig => "fred1", to => 4,)» | ||
12:51
bluescreen joined,
bluescreen is now known as Guest59170
|
|||
pmichaud | twitter.com/aledalgrande/status/22614181643 # huh?!?! | 12:52 | |
takadonet | .. | ||
daxim | quick! reply with something witty and scathing that would make sideshow bob proud! | 12:53 | |
12:54
cognominal joined
|
|||
tadzik | ignorance is bliss. It also makes you look silly though | 12:54 | |
12:55
zulon left
|
|||
takadonet | tadzik: nice | 12:55 | |
12:56
kaare_ left
|
|||
pmichaud | sometimes the simplest replies are easiest: twitter.com/pmichaud/status/22704356371 | 12:56 | |
frettled | pmichaud++ — for applying KISS | 12:58 | |
12:58
proller left
12:59
proller joined
|
|||
elekt | yrb: Nice, i'll check it out | 13:02 | |
13:09
orafu left,
orafu joined
13:12
Holy_Cow joined
|
|||
colomon | whee, 21 passing tests for ABC! | 13:12 | |
31 | 13:13 | ||
13:15
ruoso joined
13:21
zulon joined
13:23
f00li5h left,
f00li5h joined
|
|||
tadzik | please say that the smoking stats motivated you :) | 13:23 | |
colomon | I'm happy to say the smoking stats motivated me. | 13:25 | |
though I don't actually know where they are. | |||
tadzik | yay :) | ||
colomon | mostly I want to have a functional ABC parser. I actually could have used one last week. | ||
tadzik | well, the last html ones are quite old: tjs.azalayah.net/ser.html | ||
colomon | actually, I used your tool in a completely different fashion this morning. | 13:26 | |
tadzik | which tool? | ||
colomon | neutro | ||
tadzik | well, neutro is for installing specifically | ||
smoker.pl is a wrapper around neutro for some smoketesting capabilities | |||
colomon | after doing the big smoke test, I switched to ~/.perl6/lib and did an ack search through all the installed modules. | 13:27 | |
tadzik | and the smoke test was run manually? | 13:28 | |
colomon | yes | ||
well, manually using smoker.pl. | |||
tadzik | hmm | ||
colomon | and actually, I used the run from a week or two ago. | ||
tadzik | I see | ||
colomon | it's a great way to search against the source of the current modules. | 13:29 | |
daxim | rakudo-star-2010.08 build errors paste.scsys.co.uk/49772?tx=on | ||
scroll down to the ===SORRY!=== sections | 13:30 | ||
tadzik | bbl | ||
13:30
tadzik left
|
|||
colomon | 74 passing tests | 13:33 | |
13:40
zulon left
13:41
drbean left
|
|||
pmichaud | daxim: (build errors) -- yes, we still need to work on DESTDIR a bit more | 13:48 | |
13:48
hudnix left
13:52
hudnix joined
13:58
sftp left
13:59
sftp joined
14:03
uniejo left
14:11
tylercurtis joined,
smash joined
|
|||
smash | hello everyone | 14:13 | |
moritz_: ping | |||
14:14
dju_ joined
14:15
fda314925 left,
proller_ joined,
dju left
14:16
proller left,
fda314925 joined,
daemon joined
14:19
patspam joined,
zag left
|
|||
moritz_ | smash: pong | 14:19 | |
14:20
sftp_ joined
14:21
sftp left
|
|||
colomon | rakudo: my $match = "abcdefg" ~~ /./; say $match.perl | 14:22 | |
p6eval | rakudo dc9900: OUTPUT«Match.new( from => 0, orig => "abcdefg", to => 1,)» | ||
colomon | rakudo: my $match = "abcdefg" ~~ /\w*/; say $match.perl | ||
p6eval | rakudo dc9900: OUTPUT«Match.new( from => 0, orig => "abcdefg", to => 7,)» | ||
colomon | rakudo: my $match = "abcdefg" ~~ /[\w]*/; say $match.perl | ||
p6eval | rakudo dc9900: OUTPUT«Match.new( from => 0, orig => "abcdefg", to => 7,)» | 14:23 | |
smash | moritz_: finally got time to set up those benchmarks for rakudo gil.di.uminho.pt/users/smash/rakudo-bench.html | ||
colomon | rakudo: regex A { \w }; my $match = "abcdefg" ~~ /[<A>]*/; say $match.perl | ||
p6eval | rakudo dc9900: OUTPUT«Useless declaration of has-scoped regex in a module; add our or my to install it in the lexpad or namespaceMethod 'A' not found for invocant of class 'Cursor' in <anon> at line 22:/tmp/LGV9_G0r_5 in 'Cool::match' at line 2421:CORE.setting in 'Regex::ACCEPTS' at line | ||
..5824:COR… | |||
colomon | rakudo: our regex A { \w }; my $match = "abcdefg" ~~ /[<A>]*/; say $match.perl | ||
p6eval | rakudo dc9900: OUTPUT«Method 'A' not found for invocant of class 'Cursor' in <anon> at line 22:/tmp/pvpHLBQUnY in 'Cool::match' at line 2421:CORE.setting in 'Regex::ACCEPTS' at line 5824:CORE.setting in main program body at line 22:/tmp/pvpHLBQUnY» | ||
colomon | rakudo: grammar A { regex B { \w ':' }; regex C { <B>+ }; }; my $match = A.parse("a:b:c:", :rule<C>); say $match.perl | 14:25 | |
p6eval | rakudo dc9900: OUTPUT«Match.new( from => 0, orig => "a:b:c:", to => 6, named => { B => [ Match.new( from => 0, orig => "a:b:c:", to => 2, ), Match.new( from => 2, orig => "a:b:c:", to => 4, ), Match.new( from => 4, orig => | ||
.."a:b:c:",… | |||
colomon | rakudo: grammar A { regex B { \w ':' }; regex C { <B>+ }; }; my $match = A.parse("a:b:c:", :rule<C>); say $match<B>.perl | ||
p6eval | rakudo dc9900: OUTPUT«[Match.new( from => 0, orig => "a:b:c:", to => 2,), Match.new( from => 2, orig => "a:b:c:", to => 4,), Match.new( from => 4, orig => "a:b:c:", to => 6,)]» | ||
colomon | rakudo: grammar A { regex B { \w ':' }; regex C { <B>+ }; }; my $match = A.parse("a:b:c:", :rule<C>); say $match<B>.elems | 14:26 | |
p6eval | rakudo dc9900: OUTPUT«3» | ||
colomon | rakudo: grammar A { regex B { \w ':' }; regex C { <B>+ }; }; my $match = A.parse("a:b:c:", :rule<C>); for $match<B> -> $m { say $m } | ||
p6eval | rakudo dc9900: OUTPUT«a: b: c:» | ||
colomon | and there is my issue. | ||
moritz_ | for $match<B>.flat | 14:27 | |
rakudo: grammar A { regex B { \w ':' }; regex C { <B>+ }; }; my $match = A.parse("a:b:c:", :rule<C>); for $match<B>.flat -> $m { say $m } | 14:28 | ||
p6eval | rakudo dc9900: OUTPUT«a:b:c:» | ||
moritz_ | colomon: better? :-) | ||
colomon | yes. is it supposed to be needed? | 14:29 | |
moritz_++ | 14:30 | ||
moritz_ | yes | 14:32 | |
it's needed for the distinction (.)(.) vs. (.)**2 | |||
14:33
espadrine left
|
|||
smash | moritz_: got my link ? | 14:34 | |
colomon | 114 passing tests in ABC/t/01-regexes.t, that's all for that file. | 14:37 | |
moritz_ | smash: yes, just haven't had a chance to look yet | ||
smash | moritz_: sure, take your time | 14:38 | |
14:38
espadrine joined
|
|||
colomon | www.codequarterly.com/code-challenges/markup/ -- is someone already on this? :) | 14:41 | |
smash | colomon: not me, but looks interesting | 14:44 | |
colomon | seems like the sort of thing which should be pretty easily done in p6 | ||
daxim | can HTML be parsed by a p6 grammar? | 14:45 | |
smash | daxim: i don't see why not | 14:46 | |
colomon: true | |||
moritz_ | daxim: it can, though parsing wrong HTML will be rather painful | 14:47 | |
daxim | aha, in case of wrong HTML, will there be by default a sane message like "expected 'foo', but found 'bar' at line xx column yy"? | 14:48 | |
or does the programmer have to provide this? | |||
moritz_ | "depends" | 14:49 | |
daxim | hm hm :S | ||
moritz_ | rakudo: say '<a>foobar</b>' ~~ /[ '<' (\w+) '>'] ~ [ '</' $0 '>' ] <-[<>]> / | 14:50 | |
p6eval | rakudo dc9900: OUTPUT«Unable to parse _block119, couldn't find final [ '</' $0 '>' ] at line 1 in <anon> at line 22:/tmp/xLLPVkDLhv in 'Cool::match' at line 2421:CORE.setting in 'Regex::ACCEPTS' at line 5824:CORE.setting in main program body at line 22:/tmp/xLLPVkDLhv» | ||
14:50
zulon joined
|
|||
moritz_ | seems it needs a bit of improvement :-) | 14:50 | |
14:50
patrickas joined
|
|||
colomon | rakudo: say '<a>foobar</a>' ~~ /[ '<' (\w+) '>'] ~ [ '</' $0 '>' ] <-[<>]> / | 14:55 | |
p6eval | rakudo dc9900: OUTPUT«Unable to parse _block119, couldn't find final [ '</' $0 '>' ] at line 1 in <anon> at line 22:/tmp/ghvxdCynhH in 'Cool::match' at line 2421:CORE.setting in 'Regex::ACCEPTS' at line 5824:CORE.setting in main program body at line 22:/tmp/ghvxdCynhH» | 14:56 | |
TimToady | rakudo: say '<a>foobar</a>' ~~ /[ '<' (\w+) '>'] ~ [ '</' $0 '>' ] <-[<>]>* / | ||
p6eval | rakudo dc9900: OUTPUT«<a>foobar</a>» | ||
colomon | rakudo: say '<a>foobar</b>' ~~ /[ '<' (\w+) '>'] ~ [ '</' $0 '>' ] <-[<>]>* / | 14:59 | |
p6eval | rakudo dc9900: OUTPUT«Unable to parse _block119, couldn't find final [ '</' $0 '>' ] at line 1 in <anon> at line 22:/tmp/fdMSYRwzYH in 'Cool::match' at line 2421:CORE.setting in 'Regex::ACCEPTS' at line 5824:CORE.setting in main program body at line 22:/tmp/fdMSYRwzYH» | ||
15:01
wtw left
15:03
HarryS left,
HarryS joined
15:11
HarryS left,
alester joined
15:13
justatheory joined
|
|||
bbkr | hmm, in which part of S05 is this regexp tilde trick described? | 15:20 | |
nvm, found it under "New metacharacters" | 15:21 | ||
slavik | bbkr: tilde trick? | 15:22 | |
TimToady | the "between" matcher | 15:23 | |
'[' ~ ']' <subscript> | 15:24 | ||
used above for tags | |||
bbkr | slavik: that you can write regexp like / [ '<h1>' ~ '</h1>' <header_text> / instead of / [ '<h1>' <header_text> '</h1>' / | ||
slavik | oh | 15:25 | |
TimToady | mostly it swaps the next two atoms, but also helps with error reporting | ||
slavik | so ~ is like a "stuff" symbol? | ||
15:25
dju_ left
|
|||
slavik | nice! | 15:25 | |
TimToady++ :) | |||
TimToady | STD is full of it. | ||
wait, did I say that? :) | |||
15:26
dju joined
|
|||
bbkr | rakudo: say so "abc" ~~ /a ~ (c) (b)/; say $0 # wow, it even reverts capture order :) | 15:29 | |
p6eval | rakudo dc9900: OUTPUT«1b» | ||
TimToady | uhhh | ||
that seems like a bug to me | 15:30 | ||
15:32
slavik2 joined
|
|||
bbkr reports | 15:32 | ||
15:33
slavik left,
HarryS joined
15:38
Trashlord left
|
|||
bbkr | std: "abc" ~~ /^ a ~ ($0) ($0) $/; # stupid code | 15:39 | |
p6eval | std 32123: OUTPUT«ok 00:01 119m» | ||
bbkr | rakudo: "abc" ~~ /^ a ~ ($0) ($0) $/; # stupid code | ||
p6eval | rakudo dc9900: OUTPUT«Unable to parse _block119, couldn't find final ($0) at line 1 in <anon> at line 22:/tmp/9Z5ccHwRQh in 'Cool::match' at line 2421:CORE.setting in 'Regex::ACCEPTS' at line 5824:CORE.setting in main program body at line 10:/tmp/9Z5ccHwRQh» | ||
15:39
HarryS left
|
|||
bbkr | TimToady: is above one a STD bug or Rakudo one? | 15:40 | |
moritz_ | it doesn't have to be on at all | ||
matching an undefined variable fails | 15:41 | ||
which is why ($0) doesn't match, hence the error message | |||
15:41
patspam left
|
|||
bbkr | moritz_: but following your logic this one should fail in the same way: | 15:42 | |
rakudo: "abc" ~~ /^ a ($0) ($0) $/; | |||
p6eval | rakudo dc9900: ( no output ) | ||
moritz_ | bbkr: only the ~ thing actually throws an expression | ||
*exception | |||
15:43
patspam joined
|
|||
bbkr | ok, not a bug then | 15:45 | |
TimToady | BTW, if anyone thinks of some good show-off ideas for Perl 6 on rosettacode, we can add new problem specifications | 15:47 | |
Alias | Best features are the thinks nobody else has | ||
things | |||
Does stuff like [+] work yet? | |||
TimToady | sure | ||
lots of the current entries use it :) | 15:48 | ||
and other metas like Z+ | |||
moritz_ | TimToady: so how does it feel to actually write Perl 6 code? :-) | 15:49 | |
TimToady | quite a relief | ||
smash | i might borrow some scripts from rosettacode to add the scripts list for my benchmark | ||
s/to add/to add to/ | |||
TimToady | smash: btw, that red-black tree could actually be quite useful | ||
smash | TimToady: sorry. didn't had the time to look at it, but it's on my todo list | 15:50 | |
i should still try to finish the bead sort one | |||
TimToady | I thought rosettacode.org/wiki/Formal_power_series#Haskell might also be up your alley | 15:51 | |
bbkr | rakudo: say [+](True, True, True) # bug? True + True should be True or 2? | 15:52 | |
TimToady | Alias: pretty much all of the examples on rosettacode.org/wiki/Category:Perl_6 currently work under rakudo | ||
p6eval | rakudo dc9900: OUTPUT«3» | ||
TimToady | + coerces to numeric | ||
bbkr | then it's correct | ||
TimToady | we have lots of other ways to do "or" | ||
smash | TimToady: might as well write a haskell to perl6 converter :-) | ||
TimToady | and a perl6 to haskell converter while you're at it :) | 15:53 | |
smash | TimToady: you're giving me a headache already | 15:54 | |
PerlJam | A simple perl5 to perl6 converter would be more useful I think | 15:55 | |
A complex perl5 to perl6 converter would be most useful too :) | |||
moritz_ | the problem is that no code generator produces both idiomatic *and* correct code | 15:56 | |
nobody wants a code generator that produces incorrect code | |||
and nobody wants to change generated, non-idiomatic code | 15:57 | ||
TimToady | as long as the places where it's guessing are clearly marked for audit, it can be useful | ||
PerlJam | It probably needs to be 2 pass to get correct + idiomatic | ||
TimToady | that was a2p's approach | ||
moritz_ thinks that code translation is not the right approach to code reuse, in the general case | 15:58 | ||
TimToady | where the 2nd pass is "the programmer rewrites this so it works" | ||
PerlJam | moritz_: of course not, but it could make a good bootstrap | ||
TimToady | translation is mostly useful for educational purposes | ||
that's how a2p ended up being used | |||
in which case idiomatic and almost correct is kinda what you want | |||
but it's really much more important to be able to intermix p5 and p6 modules, so people can translate (auto or by hand) piecemeal | 16:00 | ||
whether the intermixing is done by emulation or cooperating interpreters is another question | |||
emulation solves the multiple runloop problem but is not usually complete emulation | 16:01 | ||
bug compatibility is difficult | |||
16:03
HarryS joined
|
|||
TimToady | Luxembourg? | 16:04 | |
alester | pmichaud: I haven't forgotten about the rakudo.org RSS feed. | ||
16:05
wamba left
|
|||
Util | My approach in 5-to-6 conversion (PPI-based) is to change the syntax to Perl6, while logging (1) things that the converter is can't be 100% sure it has converted correctly (like bitwise-or), (2) things it has not even tried to convert, but recognizes that need converting, and (3) P5 idioms that it can recognize as having equivilant improved P6 idioms, but at a higher level of abstraction than it can process (like sort changing into 1-var form). Lower level idiom | 16:05 | |
TimToady | Util: that looks chopped | 16:06 | |
bbkr | rakudo: 01 # known STD discrepancy? | ||
p6eval | rakudo dc9900: ( no output ) | ||
Util | The idea is to make a human's brain a well-defined part of the conversion process, by telling him exactly what else needs to be done. | ||
PerlJam | Util: you have such a converter? | ||
Util | TimToady: chopped, as in "Util is missing an obvious piece of the conversion process in his description"? | 16:07 | |
TimToady | your message was chopped | ||
16:07
molaf joined
|
|||
PerlJam | Util: chopped as in the last thing I saw was "Lower level idiom" | 16:07 | |
Util | ... Lower level idiom (like "no parens needed for for loops") I am trying to handle. | 16:08 | |
16:09
HarryS left
|
|||
Util | Chopped in the IRClog on perlgeek.de, but not on my screen. /me lacks IRC-fu. | 16:10 | |
16:10
zulon left
|
|||
Util | PerlJam: Yes, I just started brushing the dust off this morning. Plan to load to GitHub later this week. | 16:11 | |
PerlJam | Util++ cool | ||
16:12
silug joined
16:13
Ross joined
|
|||
TimToady | more like IRC lacks Util-fu. :) | 16:13 | |
16:14
cdarroch joined,
cdarroch left,
cdarroch joined
|
|||
ash_ | Util hey, its John Harrison, from Auburn | 16:15 | |
ash_ | oops | 16:16 | |
umm | |||
sorry | |||
i fail at irc | |||
what was the title of the channel? (and why did it let me do that? o.0) | |||
moritz_ | »ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend! | Rakudo Star Released! | 16:17 | |
ash_ | thanks moritz_ sorry about that :-x | 16:17 | |
daxim | good clients keep a history of topics | ||
Util | ash_: I think you meant `/msg Util` instead of `/topic` | ||
bbkr | rakudo: */x # another Rakudo vs STD compatibility bug | 16:18 | |
p6eval | rakudo dc9900: ( no output ) | ||
ash_ | i did /t because i thought it meant 'tell' but ya | ||
i am irc stupid right now | |||
moritz_ | bbkr: it's the old "doesn't check for subs at compile time" bug | 16:19 | |
bbkr | moritz_: I'm not sure. in this case * Whatever messes it | 16:20 | |
rakudo: 1/x | |||
p6eval | rakudo dc9900: OUTPUT«Could not find sub &x in main program body at line 22:/tmp/nHp6_cau91» | ||
moritz_ | bbkr: it's like { $_ / x } | ||
bbkr: and because nothing calls it, the existance check for &x is never done | 16:21 | ||
ash_ | rakudo: my $a = * / x; say $a(1); | ||
p6eval | rakudo dc9900: OUTPUT«Could not find sub &x in <anon> at line 22:/tmp/0Ker9myfF2 in main program body at line 22:/tmp/0Ker9myfF2» | ||
ash_ | that error message doesn't come up until you call $a | ||
since whatever's are lazy | |||
bbkr | moritz++ ash++ # nice explanation | 16:22 | |
TimToady | doing the proper check is a bit tricky | ||
std: { $_ / x }; sub x {...} | |||
p6eval | std 32123: OUTPUT«ok 00:01 118m» | ||
TimToady | std: { $_ / x }; | 16:23 | |
p6eval | std 32123: OUTPUT«===SORRY!===Undeclared routine: 'x' used at line 1Check failedFAILED 00:02 117m» | ||
TimToady | you have to remember all the lexical scopes to re-search at CHECK time | ||
16:24
masak joined
|
|||
masak | oh hai, #perl6 | 16:24 | |
TimToady | short nap | ||
smash | masak: hello | ||
masak | I'm just stopping by. will have a longer session later tonight. | 16:25 | |
16:25
risou joined
16:29
risou_ joined
|
|||
isBEKaml | hi masak! | 16:29 | |
masak | hi! | ||
16:30
risou left
|
|||
bbkr | std: +q # some perlbot bug I think... | 16:32 | |
p6eval | std 32123: OUTPUT«Invalid class name (STD::stop::) at /opt/perl-5.12.1/lib/site_perl/5.12.1/x86_64-linux/Class/MOP.pm line 89 Class::MOP::load_first_existing_class('STD::stop::') called at /opt/perl-5.12.1/lib/site_perl/5.12.1/x86_64-linux/Class/MOP.pm line 137 | ||
..Class::MOP::load_class('STD::stop::'… | |||
bbkr | should I report it somewhere? | 16:33 | |
16:33
HarryS joined
|
|||
ash_ | wow, nice bug | 16:34 | |
moritz_ | just hilight TimToady | ||
ash_ | rakudo: +q # just wondering | ||
p6eval | rakudo dc9900: ( no output ) | ||
16:36
cytzol joined
|
|||
bbkr | std: q # TimToady this breaks perlbot | 16:36 | |
p6eval | std 32123: OUTPUT«Invalid class name (STD::stop::) at /opt/perl-5.12.1/lib/site_perl/5.12.1/x86_64-linux/Class/MOP.pm line 89 Class::MOP::load_first_existing_class('STD::stop::') called at /opt/perl-5.12.1/lib/site_perl/5.12.1/x86_64-linux/Class/MOP.pm line 137 | ||
..Class::MOP::load_class('STD::stop::'… | |||
16:39
HarryS left
|
|||
pmichaud | good afternoon | 16:43 | |
moritz_ | oh hai | ||
TimToady | std: q | 16:44 | |
p6eval | std 32123: OUTPUT«Invalid class name (STD::stop::) at /opt/perl-5.12.1/lib/site_perl/5.12.1/x86_64-linux/Class/MOP.pm line 89 Class::MOP::load_first_existing_class('STD::stop::') called at /opt/perl-5.12.1/lib/site_perl/5.12.1/x86_64-linux/Class/MOP.pm line 137 | ||
..Class::MOP::load_class('STD::stop::'… | |||
masak | hi pmichaud | 16:45 | |
TimToady | shortest STDbug ever :) | ||
bbkr bows | 16:46 | ||
pmichaud | std: Q | ||
p6eval | std 32123: OUTPUT«Invalid class name (STD::stop::) at /opt/perl-5.12.1/lib/site_perl/5.12.1/x86_64-linux/Class/MOP.pm line 89 Class::MOP::load_first_existing_class('STD::stop::') called at /opt/perl-5.12.1/lib/site_perl/5.12.1/x86_64-linux/Class/MOP.pm line 137 | ||
..Class::MOP::load_class('STD::stop::'… | |||
pmichaud | (one bit shorter...?) | ||
TimToady | looks a bit taller to me | ||
smash | pmichaud: rakudo-star speed is improving, gil.di.uminho.pt/users/smash/rakudo-bench.html | 16:47 | |
colomon | ooo, that's just the sort of benchmark graph I've been hoping to see. | 16:48 | |
ash_ | i like the angle those lines are at (in the context of what they are graphing) | ||
smash | everyone feel free to add new scripts to the github repository so they can be added to the benchmark | 16:49 | |
bbkr | smash: simple grammar test would also be nice, since Rakudo is very "grammar oriented" | ||
colomon | smash++ | ||
though I think I was thinking of benchmarks which took a couple of minutes to run now. | 16:50 | ||
will that mess things up? | |||
TimToady | some of those lines will intersect 0 within a year | ||
ash_ | wait, is doing nothing slower than saying "hello world"? | ||
thats... kinda funny actually | |||
smash | colomon: i'm only planning on running the benchmark once a day, so taking a couple of minutes to run is fine | 16:51 | |
colomon | and you are planning on running it once a day? smash++ indeed! | ||
I will try to get you an assortment of benchmarks in the next few days. | |||
(I've been planning on doing benchmarks anyway, and since you're doing all the hard organizational work...) | 16:52 | ||
smash | ash_: the do_nothing script is the faster | ||
colomon: i can set you up with commit rights on github if you want to add the scripts yourself | |||
16:53
kirillm left
|
|||
ash_ | do_nothing: 1.695492 s, hello: 1.684894 s (for 2010.08) | 16:53 | |
rakudo: say 1.695492 - 1.684894 | |||
p6eval | rakudo dc9900: OUTPUT«0.010598» | ||
ash_ | its a very small amount, but still | ||
smash | ash_: oh, that one.. yeap, but something external to the process can have tampered that | ||
ash_ | i know | 16:54 | |
i am sure, its hard to have 100% consistent and accurate benchmarks | |||
smash | i might add something to try to prevent that, like running the example more than one time and choosing the faster value (or something like that) | ||
16:55
dakkar left
|
|||
colomon | smash: that would be nice, and probably easier than me forking it and then sending you pull requests. | 16:55 | |
pmichaud | it might be nice to have the benchmarks in the perl6-examples repository. or I can set up a benchmarks repository in the perl6 account | ||
16:55
kirillm joined
|
|||
patrickas | the angle of the line seems ... treacherous | 16:55 | |
pmichaud | (or in the rakudo account, if we want these to be rakudo-specific) | ||
smash | pmichaud: that is also possible, i can change the scripts source from one repo to another | 16:56 | |
pmichaud | so, where would you like to move them? ;-) | ||
ash_ | smash: i'd say run each example 10 times and list their average and std deviation | 16:57 | |
pmichaud | I think minimum might make more sense. | ||
smash | pmichaud: any place is fine by me as long as i can clone it | ||
ash_: that's one way to go to | |||
ash_ | min and max are good too | 16:58 | |
pmichaud | smash: should I call it rakudo-bench-scripts or perhaps just bench-scripts ? | 16:59 | |
i.e., are these intended to be rakudo specific? | |||
max is likely to illustrate system load/timing errors more than anything else | 17:00 | ||
smash | any particular reason why they should be rakudo specific ? | ||
pmichaud | smash: not that I can think of | ||
I'll call it bench-scripts | |||
smash nods. | |||
colomon: i guess you won't need commit rights to my github repo now (which will be deleted soon) | 17:01 | ||
pmichaud | github.com/perl6/bench-scripts | ||
smashz and colomon have commit bits | 17:02 | ||
feel free to add the repo to hugme | |||
smash | pmichaud: excelent, thank you | ||
colomon | pmichaud++ smash++ | 17:03 | |
smash | i'll add my current scripts there to get things started, we can remove them later as more interesting scripts come up | ||
masak | pmichaud: seems we both replied with the same URL to @aledalgrande :) don't know if people who spout "not released" are receptible enough, sadly. | ||
17:03
HarryS joined
|
|||
bbkr | std: \/ a / # bug? i'm not sure if escaping is allowed in bare code, like in this case for regexp beginning | 17:05 | |
p6eval | std 32123: OUTPUT«ok 00:02 117m» | 17:06 | |
moritz_ | maybe it's a capture? | ||
smash | pmichaud: i can do a similar setup with devel releases | ||
if anyone thinks that would be interesting | 17:07 | ||
bbkr | rakudo: (\/ a /).WHAT.say | ||
p6eval | rakudo dc9900: OUTPUT«Capture()» | ||
bbkr | moritz++ | ||
17:08
zulon joined
17:09
M_o_C joined
|
|||
pmichaud | masak: on the plus side, there are tweets like twitter.com/zenogantner/status/22723693733 :-) | 17:09 | |
17:09
HarryS left
|
|||
ash_ | moritz_++ IO::Pty::HalfDuplex seems to be working out for me, thanks for the suggestion (is that by sorear?) | 17:09 | |
moritz_ | it is | ||
sorear++ | 17:10 | ||
ash_ | sorear++ | ||
i thought it was, but wasn't sure if that was his name or not (saw it on cpan) | |||
pmichaud | masak: for some reason your tweet stream doesn't appear in my default stream. hmmm.... | ||
17:10
espadrine left
|
|||
masak | pmichaud: that gentletwitterer just wrote something about LTA errors, and I wrote back. | 17:11 | |
pmichaud | masak: I wonder why I'm not seeing your tweets by default. | 17:12 | |
masak | no idea. | ||
ok, I'll be going away for a few hours now. | |||
when I get back, we'll have a Yapsi release \o/ | |||
colomon | huh. I normally see masak++'s tweets, but I'm not seeing any in the last couple of hours. | ||
TimToady | rakudo: say :10(':16<bad.decaf>') | 17:13 | |
p6eval | rakudo dc9900: OUTPUT«DON'T PANIC! Invalid character (:)! Please try again :)  in main program body at line 1» | ||
masak | the last non-directed tweet was 14 hours ago, so that's all right. | ||
pmichaud | ...DON'T PANIC? | ||
masak | that's lue's addition, I think. | ||
should the above work? | 17:14 | ||
pmichaud | yes, the str-to-num conversions still need a fair bit of work. | ||
masak submits rakudobug | |||
ash_ | rakudo: say :10(:16<10>) | 17:15 | |
p6eval | rakudo dc9900: OUTPUT«16» | ||
ash_ | rakudo: say :2(:16<10>) | ||
p6eval | rakudo dc9900: OUTPUT«DON'T PANIC! Invalid character (6)! Please try again :)  in main program body at line 1» | ||
masak | could probably do better than that error message. | 17:16 | |
pmichaud | agreed. | ||
TimToady | is it taking () as *quotes*?!?! | ||
pmichaud | I think it's stringifying the argument | ||
masak | aye. | ||
pmichaud | rakudo: say :2('16') | ||
p6eval | rakudo dc9900: OUTPUT«DON'T PANIC! Invalid character (6)! Please try again :)  in main program body at line 1» | ||
TimToady | stringifying without evaluating? | ||
pmichaud | with evaluating, in this case | ||
TimToady | oh, yes | ||
with | |||
pmichaud | since :16<10> is '16' | 17:17 | |
TimToady | 16 has a 6, duh | ||
17:17
patrickas left
|
|||
ash_ | rakudo: say :2(16) # so this works? | 17:18 | |
17:18
amkrankruleuen joined
|
|||
p6eval | rakudo dc9900: OUTPUT«DON'T PANIC! Invalid character (6)! Please try again :)  in main program body at line 1» | 17:18 | |
ash_ | no, i don't understand :2 i guess | ||
amkrankruleuen | Hello! | ||
TimToady | that's a function | ||
not a quoting construct | |||
masak | amkrankruleuen: hi! | ||
TimToady | so it evaluates the 16, and the function coerces to Str, and '16' is an invalid binary digit | 17:19 | |
well, '6' is | |||
it can work accidentally though | |||
rakudo: say :2(11) | |||
p6eval | rakudo dc9900: OUTPUT«3» | ||
ash_ | ah, see i thought it would convert 16 to base 2 | 17:20 | |
frettled | I was confused by that one when I tried it, too. | ||
ash_ | so you'd 10000 | ||
i see, i am going the wrong way with it | |||
TimToady | we don't have a good generic conversion going the other way yet | ||
pmichaud | rakudo: say 16.fmt('%b') | 17:21 | |
p6eval | rakudo dc9900: OUTPUT«10000» | ||
TimToady | "generic" | ||
pmichaud | (not general, but good for binary) | ||
TimToady | not good enough for fractions though | ||
ash_ | 12.base(:2) # would be neat or raxdix could work | ||
radix* | 17:22 | ||
masak | fwiw, I think :10(':16<bad.decaf>') is *brilliant*. there was a p6l thread recently requesting conversion from an arbitrary base. | 17:23 | |
if no-one else replies to that thread, I will. | |||
pmichaud | masak: what are you expecting there, ooc? | 17:24 | |
frettled | masak: please do, I was a bit disappointed in the response. | ||
TimToady | std: the correct answer is 912559.729 | ||
p6eval | std 32123: OUTPUT«===SORRY!===Undeclared routines: 'answer' used at line 1 'correct' used at line 1 'is' used at line 1 'the' used at line 1Check failedFAILED 00:01 115m» | ||
masak | pmichaud: the decimal number corresponding to the hexadecimal number 0xbad.decaf | ||
TimToady | or no, that's decaf.bad | 17:25 | |
pmichaud | masak: that's just :16<bad.decaf> | ||
masak | hm. | ||
I just realized that. | |||
pmichaud | as we just mentioned, the :10 syntax doesn't do conversion to another base. | ||
masak | indeed. | ||
TimToady | 5655.675452 | ||
pmichaud | rakudo: say :16<bad.decaf> | ||
p6eval | rakudo dc9900: OUTPUT«2989.87028408051» | ||
frettled | rakudo: say :16<deadbeefcafef00dbabe> | 17:26 | |
TimToady | hmm, no I gave the octal answer :( | ||
p6eval | rakudo dc9900: OUTPUT«-4.68830549077146e+18» | ||
frettled | hah | ||
masak | anyway, the thread is here: www.mail-archive.com/perl6-language...32514.html | ||
pmichaud | I somewhat like the .base() notation -- then it's just :16<bad.decaf>.base(10) | ||
or | |||
I somewhat like the .base() notation -- then it's just :16<bad.decaf>.base(8) | 17:27 | ||
masak | .base(10) would be a no-op, wouldn't it? | ||
TimToady | point is :10($anything) works if $anything is :16<deadbeefcafef00dbabe> | ||
or is supposed to | |||
masak | TimToady: there's now a rakudobug in RT about that. | ||
TimToady | so does any other :<num> | ||
ash_ | .base(8) or .base(:8) ? | ||
pmichaud | TimToady: right -- that's what I meant earlier when I said that str-to-num conversions need work. | ||
masak | ash_: the latter is a parsefail, I think. | 17:28 | |
ash_ | oh | ||
pmichaud | masak: .base(10) might force a decimal point | ||
ash_ | rakudo: sub base(:$8) { } | ||
TimToady | std: 42.:8 | ||
17:28
risou joined
|
|||
p6eval | rakudo dc9900: OUTPUT«===SORRY!===Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22» | 17:28 | |
std 32123: OUTPUT«===SORRY!===Unsupported use of . to concatenate strings; in Perl 6 please use ~ at /tmp/2LND3B1MHD line 1:------> 42.:⏏8Parse failedFAILED 00:01 115m» | |||
pmichaud | masak: e.g., (1/3).base(10) | ||
the point is that .base creates a Str | |||
masak | anyway, let's make sure we don't re-make the mistake of bin(), oct(), and hex() -- where people expect it to go the wrong direction half of the time. | 17:29 | |
pmichaud | masak: I think we already have that mistake, as evidenced by people expecting :2(...) to do something other than what it does :-) | ||
17:29
isBEKaml left
|
|||
masak | maybe there's no way not to make that mistake. | 17:30 | |
at least not with nice names. | |||
TimToady | yes, but there's the correspondence with the :2<1111> form at least | ||
[Coke] | colomon: nice graph. (except: UGH YELLOW ON WHITE). ;) | ||
17:30
risou_ left
|
|||
colomon | [Coke]: errr, what? | 17:30 | |
frettled | pmichaud: I think it has something to do with how it's applied. | ||
I think the current syntax is close to useless. | 17:31 | ||
pmichaud | frettled: I suspect it's that people think "I need to do a base conversion... Oh yes, :16() is what I want" | ||
without recognizing that conversion is a two-way-street. | |||
[Coke] | colomon: smash's graph. | ||
masak | swimming & | ||
17:31
masak left
|
|||
frettled | pmichaud: yup | 17:31 | |
ash_ | ya, i just assumed :16 would give me the base 16 version of whatever i passed it | 17:32 | |
frettled | pmichaud: I really like bc(1)'s way of handling it, that's rather nice and intuitive. But it's not easy to translate that into something that's sensible in a programming language, I'm afraid. | ||
ash_: I think there's room for a spec improvement there, too. | |||
I dropped the ball on that one. I'm good at dropping balls, recently. | 17:33 | ||
ash_ | rakudo: say 123.':8'; | ||
p6eval | rakudo dc9900: OUTPUT«===SORRY!===Quoted method name requires parenthesized arguments at line 22, near ";"» | ||
17:33
HarryS joined
|
|||
ash_ | rakudo: say 123.':8'(); | 17:33 | |
p6eval | rakudo dc9900: OUTPUT«Method ':8' not found for invocant of class 'Int' in main program body at line 22:/tmp/AXGkZbqef5» | ||
frettled | ash_: IIRC, there is nothing in the spec about conversion between arbitrarily chosen bases. | 17:34 | |
pmichaud | we can convert strings using bases up to 36. there's no conversion for going the other way yet. | ||
ash_ | i am not sure arbitrary is right though, 2, 8, 10, 16 (and sometimes 64) are very common in programming languages, so its not purely arbitrary | 17:35 | |
frettled | I think a clarification of the current spec is needed, with some minor additions. | ||
17:35
M_o_C left
|
|||
ash_ | saying i want 15 in base pi would be nifty, but i don't think thats something the core of perl6 needs to support | 17:37 | |
17:37
M_o_C joined
|
|||
frettled | That is a strawman. | 17:38 | |
Integer bases are reasonable. | |||
17:40
HarryS left
|
|||
ash_ | i guess i don't like the idea of anything other than 2, 8, 10 and 16 because i don't know the calculations or operations required to produce any other bases | 17:40 | |
so, take my opinion with a grain of salt :P | |||
17:42
sahadev joined
|
|||
frettled | rakudo: my $x = 30; my $y = :13($x); say $x; say $y; | 17:44 | |
p6eval | rakudo dc9900: OUTPUT«3039» | ||
17:45
molaf left,
javs joined
|
|||
frettled | ash_: the calculation required for other bases isn't particularly more complicated than converting between base 10 and the others you mentioned. | 17:46 | |
If you know how to convert from base 10 to base 8 and back again, then you have the basic knowledge needed. | |||
smash | more values for gil.di.uminho.pt/users/smash/rakudo-bench.html (trying to get a bit more accurate info) | 17:49 | |
ash_: the average time for the hello.p6 is slower than the do_nothing ;-) | 17:50 | ||
ash_ | lol, aww, now its not faster to say "hello world", than it is to do nothing :P | ||
smash | hehe | 17:51 | |
ash_ | i noticed :P | ||
pmichaud | multi sub base(0, $b) { '' }; multi sub base($n, $b) { base($n div $b, $b) ~ substr("0123456789abcdefghijklmnopqrstuvwxyz", $n % $b, 1); }; say base(:16<deadbeef>, 8); | ||
(a not terribly efficient base converter) | |||
rakudo: multi sub base(0, $b) { '' }; multi sub base($n, $b) { base($n div $b, $b) ~ substr("0123456789abcdefghijklmnopqrstuvwxyz", $n % $b, 1); }; say base(:16<deadbeef>, 8); | |||
p6eval | rakudo dc9900: OUTPUT«No applicable candidates found to dispatch to for 'infix:<div>'. Available candidates are::(Int $a, Int $b) in 'base' at line 22:/tmp/3KqAXzAAZL in main program body at line 22:/tmp/3KqAXzAAZL» | ||
pmichaud | hmmm | ||
rakudo: multi sub base(0, $b) { '' }; multi sub base($n, $b) { base($n div $b, $b) ~ substr("0123456789abcdefghijklmnopqrstuvwxyz", $n % $b, 1); }; say base(258, 8); | |||
p6eval | rakudo dc9900: OUTPUT«402» | ||
ash_ | still, those are pretty consistent results, but i don't know if any of those are terribly difficult problems in terms of like O(N^M) | 17:52 | |
pmichaud | rakudo: multi sub base(0, $b) { '' }; multi sub base($n, $b) { base($n div $b, $b) ~ substr("0123456789abcdefghijklmnopqrstuvwxyz", $n % $b, 1); }; say base(258, 13); | ||
p6eval | rakudo dc9900: OUTPUT«16b» | ||
colomon | smash: more tests coming soon.... ;) | ||
smash | ash_: better 'bench-oriented-scripts' are needed, yes | 17:53 | |
smash: nice | |||
pmichaud | in our case, we're wanting to benchmark basic ops as well as computationally complex ones, I think. | 17:54 | |
17:54
M_o_C left,
szabgab left
|
|||
colomon | absolutely good to have the simple ones in there, yup. | 17:54 | |
ash_ | you could take, like: shootout.alioth.debian.org/u32/prog...l&id=2 and convert it from perl5 to perl6 | 17:55 | |
the more, the better | |||
17:56
szabgab joined
|
|||
moritz_ | should I add bench-scripts to hugme? | 17:58 | |
pmichaud | +1 | ||
smash | i'm deleting my github repository for the scripts then | 17:59 | |
ash_ | ooo, a regex test shootout.alioth.debian.org/u32/prog...l&id=4 might be fun to convert to perl6 | ||
18:00
hugme left,
hugme joined,
ChanServ sets mode: +v hugme
18:01
jaldhar_ joined
|
|||
moritz_ | hugme: show bench-scripts | 18:04 | |
hugme | moritz_: the following people have power over 'bench-scripts': PerlJam, TimToady, [particle], colomon, jnthn, masak, moritz_, pmichaud, smash. URL: github.com/perl6/bench-scripts/ | ||
18:04
_jaldhar left
18:05
zulon left
18:11
espadrine joined,
tadzik joined
|
|||
moritz_ | perlgeek.de/en/article/debug-a-perl-6-grammar any final comments before I publish it for real? (ie link to it from the menus) | 18:12 | |
tadzik | 'evening | ||
pmichaud | moritz_: reading | 18:14 | |
ash_ | moritz_: in the backtracking control section, should you mention that rule/token have an implied :ratchet? | 18:15 | |
eg, rule { } is the same as regex :ratchet :sigspace { } | 18:16 | ||
pmichaud | "the difference to the previous one tells you how much time was spent in that rule." better might be "the difference to the previous one tells the time between regex events" | ||
since it's possible that some rules could turn off debugging (or might be missing the debugging statements) | |||
moritz_ | pmichaud: agreed, will change | ||
ash_: I'll mention token/rule, but it's not a tutorial for regexes, so I won't explain too much | 18:17 | ||
18:17
patspam left
|
|||
ash_ | moritz_: alright, just thought it might be worth noting, even if its a sidenote | 18:17 | |
18:17
NABC854 joined
|
|||
PerlJam | moritz++ | 18:18 | |
moritz_ | if you have more debugging hints, please let me know | ||
pmichaud | maybe even "... between logged regex events" | 18:19 | |
"PASSing rules have and additional" -> s/and/an/ | 18:20 | ||
PerlJam | moritz_: in the backtracking control section you have a rule that says "# switch off backtracking from here on" before :!ratchet. That's exactly backwards isn't it? | ||
s/a rule/a comment within a rule/ | |||
18:21
jhuni joined
|
|||
pmichaud | s/endvebatim/endverbatim/ # maybe | 18:21 | |
18:21
macroron joined
|
|||
moritz_ | PerlJam: you're right | 18:23 | |
updated. | |||
18:25
dual left,
daxim left
|
|||
PerlJam | When did <?DEBUG> start outputting timestamps? | 18:25 | |
pmichaud | a couple of weeks ago | ||
I'm using it to time where the parser is spending its efforts | 18:26 | ||
PerlJam | okay, just checking. I guess I haven't installed the latest release on this laptop. | ||
moritz_: maybe add a small note that says if you're using an older release, you won't get the timestamps | 18:27 | ||
18:27
ash_ left
|
|||
moritz_ | PerlJam: good idea | 18:27 | |
18:27
Guest59170 left
18:28
Guest59170 joined,
risou left
18:32
kjeldahl left
18:33
jhuni left
|
|||
TimToady is back after a network outrage | 18:39 | ||
well, actually, my WiFi reset itself to factory spec, and it took me that long to get it reconfigured | 18:40 | ||
PerlJam | TimToady: at least it wasn't a neural network outage | 18:41 | |
TimToady | well, part of it was, till I remembered my password | ||
hmm, better go check my inbound settings though... | 18:42 | ||
18:44
ash_ joined
|
|||
ash_ | rakudo: &GLOBAL::dir := sub {die 'fail'}; say 1...5; # why does ... use dir? | 18:47 | |
p6eval | rakudo dc9900: OUTPUT«fail in <anon> at line 22:/tmp/sv5akghK_V in 'Block::ACCEPTS' at line 5783:CORE.setting in 'infix:<...>' at line 768:CORE.setting in 'infix:<...>' at line 840:CORE.setting in main program body at line 22:/tmp/sv5akghK_V» | ||
ash_ | i just realized that the safemode file i am using for try.rakudo.org won't let you use ... ops | 18:50 | |
well, as a series | |||
github.com/moritz/try.rakudo.org/bl.../p6safe.pl is the safe mode file i am using, if your curious | 18:54 | ||
moritz_ | ash_: does that actually work? | 18:59 | |
ash_ | ya | ||
and, thanks to IO::Pty::HalfDuplex the daemon for try.rakudo.org is working too | |||
moritz_ | I ask because stuff is in the lexical scopes, not global | ||
ash_ | i have an extra newline i am hunting down thats messing up a regex, then i think its ready for testers | 19:00 | |
you can download the file and run it with rakudo if you want to test it (you'll need to change the $*ARGFILE line to match your system though | 19:01 | ||
) | |||
hmmm, no your right, thats not functioning as expected, nevermind | 19:02 | ||
i still don't understand why ... calls dir though | |||
moritz_ | you need to go through the lexpad | 19:03 | |
ash_: github.com/perlsix/Mu/blob/master/m...ot.pl#L113 | 19:04 | ||
the second Q:PIR block shows how manipulate the lexpad | 19:05 | ||
ash_ | ah, okay, thanks | 19:06 | |
hmm, now it doesn't complain when i use ... | |||
thanks | |||
i was just doing it wrong | |||
PerlJam | ash_: still, ... somehow calling GLOBAL::dir() is weird | 19:08 | |
ash_ | rakudo: &GLOBAL::dir := sub {die 'fail'}; 1...5; # this? ya, i duno whats up with this | 19:09 | |
p6eval | rakudo dc9900: OUTPUT«fail in <anon> at line 22:/tmp/SDXuJLrfUq in 'Block::ACCEPTS' at line 5783:CORE.setting in 'infix:<...>' at line 768:CORE.setting in 'infix:<...>' at line 840:CORE.setting in main program body at line 22:/tmp/SDXuJLrfUq» | ||
19:10
cytzol left
|
|||
pugssvn | r32124 | moritz++ | [t/spec] unfudge tests for RT #77604 | 19:13 | |
19:17
hercynium joined
19:21
plainhao joined
|
|||
tylercurtis | rakudo: fail 'test'; say 5; | 19:22 | |
p6eval | rakudo dc9900: ( no output ) | ||
19:23
dalek left
19:24
dalek joined,
ChanServ sets mode: +v dalek
|
|||
dalek | p-rx: 71b25e6 | pmichaud++ | src/Regex/Cursor-builtins.pir: Add regex debugging for cclass-based builtins. |
19:25 | |
p-rx: 29ce78f | pmichaud++ | src/Regex/Cursor-builtins.pir: Add debugging output to <alpha>. |
|||
p-rx: 5349f17 | pmichaud++ | / (3 files): Comment out split() function for now; it causes the Parrot build to fail is repaired. |
|||
p-rx: 699da41 | pmichaud++ | src/stage0/ (5 files): Update bootstrap. |
|||
TimToady | y'know, printf formats are really kind of an abomination, and could use to be refactored almost as much as traditional regexen | 19:28 | |
moritz_ | aye | ||
19:28
mikehh joined
|
|||
moritz_ | and they should be able to address params by name too | 19:28 | |
not only by position | |||
ash_ | have you guys ever seen randexp? its a ruby module, its rather nifty, its for generating random data, but you specify things in regex form, so if you want a name you could say /\w{5}/ will generate a word with 5 characters, might be fun to make something like that for p6 | 19:34 | |
Tene | pmichaud: github.com/blog/712-pull-requests-2-0 | ||
pmichaud | Tene: yes, I noticed that. | ||
TimToady | ash_: seems to me someone was working on that back in the pugs days | 19:35 | |
pmichaud | Tene: that seems to resolve a lot of the issues I had with pull requests... but as before I'd need to see it work. | ||
and I'm not yet sure we want to move off of RT for such things yet. | |||
Tene | I figured, just mentioning in case you hadn't noticed it yet. | 19:36 | |
pmichaud | afk, kid pickup | ||
19:39
HarryS joined
19:40
proller_ left
19:45
HarryS left
19:50
jdv79 left
19:59
Italian_Plumber1 left
|
|||
TimToady | phone | 20:00 | |
pmichaud | phone | ||
darn, a couple of seconds late :) | |||
20:04
__rnddim__ is now known as lue
|
|||
lue | hello o/ | 20:04 | |
tadzik | oh, lue incognito! :) hi | ||
ash_ | who wants to break 75.143.73.208 for me? | 20:05 | |
tadzik | ! | ||
ash_ | the first request is always kinda slow | ||
but after that, it should be fairly responsive (its startup time on parrot/rakudo) | 20:06 | ||
tadzik | help cannot be entered | ||
lue | it only happens when my internet mysteriously stops working (and even then it's rare for freenode to keep me from using lue) | ||
20:06
nine_ left,
Mowah left
|
|||
tadzik | ash_: I accidentally exit' | 20:06 | |
20:06
nine joined
|
|||
tadzik | I wonder if I enter stuff into your console now | 20:07 | |
ash_ | lol, exit kills the daemon, oops... | ||
i'll add that to the safemode... | |||
TimToady | camelia is pretty jaggy when scaled | ||
lue | only if you scale the raster version :) | 20:08 | |
ash_ | mgiht want to refresh your browsers | ||
might* | |||
20:08
rindolf joined
|
|||
tadzik | now nothing works | 20:08 | |
ash_ | hmm | 20:09 | |
20:09
HarryS joined
20:10
amkrankruleuen left
|
|||
moritz_ | Cannot connect to rakudo eval server | 20:10 | |
ash_ | ya, i just reset the eval server | ||
20:11
Mowah joined,
ruoso left
|
|||
ash_ | how about now? | 20:11 | |
20:12
dual joined
|
|||
tadzik | ash_: you may want to add a note about this startup time, it may seem offpissing for some folks | 20:12 | |
ash_: now it seems to load forever | |||
20:13
jferrero left
|
|||
tylercurtis | ash_: you should probably also note that sending multiple lines of input doesn't work well. | 20:13 | |
PerlJam | ash_: does it have something on $*IN ? | ||
ash_ | ya, same as p6eval | ||
somethings keeps causing the server to die, i am not sure what... | 20:14 | ||
20:14
Italian_Plumber joined
|
|||
lue | I just can't seem to get it working. | 20:14 | |
PerlJam | ash_: for lines -> $x { say $x } # broke it. | ||
TimToady | std: for lines -> $x { say $x } # broke it. | ||
p6eval | std 32123: OUTPUT«===SORRY!===Function 'lines' needs parens to avoid gobbling block at /tmp/9SQnX6cBf3 line 1:------> for lines⏏ -> $x { say $x } # broke it.Missing block (apparently gobbled by 'lines') at /tmp/9SQnX6cBf3 line 1:------> for lines -> $x | ||
..{… | |||
PerlJam | rakudo: for lines -> $x { say $x } | 20:15 | |
tadzik | well, multi-line stuff seems not to work at all | ||
p6eval | rakudo dc9900: OUTPUT«===SORRY!===Missing block at line 22, near ""» | ||
PerlJam | rakudo | ||
20:15
HarryS left
|
|||
ash_ | hmm, i'll look into the multi-line stuff | 20:15 | |
PerlJam | rakudo: for lines() -> $x { say $x } | ||
p6eval | rakudo dc9900: OUTPUT«Land der Berge, Land am Strome,Land der Äcker, Land der Dome,Land der Hämmer, zukunftsreich!Heimat bist du großer Söhne,Volk, begnadet für das Schöne,vielgerühmtes Österreich,vielgerühmtes Österreich!Heiß umfehdet, wild umstrittenliegst dem Erdteil du inmitten,einem | ||
..stark… | |||
tadzik | I doubt if REPL supports'em | 20:16 | |
doesn't seem so | |||
ash_ | lol, there are some glaring issues with it, i'll try to fix some of them, then let you guys know | 20:17 | |
20:18
amkrankruleuen joined
20:19
Italian_Plumber left
20:20
amkrankruleuen left,
amkrankruleuen joined,
Italian_Plumber joined
20:21
kolibrie_ is now known as kolibrie
|
|||
ash_ | brb restarting | 20:24 | |
20:24
ash_ left
|
|||
lue | Can anyone point to an explanation of the difference between regex, token, and rule (in a grammar)? I've read what the differences, I just have no idea what that means to me. | 20:26 | |
[why should I care if backtracking is disabled or not?] | 20:27 | ||
PerlJam | lue: backtracking is was allows quantified constructs or alternation to "back up" and try again. | ||
[particle] | do you want to use *, +, or ? regex modifiers? | ||
if you do, you need backtracking | 20:28 | ||
moritz_ | lue: if you care what your regex should match, you should care about backtracking | ||
[particle]: that's not strictly true | |||
rakudo: say '123abc' ~~ /:ratchet \d+ <alpha> / | |||
[particle] | ok, you're right, i'm telling half-truths | ||
p6eval | rakudo dc9900: OUTPUT«123a» | ||
moritz_ | no backtracking, still works | ||
lue | Of course. What I meant was that the explanations for these differences are terse (the ones I've found), and don't really explain it. | 20:29 | |
moritz_ | lue: the best verbose explanation about backtracking is in "Mastering Regular Expressions" by J. Friedl | 20:31 | |
lue | In my experience, information on Perl 6 regexes tend to assume I've used regexes in P5 before or that I have a pretty good grasp of them already. [anyone willing to prove me wrong feel free] | ||
moritz_ | lue: github.com/perlpilot/perl6-docs/blo...-intro.pod does not | ||
Tene | lue: prove you wrong about your experiences? | ||
moritz_ | PerlJam++ for it | ||
20:32
kjeldahl joined
20:34
ash_ joined
|
|||
lue | .oO(I consider the fact that I've never used P5 before a good thing for the documentation side of things) |
20:34 | |
PerlJam | lue: If you have any suggestions for making that document clearer, feel free to offer them. | ||
20:35
envi^home left
|
|||
[Coke] | TimToady: I am actually looking forward to redoing printf formats in tcl as a grammar in nqp. As much as one can look forward to such things, anywya. | 20:37 | |
lue | PerlJam: pretty good so far. | ||
PerlJam | It's hard to write something where you have to simultaneously know the subject and forget everything you know about it :) | 20:39 | |
20:39
HarryS joined
20:41
ash_ left
|
|||
pmichaud | lue: 'rule' basically means that whitespace in the pattern corresponds to (optional-ish) whitespace in the target | 20:42 | |
moritz_ | PerlJam: that's pretty mmuch always the case when you write for beginners :-) | ||
pmichaud | rakudo: say ?('a b c' ~~ regex { a b c }) | ||
p6eval | rakudo dc9900: OUTPUT«0» | ||
pmichaud | rakudo: say ?('a b c' ~~ rule { a b c }) | ||
p6eval | rakudo dc9900: OUTPUT«1» | ||
pmichaud | the first only matches "abc". The second will match "a b c" or "a\tb c" or "a b c" | 20:43 | |
(or various other combinations where there's whitespace between the a, b, and c) | |||
20:43
perlygatekeeper left
20:44
svetlins joined
|
|||
pmichaud | 'token' (ratcheting) indicates what should be done when encountering a quantifier or other things that could backtrack | 20:45 | |
consider the case of the * quantifier | |||
in a regex, the * quantifer says "match as many of these as you can, and then continue with the rest of the match" | |||
but if the rest of the match fails, we backtrack and try with one fewer match in the * quantifier | |||
20:46
HarryS left
|
|||
pmichaud | and we keep doing that until we're completely unable to match no matter how many times the * quantifier matches | 20:46 | |
20:46
tadzik left
|
|||
pmichaud | that's the default for 'regex' -- backtracking is enabled by default | 20:47 | |
but backtracking can also be expensive -- especially if we know that we're parsing something that can't possibly backtrack and match | |||
or where we know that we don't want to do any backtracking | |||
20:49
sftp_ left
|
|||
tylercurtis | Valgrind does not seem to like Rakudo. On every spectest(with valgrind --leak-check=full), I'm seeing at least 122k bytes "definitely lost". | 20:49 | |
lue | so regex has a stronger will to live, [to put it in non-coding terms], by constantly taking away one match from a quantifier and seeing if that's what's needed to match? | 20:50 | |
pmichaud | so, 'token' is a regex where the backtracking is disabled by default. With the * quantifier, that means we match as many as we can, and continue the match. If the latter part doesn't match, we don't try again with smaller numbers of matches on the * | ||
yes, regex will try more possibilities for matching | |||
so, consider something like | 20:51 | ||
'123X' ~~ regex { \d+ Z } | |||
actually, let's stick with * | |||
'123X' ~~ regex { \d* Z } | |||
the regex will match the '123', and then look for a Z. That fails, so it tries again by looking at the '12' and seeing if it can match a 'Z'. That fails, so it looks at the '1' and see if it can match a 'Z'. That fails, so it tries just matching a Z at the beginning. | 20:52 | ||
20:52
masak joined
|
|||
pmichaud | ultimately it fails | 20:52 | |
masak | ahoy! | ||
pmichaud | but if we do | ||
'123X' ~~ token { \d* Z } | |||
the \d* will match the '123', and then we look for a Z, and not finding one, we fail the match immediately at that point. | 20:53 | ||
lue | hello masak o/ | ||
pmichaud | because the 'token' disables backtracking on the quantifier | ||
now then, granted that a sufficiently smart optimizer could look at regex { \d* Z } and figure out that since Z is not a digit, there's no need to backtrack on the \d* anyway and it optimizes it out. But that doesn't always work in a general case. | 20:54 | ||
[particle] | especially if you don't have an optimizer at all... | 20:55 | |
lue | I was wondering about that, but chalked it up to "you just don't know". Maybe the guy retooled \d to mean base 36. | ||
20:55
ash_ joined
|
|||
pmichaud | \d doesn't mean "integer" in this case :-) | 20:57 | |
but yes, I see what you mean :-) | |||
masak | haven't backlogged yet. I was thinking after I logged off that .into(:base($n)) would be a pretty ideal syntax for a radix conversion method. | 20:58 | |
pmichaud | I don't know that .into is the right verb or adjective I'd want to use here, though. | 20:59 | |
unless there are other things we plan to .into besides just bases | |||
masak | if it's a multi, that's certainly possible. | ||
.into( :base64 ) | 21:00 | ||
pmichaud | I think I'd just prefer .base(64) in that case | ||
21:00
Mowah left
|
|||
pmichaud | I don't see what ".into" adds | 21:00 | |
masak | .base has the bin/oct/hex deficiency of not specifying direction. | ||
frettled | pmichaud: seems reasonable | ||
21:01
rindolf left
|
|||
frettled | .base(:8(15)) | 21:01 | |
PerlJam | 15.base(8) | ||
21:02
whiteknight joined
|
|||
frettled | That's not quite what I meant :) | 21:02 | |
masak | frettled: what DID you mean? | ||
I'm looking at that, scratching my head. | |||
frettled | my $x = 69; say $x.base(:8(15)); | ||
PerlJam | then I think you get my point :) | ||
masak | why would anyone do :8(15) inside .base() ? :/ | 21:03 | |
frettled | :8(15) is what it is today (though I may not like it) | ||
masak: $x.base(:8($y)) | |||
:) | |||
masak tries a primal scream | 21:04 | ||
PerlJam | masak: wow. I think I heard you all the way over here in Texas. | ||
either that, or it was one of my kids in the other room | |||
pmichaud | .oO( faster than the speed of sound? ) |
||
masak | the trick is to breathe in first. | ||
pmichaud | I tried inhaling once... didn't like it. :-P | 21:05 | |
I haven't inhaled since. | |||
21:05
kjeldahl left
|
|||
PerlJam inhales all the time. | 21:05 | ||
I'm inhaling right now even | |||
frettled only inhales while not exhaling. | |||
lue | there should be some pragma to have Perl 6 handle your integers differently. Something like use base :16 [or however pragmas work], which then prints integers and treats numbers in the file as being in base 16. | ||
frettled | lue: like obase in bc(1)? | 21:06 | |
[Coke] | frettled is clearly not tuvan. | ||
PerlJam | lue: Sounds confusing ... but, sure, why not | ||
frettled | The :base thingy works similarly to a very local ibase | ||
[Coke]: nopes, I never managed to do both :) | |||
dalek | psi: 2a0ab24 | masak++ | .gitignore: [.gitignore] Makefile |
21:07 | |
pmichaud | masak: then I'd suggest .to-base(16) | ||
instead of .into(:base(16)) | |||
frettled | PerlJam: We must remember to cater for the obfuscating contests ;) | ||
pmichaud: .ibase and .obase ;) | |||
pmichaud | or .as-base | ||
frettled | bonus: eliminates :base | ||
masak | pmichaud: that dash is a great pity. it'd be nice to avoid dashes and underscores in core-y things. | ||
PerlJam | frettled: apparently normal perl 6 code is already obfuscating enough for some people. | ||
lue | the difference here is that you wouldn't need a prefix (like 0x) to specify its a hex number, because the interpreter has been told to handle everything as hex (this sounds weird for hex, but becomes a good thing for oddball bases like 36) | 21:08 | |
masak | pmichaud: some metamodel stuff does not succeed doing this, but otherwise I think everything is dash-free and underscore-free. | ||
frettled | PerlJam: that just proves it's Perl, people say the same about v5.x, too :) | ||
pmichaud | there's always 15.Str(:base(16)) | ||
21:08
Ross left
|
|||
masak | pmichaud: not sure I like that. | 21:09 | |
feels arbitrary. | |||
21:09
HarryS joined
|
|||
PerlJam | .oO(what *isn't* arbitrary on some level?) |
21:09 | |
pmichaud | but it's a bit more precise than anything else we've selected :) | ||
masak | might just be me not being used to the thought, though. | ||
frettled | 15.Str(:base(:8(10))) # Nice and evil | ||
I would have severe problems trying to explain why it's like that, though. | |||
masak | I think I don't like the special-casing of what was a normal casting method just moments ago. | 21:10 | |
it's a step up in complexity, in a way. | |||
lue | use base :16; my $a = 10; say $a.to-base(10); # here, say would print 16 | ||
pmichaud | frettled: you keep using that term :8(10). I do not think it means what you think it means. </montoya> | ||
masak | +1 | ||
pmichaud | but why the colon on :16? | 21:11 | |
I think there's a bit too much significance being attached to the colon here. | |||
lue | Or however pragmas are supposed to work | ||
frettled | pmichaud: does it not mean to represent in base 10 the base 8 number 10? | 21:12 | |
lue | .oO(I just realized that my solution would likely lead to each number having a 'base' attribute.) |
||
pmichaud | frettled: it does not. | ||
lue | s/number/variable/ | ||
pmichaud | frettled: it simply is the value of '10' interpreted as base 8 | ||
frettled | pmichaud: except that there seems to be an implied understanding that values are in base 10. | 21:13 | |
(see p6l) | |||
pmichaud | frettled: that's not exactly correct. | ||
when output, a value is displayed in base 10 by default | |||
PerlJam | rakudo: say :8(99) | ||
p6eval | rakudo dc9900: OUTPUT«DON'T PANIC! Invalid character (9)! Please try again :)  in main program body at line 1» | ||
PerlJam | I like that message for some reason :) | ||
frettled | pmichaud: the semantics are, in effect, the same for the example, though | 21:14 | |
pmichaud | in particular, :8(16) would output what? | ||
frettled | 14 in decimal, I would hope. | ||
masak | 14. | ||
pmichaud | right | ||
that says nothing about how it's represented internally, though. | |||
frettled | no | ||
pmichaud | in fact, it's likely to be internally represented as 00001110 | ||
frettled | but that's also irrelevant to the example, is it not? | ||
21:15
HarryS left,
Quadrescence left
|
|||
pmichaud | frettled: it may be. But with :8(10) some people attach meaning to the '10' as being how it's represented internally | 21:15 | |
frettled | pmichaud: ah, now I see what you mean. | 21:16 | |
pmichaud | right... it's a bit of a confusing pun for some folks | ||
frettled | I guess that is a side effect of the rather special syntax. | ||
My use _was_ intended as a mere obfuscation of the decimal number 8. | |||
pmichaud | ah | ||
well, technically :2(10), :4(10), :16(10), :20(10) all end up being the value of the radix. :-) | 21:17 | ||
frettled | I tried to indicate how evil it might be. | ||
pmichaud | yes, it's evil. | ||
lue | my pragma idea stems from the fact that how you handle the number is different to how its handled internally. Therefore, you should be able to handle numbers in base 32 if you want. | ||
pmichaud | we must learn to control our evil ways :-) | ||
frettled | lue: yup | 21:18 | |
pmichaud: I guess my beef is that we have a very special syntax for specifying the radix of the postinfix variable, and that this syntax has no similar counterpart for doing other radix operations. | 21:19 | ||
(if that made sense, my communication skills may be improving) | |||
PerlJam | s/variable/value/ | 21:20 | |
pmichaud | frettled: your beef is that :16($x) only handles conversion from a string to a numeric, and we don't have the inverse. | ||
frettled | PerlJam: thanks | ||
pmichaud | I agree | ||
but we're not sure what to call the inverse. | |||
frettled | $x.16 ;) | ||
lue | right now it's called .fmt('%x') | 21:21 | |
PerlJam | lue++ | ||
pmichaud | lue: for hexadecimal, yes. | ||
lue: what if I want base 20? | |||
lue | exactly. | ||
21:21
patspam joined
|
|||
PerlJam | .base and .unbase :) | 21:21 | |
lue | I think it's ugly for just radix conversion, and it doesn't handle every base. | ||
PerlJam | Clearly the inverse of :16($x) should be $x:16 :) | 21:23 | |
pmichaud | :16)$x( | ||
frettled | PerlJam: oh. I slipped the shift! | ||
(that was what I meant) | |||
pmichaud++ | |||
pmichaud | :-16($x) :-P | 21:24 | |
lue | is pasing a positional parameter to a pragma the same as with anything else? use base 16 ? | ||
PerlJam | lue: that'll work | ||
frettled | pmichaud: en.wikipedia.org/wiki/Negative_base | 21:25 | |
masak | smash++ # gil.di.uminho.pt/users/smash/rakudo-bench.html | ||
PerlJam | smash++ indeed | 21:26 | |
masak | smash: if there's anything you can do about that bright-yellow-on-white, a great number of pairs of eyes will thank you. | ||
Tene | One common failure of these discussions I've seen elsewhere is a failure to keep the distinction between "a number" and "a representation of a number in a given base" appropriately distinct. AFAIK, numbers themselves don't have bases, only formattings that are rendered or parsed do. | 21:27 | |
Seems like it's all pretty clear here, though. | |||
(I just skimmed. ;) | |||
masak | Tene++ | 21:28 | |
yes, I think that confusion plays into many discussions about this. including some we've had today. | 21:29 | ||
lue | If there are no objections to my idea of a pragma controlling which base a number is represented in, I'd like to hear what the people at p6l think. | ||
frettled | tired minds generate all sorts of nonsense. | ||
Tene | Given that understanding, I rather liked .Str(:base(36)) | ||
masak | lue: you don't need anyone's permission to post to p6l :) | 21:30 | |
Tene | The correspodning suggestion to decode it seems to be Str.Int(:base(36)); | ||
masak | aye. | ||
maybe I can convince myself to like that after all. | 21:31 | ||
frettled | lue++: if you can avoid the presentation/representation confusion Tene++ mentions, that would be awesome. | ||
Tene | I didn't actually follow what you disliked about that, masak. | ||
masak | Tene: merely the action of putting a named parameter into an otherwise "pure" conversion method. | 21:32 | |
there are no other cases, as far as I remember, of conversion methods taking named parameters. as such, this would be a first. that's the only thing that bothers me. | |||
21:32
Quadrescence joined
|
|||
PerlJam | and what would "hello | 21:32 | |
blah | |||
Tene | masak: That's a very good point. | 21:33 | |
PerlJam | and what would "hello".Str(:base(36)) actually do? | ||
masak | Tene: it's one of those "I'm an implementor, I want to keep complexity down" points-of-view. | ||
frettled | PerlJam: confuse people | ||
Tene | PerlJam: ITYM .Int() | ||
PerlJam | I don't think so. | 21:35 | |
Tene | masak: I think that the main thrust of my suggestion was that "render this number using a particular base" is an operation on an Int that produces a String, and the reverse is the reverse. | ||
21:35
Guest59170 left,
lichtkind joined
|
|||
Tene | So, a method on Int, and a complementary method on Str | 21:35 | |
lichtkind | hi tene :) | ||
frettled | Tene: that makes sense | ||
masak | Tene: aye, I got that. that's what made me not dislike the suggestion .Str(:base) so much. | 21:36 | |
frettled | Combined with pragmas for input and output base, this can become fairly useful, I think. | 21:38 | |
PerlJam | but only for integers? | ||
Tene | perhaps something like: use base :render(36), :parse(16); oslt | 21:39 | |
21:39
Trashlord joined
|
|||
PerlJam | 3.1415 <-- always decimal no matter what ? | 21:39 | |
21:39
HarryS joined
|
|||
dalek | ok: 90f4939 | chromatic++ | src/roles.pod: Edited roles chapter; added some author notes. |
21:39 | |
TimToady | it should all be part of a refactored printf format | ||
and :16() should reject anything that is already numeric | |||
frettled | I hope the refactored printf format won't be using a "printf" name :) | 21:40 | |
TimToady | if I start refactoring formats, it'll end up about as far from printf as p6 regex from p5 | ||
PerlJam | TimToady: well volunteered! ;) | ||
frettled | PerlJam: well mst'ed! | 21:41 | |
Tene | Yes, :16(10) is a little uncomfortable to me. | ||
TimToady | however, as a short term expedient, .fmt('%32X', :base($r)) could override the 16-ness of X | ||
Tene | :16('10') is nicer to me. | ||
frettled | I fear that we may be heading in a direction that makes radix conversions cumbersome. | 21:42 | |
TimToady | I don't know how to do a general radix on top of existing printf formats though | ||
which is why it occurred to me that they were basically beyond redemption | 21:43 | ||
frettled | ISTR that there are legitimate, mathematical uses of performing some operations in one base, and others in another. | ||
lue | [backlogging] feel free to remove those DON'T PANIC's. I look at them and wonder what I was thinking :) | ||
frettled | (going from e.g. base 10 to 8, or vice versa, with the "same" number) | ||
lue: you forgot to bring your towel? | |||
Tene | I still don't think it would be that unusual for some conversion methods in some classes to have optional parameters, though. | 21:44 | |
frettled | That's okay. | ||
I'm worried about having to convert back and forth between strings and numerical types. | |||
TimToady | lue: regarding pragmas, they're usually for when your language sucks over a large lexical scope, or you want your language to suck over a large lexical scope. | 21:45 | |
Tene | frettled: Numbers don't have bases, only representations of numbers have bases. | ||
TimToady | in this case, it would be the latter | ||
21:45
HarryS left,
javs left
|
|||
frettled | Tene: s/representations/presentations/? | 21:46 | |
Tene | frettled: Sure. I don't disagree with that. | ||
frettled | Tene: anyway, that objection is problematic | ||
Tene | frettled: hm? | ||
masak | yapsi: our $a = 42; { my $a = 5; { say our $a } } | 21:47 | |
p6eval | yapsi: ( no output ) | ||
masak | :/ | ||
frettled | Tene: remember that in programming, you don't always receive input to your methods as user input (strings) | ||
Tene: and it might not even be desirable | |||
An objection to that is, of course, "use multis!" | 21:48 | ||
Tene | frettled: It's not clear to me at all what that's supposed to be an objection to? | ||
If you want a number, you ask for a number. Why would you want your users to give you a string? | |||
frettled | Tene: in the way we were heading, you'd have to do your radix arithmetic with strings. | 21:49 | |
lue | .oO(I agree, presentation gets the point across better. Changing email to reflect that.) |
||
21:49
rgrau_ joined
|
|||
TimToady | alternately, :16($number) should just return $number always if it's already numeric | 21:49 | |
Tene | frettled: explain "radix arithmetic"? | 21:50 | |
frettled | TimToady: essentially rendering it a noop, you mean? | ||
Tene | TimToady: I'd much prefer that it at least warn. | ||
TimToady | yes, but that doesn't help when someone does the equivalent of :8(777) | ||
so I think non-strings should just blow up | |||
Tene | Agreed | ||
frettled | Tene: Let's assume that you want to use a special radix, say base 1000. You can run into overflow blow-up. | 21:51 | |
PerlJam | std: say :8(777) | 21:52 | |
p6eval | std 32123: OUTPUT«ok 00:01 116m» | ||
sbp | how do you specify the repertoire for large bases? | ||
phenny | sbp: 20:59Z <Morbus> tell sbp thisismyjoystick.com/editorials/fin...lly-works/ | ||
sbp | I mean the characters used for that base | ||
Tene | frettled: I don't know "overflow blow-up". Can you explain what "use" means there? | ||
sbp | something in base 1000 is going to need a lot of characters to represent it | ||
frettled | Tene: what sbp said, or it is going to need a very large integer. | 21:53 | |
to store in | |||
PerlJam | frettled: you mean a sequence of integers. | ||
frettled | PerlJam: are you confusing integers with digits? | ||
PerlJam | oh, I did. sorry | 21:54 | |
21:54
mberends left
|
|||
PerlJam | the juxtaposition of "lots of characters" and "very large integer" on my screen confused my meager brain | 21:54 | |
frettled | my $x = :1000000(1000000) | 21:56 | |
Tene | frettled: It's entirely possible that I'm just not aware of the relevant math here, and I feel like at least one of us is confusing levels here. | ||
frettled | Tene: Ok. What I tried to say, was that it appeared that there was a suggestion that any handling of radix conversion would have to involve a string. | 21:57 | |
pugssvn | r32125 | lwall++ | [S02] outlaw :8(777) and such | ||
Tene | frettled: Let me take a sec to confirm if I'm understanding you here. | 21:58 | |
sbp | I guess now would be a bad time to mention non-integer bases... | ||
frettled | sbp: We've been there briefly :D | ||
[particle] | NOT CORE | ||
Tene | sbp: also mixed redix systems :) | ||
TimToady | modules have to be good for something | 21:59 | |
sbp | actually mixed radix systems would be kind of helpful | ||
frettled has handily avoided talking about mixed radix, to avoid confusing things further. | |||
Tene | "radix conversion" meaning "If I have a number X, what is the base-16 interpretation of the base-8 presentation of X"? | ||
sbp | modules: hehe | ||
[particle] | don't forget surreal radix systems | ||
:surreal(71) # "you are more beautiful than a bouquet of fossils." | |||
frettled | sbp: golden ratio base, prime base, factorial base, ... | 22:00 | |
TimToady | if they were fossilized with rose quartz that would almost make sense | ||
masak | please to read through and comment, kthx: github.com/masak/yapsi/blob/master/...ce/2010.09 | ||
sbp | imaginary base? | ||
Tene | frettled: "radix conversion" meaning "If I have a number X, what is the base-16 interpretation of the base-8 presentation of X"? | 22:01 | |
22:01
sinusoid234 joined
|
|||
TimToady | std: :φ(42) | 22:01 | |
p6eval | std 32123: OUTPUT«ok 00:01 115m» | ||
22:01
Holy_Cow left
|
|||
TimToady | there you go :P | 22:01 | |
22:01
drbean joined
|
|||
masak | TimToady++ # that' sick :P | 22:01 | |
s/'/'s/ | |||
frettled | Tene: That seems essentially correct, yes. | 22:02 | |
std: :!(42) | |||
Tene | For example, :10(52).fmt("%o") is "64". :16("64") is 100. So the radix conversion from 8 to 16 of 52 is 100? | 22:03 | |
p6eval | std 32123: OUTPUT«===SORRY!===Malformed False pair; expected identifier at /tmp/lQQOKpyogY line 1:------> :!⏏(42)Parse failedFAILED 00:01 114m» | ||
sbp | "SIC is explicitly not compatible with later, earlier, or present versions of itself." :-) | ||
PerlJam | rakudo: say :16<64> | ||
p6eval | rakudo dc9900: OUTPUT«100» | ||
Tene | frettled: Is this 1) something that people actually do and has meaning? and 2) something that can be expressed mathematically instead? | ||
masak | sbp: I wish that was less true. :) | ||
diakopter | rakudo: say :16<-1> | 22:04 | |
p6eval | rakudo dc9900: OUTPUT«===SORRY!===Malformed radix number at line 22, near "<-1>"» | ||
22:04
mikehh left
|
|||
dalek | psi: f2b8060 | masak++ | doc/announce/2010.09: [doc/announce/2010.09] added |
22:04 | |
masak | more reviewers, moar! :) | ||
frettled | Tene: That conversion doesn't really make sense, unless you by 100 mean binary true-false-false | 22:05 | |
TimToady | .oO("this book fills a much needed gap") |
||
Tene | frettled: then I completely misunderstand what you mean by "radix conversion". | ||
frettled | Tene: and even so, it doesn't even seem correct | ||
Tene | decimal 52 expressed in base 8 is "64". "64" interpreted in base 16 is decimal 100. | 22:06 | |
22:06
awwaiid joined
|
|||
sorear | hello #perl6 | 22:07 | |
phenny | sorear: 12:31Z <azawawi> tell sorear Thanks for the latest STD syml inclusion. Fixed S:H:P6 to re-use it. padre.perlide.org/trac/changeset/12415 | ||
masak | sorear: hi! | ||
sorear: about to release Yapsi 2010.09! :) | |||
frettled | Tene: uhm, you ought to end up with :16(34) and :10(52). | ||
diakopter | .oO("this gap books a much needed fill") |
22:08 | |
22:08
sinusoid234 left
|
|||
Tene | frettled: Um... those are the same number. | 22:09 | |
frettled | yes. | ||
22:09
patspam left
|
|||
Tene | Are you saying that radix-conversion is the identity function? | 22:09 | |
22:09
HarryS joined
|
|||
Tene | 'cos that doesn't sound so difficult to implement to me. | 22:09 | |
frettled | radix-conversion yields the same underlying number. | ||
22:09
patspam joined
|
|||
Tene | frettled: numbers don't have radixes, afaik. afaik, radix is only a property of the presentation of a number. Am I misinformed here? | 22:10 | |
22:10
jhuni joined
|
|||
frettled | where "underlying" might mean "the actual number" | 22:10 | |
frettled is _not_ a mathematician. | |||
Tene | So, yes, you're telling me that you're expecting trouble implementing the identity function. :P | ||
dalek | psi: 44c8530 | masak++ | doc/announce/2010.09: [doc/announce/2010.09] pidgeon |
||
frettled | Tene: I have severe terminology problems here, for a lack of mathematical background, but as I mentioned initially: | ||
Tene: there may be legitimate, mathematical uses of interpreting a number differently depending on the radix. | 22:11 | ||
TimToady | you're asking for a Str-to-Str crossbar topology when we want a Str-to-Num-to-Str star topology. | ||
Tene | frettled: I was reading all of that assuming that you were much-more-informed mathematically than I am. | ||
frettled | meaning that it would be legitimate, _numerically_, to look at the radix as a property of the number, rather than a string presentation. | ||
Tene: sorry, I thought I made that caveat very clear early on. | 22:12 | ||
Tene | frettled: I must have missed that; sorry. :) | ||
TimToady | perhaps this belongs on p6l. :P | ||
Tene | You could always ask #math | ||
masak | "belongs on p6l" -- is that an assessment or a curse? :) | 22:13 | |
frettled | TimToady: Num-to-Num, perhaps. | ||
masak: yes. | |||
lue message to p6l sent | |||
frettled is growing increasingly tired, so perhaps this is a bad time to try clarifying, it appears that I'm only making things more confusing instead. | |||
masak switches to next level of Yapsi release | |||
TimToady | and how will we marshall these Nums-with-baggage for talking with normal languages? | 22:14 | |
lue | .oO(Funny, I got done with my message to p6l about bases when TimToady suggested it go there) |
||
frettled | With brutal force. | ||
22:14
patspam left
|
|||
TimToady | lue: I already gave my opinion of pragmas above. They're nearly always a design smell, or the desire for a design smell. | 22:15 | |
Tene | frettled: afaict by asking google, no, that's not an operation that really makes sense. | ||
22:15
HarryS left
|
|||
Tene | Numbers don't have bases. | 22:15 | |
TimToady | because all their bases are belong to us | ||
frettled | :D | 22:16 | |
Tene | If you want to perform an operation that depends on the presentation of a number, you do need to actually computer the presentation. | ||
perigrin | is that considered acidic wit? | ||
lue | is that why S31 is under-specced? :) | ||
TimToady | more like caustic | ||
perigrin | TimToady: it's certainly been a corrosive influence in my life. | ||
sbp learns the answer to his earlier question about specifying a repertoire when he finds out that only radices in 2..36 are supported | |||
frettled | perigrin: we might be getting to a very base argument | 22:17 | |
dalek | psi: e06cad0 | masak++ | doc/announce/2010.09: [doc/announce/2010.09] reformulation, addition |
||
sbp | hi perigrin | ||
perigrin | hey sbp :) | ||
masak | .tar.gz file uploaded. github.com/masak/yapsi/downloads | 22:18 | |
lue | Even though I personally have no immediate need for the pragma, I don't see why we can't have it. | ||
masak posts announcement | |||
lue: I agree with that. I also don't see why we can't have it. | 22:19 | ||
frettled will sleep a bit on the problem and see if a more coherent presentation can be made in a few days. :) | 22:20 | ||
perigrin | phrettled: phear the phinal phorm of the phuss | ||
frettled | heh | ||
Good night, #perl6! | |||
TimToady | o/ | ||
frettled → idle. | |||
masak | dream radical dreams, frettled. | ||
PerlJam | lue: If the community wants it, they'll create it. :) | 22:21 | |
lue | .zZ(√) | 22:22 | |
22:26
synth left
22:30
macroron left
|
|||
TimToady | rakudo: my &postfix:<²> := * ** 2; say 3²; | 22:31 | |
p6eval | rakudo dc9900: OUTPUT«===SORRY!===Confused at line 22, near "say 3\x{b2};"» | ||
TimToady | rakudo: sub postfix:<²> ($x) { $x ** 2 }; say 3²; | 22:32 | |
p6eval | rakudo dc9900: OUTPUT«9» | ||
masak | p6c announcement and blog post announcement have been posted. stand down release mode. | ||
lichtkind | TimToady: can you please give me the exact url to ypu rosetta examples? | ||
your | |||
TimToady | rosettacode.org/wiki/Category:Perl_6 | ||
sbp | is there a non "hack the grammar" way to get postfix:<...> to operate over a regex? | 22:33 | |
so that you could capture a wider range of postfix superscript digits say | |||
(and many other applications, I'm sure) | |||
pmichaud | (r32125) Does this include things like...? my $a = '771' + '6'; say :8($a); # blows up because $a is numeric | 22:34 | |
TimToady | yes | ||
lichtkind | thanks | ||
pmichaud | blow up +1 | ||
and "blow up" means "returns Failure"? Or is it MMD dispatch error? | 22:35 | ||
TimToady | I think this one might rate a stub that blows up with a specific message | ||
pmichaud | stub dies or fails, then? | 22:36 | |
TimToady | I'm fine with dies | ||
pmichaud | "Attempt to do radix conversion of non-Str value..." ? | ||
22:37
ash_ left
22:39
HarryS joined,
awwaiid left
22:40
broquaint left
|
|||
masak | pmichaud: wfm. | 22:42 | |
sbp | rakudo: my $x = Any; say :8($x) | ||
sorear | hey pmichaud | ||
p6eval | rakudo dc9900: OUTPUT«DON'T PANIC! Invalid character (A)! Please try again :)  in main program body at line 1» | ||
sbp | is that an appropriate message there? | ||
masak | sbp: no. | ||
sbp: I submitted a ticket about that today. | |||
sbp | ah, sorry | ||
masak | no worries :) | 22:43 | |
rt.perl.org/rt3/Ticket/Display.html?id=77626 | |||
sorear | pmichaud: what is your take on github.com/perl6 versus github.com/perlsix ? | 22:45 | |
22:45
drbean left,
HarryS left
|
|||
lue | rakudo: grammar a { regex TOP { <Abe> }; regex Abe { Abe }; }; if "Abe" ~~ /<a::Abe>/ { say "hi" }; | 22:46 | |
p6eval | rakudo dc9900: OUTPUT«===SORRY!===regex assertion not terminated by angle bracket at line 22, near "::Abe>/ { "» | ||
masak | lue: known TODO. | ||
lue | mberends seems to have made <a::Abe> do what it should in his Pod parser. | ||
masak | lue: that's because that's alpha code. | 22:47 | |
lue: if you want mberends' code to run, you might fare best with the January 2010 release of Rakudo. | |||
or perhaps earlier still. | 22:48 | ||
sorear | wait, I'm confused | ||
pmichaud | sorear: not sure we want/need separate "perl6" and "perlsix" github accounts. Seems like it's likely to cause a lot of confusion. | ||
sorear | pmichaud: That's what I said when moritz_ announced he created perlsix | ||
I thought alpha's critical weakness was NOT having working grammars | 22:49 | ||
masak | sorear: not at all. | ||
pmichaud | alpha's weakness was not having protoregexes (among other things) | ||
masak | sorear: they just worked in a way that wasn't extensible to what we ultimately wanted. | ||
lue | Ah well. At least TIMTOWTDI, or I'd have nothing to do but define a grammar :) . | ||
pmichaud | also the fact that the regex engine was almost entirely pir | ||
masak | sorear: moritz_ had two reasons for perlsix, IIUC. (1) it's a special type of account. I forget the name. perl6 isn't, I think. (2) moritz_ didn't have sufficient privs for perl6. | 22:50 | |
pmichaud | we can turn perl6 into an organizational account | ||
masak | sorear: those two reasons may or may not be good, and they may change over time. | ||
pmichaud | we don't need to create a new account for that. | ||
masak | organisational account! that's it! | ||
sorear | masak: I'm pretty sure there's a "convert unspecial account into special account" button | ||
pmichaud | I already did that conversion for the 'parrot' github account. | 22:51 | |
masak | right. I'm more explaining than defending moritz_' choice. | ||
I'd also prefer just one account. | |||
pmichaud | anyway, if we want to move perl6 to an organizational account, that shouldn't be a problem. | ||
and I'd prefer to keep "perl6" than to switch to "perlsix"... unless we plan to say "perlsix" most other places as well. | |||
I don't even know who owns "perlsix.org" :-P | 22:52 | ||
ah, it's diakopter++ | |||
22:53
plainhao left
|
|||
masak | +1 for keeping perl6 | 22:53 | |
sorear | +1 | ||
pmichaud | anyway, I'll convert perl6 over to an organizational account in the next day or so. I need to make sure we won't lose anything in the process, and I suspect hugme might need some tweaking | ||
wallberg | hi all! a question regarding Perl 6 objects: how are "attributes" stored internally in an object? one thing I like about Perl 5 is that I can bless either an arrayref or a hashref depending on my needs. I've found blessed arrays to be a little more memory efficient and quicker to retrieve data from, which can make a difference when using hundreds of thousands of objects... what is going on behind the scenes in a Perl 6 class? | 23:01 | |
masak | wallberg: S12 has the full story, but... | 23:02 | |
wallberg: ...the default is an 'opaque object', the internals of which you're not supposed to care about. | |||
wallberg: that said, hashes and other things are spec'd to work too as underlying attribute storage thingies. | 23:03 | ||
wallberg | masak: so an 'opaque object' is a computer science thing that schmucks like I shouldn't bother losing sleep over? | 23:04 | |
TimToady | we will certainly be trying to optimize opaque attributes into very efficient storage | 23:05 | |
masak | wallberg: the take-away point of it is, I believe, that there's no way to get at the attributes from outside the class except through the declared access methods. | ||
TimToady | which can also be heavily optimized in many cases | 23:06 | |
masak | wallberg: if all you desire is a mental model, one can certainly think of the opaque object as a normal hash which one cannot get at directly. | 23:07 | |
wallberg | masak: yup. Wikipedia: "In computer science, an opaque data type is a data type that is incompletely defined in an interface, so that ordinary client programs can only manipulate data of that type by calling procedures that have access to the missing information." en.wikipedia.org/wiki/Opaque_data_type | ||
masak | wallberg: though for optimization reasons, that might in actuality be the case. | ||
wallberg: ooh, I wasn't aware there was a Wikipedia article about it :) | 23:08 | ||
but yes, the idea behind opaqueness is encapsulation. | |||
er, information hiding. er, something. | |||
23:09
HarryS joined
|
|||
wallberg | TimToady: so access and memory storage efficiency can theoretically approach that of an array or even surpass it? | 23:10 | |
TimToady | yes, depending on usage patterns | ||
masak | wallberg: jnthn++ just got a grant approved where he, roughly described, will turn attribute access from hash indexing into array indexing under the hood. | 23:11 | |
23:13
rgrau__ joined
23:15
rgrau_ left,
HarryS left
|
|||
wallberg | masak: cool! in a little project I worked a year ago, I declared named constants in Perl 5 and interacted with an array object much like a hash object but with noticeable speed benefits. looking forward to see what a real programmer can produce in this context :-) | 23:15 | |
23:19
rgrau__ left
|
|||
masak | me too. | 23:20 | |
lue | How do you match a set of brackets in a regex? In cases like embedded comments, where you don't know what the brackets are going to be. | 23:23 | |
23:23
rgrau__ joined,
synth joined
23:24
azert0x left
|
|||
masak | lue: see STD.pm6, line 1045 :) | 23:24 | |
actually, the relevant parts are on lines 848 to 1066. | 23:25 | ||
23:26
Sanitoeter left
|
|||
TimToady | the real work is done at line 501, where we derive a new language in which starter and stopper are appropriately defined | 23:27 | |
lue | AAH! | ||
I'm quite surprised that's not readily available. Seems to me it'd be a common thing you need to match. | 23:29 | ||
masak | packaging it up into a module shouldn't be too difficult. | ||
23:29
rgrau__ left
|
|||
masak | but arguably not the responsibility of STD.pm6 :) | 23:30 | |
23:31
felipe left
|
|||
lue | something like /<bracket a> [0..9,A..F]+ <bracket a>/ maybe, where 'a' helps identify which brackets are supposed to pair up. | 23:31 | |
TimToady | lue: in general you also have to correctly match whatever is inside your brackets. comments are special case; the general problem is much harder | 23:32 | |
masak | lue: what you might be looking for is the concept of a circumfix operator. | 23:35 | |
TimToady | circumfixes are also a special case | ||
lue | .oO(In any case, I'm certainly not putting that many lines of code in my code.) |
||
rakudo: say "( hi )" ~~ / '(' [<!before ')'> .]+ ')' / | 23:36 | ||
p6eval | rakudo dc9900: OUTPUT«( hi )» | ||
lue | circumfixes are what I'm after, I'm sure. How to match them is my question :) | 23:37 | |
TimToady | congratulations, you've invented Q. now handled nested brackets and escapes. :) | ||
*handle | |||
eventually you'll write the nibbler at line 432 | 23:38 | ||
masak .oO( TimToady is smug because he's already stumbled upon all the hard problems we'll face in the next ten or so years ) | |||
TimToady | if you want to parse ( hi ) where hi is an expression, then circumfix is fine. otherwise, not | 23:39 | |
masak | nod | ||
lue | I wonder how common this problem is. [Which would determine if it would go in core or in a module] | ||
masak | eventually there'll probably be an idiom for making a quoting construct for a sublanguage. | 23:40 | |
TimToady | you can't just think of all these things as the same thing; it's crucial to know what language you're parsing inside, and how it relates (or not) to the language or languages outside | ||
masak | lue: don't worry too much about core-or-module. | ||
23:40
prism joined
|
|||
PerlJam | lue: See Text::Balanced on CPAN :) | 23:41 | |
lue | .oO[ When I first thought of this problem, I kinda hoped \( and \) would work and dwim :) ] | ||
TimToady | not if the language inside is .*? | 23:42 | |
if you want that kind of behavior, you have to use (knowingly or not) something like nibbler | 23:43 | ||
23:43
daemon left
|
|||
TimToady | I keep wanting to use the phrase "half-assed solutions", but that would not be polite. | 23:44 | |
lue | I'm not quite sure I see all of these different cases [I'm new to regexes and grammars and such]. I should probably ask more specific questions when they need to be asked. | ||
smash | masak: i'll try to put some better colors in there | 23:45 | |
masak | \o/ | ||
smash | colomon: you're scripts ruined the server, hehe | ||
masak just fixed an embarassing bug in Yapsi wherein duplicate labels and insufficiently clever lookup caused the runtime to jump out of blocks without unrolling the stack | 23:46 | ||
smash | colomon: updated with mandrelbrot scripts gil.di.uminho.pt/users/smash/rakudo-bench.html | 23:47 | |
cya all tomorrow | 23:49 | ||
23:49
smash left
23:54
wallberg left
|
|||
dalek | psi: c65b333 | masak++ | lib/Yapsi.pm: [Yapsi] bumped SIC version Between releases, the SIC version is always the version number of the upcoming release. |
23:57 | |
psi: 96ca8f0 | masak++ | / (2 files): [Yapsi] made labels globally unique Because they were only unique for each block, the label lookup (which traverses the whole SIC) accidentally the whole call stack in some cases. |