»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by masak on 12 May 2015.
timotimo yes 00:02
sorry for the AFK
then you can get a better look at the backtrace
and you can also "print MVM_dump_backtrace(tc)" in the gdb session and get a backtrace of nqp and perl6 code 00:03
00:04 kurahaupo1 left 00:08 Ven joined
timotimo it's important to be in a frame where tc is available; sometimes gdb ends up in the wrong frame for me, but "frame 0" will fix that (almost every innermost frame will have tc, otherwise use "up" to find one that does) 00:11
00:12 virtualsue left 00:13 kurahaupo1 joined 00:16 colomon joined 00:24 Sqirrel left 00:28 Ven left, Sqirrel joined
timotimo now you've gone AFK on me :) 00:30
andreoss i've rebuilt it but still no debug symbols 00:32
i should try to put this option into rakudobrew somewhere 00:33
timotimo er, huh? 00:55
rebuilt and "make install"?
can you make sure your "perl6" is pointing at the right moarvm?
00:56 fhelmberger joined 01:00 Sqirrel left 01:01 fhelmberger left 01:04 gfldex left 01:11 itz_ joined, tinyblak joined 01:12 atta_ joined 01:13 sivoais_ joined, broquain1 joined 01:14 itz left, atta left, sivoais left, zoosha_ joined 01:15 Brock joined, awwaiid left 01:17 pochi_ joined, rvchangue joined, KotH_ joined 01:21 sivoais_ left 01:23 sivoais joined 01:28 pochi left, KotH left 01:30 sivoais left 01:33 sivoais joined, xiaomiao left 01:35 xiaomiao joined 01:42 adu joined 01:55 colomon left 01:58 colomon joined 02:10 adu left, kurahaupo1 left 02:18 andreoss left 02:21 colomon left 02:50 noganex joined 02:54 noganex_ left 03:19 adu joined 03:24 adu left 03:40 ilbelkyr joined 03:46 FROGGS_ joined 03:49 tinyblak left 03:50 kaare__ joined, FROGGS left 03:52 vendethiel- left 04:02 deepesh_ joined 04:06 skids joined 04:10 tinyblak joined 04:53 Sqirrel joined 04:57 fhelmberger joined 05:01 fhelmberger left 05:02 cognominal joined 05:21 deepesh_ left 05:24 cognominal left
tadzik timotimo: on it 05:35
05:35 BenGoldberg left 05:40 araujo joined
tadzik Ok, should be all good 05:40
05:52 jack_rabbit left 05:54 jack_rabbit joined 05:55 skids left 06:09 jack_rabbit left 06:23 kaare__ is now known as kaare_
FROGGS[mobile] o/ 06:46
raydiak good morning FROGGS 06:47
06:57 fhelmberger joined 07:01 diana_olhovik joined 07:02 fhelmberger left 07:04 vendethiel joined 07:06 kaare_ left
raydiak good night #perl6 07:06
07:16 kurahaupo1 joined 07:26 darutoko joined 07:27 vendethiel left 07:29 quester joined 07:38 espadrine joined, cognominal joined 07:51 FROGGS[mobile] left, cognominal left 08:03 KotH_ is now known as KotH
masak antenoon, #perl6 08:23
nwc10 good *, masak 08:26
08:30 adu joined 08:31 adu left 08:32 rindolf joined 08:35 kurahaupo1 left 08:42 domidumont joined 08:45 domidumont left 08:46 domidumont joined 08:51 eli-se joined 08:58 quester left 09:00 kaare_ joined 09:02 virtualsue joined 09:06 RabidGravy joined 09:09 vendethiel joined 09:13 virtualsue left 09:16 virtualsue joined
dalek href="https://perl6.org:">perl6.org: d1e3d0e | paultcochrane++ | source/documentation/index.html:
Make documentation location a bit more obvious
09:16
masak pre-cmmits to blogging today
commits*
...with fewer typos than in my /me statements :P 09:17
Juerd Does the search box work for anyone, on doc.perl6.org?
dalek c: 5a2cebc | paultcochrane++ | lib/Type/IO/Path.pod:
Correct minor typo
09:18
masak Juerd: works here. searched for 'Array': doc.perl6.org/type/Array
Juerd Ah, there's no feedback when nothing's found, but it does work! 09:19
masak Juerd: please submit an issue about that, kthx 09:20
09:20 Alina-malina left, Alina-malina joined
[ptc] thinks unary hyperoperators rock 09:23
just had to say that...
masak [ptc]: there's something interesting going on in that area, for sure. 09:24
[ptc]: jQuery manages to hyperthread over a collection without *any* extra syntax! o.O
(or put differently, jQuery just assumes everything happens inside the List monad) 09:25
Juerd masak: jQuery's silent acceptance of empty collections is annoying, though!
[ptc] masak: it simplifies the code so much, it's *very* nice to use
masak Juerd: I only find it annoying on a theoretical level. it's never bothered me in practice.
Juerd: in the cases where I do care, I check for length == 0
[ptc] masak: reminds me of how one used to have to program Matlab before Matlab got JIT: one *had* to think in terms of vectors in order to have reasonably fast code 09:26
Juerd masak: It's annoying when you meant to match exactly one thing, and you got none
$("#foo").bar()
09:26 eli-se left
Juerd That will just silently do nothing if there is no #foo. 09:26
While to human readers it's absolutely clear that you meant to match exactly 1 element.
masak Juerd: sounds like you could use a jQuery plugin .guard() or something, that makes sure something is there, or else dies in a fire.
Juerd masak: I've been thinking about extending the selector syntax 09:27
masak hm.
Juerd $("1 #foo"), $("+ .bar"), $("* a")
masak maybe just add a different method to do selection, but keep the selector syntax?
09:28 gfldex joined
Juerd * is in use, but the only thing that isn't in * is <html> itself, so only for "* html" it would work slightly differently (it would suddenly match, while normally it shouldn't) 09:28
masak $.selectOne("#foo")
Juerd masak: In all the jQuery code I've ever written, selecting 1 or + would happen more than *, so a named method would be poor huffman coding 09:29
In fact, defaulting to + would make sense to me. 09:30
masak $$("#foo")
Juerd That looks like 2 or more.
masak hehe
$1("$foo")
Juerd I don't think you can do that in javascript. Let's try. 09:31
$1 is a reserved thingy.
masak I didn't get an error in Chrome Dev console, but the variable doesn't seem to stick, either
Juerd My Chromium console says $1 is not a function 09:32
masak I think there might be interference with "special" variables that Chrome dev env keeps.
Juerd When trying to call it, there is
masak need to try it in a script in the browser.
Juerd s/there/that/
09:33 vendethiel left
masak indeed. works in a script in an HTML file. 09:33
var $1 = function(s) { alert(s) }; $1("OH HAI"); // alerts "OH HAI" 09:34
Juerd Wow. 09:35
09:41 virtualsue left 09:42 Ven joined 09:43 vendethiel joined 09:54 smls joined 10:00 burnersk left, [ptc] left
smls Am I imagining that there was some easy&elegant way to 'merge' pair lists into a hash of arrays? I can't remember what is was... 10:08
I.e. given something like (a => 1, a => 2, b => 3) produce { a => [1, 2], b => [3] }
(or alternatively { a => [1, 2], b => 3 } since items can be treated as single-element lists so it doesn't make much difference.)
going the .classify route ends up being more messy/unelegant then I would like 10:09
m: say (a => 1, a => 2, b => 3).Mix.perl 10:10
camelia rakudo-moar 800f70: OUTPUT«("a"=>3,"b"=>3).Mix␤»
smls ^^ something more like this would be nice, except pushing instead of adding.
Ah, I was probably thinking of .Hash::push 10:13
m: my %a; %a.push($_) for (a => 1, a => 2, b => 3); say %a.perl
camelia rakudo-moar 800f70: OUTPUT«{:a([1, 2]), :b(3)}<>␤»
smls Not very functional though :( 10:14
m: say (a => 1, a => 2, b => 3).reduce({ $^a.hash.push: $^b }).perl 10:16
camelia rakudo-moar 800f70: OUTPUT«{:a([1, 2]), :b(3)}<>␤»
smls ^^ I suppose this works...
Alright, gonna stop spamming the channel with my monologue now :P 10:17
10:30 sue__ joined 10:48 mj41 joined 11:11 [ptc] joined 11:19 rindolf left
itz_ isn't smoke.perl6.org "stuck"? 11:30
11:37 Gothmog_ joined 11:41 Bucciarati joined 11:43 rindolf joined 11:46 diana_olhovik left
dalek href="https://perl6.org:">perl6.org: ab98067 | paultcochrane++ | source/community/index.html:
Mention smoke.perl6.org on the community page.
12:06
[ptc] come to think of it, what's the difference between testers.perl6.org and smoke.perl6.org? 12:07
masak the Type Hints PEP is accepted. news.ycombinator.com/item?id=9592637
[ptc] both show the testing status of the modules in the ecosystem, right?
Ven masak: irclog.perlgeek.de/perl6/2015-05-23#i_10647134 :P 12:08
12:10 kshannon left 12:11 kshannon joined 12:12 kshannon left
smls m: say (2, 4, 6, 8).rotor(2, -1).perl 12:12
camelia rakudo-moar 800f70: OUTPUT«((2, 4), (), (4, 6), (), (6, 8), ())␤»
smls ^^ Where are the empty parcels coming from?
12:14 tinyblak left
lizmat smls: good question 12:14
I was just looking at your classification problem :-) 12:15
smls :) 12:16
should I rekudobug the rotor thing?
lizmat not yet, let's see if I can fix that in the next 20 mins or so
smls ok 12:17
12:17 BenGoldberg joined
lizmat $ 6 'my %h = (a => 1, a => 2, b=> 3).classify(*.key, :what(*.value)); say %h.perl 12:17
{:a([1, 2]), :b([3])}<> 12:18
smls: that's what you were looking for, right ?
smls yes
lizmat perhaps :what should be called :as
Ven m: say (^50).classify(* % 3).perl 12:19
camelia rakudo-moar 800f70: OUTPUT«Cannot call infix:<===>(Any, Mu); none of these signatures match:␤ (Any $?)␤ (Any $a, Any $b)␤ (Int:D \a, Int:D \b)␤ (int $a, int $b)␤ (Num:D \a, Num:D \b)␤ (Num $ where { ... }, Num $ where { ... })␤ (num $a, num $b --> …»
12:19 berekuk joined, berekuk left 12:20 laouji joined
smls lizmat: :as is used in .squish for something different 12:21
though maybe .squish's :as should be changed to :by, to match .sort
lizmat keeping :as for now, we can bikeshed it later, when TimToady is around again 12:24
or scrap altogether if it feels like adding too much functionality
smls m: say (2, 10, 1).sort :by(~*); say (2, 10, 1).sort(~*) 12:26
camelia rakudo-moar 800f70: OUTPUT«1 2 10␤1 10 2␤»
smls Hm, I thought the adverb form was allowed there
12:27 spider-mario joined
smls .classify(by => *.key, as => *.value) reads quite nicely I think ;) 12:28
12:29 colomon joined
dalek kudo/nom: 922bcf0 | lizmat++ | src/core/ (2 files):
Introduce :as parameter to classify

Use case: my %h = (a => 1, a => 2, b=> 3).classify(*.key, :what(*.value)); say %h.perl
  {:a([1, 2]), :b([3])}<>
Inspired by smls++'s comments at:
   irclog.perlgeek.de/perl6/2015-05-24#i_10648933
12:30
lizmat if this gets consensus, .categorize will probably need the same treatment
but I'm leaving that out in the open, as I'm not writing any tests for it either yet 12:31
Oops, I left the :what in the commit message
anyways, the intent should be clear :-)
smls: I think '.classify(*.key, as => *.value)' also reads nicely 12:32
smls squish could get something similar as well, to let you specify a replacement element for a squished sequence instead of always replacing it with its first element. 12:33
Ven lizmat: why does the commit message mention ":as"?
sounds like a typo on the first line :)
lizmat Ven: because that's what I implemented
the :what is the typo
Ven ah, alright, thanks
lizmat++ # I agree that mapping over a list of Pairs/a hash maybe could be easier
smls (a => 1, a => 2, b=> 3).squish(*.key, :as => { $(@_) }) # same as the classify example but returning a list with preserved order rather than a hash? 12:36
12:37 colomon left, colomon joined 12:38 koo6 left, domidumont left
smls m: say (2, 4, 6, 8).rotor(2 => -1).perl 12:39
camelia rakudo-moar 800f70: OUTPUT«((2, 4), (4, 6), (6, 8))␤»
smls ah, rotor works after all, i just mistakenly used , instead of => above
lizmat ah! 12:40
but in interesting WAT nonetheles
*an
mj41 Hi. I just finished roast-data chart. github.com/mj41/Perl6-Analytics-re...d#id-tests ... Does any other chart exist?
lizmat *nonetheless
mj41 coke++ for roast-data repo
smls lizmat: maybe it should warn when given a negative cycle length? 12:41
after all, when you really want the current behavior you could specify it using two cycles instead: 12:43
m: say (2, 4, 6, 8).rotor(2, 0 => -1).perl
camelia rakudo-moar 800f70: OUTPUT«((2, 4), (), (4, 6), (), (6, 8), ())␤»
12:44 tinyblak joined
lizmat yeah, so it should die with <1 as cycle length 12:44
unfortunately, we would need to check the cycle in advance for -1 12:45
smls another small WAT about the rotor function is that when called without arguments, it never finishes 12:47
maybe it assumes a cycle length of zero?
s/function/method/ 12:48
12:50 tinyblak_ joined 12:53 tinyblak left, sue__ left
lizmat $ 6 'say (2, 4, 6, 8).rotor(2, -1).perl' 12:54
===SORRY!===
Cannot have elems < 1, did you mean to specify a Pair with => -1?
$ 6 'say (2, 4, 6, 8).rotor.perl'
Must specify *how* to rotor a List
smls lizmat++
lizmat hmmm... feels overdone to create a seperate MMD candidate for that, if rotor(my @) would hang 12:57
dalek kudo/nom: b9b7f4c | lizmat++ | src/core/List.pm:
Put some sanity testing in List.rotor, smls++
13:00
13:02 [ptc]_ joined, burnersk joined
smls
.oO( *@slurpy ---> +@nonempty-slurpy )
13:03
13:04 colomon left
lizmat hmmm... seems I broke something 13:08
masak hehe. I've trained my brain to genuinely not care about the (alleged) nuanced differences between "weak typing" and "dynamic typing". which means I can skip large parts of the HN thread discussion. :P 13:10
anyway, verdict: Python is going the TypeScript route. typing gets done at the tooling layer. color me interested. 13:11
well, um, Python 3.x, that is. *cough*
13:11 telex left 13:12 telex joined 13:13 Vlavv joined 13:15 [ptc] left, [ptc]_ is now known as [ptc]
moritz thinks that having "type hints" instead of type constraints is a mistake 13:16
13:16 BenGoldberg left
lizmat m: ((@) xx *)[0] # interesting way of hanging yourself 13:16
13:17 BenGoldberg joined
camelia rakudo-moar 922bcf: OUTPUT«(timeout)» 13:17
13:17 smls left
lizmat perhaps xx should check for empty lists 13:17
vendethiel m: say @
camelia rakudo-moar 922bcf: OUTPUT«␤»
lizmat m: say state @ 13:18
camelia rakudo-moar 922bcf: OUTPUT«␤»
dalek kudo/nom: 93e61dc | lizmat++ | src/core/List.pm:
Handle checking for infinite lists
13:19
13:24 Ven left
masak moritz: it is whenever one writes the type hints without validating/asserting them. 13:25
lizmat m: Hash[Any,Any].new.perl # golfed vendethiel++ problem with .classify
camelia rakudo-moar b9b7f4: OUTPUT«Cannot call infix:<===>(Any, Mu); none of these signatures match:␤ (Any $?)␤ (Any $a, Any $b)␤ (Int:D \a, Int:D \b)␤ (int $a, int $b)␤ (Num:D \a, Num:D \b)␤ (Num $ where { ... }, Num $ where { ... })␤ (num $a, num $b --> …»
13:31 bjz left
dalek kudo/nom: 0f0e73f | lizmat++ | src/core/Hash.pm:
Fix Hash[Any,Any].new.perl failure, vendethiel++
13:32
vendethiel lizmat++
13:35 eli-se joined 13:36 burnersk left, [ptc] left
moritz masak: well, the "asserting" part should be automatical 13:36
13:37 burnersk joined, [ptc] joined 13:38 burnersk left, [ptc] left
moritz masak: IME the possiblity of type annotations is just too tempting, so too many folks will use them even though they don't (or can't, because they don't have the tooling) verify them 13:38
masak moritz: I wonder why that is. 13:39
a sense of wanting to be descriptive and tidy, perhaps?
13:40 [ptc] joined, burnersk joined
Juerd Heck, there are people who insist on using Perl 5 prototypes on methods, even if they know it's utterly useless. 13:41
moritz masak: yes, and the feeling of providing some sort of extra safety, even if it'll only work in an imagined future where type checking is on by default
13:42 araujo left
lizmat afk& 13:43
masak hm.
vendethiel Juerd: don't prototypes change the parsing rules?
oh, they don't for a->b() 13:44
moritz vendethiel: not for methods
vendethiel alright
vendethiel thought people stopped using prototypes altogether, except for \
masak so maybe Python should have gone more the TypeScript route, encouraging/forcing people to write in a "TypeThon" superset of the language, whose tools are mandatory or at least hard to turn off.
moritz masak: we've had that in Perl 6 land; people wrote types on their routine declarations, and when we enforced them, turned out that about a quarter of them were wrong
13:44 burnersk left
masak *nod* 13:45
Juerd Never have any dead code, even if it's just declarations.
At the very best, it will have been correct at one point but gets out of sync.
13:46 [ptc] left
masak was gonna say. it's tempting fate to write anything that never runs as it's authored. 13:46
vendethiel "comments = dead code" :P
masak writing things test-first kind of breaks one out of that bad habit a little.
Juerd I've written Perl 6 code long before there was any implementation to test my code, and I'm quite sure that none of it would even compile... :D)
vendethiel 0xD34DC0D3
Juerd s/\)//
vendethiel Juerd: depends, which perl6? :) 13:47
Juerd vendethiel: Comments aren't code
vendethiel: The postapocalyptic one.
I don't remember if it was presynoptic. 13:48
dalek c: 90b5c64 | moritz++ | lib/Pod/Htmlify.pm6:
htmlify: Always explicitly link to the gh repo in the footer

Closes #85.
13:49
Juerd moritz++ \o/
moritz Juerd++ # reporting doc.perl6.org bugs
13:50 tinyblak_ left
moritz though currently, rebuild of doc is broken anyway :( 13:50
because it has an old-ish rakudo installed, which doesn' understand the 'unit' declarator :( 13:51
13:51 [ptc] joined, burnersk joined, [ptc] left, burnersk left
moritz rakudobrews 13:51
last successful build was 2015-05-16 13:52
13:52 [ptc] joined, burnersk joined 13:54 Sqirrel left
moritz wow, that was quick :-) 13:55
13:56 Sqirrel joined, koo6 joined 14:06 flussenc1 joined 14:07 flussenc1 left, flussence joined 14:17 BenGoldberg left, BenGoldberg joined 14:20 [ptc] left, burnersk left 14:23 [ptc] joined, [ptc] left 14:24 [ptc] joined, burnersk joined
Ulti Stage parse : 28198.047 the miracles of standby 14:26
14:27 flaviusb left
dalek c: 8cf8c22 | moritz++ | type-graph.txt:
X::OS is Exception
14:31
14:40 colomon joined 14:45 bbkr joined
mj41 12 months: lizmat++ > jnthn++ :-) github.com/mj41/Perl6-Analytics-re...d-top30-12 14:48
moritz mj41: you might want to include perl6/doc in the analysis 14:52
(especially if you want to boost my ranking :-) )
mj41 moritz: ok, np ... see github.com/mj41/Perl6-Analytics/tr...aster/data 14:54
dalek c: bb4bd0e | moritz++ | type-graph.txt:
Type graph: control exceptions
14:56
14:59 fhelmberger joined
moritz Juerd: the doc.perl6.org has now been rebuilt 15:00
15:04 fhelmberger left
mj41 moritz: it's already there github.com/mj41/Perl6-Analytics/bl...json#L1006 15:10
697 commits by you
tadzik Hmm, someone called?
mj41 moritz: all in grey color are not shown in legend 15:11
15:11 eli-se left 15:17 BenGoldberg left, Ben_Goldberg joined 15:28 skids joined, grondilu joined, laouji left 15:32 eli-se joined 15:45 [TuxCM] joined 15:51 [Tux] left 15:54 Khisanth left, [Tux] joined 15:56 [TuxCM] left
japhb Anyone know if there's a plan to get coercive types for class attributes? e.g. class Foo { has Int() $.v; } 15:58
16:00 Khisanth joined 16:01 rindolf left
FROGGS_ hmmmm, that might not even be too hard 16:01
16:04 rindolf joined 16:05 colomon left
mst hates class attributes so much 16:08
if you make them easy, people use them for global variables all over the place
and then congratulate themselves on not using globals 16:09
16:09 diana_olhovik joined
jnthn confusing, has declared an instance attribute :P 16:10
yoleaux 23 May 2015 15:34Z <Ven> jnthn: typing "s" in the debugger gives me (with --ll-exception) this stack trace: gist.github.com/vendethiel/80b612785402162de022 . It also seems, when stepping (via enter) that the "grammar mode" (that shows which part matched already/didn't match yet) is not appearing anymore
jnthn *declares
timotimo o/
jnthn japhb: Yes, eventually
16:11 liztormato joined, itz2 joined
liztormato mst: I don't think that is what japhb means 16:11
mst oh, right 16:12
he said 'class attribute' but didn't actually meant 'class attribute'
never mind then
jnthn "my $.foo" gets you a class attribute, fwiw :)
mst well, please apply my rage to that syntax then, or something ;)
leedo_ i was just wondering how you'd even get a class attribute, jnthn++
jnthn People who are bad enough at software design will find a way to re-invent global variables in any language. :)
timotimo what if it doesn't have a .? just means there's no accessor?
jnthn timotimo: Then it's just a normal lexical :)
timotimo right, but its lifetime will remain bound to the class, i.E. it will not be cloned? 16:13
jnthn timotimo: Correct. 16:14
Whereas if it's in a role you get one per composition of the role
16:14 liztormato_ joined
liztormato_ I find that almost as confusing as "has $a" to mean "has $!a" 16:14
16:14 ggoebel joined
jnthn I think that one is a sop to the twigil-fearers :) 16:15
liztormato_ Yeah. And I still feel we should get past that. It is inconsistent I think 16:16
timotimo i don't like "has $a", either
16:17 liztormato left, liztormato_ is now known as liztormato
jnthn It doesn't bother me enough to want to be rid of it :) 16:18
16:18 Khisanth left
liztormato Cycling some more& 16:19
16:19 liztormato left
nwc10 misread twigil-fearer as twigil-farmer, and was imagining folks in unlit rooms breeding symbols to sell on to time (or typing) poor programmers 16:19
16:19 Khisanth joined
jnthn has a hungry 16:19
nwc10 make with the noms!
jnthn I think we'll go out. :) 16:20
And since I got up at 4:30am today, I'll probably sleep after. I'll have some tuits tomorrow though :)
nwc10 you're doing better than I would. I'd stil have a sleep deficit 16:21
jnthn I still do, but doesn't stop me being hungry :)
anyways, bbt :)
nwc10 oh, I meant tomorrow
jnthn oh :)
nwc10 and yes, enjoy food
jnthn Well, we'll see :)
o/
timotimo o/
mst I thought $a was going to reliably be a lexical, i.e. a 'my' variable 16:30
and then $!a was an object attr
how do I tell the difference between 'has $a' and 'my $a' where $a is being used otherwise?
16:36 itz2 left 16:38 colomon joined
moritz mst: you don't; hence it's best practise to use the ! form for attrs 16:41
16:41 skids left 16:48 Khisanth left, Khisanth joined
Ulti ooc what is the fastest form of loop in Rakudo? 16:56
assuming I am doing something super tight and numeric rather than iterating a list
16:59 Khisanth left, Khisanth joined 17:01 colomon left 17:02 colomon joined
mst moritz: which makes me feel like I dislike it for the same reasons as lizmat 17:03
jnthn: if anybody does get annoyed enough to offer a patch to remove it, consider me to've +1'ed the idea, for what little it's worth :) 17:04
17:09 Khisanth left, domidumont joined
masak `has $a;` is something I would never write in my own code. I don't mind having it in the language, though. maybe someone will absolutely love it. 17:10
m: class C { has $a }; say C.^attrs 17:11
camelia rakudo-moar 0f0e73: OUTPUT«Method 'attrs' not found for invocant of class 'Perl6::Metamodel::ClassHOW'␤ in block <unit> at /tmp/8iYOtpMutl:1␤ in any <unit-outer> at /tmp/8iYOtpMutl:1␤␤»
masak m: class C { has $a }; say C.^attributes
camelia rakudo-moar 0f0e73: OUTPUT«Mu $!a␤»
masak ooh, the MOP still calls it '$!a'. I suppose that's good news for people who do .substr(2) to get the post-twigil name. :P 17:12
17:13 Khisanth joined 17:14 ggoebel left, ShimmerFairy joined 17:16 laouji joined 17:21 laouji left 17:27 Khisanth left 17:28 Khisanth joined
moritz m: class C { has $a; method f { $!a } }; 17:30
camelia ( no output )
moritz oh, and $!a is still available
mst this feature just gets better and better
moritz :/
moritz would not object to removing it 17:31
there are a few uses in the ecosystem 17:33
Text::Emotion, Net::IRC, bioperl, perl6parsing, hinges, db-orm-quicky 17:34
dalek c: 39908b7 | moritz++ | lib/Language/functions.pod:
Avoid unidiomatic use of "has $no-twigil" in unrelated example
17:35
17:36 xfix joined
grondilu thinks 'has $a' is fine 17:36
masak $!a still being available under `has $a` is by spec.
the other way around doesn't work, though.
Juerd I'm fond of 'has $a'
masak I suggest not removing it before conferring with TimToady++, who usually has something deep to say about things like this.
Juerd The use case I have in mind, is easy switching between class and instance attribute if you change your mind later, which I tend to do. 17:37
And I find the ! twigil ugly :P
vendethiel always finds the ! twigil *very* confusing, and misreads "!$!x" often 17:38
17:38 xinming joined
eli-se good thing you don't need $! as there's more than one way to do it! 17:39
grondilu likes the $! twigil
but I think it can be implicit during declaration. 17:40
17:40 colomon left, mj41 left 17:41 Khisanth left
Juerd vendethiel: Yes, in my mind, ! is still something that negates. 17:41
$!apple reads almost like $banana
17:42 Khisanth joined
eli-se have a snapple 17:43
17:46 khisanth_ joined, Khisanth left 17:51 khisanth_ left 17:52 spider-mario left 17:53 Ven joined 17:59 mj41 joined 18:00 khisanth_ joined
ugexe Can I fire off a Proc::Async from a different directory without changing my script's CWD? Like Proc::Async.new("/home/ugexe","ls")... with `shell` I would do shell("(cd /home/ugexe && ls)") 18:07
japhb returns from @family-related distractions 18:08
mst: As a couple people mentioned, I did indeed mean instance attribute, not class attribute, because tired
mst japhb: aye. no worries. 18:09
japhb As for the 'has $a' debate, while I personally don't favor it, I understand Juerd's point. The only thing in the above (skimmed) discussion I found worrying is the $!a still being available. 18:10
* Juerd's point*s*
18:12 khisanth_ left, khisanth_ joined
lizmat m: class A { has $a; my $.a = 42}; A.new.a.say # I'm not sure I want to understand this one 18:13
camelia rakudo-moar 0f0e73: OUTPUT«42␤»
masak m: class A { has $a }; say A.^attributes[0].^methods 18:14
camelia rakudo-moar 0f0e73: OUTPUT«<anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> compose apply_handles get_value set_value container has-accessor readonly package inlined WHY set_why Str gist␤»
masak m: class A { has $a }; say A.^attributes[0].has-accessor 18:15
camelia rakudo-moar 0f0e73: OUTPUT«False␤»
masak lizmat: looks like a bug to me.
jdv79 [ptc]: i think smoke and testers could be unified
dalek kudo/nom: 24aca6a | lizmat++ | src/core/ (2 files):
List|Parcel.eager should only work on instances
jdv79 .seen tony-o
yoleaux I saw tony-o 12 May 2015 02:55Z in #perl6: <tony-o> i used fluxbox up until trying xfce a couple of months ago
18:16 egrep left
jdv79 .tell tony-o HTML::Parser::XML seems broken and/or super slow 18:16
yoleaux jdv79: I'll pass your message to tony-o.
18:16 egrep joined
lizmat vendethiel: my last commit still didn't fix "my %h = classify { "foo" }, ()" 18:17
it looks like it's getting an instantiated Parcel without the $!storage defined :-(
jdv79 when will all this "churn" be over? its hard to do anything without running into ruins:( 18:19
Ven lizmat: I wasn't the one using it at first :)
I just tried to reduce the sample 18:20
lizmat m: my %h = ().classify({"foo"}); say %h.perl # works fine
camelia rakudo-moar 0f0e73: OUTPUT«Cannot look up attributes in a type object␤ in block <unit> at /tmp/2JHExcz2eR:1␤ in any <unit-outer> at /tmp/2JHExcz2eR:1␤␤»
lizmat no? 18:21
tony-o_ jdv79: i think it's the deprec warnings that make it extra slow
18:21 laouji joined
jdv79 well, i tried to load up yahoo.com and it took maybe 45s 18:21
and then i tried to load up a few other sites and it never stopped - i killed after 5 mins
lizmat jdv79: deprecation warnings generate backtraces for each warning: they're expensive! 18:22
(although less expensive than they used to be)
jdv79 how do i know if that's what is causing the seemingly never ending processing?
strace said just mem (brk)
tony-o_ jdv79: i have an open issue on it that i'm working on right now where it broke bc of the changes to Nil 18:23
jdv79 the one on the test i submitted?
lizmat jdv79: if Deprecation.report -> $deprecations { say $deprecations }
tony-o_ oh you did open that
jdv79 yeah, that got it to install but after that then i ran into molasses at runtime 18:24
maybe i'll poke at it later
grondilu std: if Bool.pick -> $x {...}
camelia std 28329a7: OUTPUT«Potential difficulties:␤ $x is declared but not used at /tmp/OnlbfnZArO line 1:␤------> 3if Bool.pick -> 7⏏5$x {...}␤ok 00:00 139m␤»
jdv79 lizmat: thanks. i'll try it later.
gotta run
grondilu m: while (^10).pick -> $p { say $p } 18:26
18:26 laouji left
camelia rakudo-moar 0f0e73: OUTPUT«6␤4␤6␤» 18:26
grondilu so I guess I can use that syntax for rosettacode.org/wiki/Temperature_co...ion#Perl_6
18:28 khisanth_ left, khisanth__ joined
lizmat grondilu: I'm surprised to see that while loop end 18:29
18:29 kaare__ joined
lizmat I think that's a bug 18:29
Ven m: say (^10).roll(50)
camelia rakudo-moar 0f0e73: OUTPUT«3 2 4 2 3 7 1 4 1 1 1 5 0 8 5 2 4 0 7 1 8 5 9 2 9 8 4 3 8 9 2 4 8 8 1 3 0 5 7 6 2 7 2 8 7 0 9 9 9 8␤»
Ven m: say any((^10).roll(50)) == 0 # what's wrong?
camelia rakudo-moar 0f0e73: OUTPUT«any(False, True, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False, True, False, False, False, Fals…»
lizmat Ven: either it should run 10 times, or it should run indefinitely 18:30
Ven I don't get why it should do that? .pick should just pick one of the possible value and return it
lizmat yes, but it will *always* be a true value, so by that reasoning it should run indefinitely 18:31
or it should run until exhausted
grondilu doesn't it stop when it returns 0?
Ven ? ^10 means 0..9
lizmat ah, duh
*sigh*
18:32 smls joined
grondilu maybe we need a prefix for 1..$n 18:32
Ven good thing it's so easy to add :)
18:32 khisanth__ left
lizmat ^^10 would be 0^..^10 18:33
18:33 kaare_ left
Ven 's grip with "^" is mostly precedence, but that can't be fixed 18:33
m: augment class Int { method cir { ^self } }; say 5.reduce(2* *) 18:36
camelia rakudo-moar 0f0e73: OUTPUT«5===SORRY!5=== Error while compiling /tmp/IBzu7dyGPo␤augment not allowed without 'use MONKEY-TYPING'␤at /tmp/IBzu7dyGPo:1␤------> 3augment class Int7⏏5 { method cir { ^self } }; say 5.reduce(␤ expecting any of:␤ generic role␤»
Ven m: use MONKEY-TYPING; augment class Int { method cir { ^self } }; say 5.reduce(2* *)
camelia rakudo-moar 0f0e73: OUTPUT«5␤»
18:36 khisanth__ joined
smls lizmat: I had submitted a rakudobug about the Hash[Any,Any] .perl bug yesterday, did you see it? 18:37
lizmat not consciously :-)
tony-o_ .tell jdv79 i have 29s for parsing yahoo.com , it does seem excessive but it's quite possibly because the code was meant to get us by until we had libxml bindings (or if someone needed a PP parser) 18:38
yoleaux tony-o_: I'll pass your message to jdv79.
lizmat smls: do you have a ticket number handy? 18:41
smls #125242
lizmat hmmm... seems to not have gotten a mail about that :-( 18:42
Ven m: use MONKEY-TYPING; augment class Int { method cir { ^self } }; say 5.cir.reduce(2* *) 18:43
camelia rakudo-moar 0f0e73: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in block <unit> at /tmp/J5eNn5L_KB:1␤ in any <unit-outer> at /tmp/J5eNn5L_KB:1␤␤»
18:46 spider-mario joined
Ben_Goldberg m: say 1 R, 2 R, 3 R, 4; 18:46
camelia rakudo-moar 0f0e73: OUTPUT«2 1␤»
masak huh. 18:48
dalek osystem: 08a6f57 | (Sterling Hanenkamp)++ | META.list:
Add Path::Router to the Perl6 ecosystem
18:50 eli-se left
lizmat moritz masak: is there a reason why t/02-rakudo is not included in "make test" ? 18:52
18:53 andreoss joined
smls m: say (1..500).classify 18:59
camelia rakudo-moar 24aca6: OUTPUT«Cannot call classify(Int: Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, …»
smls that's quite the error message ;)
masak even an Int invocant argument... o.O
18:59 colomon joined 19:04 colomon left
lizmat wow 19:05
dalek kudo/nom: bdf5c7d | lizmat++ | t/01-sanity/55-use-trace.t:
Add basic "use trace" sanity test
19:10
19:14 khisanth__ left
tony-o_ what should that .classify produce? 19:15
moritz tony-o_: a hash
lizmat: I'm not aware of any reason 19:16
lizmat no, it should die on lack of a $test
m: say (^10).classify({$_})
camelia rakudo-moar 24aca6: OUTPUT«0 => 0, 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9␤»
lizmat m: say (^10).classify(*) 19:17
camelia rakudo-moar 24aca6: OUTPUT«Cannot look up attributes in a type object␤ in block <unit> at /tmp/Q__YtnwodE:1␤ in any <unit-outer> at /tmp/Q__YtnwodE:1␤␤»
moritz oh, /me didn't read properly 19:18
19:18 domidumont left
lizmat $ 6 '(1..1).classify' 19:22
Must specify something to classify with, a Callable, Hash or List
$ 6 '(1..1).classify(*)'
Doesn't make sense to classify with itself
b2gills m: say (^10).classify(+*)
camelia rakudo-moar 24aca6: OUTPUT«0 => 0, 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9␤»
tony-o_ m: say (^10).classify({ 0 => $_ }); 19:23
camelia rakudo-moar 24aca6: OUTPUT«(0 => 0) => 0, (0 => 1) => 1, (0 => 2) => 2, (0 => 3) => 3, (0 => 4) => 4, (0 => 5) => 5, (0 => 6) => 6, (0 => 7) => 7, (0 => 8) => 8, (0 => 9) => 9␤»
tony-o_ m: say (^10).classify(:key(0), :values(*)); 19:24
camelia rakudo-moar 24aca6: OUTPUT«Cannot call classify(Int: Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Whatever); none of these signatures match:␤ (Any: Any $test, Any |c)␤ (Any: Any $test, Any :into($into)!, Any |c)␤ in block <unit> at /tmp/IDFyL6vvGd:1␤ in any <uni…»
masak m: say (0 => ((0 => 0)).perl
camelia rakudo-moar 24aca6: OUTPUT«5===SORRY!5=== Error while compiling /tmp/WtDYSD6cfg␤Unable to parse expression in parenthesized expression; couldn't find final ')' ␤at /tmp/WtDYSD6cfg:1␤------> 3say (0 => ((0 => 0)).perl7⏏5<EOL>␤ expecting any of:␤ statemen…»
tony-o_ m: say (^10).classify(:key(0), :values({$_})); 19:25
masak m: say (0 => (0 => 0)).perl
camelia rakudo-moar 24aca6: OUTPUT«Cannot call classify(Int: Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Block); none of these signatures match:␤ (Any: Any $test, Any |c)␤ (Any: Any $test, Any :into($into)!, Any |c)␤ in block <unit> at /tmp/kqWHTIfNvz:1␤ in any <unit-o…»
rakudo-moar 24aca6: OUTPUT«0 => 0 => 0␤»
b2gills m: say (^10).categorize: { ($_ %% 2 ?? 2 !! Empty), ($_ %% 3 ?? 3 !! Empty) } 19:26
camelia rakudo-moar 24aca6: OUTPUT«2 => 0 2 4 6 8, 3 => 0 3 6 9␤»
b2gills m: say (^10).categorize: { ($_ %% 2 ?? 2 !! ()), ($_ %% 3 ?? 3 !! ()) }
camelia rakudo-moar 24aca6: OUTPUT«p6listitems may only be used on a concrete List␤ in block <unit> at /tmp/Js02IV9nNg:1␤ in any <unit-outer> at /tmp/Js02IV9nNg:1␤␤»
dalek kudo/nom: bfbf833 | lizmat++ | src/core/Any.pm:
Add some sanity to Any.(classify|categorize)
andreoss m: sub is-pandigital($n) { so all $n.comb.one == all 1..9 }; is-pandigital(12365789).say; 19:28
camelia rakudo-moar 24aca6: OUTPUT«False␤»
andreoss m: sub is-pandigital($n) { so all $n.comb.one == all 1..9 }; is-pandigital(412365789).say;
camelia rakudo-moar 24aca6: OUTPUT«True␤»
19:28 cognominal joined
timotimo m: sub is-pandigital($n) { bag $n.comb == 9 }; is-pandigital(412365789).say; 19:30
camelia rakudo-moar 24aca6: OUTPUT«bag(True)␤»
timotimo m: sub is-pandigital($n) { bag($n.comb) == 9 }; is-pandigital(412365789).say;
camelia rakudo-moar 24aca6: OUTPUT«True␤»
timotimo m: sub is-pandigital($n) { bag($n.comb) == 9 }; is-pandigital(12365789).say;
camelia rakudo-moar 24aca6: OUTPUT«False␤»
timotimo m: sub is-pandigital($n) { bag($n.comb) == 9 }; is-pandigital(111111111).say;
camelia rakudo-moar 24aca6: OUTPUT«True␤»
timotimo m: sub is-pandigital($n) { bag(|$n.comb) == 9 }; is-pandigital(111111111).say;
camelia rakudo-moar 24aca6: OUTPUT«True␤»
timotimo uh?
19:31 zakharyas joined
timotimo m: sub is-pandigital($n) { set(|$n.comb) == 9 }; is-pandigital(111111111).say; 19:31
camelia rakudo-moar 24aca6: OUTPUT«False␤»
timotimo that's it
m: sub is-pandigital($n) { set(|$n.comb) == 9 }; is-pandigital(123456789).say;
camelia rakudo-moar 24aca6: OUTPUT«True␤»
timotimo m: sub is-pandigital($n) { set(|$n.comb) == 9 }; is-pandigital(123456780).say;
camelia rakudo-moar 24aca6: OUTPUT«True␤»
timotimo this doesn't fit the definition, though, right?
andreoss not really, zero is excluded
timotimo right 19:33
andreoss @a.every == @b.every would be a nicer to read
then all @a.one == @b.any
masak to this day, the oppression of poor zero continues...
lizmat m: say 0 but True # :-) 19:35
camelia rakudo-moar 24aca6: OUTPUT«0␤»
raydiak m: sub is-pandigital($n) { set(|$n.comb) == 9 }; is-pandigital('o/ #perl6').say;
camelia rakudo-moar 24aca6: OUTPUT«True␤»
timotimo right 19:38
fair enough
tony-o_ .tell japhb i have these hilights in irssi doing what you're looking for, they could be improved but they work well enough (and you're right, it cleans up the channel quite a bit): gist.github.com/tony-o/968491d6430de41b3ae2
yoleaux tony-o_: I'll pass your message to japhb.
timotimo m: say &[(=)] 19:39
camelia rakudo-moar 24aca6: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zwIl878Q0N␤Missing infix inside []␤at /tmp/zwIl878Q0N:1␤------> 3say &[7⏏5(=)]␤ expecting any of:␤ argument list␤ infix␤ infix noun␤ infix stopper␤ …»
timotimo what does set equivalence look like? just regular eqv?
19:39 spider-mario left
raydiak this looks relevant: github.com/rakudo/rakudo/blob/nom/...m#L147-153 19:42
masak m: say True but 0 19:44
camelia rakudo-moar 24aca6: OUTPUT«True␤»
lizmat m: say (True but 0)++ # just curious 19:45
camelia rakudo-moar 24aca6: OUTPUT«Cannot modify an immutable Bool+{<anon>}␤ in block <unit> at /tmp/9uQx2iSVe8:1␤ in any <unit-outer> at /tmp/9uQx2iSVe8:1␤␤»
andreoss m: say 0 orelse True 19:46
camelia rakudo-moar 24aca6: OUTPUT«0␤»
masak andreoss: precedence there probably ain't what you think
(say 0) orelse True 19:47
19:47 ShimmerFairy left
andreoss m: say (0 orelse True) 19:47
camelia rakudo-moar 24aca6: OUTPUT«0␤»
masak oh, and `orelse` probably doesn't mean what you think either :P
m: say (0 or True)
camelia rakudo-moar 24aca6: OUTPUT«True␤»
19:47 spider-mario joined
masak m: say (Any orelse True) 19:48
camelia rakudo-moar 24aca6: OUTPUT«True␤»
andreoss m: say so 0
camelia rakudo-moar 24aca6: OUTPUT«False␤»
lizmat for performance reasons, I think we need to create an IDENTITY method for infix:<===>, similar to ACCEPTS for infix:<~~>
since most of the time, things are *not* the same, it could safe potentially very expensive/problem prone stringification 19:49
*save
19:49 yqt joined
masak sounds good 19:51
except I thought that's what .WHICH already does 19:52
lizmat nope: ulti sub infix:<===>($a, $b) {
nqp::p6bool(nqp::iseq_s(nqp::unbox_s($a.WHICH), nqp::unbox_s($b.WHICH)))
}
mind you, this wouldn't change anything about .WHICH, was we need that still 19:53
it would only make === a lot cheaper
19:54 kaare__ left
masak you say "nope" and then paste a sub that uses .WHICH? :P maybe we're talking past each other here... 19:54
let me restate, then: I don't yet see how your proposed .IDENTITY is distinct from .WHICH 19:55
timotimo i think if it's meant to be similar to ACCEPTS, it'd implement the whole identity comparison 19:57
lizmat my proposal would be:
multi sub infix:<===>(Mu \topic, Mu \matcher) {
matcher.IDENTITY(topic).Bool;
}
timotimo like, method IDENTITY($other) { ... }
lizmat and then make the default IDENTITY use the .WHICH comparison we have in infix:<===> now 19:58
masak ooh!
sorry I'm so slow
lizmat so e.g. when List === List, you would first check nr of elems in IDENTITY e.g. 19:59
masak just a minor point from a mathematician's POV: === is symmetric, ~~ ain't
so doing matcher.IDENTITY(topic) feels like it "unfairly" privileges matcher
19:59 ShimmerFairy joined
andreoss timotimo: i've managed to get full back trace paste.debian.net/183070/ 20:00
lizmat is that important though? I mean, if it's symmetric, it doesn't matter in which order you compare them
masak I don't know. it somehow feels like borrowing a scheme that works very well for ~~ and ACCEPTS, and expecting it to work just as well for ===, but there the conditions are different 20:02
20:02 rindolf left
masak doing it with matcher.IDENTITY introduces the *opportunity* for === not to be symmetric (if someone implements it wrong, for example) 20:03
I would be more sold on the scheme if it didn't allow for an implementation of === that could be asymmetric 20:04
lizmat well, isn't that really a case of DIHWIDT ? 20:05
20:06 darutoko left
masak depends which level you're reasoning at. at the architectural level, one has a duty to not introduce DIHWIDTs :P 20:07
also, I'm wondering if the way to get rid of the cost of a string comparison is to introduce a method dispatch... 20:08
lizmat well, any size of Set/Bag/Mix makes === *very* expensive on them
apart from the issue that there are false positives 20:09
masak *nod*
lizmat when using string comparison
TimToady identity strings should probably be interned
20:10 laouji joined
masak if someone asked me how that happened under the hood, I'd guess something like Git's hash comparison. the cost would then be amortized, too. 20:10
20:10 mj41 left
TimToady identity is about individuals, not pairs of things 20:10
TimToady will be a bit distracted here, still helping run a quiz tournament... 20:11
lizmat TimToady: not sure what you mean by "should be interned" ?
TimToady strings are a convenience for the implementor, really, but identity is more of an opaque value than a string 20:13
two interned strings can be compared merely by comparing two integers
20:14 laouji left
masak this is in line with what I feel about hashes and amortized cost. 20:15
lizmat TimToady: but even if they are interned, shouldn't there be some way for any Class to make its interned string ? 20:16
Ven .u dog
yoleaux U+2EA8 CJK RADICAL DOG [So] (⺨)
U+2F5D KANGXI RADICAL DOG [So] (⽝)
U+1F415 DOG [So] (🐕)
masak Ven: dogs. so radical.
lizmat TimToady: and if that's the case, doesn't that run the same risks / costs as .WHICH creation right now for value types ?
Ven masak: I never knew :o) 20:17
lizmat such as Sets/Bags/Mixes ?
TimToady we allow classes to define their own WHICH for value types, sure, but just because our current WHICH scheme is expensive doesn't mean it has to be that way
masak wonders if we can get something like Java's .hashCode, without peopl actually having to implement .hashCode
people* 20:18
Ven masak: github.com/vendethiel/Serialize-Ti...ze/Tiny.pm :D
lizmat TimToady: well, making it less expensive is the reason I was exploring this
Ven auto-hashCode of public properties 20:19
lizmat but apparently I'm a person with a hammer only seeing nails :-) 20:20
TimToady I'm inclined to agree with masak, in that it feels better to make WHICH faster internally, not try to put second-guessers on the outside
lizmat TimToady: I'm not worried about the cost if two objects *are* identical 20:21
TimToady we can put cheaters on the outside to optimize, but we'll probably get "caught" sooner, and we can probably speed up the internal paths first, then cheat later
lizmat I'm worried about the cost when they are not: which would be most of the cases
TimToady well, strings falsify really fast if they're different at the start :)
FROGGS_ you have to create that string first though 20:22
lizmat that's true, but I'm not talking about the actual string comparison, I'm talking about the effort to create the string
FROGGS_ two of 'em actually
lizmat yup
TimToady yes, strings are problematic from all other views :)
well, most
lizmat which, if you're creating 2 Mbyte strings that are different at the first char, is very expensive
20:25 diana_olhovik left
masak why must the .WHICH of Sets be a full listing of the set's elements? this is what SHA-1s solve so well. 20:25
20:27 xfix left
lizmat well, you would need to walk all values anyway, and nqp::sha1 only works on strings 20:27
so that would seem like just a lot of extra work, really
TimToady we really need to move in the direction of everything being able to produce a hash value 20:28
masak I'm talking about the principle -- of amortizing the work of computing a good .WHICH across all additions of elements.
TimToady: well. everything hashable.
TimToady strings are just a temporary expedient
masak I'm talking about Merkle trees, I think. en.wikipedia.org/wiki/Merkle_tree 20:29
TimToady can't really pay close enough attention at the moment, so is just shooting from the hip...
duck if any bullets come too close :)
masak Git makes this cheap, because by the time you're computing the SHA-1 of the commit (say), you've already computed the SHA-1 of all its constituents at earlier moments.
TimToady: enjoy quiz! :) 20:30
lizmat masak: I think you're underestimating the cost of SHA1 calculation and number of objects in a git repo compared with something in a Bag of any size 20:32
a Bag of any size will quickly be a number of orders of magnitude larger
masak please forget I said SHA1. that was not my point.
my point was *incremental* computation of the hash value of the container. 20:33
lizmat but that would be *exactly* what my IDENTITY proposal would allow you to do
FROGGS_ I'd think that the .WHICH has to implement that, not the IDENTITY 20:34
masak well, you currently have the advantage in that you have a proposal :) I only have comments so far. 20:35
FROGGS_ and you could cache the hash of the nodes, and only rehash some nodes when altering the structure
masak the hash computation being amortized would mean that the hash-computing concern is kind of spread across the entire class.
TimToady a set cannot impose a notion of identity outside of the class, that's just a basic violation of encapsulation 20:36
lizmat FROGGS_: please note that atm, you need .WHICH to be a Str for things like typed hashes / Sets / Bags / Mixes 20:37
TimToady that's letting the implementation drive the design, I suspect
masak I've always thought of .WHICH as more of an integer, for some reason. 20:38
lizmat TimToady: the basic IDENTITY(Mu, Mu) { Mu.WHAT == Mu.WHAT }
I should say: IDENTITY(Mu:U, Mu.U) { Mu.WHAT == Mu.WHAT }
masak is that numeric comparison? 20:39
lizmat oops, I mean eq
TimToady I'd say === there, given that WHiCH is always a value type
lizmat TimToady: that was a .WHAT in the comparison
TimToady or eqv also works, since value types don't distinguish === from eqv
either == or eq is pretty sure to be wrong in the long run 20:40
okay, that's for :U only then, but still
===/eqv are more fundamental than ==/eq, in my mind 20:41
we can have types and identities that are neither numbers nor strings 20:42
nor easily reducable to them, unless you count hashes as funny integers
lizmat ok, so in order to make Set === Set faster, we would need to add an infix:<===>(Set,Set) candidate
TimToady no, a set is immutable, should have it's identity calculated some time between set creation and the first time it's asked for 20:43
lizmat well, yes, but I made it lazy, I think 20:44
TimToady $set1.WHICH === $set2.WHICH should only do the identity work once, at most
(for each set, and only if not already done)
lizmat yes, and it does, it just can be *very* expensive atm 20:45
TimToady is also not sure the current approach of optimizing for pair production is really the largest use of sets
20:45 Khisanth joined
lizmat where, if we would e.g. compare the number of elems first, we could already decide that tey cannot be equal *without* creating the identity values 20:45
Set / Bag / Mixes / Hashes / Typed hashes, all the same issue 20:46
all value types
TimToady normal hashes are not a value type
lizmat true, I meant EnumMaps
20:48 Ven left
masak wonders how Python pulls it off 20:53
20:56 beastd joined
timotimo i think they do the "if you do it wrong, it's your fault" approach? 20:56
no, wait 20:57
i think they throw exceptions when unhashable types are put into hash key positions
lizmat is there a (cheap) signature possible for ($a,$b) where $a and $b are of a different type ? 20:58
std: sub a(Int $a, !Int $b) {...} 20:59
camelia std 28329a7: OUTPUT«5===SORRY!5===␤Malformed parameter at /tmp/l4LCkqEBIc line 1:␤------> 3sub a(Int $a, 7⏏5!Int $b) {...}␤ expecting any of:␤ name␤ parameter␤ signature␤Parse failed␤FAILED 00:00 137m␤»
21:00 fhelmberger joined
masak timotimo: that always seemed very reasonable to me. but I agree it might not be Perl's style. 21:00
timotimo sub a(::T $a, ::U $b where U !eqv T) { }; a(10, "hi")
m: sub a(::T $a, ::U $b where U !eqv T) { }; a(10, "hi")
camelia ( no output )
timotimo m: sub a(::T $a, ::U $b where U !eqv T) { }; a(10, 11)
camelia rakudo-moar bfbf83: OUTPUT«Constraint type check failed for parameter '$b'␤ in sub a at /tmp/WTwdOnMsMY:1␤ in block <unit> at /tmp/WTwdOnMsMY:1␤ in any <unit-outer> at /tmp/WTwdOnMsMY:1␤␤»
timotimo great, isn't it? :P
TimToady well, we have very few unhashable types, since the identity of a container is just the container itself
lizmat timotimo: that isn't cheap :-) 21:01
masak TimToady: in Python, "unhashable" and "mutable" are the same.
21:01 colomon joined
lizmat so something like: my %h{Any} = { a => 42 } => 666 would not work in Python? 21:02
timotimo i don't think we have anything like that :S
TimToady sure, which means we give more value, if you happen to want to compare collections of mutable containers for some reason :)
21:02 colomon left
lizmat m: my %h{Any} = { a => 42 } => 666; say %h.perl 21:02
camelia rakudo-moar bfbf83: OUTPUT«Hash[Any,Any].new({:a(42)} => 666)␤»
timotimo TimToady: i think we give "more key" rather than "more value" 21:03
masak lizmat: right. you can't use dicts as dict keys in Python.
TimToady lizmat: that's the value, so no problem
it's the key that they want to hash
21:03 colomon joined
TimToady oh, wait, I misread 21:03
nm 21:04
yes, I'd expect that to fail in Python
lizmat m: my %h = a => 42; my %i{Any} = %h => 666; say %i.perl; %h<b> = 43; say %i.perl # so is this expected ?
camelia rakudo-moar bfbf83: OUTPUT«Hash[Any,Any].new({:a(42)} => 666)␤Hash[Any,Any].new({:a(42), :b(43)} => 666)␤»
21:05 fhelmberger left
lizmat m: my %h = a => 42; my %i{Any} = %h => 666; say %i.perl; %h<b> = 43; say %i.keys[0] === %h 21:05
camelia rakudo-moar bfbf83: OUTPUT«Hash[Any,Any].new({:a(42)} => 666)␤True␤»
TimToady yes, that's perfectly fine
lizmat *phew* 21:06
TimToady hashes are always === semantics, not eqv
dalek kudo/nom: c56fe3e | lizmat++ | src/core/Mu.pm:
Make @a eqv @b 10% faster if not equal

By not enforcing an explicit return in that case
TimToady users have to take their own snapshots if they want them 21:07
masak fails in Python: gist.github.com/masak/1afe22b244fcc9255f7a
21:23 zakharyas left
andreoss timotimo: had you a chance to take a look at my bt? 21:31
21:32 colomon left
timotimo sorry, i haven't reached a computer at all today until very late in the evening and didn't see your bt 21:36
can you give me the link again?
andreoss paste.debian.net/183070/
timotimo do you also have the code available that triggered this? 21:39
it seems sort of like you're assigning to something that's null somehow 21:40
is it related to state variables at all?
andreoss it's in perl6-examples, within Pod::To::HTML callback 21:41
let me commit it
timotimo god damn it :S
21:42 ggoebel joined
lizmat masak: how about a "ValueType" role: 21:44
role ValueType { has Str $!sha1; method sha1 { $sha1 //= nqp::sha1(self.Str) } 21:45
21:45 laouji joined
lizmat basically the idea of the Merkle tress, with only value types (such as Int, Str, Set, Bag, Mix) containing the extra $!sha1 attribute 21:46
and in the case of Set, Bag, Mix they would be a bit more involved... 21:47
masak *nod*
dalek pan style="color: #395be5">perl6-examples: b7c6eff | andreoss++ | lib/Pod/Htmlify.pm6:
Syntax highlighting. Code in htmlify.pl segfaults with 2015.05
21:48
lizmat the default sha1 of an object would be whatever .WHICH now returns
timotimo why not commit that in a branch?
andreoss you should have to, sorry
lizmat or maybe that is what .WHICH is intended to be ?
timotimo andreoss: did you also try to "print MVM_dump_backtrace(tc)"?
masak and please forget I said SHA1. we can do a cheaper hash function. something involving one XOR and a bitshift, perhaps.
lizmat that feels like opening a can of worms and potential security issues to me 21:50
did you follow the discussion on hashes on p5p in the past years ?
andreoss paste.debian.net/183106/ 21:51
it crashes with {*} inside BUILD
masak lizmat: I know the gist of it, I think. 21:52
by osmosis.
lizmat hehe
21:53 grondilu left
mst tries to parse {*} as Tcl 21:53
mst resets brain
lizmat wishes we had 160bit native ints
timotimo we could have 160bit native ints, but we'd have to have a platform that we target that has them :) 21:55
lizmat hehe... and SHA1 all of a sudden is not that safe anymore :-)
still, it would save half of the length if it were a 20 byte buf, instead of a 40 char string
timotimo i'm not 100% sure the operations you usually run for that kind of thing are really that much better when you have a native register that holds all of it 21:56
21:56 Ven joined
lizmat yeah, I guess the overhead of having an extra attribute with each value type object, would be the real memory hog 21:57
even though it would be uninitialized most of the time
22:05 laouji left
RabidGravy is it intentional that if you do "perl6 -Ilib" for instance, the "lib" doesn't appear in the @*INC? 22:10
dalek pan style="color: #395be5">perl6-examples: 230d296 | andreoss++ | lib/Pod/Htmlify.pm6:
Commented out problem code
lizmat RabidGravy: you mean it appears as "file#lib" ?
RabidGravy in the REPL
lizmat ah, the REPL... hmmm...
RabidGravy no I mean, not at all
lizmat I don't think that's intentional 22:11
RabidGravy perl6 -Ilib -e 'use Foo' works fine (where Foo is in a lib sub-dir)
but perl6 -Ilib 22:12
>use Foo;
doesn't
Ven I think that's a known bug
RabidGravy PITA
oh well not un-work-roundable 22:13
lizmat it appears nqp::atkey(%*COMPILING, '%?OPTIONS'), 'I') is not set when in the REPL 22:16
and that is why src/core/Inc.pm doesn't add it
I'll look at moving that into nqp when I get use cur completely functional 22:18
which will *not* be tonight
andreoss paste.debian.net/183116/ 22:19
timotimo: i've localized it a bit, seems it segfaults only when the precompiled code is used 22:20
[ptc] RabidGravy: the workaround for that which I use is: PERL6LIB=./lib perl6 22:21
22:21 RabidGravy left
[ptc] maybe that helps.. 22:22
22:23 smls left
lizmat yeah, that should help, as it is not having set %*COMPILING when -I is given, is what the problem is 22:23
lizmat calls it a night 22:24
good night, #perl6!
[ptc] g'night lizmat
22:32 Ven left 22:47 colomon joined
raydiak wrt "hashes are always === semantics, not eqv" what does "general value-keyed hashes" refer to at the end of S03:3386 ? 22:47
masak 'night, lizmat 22:48
raydiak hrm, no synbot?
design.perl6.org/S03.html#line_3386
22:50 laouji joined
raydiak has needed such a thing and so has a shoddy version of hash-keyed hashes w/eqv semantics in Math::Symbolic 22:51
23:00 beastd left, fhelmberger joined 23:03 laouji left 23:04 telex left 23:05 fhelmberger left 23:06 telex joined
raydiak TimToady: ^^^^^ 23:07
afk
23:11 espadrine left 23:19 xiaomiao left 23:23 xiaomiao joined
timotimo andreoss: oh, damn. pre-compilation related bugs are hard 23:25
any golfing you could do to this would be very appreciated
23:32 dayangkun joined
andreoss can i emulate loading compiled moar byte-code? 23:32
i've tried INIT for it, seems to be not it
23:33 colomon left 23:34 yqt left, colomon joined 23:38 BenGoldberg_ joined 23:41 ggoebel left, Ben_Goldberg left
raydiak andreoss: not sure how to do that, probably something with CompUnit.precomp() or so, but I often golf them by just doing 'panda-build . && ./test.p6' or so for every attempt 23:42
andreoss timotimo: did so, it segfaults on type checking 23:46
subset File of Str where -> $x { so $x && $x.IO.e };
has File $!in;
method BUILD() { $!in = "whatever" }
segfaults in BUILD
zostay m: say :16("0xdeadbeef") 23:47
camelia rakudo-moar c56fe3: OUTPUT«3735928559␤»
timotimo is that piece of code already enough to trigger the bug?
raydiak mentioned in #123700
timotimo how does precompilation factor in? 23:48
raydiak oh right no bothelp today
rt.perl.org/Public/Bug/Display.html?id=123700
andreoss paste.debian.net/183140/ and the class it self paste.debian.net/183141/
raydiak particularly anything precompiled with a subset constraint seems to segfault when assigned to (subset Foo; my Foo $foo = 42;) 23:49
same reason all the subset constraints are commented out in Image::PNG::Portable 23:50
andreoss timotimo: without pre-compiled code it gives type checking error
23:52 bjz joined 23:56 dayangkun left
dalek kudo-star-daily: ba0b5a7 | coke++ | log/MoarVM- (5 files):
today (automated commit)
23:56
kudo-star-daily: 59bddc6 | coke++ | log/MoarVM- (5 files):
today (automated commit)
rl6-roast-data: 690c576 | coke++ | / (9 files):
today (automated commit)
rl6-roast-data: fffa773 | coke++ | / (9 files):
today (automated commit)
23:58 stimpi joined