»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! Set by moritz on 22 December 2015. |
|||
00:08
firstdayonthejob left
00:10
bjz left
|
|||
garu | timotimo: interesting, thanks! If I may bug you just a bit further, do you know why this was decided like so? I think it might have something to do with allowing signatures to spot Pair objects, but I'm not sure | 00:20 | |
00:21
kyclark_ joined
|
|||
garu | I'd love to hear more about the design process behind the language :) | 00:21 | |
grondilu | there are the apocalypses | 00:22 | |
garu | also, is there any way to pass named arguments with spaces in them? | 00:23 | |
grondilu: yeah, but I gather they have changed a lot over the years, haven't they? | |||
00:24
garu left
|
|||
timotimo | sorry | 00:24 | |
grondilu | WIP of a NativeCall interface to Binaryen: paste.debian.net/895092/ | 00:27 | |
It seems to be working but literals will likely be an issue. | |||
timotimo | i have no idea what bynaryen is | 00:28 | |
00:29
garu joined
|
|||
grondilu | wasm C API | 00:29 | |
timotimo | web asm? | ||
garu | (sorry, got disconnected) | 00:30 | |
timotimo | garu: named arguments are 100% static syntax, in addition there's hash flattening which makes things behave a whole lot different | ||
garu | timotimo: interesting! I think I'm bumping into this more often than I hoped for :/ | 00:31 | |
grondilu | timotimo: webassembly | ||
timotimo | right | ||
garu | so if I want a method x to accept x(foo => 42, bar => 21) and x('foo' => 42, 'bar' => 21) and my %h = (foo => 42, bar => 21); x(%h), what should the signature be? | 00:34 | |
AlexDaniel | garu: fwiw, this was a nice post: perl6advent.wordpress.com/2014/12/...ong-right/ | ||
garu | (assuming I'd want to handle them all as a hash, say %foo) | 00:35 | |
timotimo | you have to pass |%h | 00:36 | |
the signature would accept a foo and a bar named argument | |||
if you want to accept the positional pair objects, too, just accept positionals | 00:37 | ||
00:37
bjz joined
|
|||
AlexDaniel | m: sub x(+%z) { say %z.perl }; x(‘foo’ => 42, ‘bar’ => 42); my %h = (foo => 42, bar => 21); x(%h) | 00:38 | |
camelia | rakudo-moar aa86b9: OUTPUT«[:foo(42), :bar(42)][:bar(21), :foo(42)]» | ||
AlexDaniel | timotimo: ? | 00:39 | |
am I missing anything? | |||
timotimo | huh? +%z? that's news to me | ||
cool. | |||
AlexDaniel | to be honest I don't really remember the difference between * and + | 00:40 | |
timotimo | well, + gives you "one arg" semantics | ||
that's probably what makes %h work | |||
00:40
kyclark_ left
|
|||
timotimo | i mean passing %h | 00:41 | |
garu | hmm | ||
timotimo | if it's just one argument, it'll be iterated over | ||
garu | AlexDaniel: the only difference between your example and mine is your signature was (+%z) and mine was (*%z) | ||
AlexDaniel | m: sub x(**%z) { say %z.perl }; x(‘foo’ => 42, ‘bar’ => 42); my %h = (foo => 42, bar => 21); x(%h) | ||
camelia | rakudo-moar aa86b9: OUTPUT«Too many positionals passed; expected 1 argument but got 2 in sub x at <tmp> line 1 in block <unit> at <tmp> line 1» | ||
garu | I definitely need to understand this better :/ | ||
00:42
sufrostico left
|
|||
garu | AlexDaniel++ | 00:42 | |
timotimo++ | |||
thanks! | |||
AlexDaniel | see docs.perl6.org/type/Signature#Slur...Parameters and docs.perl6.org/language/functions#...onventions | ||
garu | ok, while we're at it, I also have a question regarding return values :) | 00:43 | |
AlexDaniel | commit: 6c sub x(*%z) { say %z.perl }; x(‘foo’ => 42, ‘bar’ => 42); my %h = (foo => 42, bar => 21); x(%h) | ||
committable6 | AlexDaniel, ¦«2015.12,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07.1,2016.08.1,2016.09,2016.10,HEAD»: Too many positionals passed; expected 0 arguments but got 2 in sub x at /tmp/7tg9aqOrbv line 1 in block <unit> at /tmp/7tg9aqOrbv line 1 «exit code = 1» | ||
AlexDaniel | hmm, and just for fun | ||
commit: all sub x(*%z) { say %z.perl }; x(‘foo’ => 42, ‘bar’ => 42); my %h = (foo => 42, bar => 21); x(%h) | |||
garu | sub x { my $a = 42, my @b = (3,2,1); return $a,@b }; my ($x,@y) = x(); $x.perl.say; @y.perl.say | 00:44 | |
committable6 | AlexDaniel, gist.github.com/b28c38d0ea1ba2ffe2...3586925fcf | ||
garu | In the code above @y becomes [[3,2,1]], I wanted [3,2,1] | ||
what am I doing wrong? | |||
any clues? | 00:46 | ||
AlexDaniel | well, let me demonstrate | ||
m: sub x { my $a = 42, my @b = 3,2,1; return $a,@b,42 }; my ($x,@y) = x; $x.perl.say; @y.perl.say | 00:47 | ||
camelia | rakudo-moar aa86b9: OUTPUT«42[[3, 2, 1], 42]» | ||
grondilu | m: use NativeCall; constant size_t := uint32; | ||
camelia | rakudo-moar aa86b9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Redeclaration of symbol 'size_t'at <tmp>:1------> 3se NativeCall; constant size_t := uint327⏏5;» | ||
grondilu | m: use NativeCall; print size_t; | ||
camelia | rakudo-moar aa86b9: OUTPUT«Use of uninitialized value of type NativeCall::Types::size_t in string context.Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful. in block <unit> at <tmp> line 1» | ||
AlexDaniel | garu: so one way to make it work is to use $y to hold your variable | 00:48 | |
to hold your array* | |||
another way is to flatten it… | 00:49 | ||
m: sub x { my $a = 42, my @b = 3,2,1; return $a,@b }; my ($x,@y) = x.flat; $x.perl.say; @y.perl.say | |||
camelia | rakudo-moar aa86b9: OUTPUT«42[3, 2, 1]» | ||
AlexDaniel | and the sane way to do it does not seem to work, hmmhmm… | 00:50 | |
garu | AlexDaniel: buy interface-wise I kinda need to return an (Str, Array) I think | ||
I could change things, sure, but I wonder how to make that work | 00:51 | ||
AlexDaniel | garu: return $a,@b already returns array as a second element | ||
that's why @y ends up having the whole array inside its first argument | |||
garu | yeah but is there a way to magically flatten it so @y ends up with 3 arguments instead? | 00:52 | |
I tried return $a, @b.flat but it didn't exactly do what I wanted :X | 00:53 | ||
then I learned .flat returns a Seq | |||
AlexDaniel | garu: well you can do $a,|@b but I don't recommend you to | 00:54 | |
garu | why? | ||
hey, it works! | |||
urm... why don't you recommend that? | |||
AlexDaniel | well, first of all you said you want to return (Str, Array) and not (Str, array elements here, …) | 00:55 | |
but it depends on your needs. Personally I'd much rather let the user of sub x decide which behavior he wants | 00:56 | ||
garu | so you'd return an array as a single argument and get it as my ($x,$y) = x() | 00:57 | |
is that right? | |||
AlexDaniel | I think so, yes | ||
garu | ok, I can do that :) | ||
thanks for the help! | |||
AlexDaniel | garu: personally, I find | very scary and I'm not even sure if it works well in this case | 00:58 | |
perhaps it works OK in this case, but I don't know… | |||
garu | (it did - I mean, it returned that flattened list and my test passed) | ||
but I can try to work it like you said I think | |||
AlexDaniel | perhaps others can help :) | ||
garu | I want my Perl 6 code to look more idiomatic | 00:59 | |
but I find myself doing Perl 5 in Perl 6 :X | |||
(and expecting the same results) | |||
AlexDaniel | OK, yes, I am right, | does not work here | ||
garu: if you decide to go this way, then either use 「return $a, slip @b」 or 「return flat($a, @b)」 | 01:00 | ||
garu | m: sub x { my $a = 42, my @b = 3,2,1; return $a,|@b }; my ($x,@y) = x(); $x.perl.say; @y.perl.say | ||
camelia | rakudo-moar aa86b9: OUTPUT«42[3, 2, 1]» | ||
garu | ^^^ what's wrong with that? | ||
AlexDaniel | that's not the right way to test | | ||
let me demonstrate… | |||
m: sub x { my $a = 42, my @b = 3 xx 5; return $a,|@b }; my ($x,@y) = x(); $x.perl.say; @y.perl.say | 01:01 | ||
camelia | rakudo-moar aa86b9: OUTPUT«42[3, 3, 3, 3, 3]» | ||
AlexDaniel | m: sub x { my $a = 42, my @b = 3 xx 99999; return $a,|@b }; my ($x,@y) = x(); $x.perl.say; @y.perl.say | ||
camelia | rakudo-moar aa86b9: OUTPUT«Too many arguments in flattening array. in sub x at <tmp> line 1 in block <unit> at <tmp> line 1» | ||
AlexDaniel | m: sub x { my $a = 42, my @b = 3 xx 99999; return $a, slip @b }; my ($x,@y) = x(); $x.perl.say; @y.perl.say | ||
camelia | rakudo-moar aa86b9: OUTPUT«42[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3…» | ||
garu | ah, I was looking into slip earlier but couldn't get it right | ||
AlexDaniel | m: sub x { my $a = 42, my @b = 3 xx 99999; return flat($a, @b) }; my ($x,@y) = x(); $x.perl.say; @y.perl.say | ||
camelia | rakudo-moar aa86b9: OUTPUT«42[3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3…» | ||
garu | stil looks right... right? | 01:02 | |
AlexDaniel | garu: look again | ||
garu: the one with $a,|@b definitely does not look right | |||
garu | oops, sorry I was looking at the last example, didn't see it was using flat() | 01:03 | |
AlexDaniel | my rule of thumb is “never use |”, there's always a better way | ||
garu | is it supposed to give the "too many arguments"? | ||
(and if so, why?) | 01:04 | ||
AlexDaniel | garu: actually, use @b.Slip instead of slip @b | 01:05 | |
because seems like it works faster… | |||
.tell lizmat fwiw, 「slip @b」 seems to work much slower than 「@b.Slip」. I have no idea, maybe that's how it should be, but perhaps you might want to take a look | 01:07 | ||
yoleaux | AlexDaniel: I'll pass your message to lizmat. | ||
AlexDaniel | .tell lizmat e.g. 「my @alot = 3 xx 99999; say (slip @alot).perl」 vs 「my @alot = 3 xx 99999; say (@alot.Slip).perl」 | 01:08 | |
yoleaux | AlexDaniel: I'll pass your message to lizmat. | ||
AlexDaniel | garu: I don't know | 01:09 | |
01:09
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
garu | that's ok. you've been super helpful, thank you! | 01:10 | |
AlexDaniel | .tell TimToady I was expecting this to work: 「my ($x, [@y]) = 24, [40, 50, 60]; say @y.perl」, but right now it is completely bugged. What would be the right result in this case? See #130079 | 01:21 | |
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130079 | ||
yoleaux | AlexDaniel: I'll pass your message to TimToady. | ||
AlexDaniel | garu: if you want, you may follow that ticket ↑ | ||
I have a gut feeling that it was supposed to work, but I have no idea | 01:22 | ||
01:22
wamba left
|
|||
AlexDaniel | garu: in any case, “null object” should not appear there. So thanks to you one bug found :) | 01:23 | |
01:26
bjz left
|
|||
MasterDuke | m: grammar G { token TOP { "foo" \s* [ \s "bar" ]? } }; say G.parse("foo bar") | 01:26 | |
camelia | rakudo-moar aa86b9: OUTPUT«Nil» | ||
MasterDuke | m: grammar G { regex TOP { "foo" \s* [ \s "bar" ]? } }; say G.parse("foo bar") | 01:27 | |
camelia | rakudo-moar aa86b9: OUTPUT«Nil» | ||
MasterDuke | m: say $/ if "foo bar" ~~ / "foo" \s* [ \s "bar" ]? / | 01:28 | |
camelia | rakudo-moar aa86b9: OUTPUT«「foo 」» | ||
AlexDaniel | MasterDuke: are you trying to say that it is a bug? :) | 01:29 | |
MasterDuke | ^^^ am i crazy for thinking at least the last two of those should match the whole input string? | ||
grondilu | github.com/grondilu/binaryen-bindings | ||
AlexDaniel | m: grammar G { regex TOP { "foo" \s* [ \s "bar" ]? } }; say G.parse("foo bar") | ||
camelia | rakudo-moar aa86b9: OUTPUT«Nil» | ||
AlexDaniel | m: grammar G { regex TOP { "foo" \s* [ \s "bar" ]? $ } }; say G.parse("foo bar") | 01:30 | |
camelia | rakudo-moar aa86b9: OUTPUT«「foo bar」» | ||
AlexDaniel | m: grammar G { regex TOP { "foo" \s* [ \s "bar" ] } }; say G.parse("foo bar") | ||
camelia | rakudo-moar aa86b9: OUTPUT«「foo bar」» | ||
AlexDaniel | MasterDuke: here is a golfed down version | 01:31 | |
m: grammar G { regex TOP { "a" || "abc" } }; say G.parse("abc") | |||
camelia | rakudo-moar aa86b9: OUTPUT«Nil» | ||
AlexDaniel | MasterDuke: so this is what happens | ||
01:31
bjz joined
|
|||
AlexDaniel | MasterDuke: top tries to match "a", and it works, so it is happy | 01:32 | |
MasterDuke: but .parse for some reason is not, because it wants the whole thing to match… or so it seems? | |||
MasterDuke: right here: github.com/rakudo/rakudo/blob/cb8f...mar.pm#L25 | 01:36 | ||
MasterDuke | ah | ||
AlexDaniel | $match.to == target.chars ?? $match !! Nil | 01:37 | |
so it is a bug indeed… | |||
dalek | c: 7ff9021 | coke++ | doc/Type/X/Proc/Unsuccessful.pod6: remove trailing whitespace |
||
synopsebot6 | Link: doc.perl6.org/type/X/Proc/Unsuccessful | ||
MasterDuke | m: grammar G { regex TOP { "a" | "abc" } }; say G.parse("abc") | ||
camelia | rakudo-moar aa86b9: OUTPUT«「abc」» | ||
AlexDaniel | no, not | | ||
| does longest token matching, if I'm not mistaken | 01:38 | ||
so it's "abc" || "a" in reality | |||
m: grammar G { regex TOP { "abc" || "a" } }; say G.parse("abc") | |||
camelia | rakudo-moar aa86b9: OUTPUT«「abc」» | ||
AlexDaniel | m: grammar G { regex TOP { "a" || "abc" } }; say G.parse("abc") | ||
camelia | rakudo-moar aa86b9: OUTPUT«Nil» | ||
AlexDaniel | m: grammar G { regex TOP { "a" | "abc" } }; say G.parse("abc") | 01:39 | |
camelia | rakudo-moar aa86b9: OUTPUT«「abc」» | ||
AlexDaniel | m: grammar G { regex TOP { "abc" | "a" } }; say G.parse("abc") | ||
camelia | rakudo-moar aa86b9: OUTPUT«「abc」» | ||
AlexDaniel | MasterDuke: will you submit a ticket? | ||
01:41
travis-ci joined
|
|||
travis-ci | Doc build errored. Jan-Olof Hendig 'Fixed another broken link' | 01:41 | |
travis-ci.org/perl6/doc/builds/175359360 github.com/perl6/doc/compare/67e69...bc38acdf34 | |||
01:41
travis-ci left
|
|||
MasterDuke | well, i'm not exactly sure it is a bug. perl -E 'say "$1" if ("foo bar" =~ /foo \s* (\s bar)? /x)' prints nothing also | 01:41 | |
01:41
bjz left
|
|||
MasterDuke | "Method parse only succeeds if the cursor has arrived at the end of the target string when the match is over." | 01:43 | |
docs.perl6.org/type/Grammar#method_parse | |||
AlexDaniel | m: grammar G { regex TOP { "a" | "abc" } }; say G.subparse("abc") | 01:45 | |
camelia | rakudo-moar aa86b9: OUTPUT«「abc」» | ||
MasterDuke | m: grammar G { token TOP { "foo" \s* || "foo" \s* \s "bar" } }; say G.parse("foo bar") | ||
camelia | rakudo-moar aa86b9: OUTPUT«Nil» | ||
MasterDuke | m: grammar G { token TOP { "foo" \s* | "foo" \s* \s "bar" } }; say G.parse("foo bar") | ||
camelia | rakudo-moar aa86b9: OUTPUT«Nil» | ||
MasterDuke | m: grammar G { token TOP { ["foo" \s*] | ["foo" \s+ "bar"] } }; say G.parse("foo bar") | 01:47 | |
camelia | rakudo-moar aa86b9: OUTPUT«「foo bar」» | ||
MasterDuke | m: grammar G { token TOP { ["foo" \s*] || ["foo" \s+ "bar"] } }; say G.parse("foo bar") | ||
camelia | rakudo-moar aa86b9: OUTPUT«Nil» | ||
AlexDaniel | I still think that it is a bug | ||
it could've arrived to the end, but it has no information in the rule itself that it should attempt to do so | 01:48 | ||
so it bails out and then all of sudden .parse method is unhappy | |||
.subparse is also wrong because we probably don't want it to match partially | 01:49 | ||
MasterDuke | i don't like it, but i'm not quite 100% convinced | ||
AlexDaniel | basically the solution is to always put $ in the end of your TOP | ||
if you don't have $ in your TOP then it does not work as you expect… | |||
I mean, sure, we can add another trap to our documentation | 01:50 | ||
or we can just fix the damn thing, I guess… | |||
I'll submit a ticket then | |||
MasterDuke | .ask TimToady do you mind looking at irclog.perlgeek.de/perl6/2016-11-13#i_13557942? is there something wrong or are we just expecting incorrect behavior? | ||
yoleaux | MasterDuke: I'll pass your message to TimToady. | ||
01:51
araujo left
|
|||
Xliff | Well, now I need to find a testing suite for libxslt. | 01:51 | |
yoleaux | 12 Nov 2016 14:44Z <raiph> Xliff: Aiui the only thing that makes a data block in P6 a data block is that it's a pod block called 'data'. So the 'foo' and 'qux' blocks don't count. I'll tighten the SO lang to try make that clearer. | ||
Xliff | .tell raiph Yes, but __DATA__ blocks aren't always "data" blocks in p5. They can be almost anything but are still referred to as "data blocks". I think we have the intent of the OP clear enough, just splitting hairs over names. | 01:52 | |
yoleaux | Xliff: I'll pass your message to raiph. | ||
Xliff | LOL! Tests done in python! Close enough. | 01:53 | |
xmlsoft.org/XSLT/python.html | 01:54 | ||
01:54
pyrimidine joined
|
|||
MasterDuke | AlexDaniel: hmm, the perl 5 version works if you add a $ anchor at the end | 01:54 | |
m: grammar G { token TOP {^ "foo" \s* [ \s "bar" ]? $} }; say G.parse("foo bar") | 01:55 | ||
camelia | rakudo-moar aa86b9: OUTPUT«Nil» | ||
AlexDaniel | MasterDuke: perl5 version works anyway | 01:56 | |
MasterDuke: perhaps you've not noticed because you didn't 「use warnings;」, e.g. perl -wE | 01:57 | ||
MasterDuke | what do you mean works? it doesn't capture ' bar' into $1 | 01:58 | |
AlexDaniel | MasterDuke: why would it? | ||
MasterDuke: perl -wE 'say "ok" if "abc" =~ /b/x' # ok | 01:59 | ||
it does not attempt to match from the beginning, and it doesn't attempt to match till the end | |||
so once 「foo \s*」 matches there's no need to backtrack, the solution is just fine | 02:00 | ||
MasterDuke | the behavior i want is "capture the optional bit if it's there, but succeed anyway (without capturing anything obviously) if it isn't" | 02:01 | |
AlexDaniel | well in this case you probably want [\s+ bar || \s*] | 02:03 | |
02:06
pyrimidine left
|
|||
MasterDuke | yup, that works | 02:06 | |
02:06
pyrimidine joined
|
|||
MasterDuke | i guess that's the problem with matching vs capturing. just to match it makes sense to bail out as soon as you know either way, but for capturing (and i guess i really mean parsing here) that's not always desired | 02:09 | |
02:10
araujo joined
02:11
pyrimidine left
02:15
pyrimidine joined
02:17
bjz_ joined
02:19
FROGGS_ joined,
pyrimidine left
02:23
FROGGS left
02:34
pyrimidine joined
02:39
pyrimidine left
02:45
pyrimidine joined
02:46
ilbot3 left
02:47
ilbot3 joined
02:48
amalia_ left
02:49
amalia_ joined
02:53
araujo left
02:54
troys_ is now known as troys
02:55
troys is now known as troys_
03:17
araujo joined
|
|||
AlexDaniel | .tell TimToady ↑ #130081 | 03:29 | |
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130081 | ||
yoleaux | AlexDaniel: I'll pass your message to TimToady. | ||
03:36
cyphase left
03:43
noganex joined
03:46
noganex_ left
03:52
kyclark_ joined
03:54
pyrimidine left,
pyrimidine joined
|
|||
garu | AlexDaniel: are you still there? I'm found an "issue" with our previous signature solution | 03:57 | |
03:59
AlexDaniel left
|
|||
garu | AlexDaniel: sub x(+%z) gets x("foo"=>1) and %h=(foo=>1); x(%h), but not x(foo=>1) | 04:00 | |
also, I'm getting an array of pairs both times... how can I coerce it to a hash? | 04:01 | ||
or is this one of those "I'm still thinking in Perl 5" moments? | 04:02 | ||
04:02
kyclark_ left
04:05
kyclark_ joined,
pyrimidine left,
kyclark_ left
04:06
pyrimidine joined
04:11
pyrimidine left,
cyphase joined
04:13
pyrimidine joined
04:14
skids joined
04:15
aborazmeh left
04:16
cyphase left
04:27
cyphase joined,
pyrimidine left
04:36
cyphase left
04:41
aborazmeh joined,
aborazmeh left,
aborazmeh joined,
cyphase joined
04:43
mr-foobar left
04:44
mr-foobar joined
04:48
zacts left
04:54
araujo left
04:56
araujo joined
04:58
araujo left,
araujo joined
04:59
troys_ is now known as troys
05:00
bjz_ left,
araujo left
05:02
pierre_ joined,
araujo joined,
araujo left,
araujo joined
05:07
araujo left
05:17
bjz_ joined
05:18
pierre_ left
05:22
aborazmeh left,
Cabanossi left
05:25
w4and0er96 left,
timeless left,
pierre_ joined,
Spot__ left
05:26
Cabanossi joined
05:41
timeless joined,
Spot__ joined,
w4and0er96 joined
05:44
canopus left
05:45
bjz_ left
05:47
canopus joined
05:51
bjz joined
06:03
bjz left
06:04
troys left,
zacts joined
06:12
bjz joined
06:18
zrr joined
06:24
bjz_ joined
06:25
bjz left
06:48
wamba joined
07:05
p6_nb joined
07:10
labster left
07:18
p6_nb left
|
|||
grondilu | On docs.perl6.org/language/nativecall#Structs it is written that native functions must pass and returns structs by reference. So how to deal with function that do it by value? | 07:18 | |
I tried to ignore the problem and got segmentation fault. | |||
lizmat | . | 07:20 | |
yoleaux | 01:07Z <AlexDaniel> lizmat: fwiw, 「slip @b」 seems to work much slower than 「@b.Slip」. I have no idea, maybe that's how it should be, but perhaps you might want to take a look | ||
01:08Z <AlexDaniel> lizmat: e.g. 「my @alot = 3 xx 99999; say (slip @alot).perl」 vs 「my @alot = 3 xx 99999; say (@alot.Slip).perl」 | |||
lizmat | .tell AlexDaniel see github.com/rakudo/rakudo/commit/37d0e46614 | ||
yoleaux | lizmat: I'll pass your message to AlexDaniel. | ||
lizmat | commute to T-Dose& | ||
grondilu | that is how would you translate struct foo { int n; }; struct foo increase(struct foo bar) { struct foo result = { bar.n + 1 }; return result; } | 07:21 | |
07:21
lizmat left,
djbkd joined
|
|||
geekosaur | grondilu, I suspect you can't, sanely. struct passing and returning still has weird and platform specific corner cases in C. (it will work if you use the C compiler, but figuring out how to do it from outside is often an exercise in futility even when you can inspect said compiler's source) | 07:23 | |
this is a common shortcoming in foreign function interfaces and the workaround is almost invariably to defer it to C by making a wrapper that uses pointers and calls the real one | 07:24 | ||
07:24
labster joined
|
|||
geekosaur | for example some platforms may quietly rewrite it to use pointers (e.g. stick the value on the stack, then a pointer to that stack value which is used as the real parameter; and for the return make extra space on the stack and either pass that as a hidden parameter or make sure said space is just above the return address and the function returning the struct has to offset everything else by that), while some others may do so only if the struct do | 07:28 | |
esn't fit into a machine register | |||
07:30
rurban joined
|
|||
geekosaur | for a long time K&R C struct return values made a function non-reentrant (it used memory allocated next to the function itself, like pre-Algol activation records) | 07:30 | |
although ANSI disallowed that | |||
hm, lemme rephrase that. K&R C permitted that, older pcc (what most old-timers think of as "cc") did it that way but newer ones switched to stack allocation to get rid of the "hidden" non-reentrancy | 07:33 | ||
07:34
BenGoldberg left
07:40
darutoko joined
07:49
BenGoldberg joined
08:01
BenGoldberg left
08:06
rurban left,
firstdayonthejob joined
08:07
bjz_ left
|
|||
grondilu | geekosaur: it so happens I was considering writing a C wrapper. I guess I'll do. | 08:08 | |
08:09
pierre_ left
08:10
kent\n left
08:13
kent\n joined
08:17
skids left
08:18
kurahaupo joined
08:29
djbkd left,
djbkd joined
08:30
djbkd left,
rurban joined,
djbkd joined
08:31
djbkd left,
djbkd joined,
Actualeyes joined,
djbkd left
08:32
djbkd joined,
rurban left
08:37
djbkd left
08:38
kurahaupo left
08:42
canopus left
08:43
bjz joined,
djbkd joined
08:48
canopus joined
08:50
rurban joined
08:57
rurban left
09:09
toolforger joined
09:15
rindolf joined
|
|||
toolforger | I just saw nqp/docs/jvminterop-goals.md mention an "NQP class loader". Does anybody know why NQP wants its own class loader? | 09:15 | |
09:16
rindolf left
09:21
rurban joined
09:23
rurban left
09:24
rurban joined
09:28
rindolf joined
09:38
RabidGravy joined
|
|||
moritz | toolforger: is this maybe about loading NQP classes from Java land? | 09:43 | |
10:06
labster left
|
|||
toolforger | No idea | 10:10 | |
you don't need that in Java land, unless you want to achieve something specific | 10:11 | ||
such as the ability to unload classes | |||
or having a different set of permissions | 10:12 | ||
moritz | you mean Java has native support for loading NQP classes? | 10:13 | |
toolforger | it has native support for loading an arbitrary byte array as a class | 10:15 | |
10:15
rurban left
|
|||
toolforger | assuming that this specific byte array conforms to the rules for class bytecode | 10:16 | |
i.e. it must typecheck at the bytecode level, and a few other things | |||
That's why NQP is using asm.jar, it has functions that deal with the nitty-gritty details of creating a bytecode array that the JVM will accept as a class | 10:17 | ||
10:18
bjz_ joined,
bjz left
|
|||
toolforger | You can also make a class loader if you want to load a class blob from a data source that's configured differently than what the standard classloader offers | 10:19 | |
though the standard classloaders in Java land are pretty versatile, they can load from .class files, from zip archives (.jar usually), and from URLs | 10:20 | ||
Unfortunately, they cannot load from nested zips, that's one of the major reasons why people write classloaders | |||
10:20
pierre_ joined
10:24
bjz joined,
bjz_ left
|
|||
toolforger | NQP's class loader does not do anything of that kind though, all it does is define a wrapper function that prefills two parameters | 10:25 | |
no new functionality at all | |||
10:25
cibs left
|
|||
toolforger | so no new data sources, the other things might still happen, that's done in the runtime, not in the classloader itself | 10:26 | |
toolforger goes to check where org.perl6.nqp.runtime.ByteClassLoader is used | 10:27 | ||
10:27
cibs joined
|
|||
[ptc] | moritz: I've noticed some links to repos on modules.perl6.org give 404 page. The reason seems to be that the author has deleted their GitHub account. How does one handle such situations? | 10:28 | |
should the modules be removed from the modules list, or should the code be maintained somewhere else? | |||
I've noticed another user had forked at least an earlier version of the code, so the code still exists in some form | |||
*give a 404 page | 10:29 | ||
10:31
espadrine joined
10:35
rurban joined,
rurban left
10:36
seatek left
|
|||
RabidGravy | there's a community modules account for just such a purpose I think | 10:37 | |
El_Che | RabidGravy: if the specific module has a license that allows that | 10:38 | |
RabidGravy | if the module was already being used as a dependency then it probably does want to be preserved | ||
toolforger | Hm. NQP does nothing that requires a classloader, unless it's buried somewhere in callback code. | 10:39 | |
10:40
lizmat joined
|
|||
toolforger | Nope. None of the things you do with a classloader, not even there. | 10:42 | |
Whom should I ask about NQP-on-JVM specifics? I might still have missed something. | 10:43 | ||
[ptc] | RabidGravy: they all belong to the user "carbin", hard to tell if they are used as a dependency in something though | 10:44 | |
RabidGravy | you could probably do something with the projects.json, actually I think I have a little script here that does the reverse dependencies | 10:45 | |
'ang on | |||
[ptc] | oh cool! | ||
and here was me wishing for MetaCPAN for perl6, so I could get the reverse deps :-) | 10:46 | ||
the list I have is: p6-unix-privileges, p6-jdf, p6-fcgi and p6-fcgi-psgi | 10:47 | ||
RabidGravy | a cursory scan of the depended on things would suggest nothing depends on those | 10:50 | |
bartolin | toolforger: maybe psch or arnsholt. I seem to remember that you had a discussion with them about some jvm/interop stuff before | 10:54 | |
toolforger | yep | ||
10:54
djbkd left
10:55
djbkd joined
|
|||
[ptc] | RabidGravy: so should I submit a patch to the modules list to remove these modules? | 10:56 | |
[ptc] hates seeing code go to waste though... | |||
10:57
djbkd_ joined
11:00
pmurias joined,
djbkd left
|
|||
RabidGravy | just checking harder | 11:00 | |
pmurias | toolforger: jnthn is the most familiar with the JVM backend | ||
toolforger | thx | 11:01 | |
What's the best way to contact him? I see him in chat but he hasn't noticed it seems. | 11:02 | ||
RabidGravy | [ptc], there's something weird going on there though | 11:06 | |
toolforger | Oh, I also see Arne Skjærholt in the git log. That's arnsholt here, right? | ||
right, that's his mail address | |||
RabidGravy | the github user 'carbin' was only created on thursday | ||
[ptc] | RabidGravy: that's weird. | 11:07 | |
RabidGravy | I'll poke a bit more in a bit, | 11:08 | |
[ptc] | when I searched for one of the modules I found e.g. this: github.com/nbrown/p6-jdf | ||
11:08
pierre_ left
|
|||
[ptc] | where the user was actually "Carlin" | 11:08 | |
what if the new "carbin" user is actually a new user? And has taken the name after the old one deleted their account? Clutching at straws, I know, but... | 11:09 | ||
11:13
djbkd_ left
11:14
djbkd joined
11:18
djbkd left
|
|||
pmurias | toolforger: usually jnthn is much more active during the week | 11:19 | |
toolforger | good to know | ||
even if it's unfortunate | |||
pmurias | toolforger: what would using the builtin class loaders directly give us? | 11:31 | |
toolforger | Less class confusion | ||
Classes are not necessarily unique across classloaders | |||
e.g. if you have classloaders A and B, you could have MyAwesomeClass loaded twice | 11:32 | ||
this becomes nasty if objects cross classloader barriers | |||
e.g. in callbacks | |||
or generally in APIs | 11:33 | ||
e.g. MyApi.doSomething(MyClass m) lives in classloader A and gets handed a MyClass object that lives in classloader B | 11:34 | ||
You will get a ClassCastException telling you that org.whatever.MyClass is not compatible with org.whatever.MyClass | 11:35 | ||
because the error message does not tell you the classloaders, because classloaders often do not have a human-readable name | |||
pmurias | toolforger: looking at the JVM backend it seems to have two custom class loader classes | 11:36 | |
toolforger | google for "classloader hell" for more stories about this | ||
I saw only one, ByteClassLoader | |||
I seem to have missed the other one - which is it? | |||
pmurias | IgnoreNameClassLoader | ||
which seems to load serialized objects from a different source | 11:37 | ||
toolforger: isn't ByteClassLoader just a convinience wrapper as it just delegates? | 11:38 | ||
toolforger | yes | ||
I'd recommend making it a function on some other class, possibly even a static function | 11:39 | ||
this also avoids instantiating your own classloaders | |||
pmurias | toolforger: the ByteClassLoader itself doesn't seem to load anything | 11:42 | |
toolforger | Indeed it doesn't | ||
pmurias | it only seems to be a subclass inorder to gain access to a protected method | 11:43 | |
toolforger | though you'd have to check where it's instantiated and how the instances are used to see whether it's used for access control etc. | ||
Oh right, the called defineClass is protected | 11:44 | ||
11:44
cibs left
|
|||
RabidGravy | [ptc] actually something like that is highly probably | 11:44 | |
raw.githubusercontent.com/nbrown/p.../META.info | 11:45 | ||
pmurias | toolforger: it's always created like new ByteClassLoader(getClass().getClassLoader()) | ||
toolforger | OK, then all instances of ByteClassLoader are chained to the class loader of the calling code | 11:46 | |
For access control etc., one would have to check how these ByteClassLoader instances are used | |||
RabidGravy | github.com/nbrown/p6-jdf | ||
11:46
cibs joined
|
|||
pmurias | IgnoreNameClassLoader seems like it always loads Perl 6 classes only, so it shouldn't cause mixup with Java classes | 11:46 | |
toolforger: access control? | 11:47 | ||
toolforger | sandboxing | ||
that's what application servers and browser plugins need | |||
nqp shouldn't need that | 11:48 | ||
but you never know | |||
Hmm... I see that java.lang.ClassLoader itself does not offer a way to turn a byte array into a class | 11:49 | ||
pmurias | I'm not a Java programmer so I'm not familiary with all the JVMy stuff ;) | 11:50 | |
11:50
bjz_ joined,
bjz left
|
|||
toolforger | I don't know how asm injects classes into the parent class loader, I think it should do that | 11:50 | |
:-) | |||
I know a bit more, but I try to avoid ClassLoader trickery | 11:51 | ||
because I know enough to know it's dangerous, but not enough to deal with the dangers | |||
RabidGravy | [ptc], so yeah at a guess I'd say they renamed their github account and forgot to update the modules list and the meta files | 11:52 | |
I'll fix the meta list and PR the changes to the META files | 11:53 | ||
toolforger | Hmm... IgnoreNameClassLoader looks whacky to me | 11:54 | |
each newly created class has its own IgnoreNameClassLoader | |||
dalek | osystem: 1a11045 | RabidGravy++ | META.list: Change 'carbin' to 'nbrown' |
11:56 | |
toolforger | Issue is that each Class has a reference to the ClassLoader that creates it, so the IgnoreNameClassLoader objects will stick around until the class goes away, which it doesn't until you unload the ClassLoader | ||
RabidGravy | right that's part of the problem fixed | ||
toolforger | I'll have to look up how this kind of stuff is supposed to be done, proliferating ClassLoaders just to get access to a defineClass() function without having to bother with names is going to create problems, especially once you start to seriously do interop with Java code | 11:58 | |
[ptc] | RabidGravy: dunno if crabin is nbrown though... | 11:59 | |
I think nbrown just happened to have a fork of the repo; they have many forks of perl6-related repos | 12:00 | ||
toolforger | anyway - thx, gtg, rl interrupt, will be back after reading up things on the ASM site - the ASM guys should be pretty knowledgeable about how the bytecode their lib generates should be injected into a JVM | ||
12:00
toolforger left
|
|||
RabidGravy | No they're not forks | 12:00 | |
and if our assumption is wrong at least the modules will be installable again :) | 12:02 | ||
12:03
canopus left
12:08
canopus joined
|
|||
[ptc] | true :-) | 12:10 | |
RabidGravy | I've left a note on the PRs to get on here and discuss if that isn't the right thing, but all done now :) | 12:12 | |
12:18
rurban joined
|
|||
[ptc] | RabidGravy: did a bit more digging and found that nbrown was active on this channel in 2009, and that he joined GitHub in the same year. | 12:26 | |
other than that, he'd forked almost all perl6-related repos, and that's my guess how the "carbin" repos got there... | |||
RabidGravy | and if the "carbin" did delete their account then it might explain why they don't appear to be forks | 12:28 | |
[ptc] | oh well, the modules are installable again :-) | 12:29 | |
RabidGravy | yeah and if nbrown doesn't want to have anything to do with them we can arrange to have them moved elsewhere in an orderly fashion | 12:31 | |
[ptc] | sounds good | 12:41 | |
RabidGravy | now let's see about this "modules being in a weird order" thing | 12:44 | |
12:54
vendethiel left,
rurban left,
vendethiel joined
12:59
rurban joined
|
|||
RabidGravy | which I instantly regret due to the immense dependencies of the modules.perl.org code | 13:04 | |
ho hum | |||
13:11
TimToady left
13:13
TimToady joined
|
|||
masak read it as "modules being the World Order" | 13:16 | ||
13:22
lizmat left
|
|||
pmurias really dislikes how modules.perl6.org looks | 13:26 | ||
13:32
lizmat joined
|
|||
RabidGravy | I've got a thing somewhere that loads up the modules list in CouchDB for a bit of munging goodness | 13:45 | |
13:46
rurban1 joined
|
|||
masak | pmurias: I don't disagree, but could you be more speicifc? | 13:46 | |
13:48
rurban left
13:50
rurban1 left
|
|||
RabidGravy | The projects.json is there to consume for all, it's make something that pleases you :) | 13:56 | |
pmurias | masak: I don't have a good idea how it should look as I would have fixed it already | 13:57 | |
RabidGravy | maybe I should have limited the number of modules the build project list retrieved this could take all afternoon | 13:58 | |
13:58
bjz_ left
|
|||
moritz | RabidGravy: do you want a dump of module.perl6.org sqlite3 database? | 14:00 | |
RabidGravy | it'll be fine, it's about half way through now | 14:01 | |
masak | pmurias: well, it has to have *some* visual appearance... :P I was mostly asking in case you were sitting on a concrete suggestion for improvement, but seems not | 14:05 | |
maybe one way to ask is "should it look more like metacpan.org/ ?" | |||
14:06
kurahaupo joined
|
|||
masak | I mean, it doesn't actually have to be a list | 14:06 | |
in fact, it can only remain a single list for as long as we see ourselves as not having all that many modules | |||
moritz | as long as a browser can comfortable keep the whole list, I'm all for having it right there | ||
14:07
rurban joined
|
|||
RabidGravy | If more people used "tags" it would be nice to have a tag cloud kind of thing | 14:08 | |
moritz | the problem with tags is always: what do you use them for? | ||
and can you make usage somewhat consistent? | |||
RabidGravy | well that's for individual module authors and/or end-users to decide :) | 14:10 | |
the downside of tags is exactly that people will ask the questions you did :) | 14:11 | ||
moritz | and I'm hesitant to implement a system where I'm not confident I can tell people how to use or, or where I'm confident they'll use it in a way that makes sense | ||
masak | what moritz said -- it's a rare thing that "tag cloud" comes in and magically makes things better or more usable in some way | 14:12 | |
usually it takes quite a bit of work, tweaking, and experimenting. I'm not sure we should give module authors that extra work without seeing clear benefits from it. | 14:13 | ||
pmurias | masak: using a fork of metacpan.org could be the right solution | ||
stmuk | what problem are we trying to solve here? | 14:14 | |
masak | * pmurias really dislikes how modules.perl6.org looks | 14:15 | |
stmuk: ^ | |||
stmuk | what does he mean by "looks"? web design or something else? | ||
pmurias | stmuk: ugliness | 14:16 | |
it used to be uglier before I remove the kwalitee-or-whatever-it-was-called | 14:17 | ||
RabidGravy | well regarding the "fork metacpan" isn't there a move afoot to integrate with the actual metacpan? | ||
stmuk | the ecosystem doesn't remotely resemble cpan | ||
pmurias | RabidGravy: there is some work in a branch of fork on github | 14:19 | |
stmuk | forking metacpan.org wouldn't buy you much | ||
you could just stick a search box up using elastic search or whatever | 14:20 | ||
pmurias | there are plans to allow perl 6 releases on cpan | 14:23 | |
stmuk | there are experimental versions already on cpan | 14:24 | |
pmurias | stmuk: just stealing the metacpan design might be one solution | 14:25 | |
14:26
rurban1 joined,
rurban left
|
|||
pmurias | hopefully I'll talk it over with a friend who does both programming and art and he'll tell me how modules.perl6.org should look like ;) | 14:26 | |
stmuk | actually Isn't there already a forked metacpan running on hack? | 14:27 | |
RabidGravy | I'm relaxed about the appearance but nice features metacpan has include the in-site browsing, dependency look-up, testing info etc | 14:30 | |
stmuk | hack.p6c.org:5001 | 14:31 | |
14:34
rurban1 left
|
|||
moritz | Hosting generously provided by: The Perl 6 Community! | 14:35 | |
14:35
rurban joined
|
|||
stmuk | the CPAN-ecosystem experiment seemed to show quite a mismatch last time I looked | 14:36 | |
14:37
nwc10 joined
|
|||
nwc10 | I'm reading docs.perl6.org/language/phasers#INIT and I'm confused by what "When phasers are in different modules, the INIT and END phasers are treated as if declared at use time in the using module." means | 14:37 | |
or is it as simple as I think - it's the same as Perl 5 | 14:38 | ||
use Foo; where Foo.pm has `INIT {warn} END {warn}` | |||
is just the same as | |||
stmuk | stealing design and ideas is good .. but direct code reuse probably isn't possible | ||
moritz | nwc10: it means that they are run at the compile time of the outer module | ||
nwc10 | `BEGIN {INIT {warn} END {warn}}` in the outer module? | ||
which I think is what you just typed | 14:39 | ||
14:39
wamba left
|
|||
moritz | yes | 14:39 | |
nwc10 | good thanks. | ||
stmuk | how would metacpan deal with modules with the same name Foo::Bar which are different? :) | ||
moritz | the nesting of compile and run time are dificult enough to understand and explain; mixing in more phases doesn't make it easier :/ | 14:40 | |
nwc10 | yes. agree. | ||
pmurias | stmuk: the have to have distinct fully qualified named | 14:42 | |
nwc10 | I guess the reason this mattered enough here to need that note in the docs, is because INIT and END have (er) FIFO and LIFO semantics, so the ordering (relative to other INITs and ENDs) needs to be clear) | ||
pmurias | stmuk: names | ||
nwc10 | er, free ')' | ||
stmuk | pmurias: yep! | 14:43 | |
14:44
nwc10 left
|
|||
stmuk | yay nom seems to have enough windows fixes over 2016.10 for an MSI | 14:47 | |
so there will probably be a R* 2016.11 so the windows users can install a binary | |||
14:48
domidumont joined
14:51
kurahaupo__ joined
15:05
rurban left
|
|||
lizmat | stmuk++ | 15:13 | |
15:16
rurban joined
15:18
raiph joined
15:20
canopus left
|
|||
RabidGravy | I really wish I understood this jquery DataTable plugin to figure out why the weird ordering | 15:22 | |
ah, okay it's the dataType thing | 15:24 | ||
timotimo | recently the page has been very unresponsive to searching ... at least once | 15:25 | |
oh | 15:26 | ||
perhaps it was because i searched for "http" and everything matched by way of their urls ;_; | |||
15:27
canopus joined
15:30
wamba joined
15:31
rurban left
15:42
AlexDaniel joined
15:45
qub joined,
qub left
15:46
cdg joined
|
|||
RabidGravy | timotimo, I think this is entirely related to what has gone wrong with the sorting | 15:55 | |
15:55
rurban joined
15:57
rurban1 joined
|
|||
timotimo | mhm | 15:59 | |
16:00
rurban left,
araujo joined
16:01
lizmat left
|
|||
RabidGravy | yeah it appears that it is taking the whole of the first TD into consideration for searching and sorting - including the tags, href and everything | 16:04 | |
16:06
cdg left
|
|||
timotimo | so if you search for "a" or "href", that'll go in, too? | 16:06 | |
[ptc] | just tried typing "href" into the search field; didn't seem to drop the number of items at all | 16:17 | |
doing a search for e.g. 'wig' turned up the entry one would expect | |||
timotimo | i wonder how difficult it'd be to nativecall into fortran libraries? | 16:21 | |
RabidGravy | [ptc], I'm just trying to get my head round what it thinks it is doing | 16:23 | |
DrForr | Doen't FORTRAN use column-major ordering, among other things? | 16:24 | |
timotimo | yes | ||
16:24
rurban1 left
|
|||
DrForr | Not saying it's impossible by any stretch of the imagination, just thinking about what would have to be changed. | 16:26 | |
RabidGravy | right, I've got the search right but I don't appear to have cracked the ordering | 16:28 | |
16:40
rurban joined
|
|||
pmurias | what's the difference between throwpayloadlex and throwpayloadlexcaller? | 16:41 | |
timotimo | one skips a stack frame | 16:42 | |
so pretends to be in the caller's frame | |||
at least that's what i think it does | |||
the kind of thing you'd implement "die" with | |||
RabidGravy | there, that's fixed up | ||
though rather fugly but I'm no client side developer | 16:43 | ||
16:45
ale1ster joined
16:50
Khisanth left
16:54
rurban1 joined
|
|||
dalek | href="https://modules.perl6.org:">modules.perl6.org: c288107 | RabidGravy++ | assets/js/dataTables.filter.perlModule.js: Strip the html from the text, this improves search |
16:56 | |
href="https://modules.perl6.org:">modules.perl6.org: 09d7f7a | RabidGravy++ | assets/js/main.js: Strip to text for order data type Fixes #65 |
|||
16:56
rurban left,
zakharyas joined
|
|||
RabidGravy | of course if anyone else better understands the datatable plugin please intervene | 16:57 | |
16:59
rurban joined,
rurban1 left
17:01
rurban1 joined
17:03
Khisanth joined,
rurban left
17:04
rurban joined
17:06
rurban1 left
17:08
rurban1 joined
17:09
rurban left
17:11
rurban joined
17:12
ale1ster left,
rurban1 left
17:13
Guest11976 left
17:14
rurban1 joined
17:16
rurban left
17:17
rurban joined
17:19
rurban1 left,
mxco86 left
17:21
rurban1 joined
17:22
rurban left
|
|||
RabidGravy | if twingling the modules.perl6.org is necessary to pick up the changes to the javascript then someone might need to do that :) | 17:23 | |
stmuk | RabidGravy++ # full stack | 17:30 | |
RabidGravy | :-\ well in the case of client side stuff it's more tinker with stuff until it works | 17:31 | |
timotimo | i know that feeling | 17:32 | |
RabidGravy | there's something not quite right about that datatable plugin though | 17:33 | |
stmuk | hows that really different to any programming? :) | ||
RabidGravy | if you set a type on a column, even though it's implementation only effects the searching it impacts the sorting, so you have to set the orderTableType as well | 17:34 | |
17:37
skids joined
17:44
rurban joined,
rurban left
17:47
rurban1 left
17:48
rurban joined
|
|||
RabidGravy | timotimo, the searching and sorting should be fine on the modules.perl6.org/ now it appears to have reloaded | 17:50 | |
timotimo | cool :) | ||
thank you for your work | |||
[ptc] | RabidGravy++ | 17:51 | |
just tried it and it works well | |||
RabidGravy: you're a full-stack developer now :-P | |||
timotimo stacks some more stuff on top of RabidGravy | |||
moritz | now RabidGravy is a stack overflow developer :-) | 17:52 | |
[ptc] | aren't we all? | 17:55 | |
stmuk | ttp://www.commitstrip.com/en/2016/11/07/which-full-stack-developer-are-you/ | 17:57 | |
+h | |||
I'm the first sort :P | |||
TimToady | .tell garu if you want to return multiple values from a function, you should really use binding, which will work argument by argument, rather than list assignment, which will flatten like Perl 5's list assignment | 17:58 | |
yoleaux | 01:21Z <AlexDaniel> TimToady: I was expecting this to work: 「my ($x, [@y]) = 24, [40, 50, 60]; say @y.perl」, but right now it is completely bugged. What would be the right result in this case? See #130079 | ||
TimToady: I'll pass your message to garu. | |||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130079 | ||
yoleaux | 01:50Z <MasterDuke> TimToady: do you mind looking at irclog.perlgeek.de/perl6/2016-11-13#i_13557942? is there something wrong or are we just expecting incorrect behavior? | ||
03:29Z <AlexDaniel> TimToady: ↑ #130081 | |||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130081 | ||
TimToady | AlexDaniel: same to you, use binding there, not list assignment | 17:59 | |
18:00
autark left
|
|||
AlexDaniel | TimToady: example? | 18:01 | |
yoleaux | 07:20Z <lizmat> AlexDaniel: see github.com/rakudo/rakudo/commit/37d0e46614 | ||
18:01
girafe joined
|
|||
AlexDaniel | ah | 18:02 | |
got it | |||
TimToady | .tell MasterDuke TOP is not going to magically start backtracking merely because .parse fails, especially since backtracking probably means you have a smelly grammar, which is why tokens and rules don't backtrack by default in the first place; so use regex and explicit $ if you really need to backtrack | 18:03 | |
yoleaux | TimToady: I'll pass your message to MasterDuke. | ||
AlexDaniel | TimToady: so what should be the result if you attempt to use list assignment like this? | ||
should it be a syntax error, a run time error of some sort, or what is it? | |||
TimToady | it should be like P5's list assignment, to the extent possible, but assigning to [@y] should probably fail since that's not sensical for either assigning or binding a flat array | 18:05 | |
that would only bind an array contained as a single elem of another array | |||
and using [@y] makes no sense under a flattening regime like p5 list assignment | 18:06 | ||
just bare @y would slurp the rest of the args | |||
AlexDaniel | TimToady: well, I can barely follow any of this, so feel free to leave a comment on #130079 | ||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=130079 | ||
TimToady | alas, don't really have good internet here, except a few minutes at a time... | 18:07 | |
this hotel is not quite so enlightened as our previous one | 18:08 | ||
18:08
araujo left
|
|||
TimToady | and this coming week we may not have much internet at all, on a cruise | 18:08 | |
18:20
domidumont left
18:24
domidumont joined
|
|||
grondilu | geekosaur: would you have a few minutes to help me make the wrapper you were talking about earlier? I wrote it but and it compiles but I can't link it properly. | 18:31 | |
geekosaur | sure | ||
grondilu | hang on | ||
the wrapper I wrote is: paste.debian.net/895284/ | |||
I compiled it with gcc -lbinaryen -I../binaryen/src -c -Wall -Werror -fpic binaryen-constants.c | 18:32 | ||
I made the shared library like this: gcc -shared -o libbinaryen-constants.so binaryen-constants.o | 18:33 | ||
but then when trying to call it with NativeCall I get: | |||
Cannot locate native library '/usr/local/lib/libbinaryen-constants.so': /usr/local/lib/libbinaryen-constants.so: undefined symbol: BinaryenConst | |||
yet BinaryenConst is defined in binaryen-c | 18:34 | ||
(FYI binaryen is at github.com/WebAssembly/binaryen) | |||
geekosaur | putting -lbinaryen at the beginning instead of the end is at minimum a smell and potentially the problem | 18:36 | |
grondilu | ok | ||
geekosaur | linkers tend to search libraries only when they have undefined symbols, so a library at the beginning may be ignored because it doesnt have any symbols to look for yet | 18:37 | |
grondilu | same error | ||
geekosaur | -l is not really an option like -c or -o, it's a macro of sorts that expands to the path to a libraru | ||
grondilu | also frankly I thought I was supposed to put it in the linking line, not the compilation one | 18:38 | |
but I've seen it done as such somewhere so * | |||
geekosaur | the linking line is usually better. shared object handling is somewhat odd, it may well work as part of the compile line, then again it might not | 18:40 | |
you could try moving it | |||
oh, creating a .o, probably not going to be used because linker not invoked, so yes | |||
grondilu | full error message: paste.debian.net/895287/ | ||
geekosaur | you can also use ldd on the .so to see if it has the reference to libbinaryen.so.whatever | 18:41 | |
grondilu | it doesn't apparently | 18:42 | |
18:43
labster joined,
labster left
18:44
labster joined
|
|||
grondilu | I've tried adding ../binaryen/CMakeFiles/binaryen.dir/src/binaryen-c.cpp.o on the linking line but I still don't see it in ldd's output | 18:44 | |
geekosaur | that is static, it won't show in ldd | ||
grondilu | ok | 18:45 | |
geekosaur | again, try moving that -lbinaryen to the second gcc instead of the first | ||
[ptc] | anyone got an idea what this error message is trying to tell me? Cannot find method 'export-package' on object of type CompUnit | ||
18:45
labster left
|
|||
geekosaur | (also it would likely fail because other objects would be needed) | 18:45 | |
[ptc] | a `git grep` on the source doesn't turn up any `export-package` routine... | ||
grondilu | I got /usr/bin/ld: cannot find -lbinaryen | 18:46 | |
collect2: error: ld returned 1 exit status | |||
geekosaur | [ptc], something is trying to use `is export` on a CompUnit for some reason | ||
[ptc] | geekosaur: oh, ok. Thanks :-) Now I can dig further | ||
MasterDuke | src/core/CompUnit/Handle.pm:36: method export-package() returns Stash { | ||
yoleaux | 18:03Z <TimToady> MasterDuke: TOP is not going to magically start backtracking merely because .parse fails, especially since backtracking probably means you have a smelly grammar, which is why tokens and rules don't backtrack by default in the first place; so use regex and explicit $ if you really need to backtrack | ||
geekosaur | grondilu, you didn;t actually install binaryen? you will need -L and -R options in the link line to point to wherever the libbinaryen.so.* is | ||
18:47
espadrine left
|
|||
grondilu | geekosaur: I did put the libbinaryen.so file in /usr/local/lib and it works fine with NativeCall | 18:47 | |
geekosaur | then ld is not using -L/usr/local/lib -R/usr/local/lib by default | ||
(you could check /etc/ld.so.conf to see if /usr/local/lib is in there; if so then you don't need the -R, but you might still need the -L) | 18:48 | ||
grondilu | gcc: error: unrecognized command line option '-R'; did you mean '-R'? | ||
geekosaur | ??? | 18:49 | |
oh | |||
grondilu | IKR | ||
geekosaur | wait, is my client changing that? | ||
grondilu | nope, it was sic | ||
18:50
labster joined
|
|||
grondilu | $ grep local /etc/ld.so.conf.d/* | 18:50 | |
/etc/ld.so.conf.d/libc.conf:/usr/local/lib | |||
geekosaur | ok, you don't need the -R then | ||
(and I was wondering if my client had changed a normal hyphen to a Unicode smart hyphen of some kind, but I just checked that and it didn't) | 18:51 | ||
(also come to think of it that would not cause *that* error, it would somehow have to be the 'R' not the '-') | |||
grondilu | it still can find the lib | ||
s/can/can not/ | |||
geekosaur | which part can't find it now? | 18:52 | |
MasterDuke | .tell TimToady i think i figured out that i needed a regex, but i'm having some problem implementing it with some further discussion here, does this look like a bug to you? irclog.perlgeek.de/perl6-dev/2016-...i_13559207 | ||
yoleaux | MasterDuke: I'll pass your message to TimToady. | ||
grondilu | $ LANG=C gcc -L/usr/local/lib -shared -l binaryen -o libbinaryen-constants.so binaryen-constants.o | 18:53 | |
/usr/bin/ld: cannot find -lbinaryen | |||
collect2: error: ld returned 1 exit status | |||
oh wait | |||
geekosaur | aside from the fact that "-l binaryen" should not have a space and should be at the very end --- the error suggests it figured that out (which surprises me) but still can't find it. unless -l with a space does something weird | 18:54 | |
grondilu | I'm so dumb | ||
geekosaur | [ptc], MasterDuke's thing suggests you may in fact have an internal error where something that expects a CompUnit::Handle got a CompUnit instead | 18:55 | |
grondilu | geekosaur: I'm so sorry. I really thought I add put it in /usr/local/lib. Turns out I didn't. | ||
geekosaur | you may also have to put the one with the version suffix there, if it has one (and if it doesn't, it's a bad package and will bite someone someday... but that's not your problem) | 18:56 | |
grondilu | well, I still get the error anyway | ||
geekosaur | ls -lL /usr/local/bin/libbinaryen.so | ||
er | |||
ls -lL /usr/local/lib/libbinaryen.so | |||
wait no, sigh | |||
ls -l /usr/local/lib/libbinaryen.so | |||
grondilu | -rwxr-xr-x 2 grondilu staff 2349192 nov. 12 20:00 /usr/local/lib/libbinaryen.so | ||
geekosaur | ok, then I don't know why it's still not finding it | 18:57 | |
grondilu | the error I was talking about was the NativeCall one, not the gcc. | ||
now -lbinaryen works | |||
MasterDuke | does anyone here have any experience parsing the json output of rakudo profiles? i profiled building rakudo, but it creates a 830mb file, which the two usual viewers can't handle | 18:58 | |
[ptc] | geekosaur: could be. I was digging in the `v5` repository and trying to work out if the test suite worked (it doesn't) | ||
geekosaur | ok, use ldd on your .so to make sure it has the link to libbinaryen.so and that it can resolve it | ||
[ptc] | geekosaur: and once one gets the PERL6LIB right, that's the error I was getting | ||
geekosaur | MasterDuke, I think people have been slamming into that one for over a year now >.> | 18:59 | |
every so often timotimo grumps about it | 19:00 | ||
grondilu | no link to libbinaryen.so shown by ldd | ||
$ ldd /usr/local/lib/libbinaryen-constants.so | |||
linux-gate.so.1 (0xb7754000) | |||
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb757f000) | |||
/lib/ld-linux.so.2 (0x800ae000) | |||
geekosaur | then it's still not actually linking it | 19:01 | |
what does that link command currently look like? | |||
grondilu | $ LANG=C gcc -shared -o libbina | ||
ryen-constants.so $(find ../binaryen -name 'binaryen-c.cpp.o') binaryen-constant | |||
s.o -lbinaryen | |||
geekosaur | you broke it... | ||
grondilu | wyeah | ||
geekosaur | please do not link against the .o | ||
grondilu | bad paste | ||
MasterDuke | geekosaur: yeah, i looked into modifying the qt viewer, but don't know (or like) c++ enough to change its parsing library | 19:02 | |
geekosaur | you would need to link EVERY .o and not use -lbinaryen | ||
do one or the other, not both | |||
grondilu | ok | ||
finally it shows up! | 19:04 | ||
19:04
darutoko left
|
|||
grondilu | but as "libbinaryen.so => not found" | 19:04 | |
19:05
zakharyas left,
labster left,
labster joined
|
|||
geekosaur | but it's in /usr/local/lib and you showed it being in the ld.so.conf stuff. siiiigh | 19:06 | |
ok, guess you get to try to force it | |||
grondilu | I get a different error from NativeCall now. Progress I guess. | 19:07 | |
geekosaur | since gcc was being weird about -R, try passing it through as a linker option: -Wl,-R,/usr/local/lib | ||
19:09
Guest22943 left,
Guest22943 joined,
Guest22943 left,
Guest22943 joined
|
|||
grondilu | yes, that works. I see it correctly in ldd now | 19:10 | |
now I get a segmentation error | 19:11 | ||
geekosaur | sigh | 19:12 | |
grondilu | nevermind. I'll go back to it later. | 19:13 | |
geekosaur | wait, that wrapper makes not a lot of sense unless you are wrapping things that take refs already, and if you aren't then it should be throwing C errors unless they're doing something heinous in C | ||
grondilu | I guess I will have to look in the make file how they did compile and link binaryen. I'll just cargo cult it | 19:14 | |
geekosaur | (which...) | ||
because if something is struct foo f(struct foo a) then the wrapper is struct foo *f_(struct foo a_) {static struct foo evil = f(*a_); return &evil } # except this is not re-entrant nor thread safe, you need to be more clever in that case | 19:15 | ||
grondilu | I do more than turning struct value call into struct ref call if that's what you're saying. I think I can hide the struct all together. | 19:16 | |
19:17
Guest22943 is now known as giraffe
|
|||
grondilu | because the function that returns a struct is used by only one function anyway. | 19:17 | |
and that function does return a reference. | 19:18 | ||
rather a BinaryenConst | |||
which is a (void *) | |||
I supposed the binaryen team had reasons to make the struct visible but it does not seem obviously necessary. | 19:19 | ||
(sorry I meant BinaryenExpressionRef earlier, not BinaryenConst) | 19:20 | ||
geekosaur | you might want to make sure that does what you think it does. sadly, with C it's not always obvious | 19:22 | |
and if you get it wrong, your diagnostic is indeed a core dump :/ | |||
grondilu | I guess to be safe I could do a wrapper using struct ref as you suggested. | 19:23 | |
but the struct has an anonymous union in it, that makes it painful to do with NativeCall | 19:24 | ||
19:25
cdg joined,
cdg left,
cdg joined
|
|||
grondilu | oh man, I was silly again | 19:27 | |
I forgot the module argument | |||
it works! | |||
geekosaur: thanks a lot for your help :) | 19:28 | ||
geekosaur | yay | ||
grondilu | github.com/grondilu/binaryen-bindings | 19:33 | |
it will be cleaner to do the kind of wrapper you were talking about though, I'll work on it. | 19:35 | ||
timotimo | geekosaur: yeah, i grump that we don't use ldconfig to find .so files to load with nativecall | 19:46 | |
that's what that's about, right? | |||
geekosaur | no, that was MasterDuke complaining about tools choking on profile output | 19:47 | |
timotimo | oh, you mean the profile output being far too big | 19:49 | |
i see | |||
geekosaur | yep | ||
timotimo | dinner time over here now :) | 19:50 | |
moritz | bisectable6: my %h; %h{class { has str $.s }.new.s} = 1 | ||
bisectable6 | moritz, On both starting points (old=2015.12 new=59bb1b1) the exit code is 0, exit signal is 11 (SIGSEGV) and the output is identical as well | ||
moritz, Output on both points: | |||
geekosaur | grondilu, it's simpler to do the wrapper I suggested, but it's too limited --- note my comment about reentrancy. if yours works, go with it | 19:51 | |
timotimo | moritz: requires an moar+nqp bump to work | ||
grondilu | I now understand why they made the struct visible. My wrapper can not re-use the same literal for different modules, for one. | 19:52 | |
moritz | timotimo: oh, tehre's a fix for that already? | ||
19:53
setty1 joined
|
|||
AlexDaniel | this, I guess: github.com/MoarVM/MoarVM/commit/28...193ab31a53 | 20:01 | |
20:02
firstdayonthejob left
|
|||
AlexDaniel | MasterDuke: should it even report exit code if there's a SEGV? | 20:02 | |
20:03
rindolf left
20:06
firstdayonthejob joined
20:07
rindolf joined
|
|||
AlexDaniel | m: say 8.9 gcd 2 | 20:09 | |
camelia | rakudo-moar 59bb1b: OUTPUT«2» | ||
20:11
bjz joined
20:13
devmikey joined
|
|||
moritz has been working so much with gocd lately that he parses gcd as a misspelling of gocd :-) (go.cd/ for those wondering) | 20:13 | ||
AlexDaniel | I just threw it in as an interesting edge case, there's nothing wrong and nothing new with it. | 20:14 | |
… otherwise Zoffix wonders why is it so quiet here :) | 20:16 | ||
geekosaur | quiet? | 20:17 | |
yeek-yeek >.> | |||
MasterDuke | AlexDaniel: i guess there's no reason to | ||
20:26
rurban left
20:31
nowan left
|
|||
RabidGravy | coo a live issue with the futuremusic.fm, haven't had one of those for a while | 20:33 | |
20:36
setty1 left
20:37
setty1 joined
20:38
BenGoldberg joined
20:39
domidumont left,
leego left,
leego joined
20:41
leego left
20:42
leego joined
20:49
bjz left
20:54
lizmat joined
|
|||
RabidGravy | I've so got to finish the radio software | 21:03 | |
good show on the stream.futuremusic.fm:8000/mp3 btw :) | 21:05 | ||
21:08
devmikey left
21:24
Vynce joined
|
|||
El_Che | De gustibus non est disputandum :) | 21:24 | |
21:24
FROGGS_ left
|
|||
timotimo | moritz: yup, AlexDaniel found the right commit | 21:37 | |
21:39
bjz joined
21:41
seatek joined
21:42
kyclark_ joined
21:43
cdg_ joined
21:46
bjz left,
cdg left
21:47
cdg_ left,
Vynce left
21:48
bjz joined,
nowan joined
21:51
Vynce joined
21:55
Vynce left,
bjz left
22:00
kyclark_ left
22:06
bjz_ joined
22:11
bjz_ left
22:15
pmurias left
22:24
Ben_Goldberg joined,
BenGoldberg left,
Ben_Goldberg is now known as BenGoldberg
22:29
setty1 left,
cdg joined,
kurahaupo__ left
22:31
RabidGravy left
22:34
lostinfog joined,
lostinfog left
|
|||
nightfrog | 0 | 22:38 | |
seatek | I just want to thank you all for exceptions. They work so nicely and so flexibly. | 22:41 | |
rindolf | Hi all! make install paste.debian.net/895338/ in rakudo fails here - | 22:48 | |
22:52
danlei joined
|
|||
danlei | how can I redefine classes/roles/... at the repl without getting Redeclaration of ... errors? | 22:53 | |
22:54
kurahaupo left
|
|||
timotimo | JSON::Fast: 63.87user 0.48system 1:04.40elapsed 99%CPU (0avgtext+0avgdata 874728maxresident)k | 22:56 | |
JSON::Tiny: 338.42user 1.88system 5:40.57elapsed 99%CPU (0avgtext+0avgdata 4634628maxresident)k | 22:57 | ||
about 19% as much ram usage, more than 5x as fast | |||
for a 50 MB file | 22:58 | ||
seatek | timotimo: so if i were to, say, right now, change use JSON::Tiny to use JSON::Fast, no bad things would happen and my world would be much better? | 23:00 | |
timotimo | correct | ||
23:00
cdg_ joined
23:02
cdg left
|
|||
seatek | timotimo: and you also are correct! :) | 23:02 | |
rindolf | Seems like the travis-CI build fails as well - for similar reasons - travis-ci.org/rakudo/rakudo/jobs/175494053 | ||
seatek | no failed tests. that felt nice | ||
danlei | (I found MONKEY-TYPING/augment and that kinda works, but there has to be some easier way for interactive use, no?) | 23:03 | |
gfldex | danlei: no, Perl 6 is a lot less dynamic that it looks | 23:08 | |
danlei | gfldex: is that the way it's supposed to be and going to stay, or is it a deficiency of the implementation (rakudo)? that seems to be some basic stuff for interactive repl use | 23:10 | |
gfldex | danlei: it will stay that way | ||
danlei | gfldex: hm, I'm a little -- shocked :) | 23:11 | |
gfldex: but maybe that's just because I'm used to the lisp (and other modern dynamic languages) way to do things | 23:12 | ||
anyway, thanks | |||
gfldex | danlei: if you don't need type checks, you can do the dynamic stuff by hand | ||
23:13
cpage left,
cpage joined
|
|||
danlei | gfldex: you mean without using the class/rule/... sugar? | 23:13 | |
gfldex: or what do you have in mind? | 23:14 | ||
gfldex | m: my $C = class { method m { say 'oi?' } }; $C.new.m; $C = class { method m { say 'oi!' } }; $C.new.m | ||
camelia | rakudo-moar 59bb1b: OUTPUT«oi?oi!» | ||
danlei | gfldex: ah, I see | ||
gfldex: that seems ok for playing around at the repl, but it's not ideal when, say, loading files in the repl | 23:15 | ||
but it's at least something | |||
gfldex: could you maybe point me to some document explaining the rationale behind this (perl6 being more static than I expected)? some synopsis maybe? | 23:19 | ||
timotimo | you can't really load a file "into" the repl at the moment | 23:21 | |
the repl is quite underpowered and also buggy in general | |||
23:22
cpage left
|
|||
danlei | timotimo: I've written a little Emacs comint repl for perl6, I use EVALFILE for whole files, but often, I'm just sending the region to the process | 23:22 | |
23:22
Upasaka left,
cpage joined
23:23
rindolf left
|
|||
danlei | timotimo: what gfldex showed is better than nothing, but of course I don't want to write my code this way :) | 23:23 | |
timotimo | mhm | 23:25 | |
i got a major speed boost in JSON::Fast by throwing out the CATCH that translate the internal error from ordat going over the end of the string into a nicer error text | 23:27 | ||
danlei | I thought I just missed some pragma or command line switch -- I didn't expect that to be by design. it's still a great language, as far as I can tell from a few weeks of dabbling. but it's a little sobering for me. | 23:28 | |
anyway, thanks for the help guys | |||
timotimo | good luck and have fun with perl6 :) | 23:29 | |
danlei | thanks :) | ||
23:29
cpage left
|
|||
timotimo | your problem is just not being allowed to redefine classes in the repl? | 23:30 | |
23:30
cpage joined
23:31
cdg_ left
23:32
cyphase left
|
|||
danlei | timotimo: well, whatever yields the Redeclaration errors is suboptimal for interactive use, imho. (I was playing with classes and roles today and that's where I became aware of it. no problems with variables, subs etc. until now) of course, you could always just restart the repl, but that's a little awkward if you're used to languages where redefining is no problem. | 23:35 | |
timotimo | have you tried spelling it "my class Blah { .. }"? | ||
it won't affect things that have already been declared to use your class | 23:36 | ||
because the name gets overwritten for future stuff, but the old thing is still there | |||
23:36
kyclark_ joined,
cyphase joined
|
|||
danlei | timotimo: that's even better than gfldex' suggestion, thanks (but I'd still have to write the code in my files this way) | 23:37 | |
thanks | |||
23:39
kyclark_ left
|
|||
danlei | (actually, it's good to know about both :) | 23:41 | |
23:45
girafe left
23:52
kyclark_ joined
23:53
kyclark_ left
|
|||
danlei | thanks again and happy hacking -- I'm off | 23:54 | |
23:54
danlei left
23:59
pecastro left
|