»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
[Coke] lessee, no test. 01:22
[Coke] phenny: tell supernovus I tried to write a test that this passed and rakudo failed, and failed. Can you add a test to the ticket or to roast? 02:01
phenny [Coke]: I'll pass that on when supernovus is around.
dalek ast: a7ab785 | coke++ | S02-types/nan.t:
Add a test for rakudo RT #103500
02:23
[Coke] phenny: ask pmichaud if we can close rt.perl.org/rt3/Ticket/Display.html?id=68854 02:27
phenny [Coke]: I'll pass that on when pmichaud is around.
[Coke] std: my @a = 1, 2, 3, given 42; say @a 02:51
p6eval std 77327a4: OUTPUT«ok 00:00 44m␤»
masak rn: say given 42 02:52
p6eval niecza v22-7-g7df6137: OUTPUT«===SORRY!===␤␤Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/jSlezIXNSc line 1:␤------> say⏏ given 42␤␤Unhandled exception: Check failed␤␤ at /h…
..rakudo f0aced: OUTPUT«␤»
masak rn: say 1, 2, 3, given 42
p6eval niecza v22-7-g7df6137: OUTPUT«123␤»
..rakudo f0aced: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&given' called (line 1)␤»
masak heh. 02:53
diferent parsers indeed.
sorear r: say 02:55
p6eval rakudo f0aced: OUTPUT«␤»
sorear r: print 02:56
p6eval rakudo f0aced: ( no output )
sorear nr: my $niecza = !try eval 'print'; say $niecza
p6eval rakudo f0aced: OUTPUT«False␤»
..niecza v22-7-g7df6137: OUTPUT«True␤»
[Coke] nqp: True.HOW.say 02:57
p6eval nqp: OUTPUT«Method 'say' not found for invocant of class 'NQPClassHOW'␤current instr.: '' pc 92 ((file unknown):165529781) (/tmp/XyNZxhccTb:1)␤»
sorear p: my $niecza = !try eval 'print'; say $niecza
p6eval pugs: OUTPUT«*** Cannot cast from VBool True to VCode (VCode)␤ at /tmp/NH_AY3vMLR line 1, column 9-31␤»
TimToady p: try 42 02:57
sorear p: print
p6eval pugs: OUTPUT«*** Cannot cast from VInt 42 to VCode (VCode)␤ at /tmp/EMn54408k8 line 1, column 1 - line 2, column 1␤»
pugs: ( no output )
TimToady pugs doesn't have statement form of try
[Coke] r: True.HOW.say 02:58
p6eval rakudo f0aced: OUTPUT«Null PMC access in get_bool()␤ in attributes at src/stage2/gen/nqp-mo.pm:1151␤ in method perl at src/gen/CORE.setting:791␤ in method gist at src/gen/CORE.setting:786␤ in sub say at src/gen/CORE.setting:7250␤ in method say at src/gen/CORE.setting:781␤ in block…
[Coke] n: True.HOW.say
p6eval niecza v22-7-g7df6137: OUTPUT«ClassHOW.new(...)␤»
[Coke] RT-- 02:59
RT: 640 open tickets, 80 blocking on tests. 03:03
raiph hi all 03:08
sorear yo 03:11
TimToady yo² 03:12
raiph what about: parse the irclog. pull out lines beginning nr:, std: etc., plus maybe bits inside {} on a line, parse it using a Perl 6 syntax parser, and link bits to doc.perl6.org/whatever? 03:13
(or have the eval bots annotate the irc log file, but that seems wrongish to me) 03:14
diakopter irc is logged in a database 03:17
raiph diakopter: right. a Perl 5 script constructs a day's worth view, and search results, and annotates it a bit, linking things like S01. I see all these evals, and responses, and think 03:19
.oO( Wouldn't it be cool if I could click on that keyword? Wonder what more there is to say about this error? )
03:20
Invite beginners to learn on channel. The channel log becomes an anarchist tutorial farm. That might suck after a while, but would be a great problem to have. 03:21
Especially in combination with doing daily log summaries (as is now happening, with relative ease). 03:24
raiph Hmm. It could be you have to view the relatively lightweight (10% of full?) summary page to see those links. 03:42
(Lightweight also reflects my guess that few folk currently use the summary view, so server load is light.) 03:46
kevouze Hi. Anyone keen to help out for a survey about newcomer experience in the Perl community? 05:11
blogs.perl.org/users/kevin_carillo/...urvey.html
It would interesting be able compare Perl6 practices with other perl projects. You just need to have joined Perl within the last 2 years. 05:12
moritz I'm afraid I can't serve with that trait 05:20
kevouze no problem, thanks.for considering to help out. 05:23
sorear kevouze: I joined p6 in feb 10, not good enough? 05:25
kevouze yes, all good! 05:27
dalek kudo/nom: 584f19e | jnthn++ | src/Perl6/Actions.pm:
Optimize double-quoted string literals in regexes.

Those can just emit a literal node, not go through !LITERAL.
06:35
jnthn phenny: tell colomon 584f19e may help a little too; feel free to mail me an updated profile if you want me to dig some more 06:40
phenny jnthn: I'll pass that on when colomon is around.
jnthn commutes
Woodi morning everyone :) 07:56
brrt \o woodi 07:57
sorear o/ 07:58
Woodi I got some futuristic probably idea :) : there is libpcre (in C) but maybe/probably one day someone will want libpgram[mar] in C... this cycle can be avoided - a) having faster grammar engine as lib in C can be performance improvement and b) it can bring World closer to Perl6 :) 08:01
brrt in short, you want to port p6 grammar to c? 08:02
more power to you
brrt its quite another thing to say rakudo will use it, rather than their current version 08:02
but sure
Woodi brrt: I want have it :)
sorear Woodi: I can't tell whether you're arguing for or against p6grammars in C 08:03
Woodi sorear: of course I want p6 grammar engine in C in lib form usable in other projects...
brrt i personally think it is not a /really/ bad idea 08:04
sorear I agree
sleep&
brrt well, you can also help fix parrot, then other languages can run on parrot and use the grammar engine too
bye soreer
sorear
Woodi but someone can tell me how to call C macros from NativeCall ? and how "struct timeval *timeout" should be called on v6 side ? 08:06
brrt c macros can't be 'called' as such 08:07
they are translated by the compiler into textual c source code
they do not exist at runtime
Woodi brrt: ok for details :) but lots of libraries use macros, how to use it ? 08:08
brrt Woodi: basically, I imagine you have some struct 08:09
and then your library has LIBFOO_QUIX(x) defined
which gets some values from the struct, right
? 08:10
Woodi do not know exactly :)
Woodi makro is simple: #define VERSION3 3 :) but I must pack it into const void *invalue.... 08:18
brrt if it is stored anywhere in an exported symbol, you should be able to access it, i do not know if NativeCall exposes that functionality however 08:19
otherwise, you might get away with reading the header files
i'd even say, if you could make a header-file-reader to work together with NativeCall, that would be usefull 08:20
Woodi I read it myself and trying to complet single v6 view :)
and how char *attrs[] should be named in NativeCall language ? 08:21
brrt i do not know that :-) i'm sorry 08:22
i'm pretty sure its possible though
Woodi no problem :) i hear there are still problems with some parts of "translation" :) 08:25
brrt has used parrot nci, rather than NativeCall 08:26
NativeCall is considerably more powerful, though
Woodi I wonder how it works... if it do not tucg gcc or something then what to do with macros ? write some intermediate code maybe ? 08:28
*touch...
FROGGS Woodi: you could write C-functions that return a numeric #define 08:29
Woodi: you really just can "use" macros from within C 08:30
jnthn Aye, macros have no corespondence in the compiled library 08:31
FROGGS think of: #define MAX(a, b) (a > b ? a : b)
jnthn So they "don't exist" by the time NativeCall gets it, and there's no symbol to look up and so on.
FROGGS if you use MAX() somewhere in your C code, it will be replaced by the (a > b ? ...)
jnthn So, like enums, they need manual translation 08:32
FROGGS it is really just text replacement in C files, it vanishes when it becomes a lib
jnthn aye 08:32
Woodi FROGGS: I do not ask how C work :)
FROGGS thats the point where Inline C might come handy ;o)
Woodi: but you need to know, obviously 08:33
Woodi but is not enough...
I need NativeCall *notation* for things... 08:34
jnthn r: macro MAX($a, $b) { quasi { {{{$a}}} > {{{$b}}} ?? {{{$a}}} !! {{{$b}}} } }; say MAX(1, 2)
p6eval rakudo 584f19: OUTPUT«2␤»
Woodi I must add I am lazy (or not) here and trying to avoid rewriting all macros in I can found .h files... 08:36
FROGGS Woodi: thats the point where a C-wrapper might come handy, so you just can return the result from C-macro 08:37
jnthn Woodi: Write something that translates header file macros etc into Perl 6 then :P
FROGGS this wrapper function will then be a symbol you can call using NativeCall
jnthn++
Woodi: I give you 50$ for a working code ;o)
and another 20 bucks for parsing enums right 08:38
Woodi I thinked about automatic and massive .h translation too :)
brrt woodi: now you have a reason, get at it :-) 08:39
FROGGS well, it might work for some piece of code, but dont expect to get it to work for every header file there is
jnthn I believe the Parrot folks wrote a fairly advanced C grammar, fwiw.
That could be quite stealable.
So you don't have to grammar from scratch
Woodi still there is problem how things should be named on NativeCall side. eg. how translation of "char *attrs[]" should look like ? OpaquePointer or OpaquePointer CArray ? and "struct somestruct **sctrls" ? 08:43
FROGGS CArray[OpaquePointer] ?
jnthn char *attrs[] could be guessed as CArray[Str]
FROGGS ohh, you are right
Woodi :)
FROGGS had no coffee so far
jnthn is at the client with the awesome coffee machine today and is probably drinking enough of it for half the channel... 08:44
Woodi jnthn: what is name of that machine ? :) 08:45
jnthn Hm, not sure... :)
I'll ask it when I go for the next cup
brrt jnthn: isnt that CArray[CStr] or something 08:49
because you don't really have Str objects
jnthn brrt: It knows what to do with Str 08:50
brrt oh, thats nice
arnsholt Woodi: Well, that's a problem with C in general, really 08:56
char * can be either a string (zero terminated), or a byte array (with arbitrary bytes) 08:57
You'll just have to make an arbitrary choice and let the end user figure it out 08:58
jnthn Yeah, any header to NativeCall code tool will have to be "best guess" 09:02
Maybe it should have a mode where it adds comments saying "I guessed here, review" or something. :)
arnsholt Yeah, was just thinking the same thing =) 09:03
Woodi actually I want just a bindings to library to have db connectivity... but wonder how would look C done on top of Perl6 ? :) C grammar can be googled, was probably done by few projects... 09:06
maybe pointless but maybe unknown unknown is hiding ? :) 09:08
brrt having a c header reader is really useful 09:16
Woodi ok, I have situation like this: function is "int cfunc(*val)" and I must send int so in C I use &intvalue. how '&' looks in NativeCall ? :) 09:21
I try sending Int but it is too smart with checks :) 09:22
jnthn Woodi: Best way at the moment is to do CArray[int] and pass it a 1-elem array 09:23
Woodi ook :) 09:24
lumi__ r: macro MAX($a, $b) { quasi { my $a := {{{$a}}}; my $b := {{{$b}}}; $a > $b ?? $a !! $b } }; say MAX(1, 2); 09:48
p6eval rakudo 584f19: OUTPUT«2␤»
lumi__ Is that right? The binding thing? 09:49
jnthn yes 09:50
lumi__ (Also, yay, macros!)
jnthn I was just translating teh C macro literally :)
masak++ is to thank for those :) 09:51
lumi__ jnthn: Oh, OK, there's no way to do it right in C...
jnthn Still some work to go on them yet
lumi__ masak++
jnthn: What's missing? I messed with them a bit in ancient times 09:52
jnthn Making declarations (e.g. subs) inside macros, the COMPILING:: pseudo-package support.
jnthn lunch & 09:54
grondilu btw has anyone been writing a C grammar in Perl6? 11:19
moritz there's an incomplete C grammar in NQP in the parrot repo 11:24
for parsing the .ops files
grondilu ok I'll have a look. 11:31
colomon jnthn++: that shaved another 20s off the running time. 11:53
phenny colomon: 06:40Z <jnthn> tell colomon 584f19e may help a little too; feel free to mail me an updated profile if you want me to dig some more
colomon jnthn: I'll get you an updated profile ASAP
jnthn: e-mailed. 12:00
jnthn colomon: I am tied up with $client for the next couple of hours anyway 12:05
colomon: How long is it taking now?
colomon jnthn: on the linux box, 3m47s 12:08
jnthn colomon: What did all the .s you added win? 12:09
Did that help with memory also?
colomon The .s got me 45s or so. I haven't checked memory usage. 12:10
jnthn OK, so we need to win another 47s to have halved the runtime... :) 12:11
colomon r: say (5*60+52)/2 12:12
p6eval rakudo 584f19: OUTPUT«176␤» 12:12
colomon yes. :) 12:13
jnthn There may be a win from making the to/from in the match object native ints. 12:16
That's how NQP has it.
flussence ooh, regex speedups? 12:25
jnthn flussence: combination of Rakudo improvements and colomon++ tweaking his grammar :)
colomon sorear suggested adding :: to places where LTM might be causing issues. dunno if that will help rakudo performance or only niecza performance.... 12:28
moritz I don't think rakudo implements :: 12:31
r: /a :: b/
p6eval rakudo 584f19: OUTPUT«===SORRY!===␤:: not yet implemented at line 2, near " b/"␤»
jnthn Evaluating the NFA didn't seem to be unusually expensive in the profile, fwiw. 12:33
Turning that bit alternation I mentioned into a char class may help but probably only a little. 12:34
colomon jnthn: token special, you mean? I was under the impression that '!' | '"' | '*' versus <[ ! " * ]> was just a notational convenience... 12:40
jnthn colomon: They compile rather differently. 12:41
moritz in the end they have the same semantics, but rakudo still does LTM for the | case 12:42
jnthn Right
colomon guess I can give that a try. was mostly avoiding it because I thought it would make for too long a line. :)
but probably have to do a preschool dropoff first.
jnthn Who said you have to put the char class all one one line? :)
colomon ooooooo 12:43
moritz old p5 think, I think 12:44
jnthn r: say "ooh look spaces count" ~~ m:P5/ooh look/ 12:45
p6eval rakudo 584f19: OUTPUT«「ooh look」␤␤»
jnthn :)
jnthn BTW, if some enterprising soul wants a relatively easy P5Regex task, implement \A and \Z and stuff :) 12:51
jnthn (there's a load of tests for it) 12:52
moritz \A is just the same as ^ in Perl 6 regex 12:54
moritz takes a look
arnsholt \A and ^ are different under /m (or was it /s?) though 12:55
moritz \A is always the same 12:56
^ depends on /m
arnsholt Right, that. 12:56
jnthn Yeah, I already did the m-varying ^ semantics I think 12:57
moritz \z is also easy 12:58
\Z is a bit more tricky
\Z is \n?\z
jnthn Because \n semantics?
Oh, but $ does that too and I did $ already
so you can nab that :)
moritz do I need to put that in p5backaslash:sym<A> etc? 12:59
jnthn yes, you'll need something in the grammar and an action method 13:00
moritz tries 13:02
colomon is <[ ! " * ]> the same as <[ !"* ]> ? 13:24
jnthn Yes 13:29
It matches \s* as meaningless between things in the char class
Thus why multiple lines are also fine :) 13:30
colomon "Unsupported use of - as character range" 13:31
how do I escape that?
(in <[ ]>
jnthn \- 13:32
colomon now I get "regex assertion not terminated by angle bracket"
that's with token special { <[ !"*$%&.#+,\-()?/:;<=>@[]{|}^`~ ]> }
jnthn Need to escape the ] in there too 13:33
colomon and now it works! jnthn++
jnthn
.oO( but will it be faster... )
colomon jnthn: running my tests first, to make sure it's still correct. ;) 13:34
colomon which it is! \o/ 13:39
timing... 13:41
[Coke] <spongebob>3 hours later</spongebob> 13:59
colomon whoops! got sidetracked. (checks) no performance improvement at all with that change. can't say I'm wildly surprised by that. 14:00
jnthn Tells us that alternations are relatively cheap I guess :) 14:01
colomon well, I don't know that they're called all that often on a regular file.
according to the last profile I did before this, the time taken in special is trivial 14:02
jnthn ah, ok 14:03
colomon 12% of the execution time is in <ws>?
jnthn Wow
jnthn Sounds plausible though 14:03
Do you have a custom ws? 14:04
Or is this the default one?
If the default one then there's certainly room for some improvement...
colomon That's the default one, and I never even call it explicitly. 14:05
must be in the rules, I guess?
jnthn Yes 14:06
That's surprisingly pricey.
colomon jnthn: I'm looking at token untyped_parameter { '$' | <real> | <integer> | <string> 14:26
| <entity_instance_name> | <enumeration> | <binary> | <list_of_parameters> }
at the moment.
would there be value to using || instead of | here? 14:27
(would it even work in Rakudo?)
jnthn That's likely to make it slower. 14:28
arnsholt At a guess, || would make it slower than | 14:29
jnthn || tries things one by one
arnsholt Yeah, what jnthn said
With | you get LTM to find the right branch
jnthn | tries them "in parallel" using an NFA
And it can trim out impossible ones without having to call the subrules.
colomon would reordering them make any difference, given that? 14:30
jnthn No 14:30
It's || where re-ordering would help 14:31
colomon then the overall set of parameter tokens/rules may qualify as "surprisingly slow"
hard to say, because they are called a LOT
[Coke] rjbs++ 14:51
rjbs- is saving up his karma for IRC, The Home Game. 14:52
jnthn decommute & 15:02
TimToady the new sigspace policy minimizes the number of calls to <ws>; don't think rakudo implements that yet... 15:04
(the new policy only calls <ws> if something else matched first, basically)
oh, and you should be able to cut down LTM analysis with {}, which also stops the token like :: 15:06
it just doesn't change the backtracking rule, if there happens to be degrees of freedom in the token's regex 15:07
which there usually isn't, at least in parsing a language
data files might be a different story
colomon Is that just {} or do you mean wrapping things in { } brackets? 15:12
colomon fears he is behind the curve in grammar comprehension.... 15:13
lumi__ colomon: I think he means that just having a block breaks LTM even if it's empty 15:19
colomon lumi__: that's what I'm thinking too, but I'd like to make sure I'm not going astray. 15:23
jnthn An empty block would do it 15:39
But as I said, Rakudo doesn't seem to be suffering much on the LTM front.
colomon jnthn: sure, but if it provides drastic improvements for Niecza performance without hurting Rakudo performance, that would be worthwhile 15:41
jnthn I'll probably slow Rakudo down a bit since it doesn't optimize away empty blocks. 15:44
perigrin *It'll ... otherwise ... jnthn is a meenie ... punnishing poor rakudo for not optimizing away empty blocks. 15:45
jnthn er, yes :D 15:46
I should do that optimization at some point. I seem to recall that last time I tried it didn't work out for some reason. 15:47
jnthn colomon: Hm, in the latest profile you sent me it seems ws is only 6.5%, but you mentioned 12% earlier. 15:48
colomon :( 15:50
will try to sort it out in a minute.
jnthn Wow, that initial .subst got way cheaper 15:51
dalek kudo/nom: fb0b115 | jnthn++ | src/core/ (2 files):
Use native ints for Match $!to/$!from.

This will certainly save a good amount of memory, but it also saves the MATCH method from having to do two object boxings too. Of course, we do them later in some cases, but I suspect this will be an overall win.
16:13
grondilu Test Summary Report 16:14
-------------------
t/spec/S32-io/IO-Socket-INET.t (Wstat: 0 Tests: 16 Failed: 2) Failed tests: 6, 9
Files=701, Tests=25653, 7101 wallclock secs (19.85 usr 2.67 sys + 6578.06 cusr 156.14 csys = 6756.72 CPU)
Result: FAIL
jnthn colomon: Maybe fb0b115 helps a bit. 16:15
colomon jnthn: will check!
colomon will also get back to paying his taxes, as that is on a deadline of sorts. 16:19
colomon jnthn: 11 seconds gone, not bad! 16:28
I've started a new profile run.
felher r: my Int @array = 1,2,3; say @array eqv [1,2,3] 17:38
p6eval rakudo fb0b11: OUTPUT«False␤»
felher Is it expected behaviour that the Type-Information of that array makes eqv return false? 17:39
moritz yes 17:40
nr: say 1.0 eqv 1 17:41
p6eval rakudo fb0b11, niecza v22-7-g7df6137: OUTPUT«False␤»
moritz same case
felher I see. Whats the nicest way to get what i wanted, then? [&&] @array Xeqv [1,2,3]? Or Array.new(@array) eqv [1,2,3]? 17:46
(i know that for 1,2,3 i could use ==) :)
(X== that is) 17:47
jnthn Zeqv more likely 17:48
felher jnthn: yeah, of course :)
jnthn And all
felher all @array Zeav [1,2,3]?
jnthn r: my Int @a = 1,2,3; say all [1,2,3] eqv @a 17:49
p6eval rakudo fb0b11: OUTPUT«all(False)␤»
jnthn r: my Int @a = 1,2,3; say all([1,2,3] eqv @a)
p6eval rakudo fb0b11: OUTPUT«all(False)␤»
jnthn grr
r: my Int @a = 1,2,3; say all([1,2,3] Zeqv @a)
p6eval rakudo fb0b11: OUTPUT«all(True, True, True)␤»
jnthn r: my Int @a = 1,2,3; say so all [1,2,3] Zeqv @a
p6eval rakudo fb0b11: OUTPUT«True␤»
jnthn There we go :)
r: my Int @a = 1,2,4; say so all [1,2,3] Zeqv @a
p6eval rakudo fb0b11: OUTPUT«False␤»
felher jnthn: yeah, that looks kinda nice. Thanks :) 17:50
moritz (off topic) does anybody know of a generalization of the Nested Sets model to store arbitrary DAGs (and not just trees) in SQL? 18:01
PerlJam
.oO( How can that possibly be off topic *here*? )
18:09
japhb_ jnthn, can any of the optimizations you've been making to improve colomon++'s parsing use case be applied to NQP, so its parsing will be faster as well? 18:22
sorear good * #perl6 18:23
moritz I'm pretty sure that NQP already uses native ints for match attributes
_edwin filed rt.perl.org/rt3/Ticket/Display.html?id=115212 18:23
japhb_ moritz, he's done a couple more too ... double-quote literal handling, method cache authority ... 18:24
But given what you said, I now wonder how many NQP optimizations can be moved over to Rakudo. ;-) 18:25
brrt moritz: I do not know, but i'm very interested 18:26
brrt is actually really close to giving up on the whole #perl6 thing 18:28
moritz brrt: may I ask why? 18:30
brrt "Positional arguments implicitly come in via the @_ array, but unlike in Perl 5 they are readonly aliases to actual arguments:" 18:31
honestly, why?
sorear THAT is why you're leaving?
also, I think that document is out of date, @_ isn't used at all unless you mention it now 18:32
moritz brrt: because most modifications of arguments are unintended
doy and all existing implementations do read-only copies, as nicholas clark pointed out
brrt i'm not leaving, i'm nearly turning mad
well, why can't they just be copies then? 18:33
moritz because copies of big stuff can be expensive 18:34
and there's the question of how deeply/shallow you copy
and so on
brrt fine; i'm not suggesting php4 deep-copy-on-write (that was hilarious madness that hurt so bad) 18:35
but shallow pointer copy is pretty much what you'd 'want', isn't it?
PerlJam brrt: not me. 18:36
brrt why not, why isn't that enough
PerlJam unintended second order effects
jnthn japhb_: NQP already has the method cache authority thing for a long while, I'd just not gotten around to porting it over to Rakudo. 18:38
japhb_ jnthn, ah so
brrt PerlJam: please explain :-)
japhb_ jnthn, I was wondering a few weeks ago how often optimizations only make it into NQP or Rakudo but not both (when they make sense in both) ... and now I have my answer. ;-) 18:39
jnthn japhb_: And it's double-quoted strings in regexes don't actually allow interpolation or anything that would preclude literals.
dalek ast: 920c5be | (Edwin Steiner)++ | S14-roles/stubs.t:
Add test for RT #115212: [BUG] accessor method does not count as implementation of required method.
ast: 7673df5 | (Edwin Steiner)++ | S0 (10 files):
Merge branch 'master' of github.com:perl6/roast
PerlJam brrt: I wouldn't want to accidentally affect a change in the caller's environment because I made a change to a parameter passed to my subroutine.
jnthn japhb_: Well, NQP doesn't yet have an optimizer :) 18:40
japhb_ There's a biggie. ;-)
jnthn japhb_: So there's some fun to be had there too :)
japhb_ is looking forward to that improvement, as he is currently back to working on his benchmarking tool and thus seeing just how slow some things are. 18:41
brrt PerlJam: which doesn't happen if you copy pointers to the subroutine enviroment
japhb_ 18:42
brrt wait. 18:44
i'm fearing i'm misunderstanding the issue here
sorear brrt: there are reasons why I often wonder if perl6 is a good idea, and that @_ thing is never one of them 18:45
japhb_ D'oh! Ran the benchmark for several minutes only to discover I'd forgotten to send the timing data to a file. BAH.
brrt p6: sub foo(*@a is rw) { @a[0,1] = @a[1,0] }; my ($a, $b) = 0, 1; foo($a, $b); say $a;
p6eval niecza v22-7-g7df6137: OUTPUT«1␤»
..rakudo fb0b11: OUTPUT«0␤»
brrt ok, which one is right
sorear brrt: in the real world, you'd never use @_, always rw parameters 18:47
p6: sub foo($x is rw, $y is rw) { ($x,$y) = ($y,$x) }; my ($a,$b) = 0,1; foo($a,$b); say $a
p6eval rakudo fb0b11, niecza v22-7-g7df6137: OUTPUT«1␤»
brrt so, niecza got it right 18:48
right
jnthn Does the spec say one way or the other? 18:49
brrt the spec suggests niecza's behavior
jnthn Reference?
brrt which i find maddening but is apparantly the correct behavior
jnthn I think Rakudo pays no attention at all to "is rw" in a slurpy, fwiw...
Unless Pm implemented it to do so and I didn't notice. :)
brrt s06, Note: the rw container trait is automatically distributed to the individual elements by the slurpy star even though there is no actual array or hash passed in. More precisely, the slurpy star means the declared formal parameter is not considered readonly; only its elements are. See "Parameters and arguments" below. 18:50
sorry for copying, btw
jnthn ah, ok 18:52
Yeah, Rakudo probably should pay attention to the "is rw" there then and do something different.
diakopter p6: sub foo(*%a is rw) { say %a{'a'}; %a{'a'} = 2; say %a{'a'} }; my $a = 4; foo(|{'a' => $a}); say $a; 18:53
p6eval rakudo fb0b11, niecza v22-7-g7df6137: OUTPUT«4␤2␤4␤»
brrt and, that doesn't make you very nearly insane? this meant in a non-inflammatory matter, by the way
diakopter brrt: one tends to get accustomeed to glaring inconsistence. also non-inflammatory. 18:54
*around here
jnthn brrt: huh, I've worked on Rakudo since about December 2007, I've been insane for ages. :)
brrt :-) good, i'm not alone, then 18:55
jnthn The glaring inconsistencies are at least better than the subtle, unnoticed ones... 18:56
I've learend not to worry too much about such things though. They tend to get worked out, as the implementations push for them to be.
sorear brrt: is rw is pretty much the sanest part of perl 6. I am baffled by the fact that you seem to have a problem with it 18:58
brrt sorear: my problem,if anything, is that it prohibits a clean separation between caller and callee 18:59
PerlJam brrt: prohibits?!?
brrt well, yeah, suppose i have a scope containing a, and b, i must effectively pass the location of a and b to a subroutine, not their values 19:00
$a, and $b
jnthn brrt: I think you're missing a level
grondilu rn: constant foo = do given %*ENV<FOO> { when .defined { m:i/^ bar $/ }; default { False } }; say foo;
brrt because - the way i'm reasoning - the caller cannot know if the callee things its arguments are read-writeable
p6eval rakudo fb0b11, niecza v22-7-g7df6137: OUTPUT«False␤»
jnthn my $a = 42;
brrt yeah, probably
jnthn Means that the lexpad contains a Scalar which contains 42.
brrt s/things/thinks/
jnthn You pass the Scalar.
brrt .... 19:01
yes, obviously
grondilu rn: constant foo = do given %*ENV<HOME> { when .defined { m:i/^ home $/ }; default { False } }; say foo; 19:02
p6eval niecza v22-7-g7df6137: OUTPUT«False␤»
..rakudo fb0b11: OUTPUT«===SORRY!===␤Cannot assign to a non-container␤»
brrt so in a weird way you're always pushing pointers, it isn't an exception 19:03
jnthn er...what... 19:04
brrt yeah that wasn't intelligeble
i mean
jnthn brrt: That was at Rakudo's response to grondilu's program, not to you! :)
brrt ok
(i didn't understand that program either, btw)
so, youre basically always dealing with a container, and a value 19:05
jnthn grondilu: I'm, er, confused now because I just ran what you pasted locally and it worked 19:06
grondilu jnthn: is the ENV var defined ? 19:08
flussence jnthn: fails here
diakopter sorear: my last snippet above - should it behave the same as the *@a ?
grondilu nr: constant home-is-in-home = %*ENV<HOME>.defined ?? (%*ENV<HOME> ~~ m:i/ home /) !! True;
p6eval niecza v22-7-g7df6137: ( no output )
..rakudo fb0b11: OUTPUT«===SORRY!===␤Cannot assign to a non-container␤»
jnthn grondilu: No
oh wait, surely home is... 19:09
oh, no it's not
If I change it to HOMEPATH I get the error
grondilu it's rakudo bug, right? 19:10
jnthn Seems like
grondilu nr: constant foo = %*ENV<HOME> ~~ /home/; 19:12
p6eval rakudo fb0b11: OUTPUT«===SORRY!===␤Cannot assign to a non-container␤»
..niecza v22-7-g7df6137: OUTPUT«Use of uninitialized value in string context␤ at /home/p6eval/niecza/lib/CORE.setting line 1289 (warn @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 266 (Mu.Str @ 15) ␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /home/p6eval/niecza/lib/CORE.setting…
jnthn nr: constant foo = (%*ENV<HOME> ~~ /home/);
p6eval rakudo fb0b11: OUTPUT«===SORRY!===␤Cannot assign to a non-container␤»
..niecza v22-7-g7df6137: OUTPUT«Use of uninitialized value in string context␤ at /home/p6eval/niecza/lib/CORE.setting line 1289 (warn @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 266 (Mu.Str @ 15) ␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /home/p6eval/niecza/lib/CORE.setting…
jnthn nr: constant foo = %*ENV<HOME>.match(/home/); 19:13
p6eval rakudo fb0b11: ( no output )
..niecza v22-7-g7df6137: OUTPUT«Unhandled exception: Unable to resolve method match in type Any␤ at /tmp/UC83ubgjc2 line 1 (foo init @ 2) ␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /home/p6eval/niecza/src/NieczaBackendDotnet.pm6 line 76 (downcall @ 4) ␤ at /home/p6eval/niecza/src/Ni…
diakopter jnthn: my last snippet above - should it behave the same as the *@a ? 19:14
jnthn diakopter: afaik 'is rw' does nothing on slurpy hashes either 19:15
grondilu r: constant foo = %*ENV<HOME>.match(m:i/ home /); 19:16
p6eval rakudo fb0b11: OUTPUT«===SORRY!===␤Method 'match' not found for invocant of class 'Mu'␤»
jnthn grondilu: m/.../ matches immediately on $_ 19:17
grondilu jnthn: oh, ok 19:18
dalek kudo/nom: dbf3478 | jnthn++ | src/core/Cursor.pm:
Small optimization to Match construction.
19:19
jnthn So far as I can tell, the thing it fails to assign to is actually $/
Woodi bbkr: given my understability of problem :) I think I yesterday hit something you can read with this context in mind: en.wikipedia.org/wiki/Mutable_object and CoW is involved too 19:23
jnthn colomon: Not sure how much dbf3478 will help; it's hard to tell from the benchmark. It *should* make things a bit faster. 19:25
colomon jnthn++: will time...
jnthn I'm seeing if I can improve CAPHASH a little also 19:26
colomon jnthn: looks like that is another 7secs off 19:38
jnthn colomon: What're we at now? :)
colomon 3.5 min
so 30 seconds to go for an overall halving of execution time. :) 19:39
jnthn should probably be working on debugger improvements, but hey, optimizing is fun... 19:40
flussence
.oO( optimising for the "fail fast" pattern )
moritz r: sub f() { nqp::substr("foo", 0, 1) }; say f 20:02
p6eval rakudo fb0b11: OUTPUT«f␤»
_edwin rosettacode.org/wiki/Permutations_b...ing#Perl_6 20:18
cognominal nqp: say(%*A) 20:19
p6eval nqp: OUTPUT«Hash[0x9e9de88]␤»
cognominal r: say(%*A) 20:20
p6eval rakudo dbf347: OUTPUT«Dynamic variable name not found␤ in method gist at src/gen/CORE.setting:9934␤ in sub say at src/gen/CORE.setting:7250␤ in block at /tmp/Tl17ixHqyY:1␤␤»
cognominal What is the semantic for dynamic variable in NQP?
moritz nqp: say($*A) 20:21
p6eval nqp: OUTPUT«␤» 20:21
moritz nqp: say($*A.WHAT)
p6eval nqp: OUTPUT«␤»
moritz nqp: say($*A.^name)
p6eval nqp: OUTPUT«Confused at line 2, near "say($*A.^n"␤current instr.: 'panic' pc 20029 (src/stage2/gen/NQPHLL.pir:7321) (src/stage2/gen/NQPHLL.pm:324)␤»
cognominal It seems it is autovivied. how to test it has been declared?
moritz nqp: say($*A.HOW.name($*A))
p6eval nqp: OUTPUT«NQPMu␤»
cognominal nqp: my %*B; say(%*B.HOW.name(%*B)) 20:24
p6eval nqp: OUTPUT«Can only use get_how on a SixModelObject␤current instr.: '' pc 151 ((file unknown):79) (/tmp/tBHlIAD6nr:1)␤»
moritz probably a Parrot Hash 20:25
jnthn yeah, it will be
moritz nqp: say(nqp::typeof__SP(%*B))
p6eval nqp: OUTPUT«Error while compiling block : Error while compiling op call: Error while compiling op typeof__SP: No registered operation handler for 'typeof__SP'␤current instr.: '' pc 43434 (src/stage2/QAST.pir:15060) (src/stage2/QAST.nqp:2253)␤»
jnthn I guess it is auto-viving in some way
pir::
moritz nqp: say(pir::typeof__SP(%*B)) 20:26
p6eval nqp: OUTPUT«Hash␤»
cognominal nqp: my %*B := Hash.new; say(%*B.HOW.name(%*B))
p6eval nqp: OUTPUT«NQPMu␤»
grondilu made a interface to OpenSSL (so far, only a few digests): [email@hidden.address] 20:30
cognominal jnthn, I am trying to get %!, %? and $_ to live from one shell evaluation to another in the Perl6 shell. In nqp/src/HLL/Compiler.pm, I replace %interacitve_pad with %*INTERACTIVE_PAD and I want to test it in finishpad in src/Perl6/Action.pm to set $BLOCK. Is it cargo cult? if now how to do it? 20:31
s/now/no/ 20:32
jnthn cognominal: That feels like an odd kinda way to do it. 20:34
cognominal I thought you would find a better way! 20:35
jnthn Well, it's an issue for the debugger also, it seems.
I think it's getting $!, $_ etc wrong if you try to introspect them
cognominal if the debugger includes a shell, I bet
jnthn So I think it's perhaps more general that just interactive. 20:36
TimToady r: my Int @array = 1,2,3; say @array ~~ [1,2,3] 20:37
p6eval rakudo dbf347: OUTPUT«True␤»
TimToady felher: but note ^^ 20:38
jnthn oh!
TimToady++
felher TimToady: oha, nice. Thanks! 20:39
felher looks up the smart-match-table once again :)
_edwin std: gist.github.com/3868275 20:40
p6eval std 77327a4: OUTPUT«ok 00:01 53m␤»
dalek osystem: a594e55 | grondilu++ | META.list:
Update META.list

perl6 interface to openssl, so far only a few digests.  Needs small modification of code for big-endian hosts.
20:47
osystem: 3e78dba | (Ahmad M. Zawawi)++ | META.list:
Merge pull request #15 from grondilu/patch-1

Update META.list
grondilu cool 20:51
karma grondilu 20:53
aloha grondilu has karma of 6.
grondilu :)
cognominal grondilu++ 20:56
r: say UNIT.WHO.keys 21:02
p6eval rakudo dbf347: OUTPUT«GLOBALish EXPORT $?PACKAGE ::?PACKAGE $_ $/ $! $=pod !UNIT_MARKER␤»
cognominal ::?PACKAGE ?
japhb_ cognominal, current package's stash? 21:06
ingy jnthn: do you know of a good demo p6 webapp? 21:07
jnthn ingy: Not off hand 21:08
ingy jand wants to add p6 support to ActiveState's Stackato
jnthn cognominal: Like ::?CLASS - it can be used as a type name.
ingy just needs something to show off 21:09
jnthn ingy: tadzik has made Bailador, so may have some suggestions.
cognominal I don't get the difference between $?PACKAGE and ::$?PACKAGE
jnthn cognominal: They contain the same thing, but you can't write $?PACKAGE where a type name is expected
ingy I think I asked about this before
dalek rl6-bench: dc0fc43 | (Geoffrey Broadwell)++ | bench:
WIP: Pass config and overall per-run info to summarizers; display benchmark rev and overall run start time in summary outputs; save all config and per-run info in JSON output
21:10
rl6-bench: 5ed43bd | (Geoffrey Broadwell)++ | bench:
Fixes for previous WIP commit
rl6-bench: 872ccf1 | (Geoffrey Broadwell)++ | bench:
Stop testing Perlito6/perl5 on rc-forest-fire
rl6-bench: 7c25a88 | (Geoffrey Broadwell)++ | bench:
Fix braino in HTML style output
rl6-bench: 6f48049 | (Geoffrey Broadwell)++ | bench:
Improve default HTML styling
cognominal r: my $?PACKAGE $a 21:16
p6eval rakudo dbf347: OUTPUT«===SORRY!===␤Redeclaration of symbol $?PACKAGE␤at /tmp/wgkzzFw3GJ:1␤»
cognominal r: my ::$?PACKAGE $a
p6eval rakudo dbf347: OUTPUT«===SORRY!===␤Cannot use :: as a type name at line 2, near "$?PACKAGE "␤»
japhb_ r: my ::?PACKAGE $a
p6eval rakudo dbf347: ( no output )
cognominal oops 21:17
thx jnthn and japhb_
cognominal I should read closely before attempting any interpetation 21:18
dalek rl6-bench: 0d7bba5 | (Geoffrey Broadwell)++ | TODO:
A few more thoughts added to TODO
21:29
japhb_ nr: my ($s) = now.to-posix; 1 for 1..100_000; my ($e) = now.to-posix; ($e - $s).say; 21:44
p6eval niecza v22-7-g7df6137: OUTPUT«6.40090799331665␤»
..rakudo dbf347: OUTPUT«0.8622609␤»
japhb_ sorear, Any idea why niecza is unusually comparatively slow for the above trivial loop? 21:45
sorear japhb_: niecza's Range.iterator has seen much less love 21:47
japhb_ sorear, Also, it would be really nice if Instant would coerce to Num. ;-)
sorear, Ah, OK, got it.
sorear r: say now.Num
p6eval rakudo dbf347: OUTPUT«1349905682.03435␤»
dalek p: 71afc92 | jnthn++ | src/QRegex/Cursor.nqp:
Optimize CAPHASH a bit.

Avoids some boxing/unboxing and also an iterator allocation.
22:27
p: 885cc4c | jnthn++ | src/NQP/Actions.pm:
Nameds should not be involved in multi-dispatch.
p: 9ef6b1b | jnthn++ | src/stage0/ (9 files):
Update bootstrap.
p: 00bb439 | jnthn++ | src/QAST/Compiler.nqp:
Try to better convey void context.
p: a2cbfa4 | jnthn++ | src/QAST/Compiler.nqp:
Some more void context cleanups.
p: 6247a45 | jnthn++ | src/QAST/Operations.nqp:
Generate better code for void if/unless.
p: 5a60f40 | jnthn++ | src/NQP/ (2 files):
Generate better code for NQP's prefix:<!>.
jnthn 'night o/ 22:39
dalek rl6-bench: cae05bc | (Geoffrey Broadwell)++ | bench:
Add Niecza as a (partial) NQP compiler
22:46
rl6-bench: 9983ad1 | (Geoffrey Broadwell)++ | / (2 files):
Begin documenting expected results and analysis of the various tests
rl6-roast-data: e98769f | coke++ | p (2 files):
today (automated commit)
perl6-roast-data: fc4e5fb | coke++ | / (3 files):
perl6-roast-data: today (automated commit)
[Coke] I've gotten to the point in partcl-nqp where I now have a circular dependancy that won't work due to the compile to pir step. 23:25
time to start combining perl files. 23:26
TimToady rosettacode.org/wiki/Zeckendorf_num...ion#Perl_6 23:32
[Coke] TimToady: why is the constant inside the multi? 23:39
(just for scoping?)
japhb_ is intrigued by the idiom in TimToady++'s code of a finite sequence built by clipping an infinite sequence 23:47
(As opposed to just generating a finite sequence immediately.)