»ö« 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.
sorear What are the popular P5 XML libs? 00:50
colomon o/, sorear 00:51
sorear o/ colomon.
colomon how are things?
sorear colomon: not bad 00:53
tkr sorear: XML::LibXML 00:54
diakopter sorear: I've used XML::Smart
sorear is reading the XML::LibXML documentation 01:02
tkr: new here?
tkr sorear: Ive been here before. Why are you asking? 01:08
sorear 'cause I need to weclome the new folks :) 01:09
tkr Ah.
Thanks. :) 01:10
hugme: hug sorear 01:11
hugme hugs sorear
sorear aaa this DOM stuff confuses me 02:42
sorear :| 03:00
sorear tkr: I can't quite figur out how to do anything useful with XML::LibXML... nodePath is returning useless stuff like /*/*[1] instead of names 03:02
arnsholt sorear: I find SAX parsing to be just as easy to deal with as DOM in some cases 03:10
Dunno if it fits your particular need, but it might
sorear I'm quite new to this XML processing stuff. 03:14
it seems... unnecessarily complicated 03:15
diakopter :) 03:16
arnsholt Yeah, XML can be a bit too much 03:21
flussence one thing that makes LibXML more tolerable for me is going crazy with wrapper functions 03:22
diakopter sorear: I think I've come up with a way to use lua(jit)'s registry as a store for automatic memory mgmt of Lua objects (including generic userdata buffers) from C
arnsholt But the advantage with SAX (XML::SAX on CPAN is what I use) is that it just calls a method on your object whenever it sees an opening tag for example
Which lets you extract pretty much exactly what you want without too much digging about in the document structure
flussence e.g. "sub tags_only { grep { $_->nodeType == some_uppercase_thingy } @_ }" etc
arnsholt I usually do something along the lines of sub "start_element { given($_[1]->{LocalName}) { ... } }" 03:24
Add some state to your handler object, and I'm usually done
flussence needs to look into the SAX parser some time, at $dayjob I've got an ugly mess of DOM calls that add up to 1 read pass of the input... 03:27
arnsholt Hehe
SAX has the added benefit of using less memory for large documents as well, since you only have to represent whatever you care about ATM, rather than the whole mess of XML 03:28
flussence it was worse before I got it to that state; the guy who originally wrote it used getElementsByTagName and grep. :( 03:29
arnsholt Tasty. Probably a quick way to get the code written, but probably not very fast either if the XML gets big
sorear arnsholt++ 03:35
flussence (I get the fun of maintaining a codebase where large parts were written by an old-school C guy in the pre-5.8 era. Every so often I discover a surprise like that one, or something horrible involving bitmasks and syscalls...)
sorear pines for .gist 03:36
sorear yay! XML::SAX is working well arnsholt++ 04:00
dalek ecs: d2a7270 | duff++ | S05-regex.pod:
Minor typo
04:34
sorear TimToady: found a nit(?) in S05's character class stuff 06:27
TimToady: at line 1645, it talks about arguments to pairs being used as smartmatchers. But there's no general ACCEPTSy way to implement Unicode's fuzzy property match rules ("ASCII" !~~ "ascii") 06:28
TimToady: I'm going to interpret this as "Str is special-cased to use Unicode fuzzy matching, everything else gets ACCEPTs"
TimToady: is this an intendable interpretation? 06:29
diakopter sorear: did you see my msg about lua gc 06:35
sorear diakopter: yes 06:48
diakopter: question? 06:49
or, context?
diakopter I wanted to run the idea by you
sanity check
do you know about the registry?
sorear yes
diakopter sorry, thinking/typing 06:51
sorear I think that's what the registry is _for_
diakopter right..
sorear www.lua.org/pil/27.3.html
diakopter right, I have pil 2nd ed 06:52
I want to reimplement all the "classes" I have in lua/runtime as userdata types
then, to make the userdata refer to each other, but to work with the GC properly, 06:53
diakopter stash the other userdata' Registry int index in the userdata 06:54
diakopter so that every userdata's methods can access its members via the Registry. Each userdata would need a __gc method that would also release those references 06:55
so, every slot in a userdata that refers to a lua object (userdata or not) would have an entry in the Registry 06:56
sorear 1. this will be very slow because the Lua C API has a *huge* impedance mismatch with the internal representations 06:58
sorear 2. this will leak memory with user-level circular references 06:58
3. __gc is a pessimized path in the lua runtime 06:59
other than that it will work.
diakopter :P
I understand 1,3 but 2 is escaping me 07:00
sorear it's basically the same issue as reference counting 07:01
imagine you have two objects A and B, A has a slot referring to B and vice versa
when the GC runs, it sees that both A and B are referred to from the registry, so it can't free either one 07:02
diakopter I follow you, but how would those objects be left dangling like that 07:04
sorear my $a = []; push $a, $a; 07:05
sorear Perl 5 calls this DIHWIDT, but we need to do better in this century 07:07
diakopter so, you're saying when $a goes out of scope, ... what 07:08
sorear exactly 07:09
diakopter ..? 07:09
sorear under your proposal, the memory for the array is retained forever. 07:10
diakopter why wouldn't the reference be released when __gc is called on $a ? 07:10
sorear because __gc won't be called on $a 07:11
diakopter why not?
sorear __gc is only called after the last reference goes away
there's a reference in the registry
chicken and egg
diakopter well hm, there would need to be a go-out-of-scope finalizer that did the same thing as the __gc hook 07:13
called from the runtime
sorear that would not help at all 07:15
{ my $a = []; push $a, $a; $a = Any; } # what does your finalizer get called on? 07:16
diakopter wouldn't it release all the direct references in $a ?
diakopter looks
sorear my $foo = [1,2,3]; { my $b = $foo; } # $b goes out of scope, oops you just broke Perl6
diakopter hrm 07:24
diakopter ok; thanks for the sanity check :) 07:24
moritz \o 09:41
tadzik \o
Woodi so what algorithm is used in Rakudo and Niecza for vars GC ? 10:15
moritz rakudo uses parrot's GC, and niecza uses mono's GC 10:17
pmurias awwaiid: hi 11:23
dalek p/bigint: ae25d33 | moritz++ | / (3 files):
add nqp::tonum_I opcode, tests
12:26
p/bigint: 59a8cfe | moritz++ | src/ops/nqp_bigint.ops:
factor out mp_int -> FLOATVAL conversion into a static subroutine, reuse it in other ops
dalek kudo/bigint: db5d137 | moritz++ | src/core/Rat.pm:
save a call in Rat.new
12:52
kudo/bigint: 9342c1c | moritz++ | / (2 files):
make use of the improve bigint -> float conversion
awwaiid hi 13:58
pmichaud,
er
hm
pmurias awwaiid: Devel::ebug::HTTP seems to be a bit bitroten? 14:53
awwaiid: what should i do fork it on github and fix up?
awwaiid pmurias, Devel::ebug::HTTP is a separate distro that I haven't put on github 15:27
awwaiid so if you're wanting to fix it, you'll have to start with the .tar.gz from cpan. I haven't yet successfully built it myself. 15:28
awwaiid I am working on Plack::Middleware::Scrutinize as my http GUI (I'll make a standalone version too), but haven't gotten very far yet 15:28
pmurias, I was just writing you an email 15:30
dalek ast: 16bc94a | tadzik++ | S04-statements/for.t:
Add passing test for RT #78232
17:31
tadzik rt.perl.org/rt3/Ticket/Display.html?id=78232 closable 17:32
tadzik Warning: we regressed on rt.perl.org/rt3/Ticket/Display.html?id=69482 17:36
dalek ast: 8e9b28a | tadzik++ | S03-operators/is-divisible-by.t:
Test for RT #76170
17:42
tadzik rt.perl.org/rt3/Ticket/Display.html?id=76170 closable
tadzik rt.perl.org/rt3/Ticket/Display.html?id=76466 maybe-closable 17:45
dalek ast: 70c5eb7 | tadzik++ | S14-roles/mixin.t:
Tests for RT #77184
17:49
tadzik rt.perl.org/rt3/Ticket/Display.html?id=77184 closable
dalek ast: 9219d0e | tadzik++ | S32-str/numeric.t:
Test for RT #100778
17:54
tadzik rt.perl.org/rt3/Ticket/Display.html?id=100778 closable 17:54
dalek ast: 516760b | tadzik++ | S12-construction/new.t:
Tests for RT #100780
17:57
tadzik rt.perl.org/rt3/Ticket/Display.html?id=100780 claosable
rt.perl.org/rt3/Ticket/Display.html?id=78208 closable 18:02
dalek ast: e25f148 | tadzik++ | S06-multi/lexical-multis.t:
Test for RT #78208
dalek ast: 2a83aa9 | tadzik++ | S02-types/native.t:
Tests for #101450
18:06
tadzik rt.perl.org/rt3/Ticket/Display.html?id=101450 closable 18:07
tadzik ok, enough of this killing spree. Anyone with RT privileges to close those? :) 18:11
we should be below 450 now 18:12
sorear good * #perl6 18:13
tadzik hello sorear 18:18
moritz tadzik: [Coke] and pmichaud can give you closing privs 18:53
moritz closes #101450 18:55
moritz tadzik++ 18:55
tadzik moritz: I think they already did, at least pmichaud stated so :) 18:58
moritz: mind closing the rest of them in some spare time?
moritz backscrolls 18:59
moritz #78208 closed 19:00
moritz #100780 closed 19:00
moritz #76170 closed 19:01
moritz #78232 closed 19:02
moritz #76466 closed 19:03
did I miss anything?
vmspb Hi! Need more bugs? :) 19:15
diakopter ok 19:16
vmspb perl6: my $x=0; ($x+=1)+=10; say $x;
p6eval pugs b927740, rakudo ef4702, niecza v11-22-gbebf7a0: OUTPUT«11␤»
vmspb perl6: my $x=0; ($x++)+=10; say $x;
p6eval rakudo ef4702: OUTPUT«Cannot assign to a readonly variable or a value␤ in block <anon> at /tmp/2AKR7XFnE2:1␤ in <anon> at /tmp/2AKR7XFnE2:1␤»
..pugs b927740: OUTPUT«*** Can't modify constant item: VInt 0␤ at /tmp/oR8TI3NI0Y line 1, column 10-20␤»
..niecza v11-22-gbebf7a0: OUTPUT«Unhandled exception: assigning to readonly value␤ at /tmp/YtPCWUFQj2 line 0 (mainline @ 0) ␤ at /home/p6eval/niecza/lib/CORE.setting line 2224 (ANON @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 2225 (module-CORE @ 58) ␤ at /home/p6eval/niecza/li…
vmspb perl6: my $x=0; (++$x)+=10; say $x; 19:16
p6eval pugs b927740: OUTPUT«*** Can't modify constant item: VInt 1␤ at /tmp/REzJ6KasoL line 1, column 10-20␤» 19:16
..niecza v11-22-gbebf7a0: OUTPUT«11␤»
..rakudo ef4702: OUTPUT«Cannot assign to a readonly variable or a value␤ in block <anon> at /tmp/jo0I70OfsN:1␤ in <anon> at /tmp/jo0I70OfsN:1␤»
moritz vmspb: I believe the spec is silent on whether such modifiying operators should return lvalues or not 19:29
TimToady p5 is a bit inconsistent on this subject: it can modify a $x += 1 but not a ++$x, which should be equivalent 19:45
TimToady not that it's a style we encourage in any case... 19:46
japhb TimToady, out of curiosity, why *is* there a difference in Perl 5? 19:46
TimToady beats me
japhb Forgotten in the mists of time? ;-) 19:47
moritz hysterical raisons
TimToady possibly someone's optimizer wants ++$x to return an rvalue 19:47
dalek kudo/bigint: 1bef826 | moritz++ | src/Perl6/Actions.pm:
simplify escale action method
20:06
tadzik moritz: rt.perl.org/rt3/Ticket/Display.html?id=77184 rt.perl.org/rt3/Ticket/Display.html?id=100778 and we're done :) 20:07
moritz done, tadzik++ 20:08
cognominal_ wonder if I can define a lexical rule ws within another rule. Is this legal? Is this implemented? 20:09
I would say yes and now.
*no
cognominal_ I would want it now as my lapsus keyboardy shows. 20:10
moritz cognominal_: rule calls are method calls, unless explicitly done otherwise
moritz liek with <&foo> instead of <foo> or <.foo> 20:10
cognominal_ that's not the first time I want it to be regular function. 20:11
cognominal_ but I suppose the cursor want a class. 20:11
cognominal_ *wants 20:11
tadzik moritz++ 20:12
cognominal_ but when I create a mere regex, (I alway forget the perl 6 syntax), I suppose the said class is instanciated. 20:14
cognominal_ rx // # that's should be easy. Probably the hard part is to forget about qr// 20:15
cognominal_ rakudo is fussy, it wants rx// without space. 20:17
moritz std: rx // 20:19
p6eval std be1f10e: OUTPUT«===SORRY!===␤Null pattern not allowed at /tmp/BVgWTpE0sA line 1:␤------> rx /⏏/␤Parse failed␤FAILED 00:01 118m␤» 20:19
moritz std: rx /./
p6eval std be1f10e: OUTPUT«ok 00:01 120m␤»
moritz cognominal_: probably easy to fix 20:20
cognominal_ rakudo: grammar A { token TOP { :my &ws = rx/a/; :s b } }; A.parse("aba")
p6eval rakudo ef4702: ( no output )
cognominal_ rakudo: grammar A { token TOP { :my &ws = rx/a/; :s b } }; say A.parse("aba")
p6eval rakudo ef4702: OUTPUT«#<failed match>␤»
cognominal_ rakudo: grammar A { token TOP { :my &ws = rx/a/; :s b } }; say A.parse(" b ") 20:20
p6eval rakudo ef4702: OUTPUT«=> < b >␤␤»
cognominal_ moritz, what do you think? 20:21
moritz cognominal_: I don't know the regex stuff well enough to comment on the implications of such a change 20:22
I'm sure that the current spec doesn't say it picks up the lexical &ws
cognominal_ that would slow down thing 20:24
cognominal_ rakudo: grammar A { token TOP { :my const &ws = rx/a/; :s b } }; say A.parse(" b ") 20:24
p6eval rakudo ef4702: OUTPUT«===SORRY!===␤Malformed my at line 1, near "const &ws "␤»
cognominal_ I could compromise with a const... 20:25
cognominal_ anyway, I will cheat my way around... 20:25
cognominal_ that would get even weirder with &*ws :) 20:28
dalek ast: fbeaaf0 | moritz++ | S04-statements/for.t:
fix plan in for.t
sorear vmspb: ++$x in niecza returns an lvalue as a performance hack; it returns the existing scalar $x instead of having to create a new read-only scalar for the return value 21:01
vmspb: the hack doesn't work for $x++ because it has to return a different value
dalek p/bigint: bd5e5b0 | moritz++ | src/ops/nqp_bigint.ops:
fix the float case of pow_I
21:07
moritz -> sleep 21:09
tadzik g'night
lichtkind good night 21:57
dalek odel: 14f2cda | diakopter++ | lua/runtime/ (4 files):
15% overall speedup
22:06
tadzik how fast is that compared to nqp on parrot now? 22:07
diakopter tadzik: quite slow 22:11
diakopter tadzik: actually, it's slow when comparing with parrot-nqp 22:16
diakopter I haven't measured it against the 6model-based nqp (which would be a much more fair comparison) 22:17
diakopter parrot-nqp takes 2 seconds to decrement/compare a number 10,000,000 times; nqplua takes 312 seconds. (ick) 22:22
to decrement/compare a number 10,000 times takes 1,200,000 lua function calls
sorear diakopter: wazzit like on lua.org's lua? :) 22:46
diakopter good question 22:48
sorear: could I impose upon you a request for more debugging help? 22:49
dalek odel: 675122b | diakopter++ | lua/compiler/ (2 files):
break the build; request sorear++ to help debug
22:51
sorear Perhaps. What's the problem? 22:53
ick, you're inlining the pcall stuff 22:54
diakopter ick indeed, but if it works it will get rid of two extra closure creations (and invocations) per routine call
there is only one try/catch/finally per routine, luckily 22:55
sorear I don't understand the 15% changes 22:56
you're getting rid of the metatable setting, so how do method calls work anymore?
diakopter I took out all the method calls on List anyway 22:56
definite hotpaths 22:57
the speedup there was mostly from the capture inlining
sorear tries a build 22:58
diakopter ooo missed mberends 23:00
sorear not really 23:01
diakopter sorry; I meant list creation was a hotpath.
sorear diakopter: have you considered doing fetch-once for all the Ops methods that are used? local get_lex = Ops.get_lex 23:02
diakopter yeah; that should be done at some point 23:02
sorear looks at l[7945] = l[1452][1][2](l[1452][1], TC, l[1452], "add_attribute", -1); 23:03
I give up. Right now.
diakopter :/
dalek odel: 931a588 | diakopter++ | lua/compiler/PAST2LSTCompiler.pm:
unbreak the build
23:05
sorear if we're going to have code like that in the .lua files we need _readable_ IR files 23:06
diakopter unfortunately I don't have a good way of reversing the "optimizations" 23:07
tadzik have you tried that on luajit?
sorear tadzik: the code only works on luajit
tadzik oh, ok
sorear maybe use the C pre-processor for this. #define GET_LEX(name) Ops[90](name) 23:08
diakopter it doesn't have to; there are bitops libraries for lua too; I just set it to use 'bit' built into luajit since that's what I was using
diakopter I dont' understand why the TryCatchFinally is doing anything different from the TryFinally nested inside the TryCatch 23:10
er, vice versa
... from the TryCatch nested inside the TryFinally
diakopter pmurias' connection is flaky these days :) 23:11
sorear lexical scope funny business maybe
diakopter oh, found one bug 23:14
dalek odel: be2ed88 | diakopter++ | lua/compiler/LST2Lua.pm:
bug in TryCatchFinally
23:15
sorear diakopter: pmurias gets a pass for being a regular. clairvy bugs me more 23:15
japhb Wheee, Str.Numeric() rewrite is now a strict superset of the original (and significantly so). Sadly, it is also 36% slower right now, and there is still lots left to do to be fully spec-compliant. 23:26
At least I can think again finally. I hate it when sickness knocks out my brane.
sorear \o/ japhb 23:27
sorear I'd love to look at your complete impl sometime, steal some of it... ;) 23:27
japhb sorear, hopefully soon it will be ready to merge. I'd like to get it more complete though -- I've got some large subspaces to handle still. 23:29
tadzik hi japhb 23:35
japhb o/
[Coke] \o 23:52
sorear o/ [Coke] 23:53