»ö« 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.
sortiz jnthn, my last one today: There are many MoarVM ops not exposed at the nqp level? 00:05
lizmat good night, #perl6!
kjs_ good evening. I’m using JSON::Tiny to parse large files most of which have simple key-value entries, but some value entries are arrays. However, when parsing it (using the “from-json” method), I can’t seem to iterate over the values of arrays. 00:06
sortiz gnight lizmat
kjs_, Do you have a minimal example that shows the problem? 00:09
jnthn sortiz: Not that many, no.
sortiz: Provided you discount spesh ops, but those aren't part of the VM interface, and you can't even use them in a bytecode file. 00:10
sortiz: Those ones are marked .s in oplist
kjs_ nopaste?
sortiz kjs_, sure.
kjs_ eh, that used to give a link many years ago :-) 00:11
sortiz: nopaste.linux-dev.org/?958277 00:12
sortiz: that isn’t the code, that’s the result of the parse
jnthn Time for some rest...'night o/ 00:13
sortiz jnthn, thanks and gnight
kjs_ the “technologies” field has an array of values, but I don’t understand how I can iterate over them.
sortiz kjs_, seems that technologies in fact has [Objective C iOS 5.0] as value, so not a problem with JSON::Tiny, can be in your iteration code. 00:17
kjs_ sortiz: yes, it’s probably in the code alright. Only starting out with Perl 6 (no Perl experience) 00:18
sortiz kjs_, I suggest you write a small test program to test the concepts of nested arrays. 00:20
kjs_ sortiz: nopaste.linux-dev.org/?958297.
if I run this, I just get a b c, but I think I need to write for @a -> @e , and then a nested loop 00:21
sortiz kjs_, nop, you should test inside the loop the kind of $e and act accordingly, may be with an inner loop. 00:22
sortiz m: my %h = (a => 1, b => [1,2,3]); for %h { say .value if .value ~~ Array } 00:25
camelia rakudo-moar 08ad4b: OUTPUT«[1 2 3]␤»
kjs_ sortiz: ah thanks, I’ll try that 00:26
I think I got it. I’ll work further on it. 00:27
sortiz kjs_, you can use a Hash directly in a for, the element will be a Pair 00:28
timotimo yo 00:33
dalek ecs: e441a27 | skids++ | S17-concurrency.pod:
Pass 2 at react/supply blocks, clarify some grammar, add some examples
timotimo saw deadpool now 00:35
SmokeMachine____ I think I found a bug on rakudo.. shouldn't be printing 2 different counters? www.irccloud.com/pastebin/s6erYoU2/ 01:43
and if I kill the first one (the bged one) the second starts counting... 01:45
geekosaur I think the only bug visible there is that your shell doesn't tell you the first one caught SIGTTOU when it tried to do output? 01:45
SmokeMachine____ the same thing happens if I run the code on two different terminals... 01:46
SmokeMachine____ I think this version is easier to see what I'm talking about... www.irccloud.com/pastebin/PE4rbDVa/ 01:49
geekosaur: ^^ 01:50
I don't know how, but it looks like one process is "pausing" the other process... 01:51
ugexe what if you dont use `-I. -MNode -MData` 01:55
ugexe without those it works for me. and thats because module loading/precomp uses locks, which is what is "pausing" your second process 01:58
SmokeMachine____ ugexe: removing the -MData from the 2nd one works for me too... www.irccloud.com/pastebin/PL4G21Ws/
ugexe: but shouldn't the first works too?
ugexe first what? 01:59
SmokeMachine____ the one with the -MData on both scripts...
ugexe get rid of the =I. and it probably will 02:00
-I.
dont misunderstand, they all *should* work. but its a known bug 02:01
llfourn rt.perl.org/Public/ # down for me 02:02
SmokeMachine____ oh! is it a known issue?! ok! thanks! 02:03
AlexDaniel huh! RT is down? 02:04
llfourn AlexDaniel: yep
AlexDaniel nice
:/
llfourn
.oO( where do I send the RT for that )
I just had a pub report to file too :( 02:05
try: perl6 -e 'sub MAIN($foo,*%) { }'
AlexDaniel llfourn: perhaps you can send an email and it will be processed once it is up 02:06
llfourn it probably would work
hmm it processed the email immediately 02:09
AlexDaniel llfourn: awesome bug by the way 02:12
llfourn XD
dalek kudo-star-daily: 839ed18 | coke++ | log/ (9 files):
today (automated commit)
02:23
llfourn is there a way to get the current Distribution object? 02:25
inside a distribution's bin/some-script.p6 in this case. 02:27
AlexDaniel llfourn: does it say Usage: -e '…' ? 02:32
why does it say*
llfourn: it seems like it treats the first arg as a file name or something?
and in this case it is ‘-e’? 02:33
geekosaur would suspect -e is implemented with a custom MAIN and addition of a second one breaks things?
ugexe use $?FILE to get the sha1 of the bin script, grep CURLI/dist/* for the one containing the sha1 ($?FILE), and from-json(slurp($that-file)). if its not installed then use from-json(slurp("../META6.json")). then Distribution.new(|%meta)
llfourn AlexDaniel: that usage -e thing is normal 02:34
what geekosaur said
ugexe: :D ahhhhh
AlexDaniel oh, right, it actually works 02:35
timotimo well, RT may be down, but at least synopsebot6 is happy
llfourn Ok what I want to do is get the version of the thing I am currently in so I can so in the USAGE 'blah blah v3.2' or whatever 02:37
ugexe i dont think it can know that 02:39
llfourn hmmm so how does it figure out %?RESOURCES if it doesn't already parse MET6.json 02:40
ugexe if you have it installed already and you run bin/myscript without -Ilib, then its not running in your local Distribution, but you arent really running the installed one either
its because if you are in a root module path its a ::FileSystem or whatever
so it'll use the resources locally before the installed i believe 02:41
llfourn so what if it's an ::Installation?
is there a way to do it there?
ugexe github.com/ugexe/zef/blob/master/l...t.pm6#L453 02:45
llfourn I guess that makes sense now that I think about. You don't want your bin/ stuff reading META6.json.
ugexe you can do that with a regular Distribution (doesnt have to be Zef::Distribution
llfourn ugexe: yep thanks. I'm going to do something like that in USAGE. $?FILE.parent.parent.child("META6.json").slurp.&from-json<version> 02:48
llfourn $?FILE.IO* 02:49
ugexe for that specifically you might be able to use BEGIN { } to just do it once 02:51
i output the current config file being used (its dynamic) so i didnt think about that 02:52
llfourn ugexe++ that is a splendid idea
hmm maybe I should add this to CompUnit::Util 02:53
since I can find the meta from the repo I think. I could say given a compunit try and find its version. 02:55
llfourn AlexDaniel: it actually works fine if you do '*%foo' instead of '*%' 03:04
it's sometime to do with printing usage with 0-length variable name
also *%vars in MAIN seem to be goofy in general in terms of printing out usage 03:05
ugexe shouldnt the version be available without loading the meta though? 03:42
llfourn It would be nice. You could insert some variable at compile time into each compunit, assuming you have the MET6.json at compile time. 03:44
ugexe you can get at the namespace, seems like you should be able to get at the identity
llfourn $?DISTRIBUTION #?
ugexe well CURLI has a .resolve method. and there is *supposed* to be a $?PACKAGE
note that .resolve requires a newer rakudo 03:45
then you couuld theoretically do .resolve($?PACKAGE).distribution.ver
llfourn What do we call .resolve on? 03:46
$?PACKAGE?
ugexe $*REPOS>>.can-install # you get the idea 03:47
its a method in compunit::repository::installation
llfourn oh ok
ugexe it will do the lookup for you 03:48
llfourn can ::filesystem do it too?
ugexe no
llfourn ah 03:49
ugexe it probably could, it would be trivial i'd think
llfourn ugexe: according to S02: $?MODULE Which module am I in? 03:50
ugexe zef does it. but it uses its own ::DependencySpecification to match against
llfourn I think $?MODULE means distribution? 03:51
ugexe it should just mean module not distribution, but you can look up a distribution from the module
llfourn what is a module then?
ugexe the key is it needs to include the version
llfourn there is already $?PACKAGE
$?MODULE ~~ CompUnit?
ugexe package { } vs module { }, but both would be in `provides` id imagine 03:52
so your lookup needs to look at provides
llfourn ugexe: ah anyway in S02: %?META The META6.json data associated with the module
ugexe now that would be nice 03:53
llfourn it should be doable -- though I'm not sure how it works for stuff in bin/ of a distribution 03:54
seeing as they are not loaded via CompUnit:: afaik
(which is where I want it)
ugexe it also goes well with Distribution as an interface
then it would be trivial 03:55
bin/ gets listed in `files` of the META6 that gets installed (the META6 that gets installed is slightly different from the original META6)
llfourn I see. 03:56
ugexe or maybes its resources, but it gets *added* in the install process
llfourn right but if you are just doing perl6 -Ilib bin/whatever.pl it might be tricky to set any compile time variables 03:57
llfourn but not impossible. There could just be a static check like $?FILE.parent.parent('META6.json').e in the case of directly running a .pl. 03:57
ugexe not if you have Distribution as an interface
role files { } role sources { } for example. now you can switch role files with whatever parses the correct META6 file 03:58
Distribution does LocalMeta { method meta { slurp(...) } }
llfourn hmm yeah I'm not really familar with how Distribution is used 03:59
I'm sure i will learn from your PR that implements these things :D
ugexe excellent, so think of how you would *want* to use it
llfourn well my curreny use case is doing have a bin/script.pl --version thing that just gives the right answer 04:00
(we could even include it as part of the default USAGE generation)
ugexe as long as you dont use --ver heh 04:03
(github.com/rakudo/rakudo/blob/nom/...ion.pm#L39 install wrapper will eat it)
llfourn ugexe: yeah... do we have to do that install wrapping thing? 04:04
ugexe i think so yes
you have 2 versions of a Distribution installed. which bin/ script wins? what if you want to use the older version? 04:05
llfourn I'd suggest that the newest one should just be in the path, then if you want the old one just use the absolute path 04:06
obviously it's a bit of work
ugexe it could be improved though; if it actually did like `use <bin/script.pl6>` then we could precompile the bin scripts
llfourn but most of the time you just want the newest one
ugexe (instead of running in a new proc)
llfourn yeah the new proc thing is what bugs me :\
ugexe because there has to be a perl6 entry point
to get the fastest start up time my bin script is just `use Zef::CLI;`, and all my MAINs are in Zef::CLI which gets precompiled as a module 04:07
mst needing to do an exec may not have to be forever, or at least not actually always required, but for the moment it's a good way to give us freedom of movement later
ugexe make the perl6 entry point as bare as possible
llfourn wonders if the wrapper is preserving STDIN 04:08
mst er. I'm unsure what you're imagining, but it doesn't read anything, so fd 0 will be handed on untouched 04:09
llfourn hmm ok I didn't know what's how run works
phew
mst try and avoid imagining extra problems that don't exist - programming is hard enough when you only have to deal with the real ones. 04:10
llfourn docs: $in, $out and $err are the three standard streams of the to-be-launched program, and default to "-" # :) 04:11
mst writing a wrapper that does an exec is a time honoured unix tradition and generally it's difficult to screw it up *subtly* 04:14
i.e. either it works or it's completely foobar
note: I have seen it be completely foobar, briefly. diagnosing that and proposing a fix (which lizmat then improved in the process of writing it competently, which I couldn't've done ;) is one of the few useful things I've done so far 04:15
llfourn run isn't exec though afaik. But its default seems to emulate it. 04:16
mst++ for useful things :) 04:17
mst I'm reasonably sure we don't fork a child process and leave it around? or maybe my lack of knowledge is showing
do remember that if I ever appear to know what I'm talking about, it's usually because I'm talking about toolchain-y stuff which I know too much about from other areas combined with reasoning from first principles and frantically diving the rakudo sources to provide the illusion of knowing things about perl6 ;) 04:19
llfourn heh gotcha. I don't know much either. But you can definetly use run create a new process not exec. 04:20
if called wihtout args it just seems to attach the fds in all the right places
my $proc = run 'echo', 'Hallo world', :out; #eg
s/args/options/ 04:21
but that's a good point why doesn't it just exec..
m: say &exec 04:22
camelia rakudo-moar 08ad4b: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_66z0AJuUF␤Undeclared routine:␤ exec used at line 1␤␤»
llfourn can we even do exec?
mst ... surely ... 04:24
llfourn I know we don't have a direct way of doing fork
ugexe the wrapper indeeds leaves a process living, waiting for the spawned process to finish 04:25
mst huh
is there some writeup of the 'no direct fork' thing?
llfourn mst: docs.perl6.org/language/5to6-perlfunc#fork 04:26
llfourn Nothing in Perl 6 exactly replicates the Perl 5 exec. shell and run are similar to Perl 5's system, but exec's behavior of not returning after executing a system command would have to be emulated by something like shell($command);exit(); or possibly exit shell($command); 04:26
ugexe exit run($*EXECUTABLE, @binaries[0].hash.<files><bin/#name#>, @*ARGS).exitcode
llfourn so there's our explanation
ugexe i believe the .exitcode should wait for the process to finish
mst that doesn't explain anything though.
llfourn well it exlpains why the implementor of the wrapper didn't use exec 04:27
ugexe probably should use Proc::Async?
llfourn ugexe: why?
ugexe i guess its still has to wait for the exitcode 04:28
llfourn run is blocking isn't it?
mst ugexe: if you've forked, you don't want the parent process to exit before the child does, because somebody may be waitpid()ing on you 04:29
llfourn ah no it isn't... I see what you mean :P
ugexe its blocking once its sunk, or something
llfourn ugexe: k thanks for the info :)
I wonder if by "Nothing in Perl 6 exactly replicates the Perl 5 exec" it means nothing in "rakudo" or that Perl 6 by desgin is really not meant to have exec... 04:30
geekosaur exec isn't portable. I was under the impression that things like fork and exec would be left to an ecosystem POSIX module 04:31
and likewise for win32-specific things 04:32
llfourn ah right.. windows
geekosaur perl 5 has to do fairly disgusting things to emulate both on windows 04:34
mst oh, yes, I'd be perfectly happy with saying "this isn't going to be portable" 04:38
but "you can't have exec(), even when exec() is available on your platform and would have exactly the behaviour you want", seems ... distinctly LTA to me 04:41
sortiz \o #perl6 04:58
llfourn \o 04:59
llfourn ugexe: putting BEGIN my $ver = $?FILE.IO.parent.parent.child("META6.json").slurp.&from-json<version>; 05:10
doesn't work because when you run it after intalling it aint relative to META6.json anymore :\
eg Failed to open file /home/travis/rakudo/install/share/perl6/site/META6.json
llfourn ($?DISTRIBUTION or w/e seems all the more necessary it seems) 05:11
ugexe right, you have to slurp all the files in site/dist, turn it into a meta6 hash, and determine if thats the distribution you want or not 05:19
llfourn :S 05:20
ugexe you determine that by looking at $?FILE, which will have a sha1 basename. that sha1 basename will be in the site/dist/whatever-file that you are looking for 05:21
under `files` or `resources` or some such as a `bin/script` => `<SHA1>` pair
llfourn ugexe++ for figuring that out 05:22
ugexe maybe you can abuse RAKUDO_MODULE_DEBUG=1 output to skip slurping random files to find the right one 05:24
but from what i see its just shows the source files, not the dist file that would have the version info easy to find 05:25
llfourn I guess if I'm going to do the work to do that though I might as well try and implement %?META or w/e 05:26
a lot of work for just getting the 5 or so characters of the version :P
ugexe there are changes coming to the distribution layout / meta format i think 05:27
that will make this stuff easier
llfourn \o/
ugexe if you look at that wrapper code in ::Installation though it uses a .files method to look up a Distribution it looks like 05:28
that or a CompUnit that has a Distribution attached? 05:29
llfourn compunits have distributions attached? 05:30
ugexe well, they *could*: github.com/rakudo/rakudo/blob/nom/...on.pm#L314 05:31
llfourn ahh ha...they do
so yeah I could do a fun work around where I get the compunit from a module in the distribution 05:32
and grab the distribution from it to get the version
ugexe .files looks like it returns an array of META info
llfourn it's slightly odd but it should work
ugexe so .files('bin/original-script-name')[0].ver 05:33
$?FILE wouldnt work if it was installed, as it would be the precomp sha1 path
but a fix for that is in the works too i think
llfourn right I think I have a hacky way forward at least :P
sortiz m: use Test; for $*REPO.repo-chain { for .loaded { say .short-name, .version } } 05:57
camelia rakudo-moar 08ad4b: OUTPUT«Testv6.c␤»
llfourn I've been using ES6 over the past day. It makes JS quite a lot better. Continuations, Promises, () => { } anonymous function syntax. 06:07
also.. lexical scoping with let and const
or at least they seemed lexical... I'm just reading now and they're calling it "block scoping" 06:10
I guess that's the same thing? 06:11
geekosaur sort of? I'd expect block scoping to allow use-before-"declaration" since the declaration gets re-scoped to the beginning of the block 06:12
but for all I know they expected block scoping and lexical scoping to be "the same thing" 06:13
llfourn I've seen this "Also, just like var, variables declared with let are visible before they are declared in their enclosing block" but I don't get what they means 06:14
geekosaur what I said. basically 06:15
strict lexical scope would begin the scope at the point of declaration and end it at the end of the containing block
block scope means variables declared in the block come into existence *when the block does*
so they can be used before their declaration as long as you're in the same block 06:16
llfourn I had no idea that var/let did that...
I wonder why they made that decision
but you still get new copies of the variables for each invocation of the block I hope
I haven't tested that yet.. 06:17
geekosaur it's actually easier to implement if you make all such names part of the structure representing the block
ancient (into the 1960s) languages did that rather than have to track scope properly
come to think of it, perl 5 does that under some circumstances iirc --- only visible when doing some BEGIN hackery 06:18
llfourn makes sense I think.. but then don't you have to parse the block twice. Once to figure out what variables are declared and then once to actually compile it?
geekosaur no, you can compile the block as you go, it's the runtime representation that in block scope begins when the block comes into scope vs. when the declaration does 06:19
llfourn but maybe since JS allows globals it just figures that later on
yep I getcha
geekosaur JS beiing untyped there is no real reason to care about the declaration /per se/ at compile time 06:20
er, JS variables
masak I think there is a bit of confusion above as to let/const's "can be used before their declaration" 07:36
see dzone.com/articles/learning-es6-us...l-dead-zon
"The variables are created when their containing Lexical Environment is instantiated, but may not be accessed in any way until the variable’s LexicalBinding is evaluated." 07:37
what makes the TDZ a bit tricky is that the "temporal" and the "until" mean that (for example) a nested function is allowed to precede a `let` declaration (and use that variable), as long as it's *called* after the `let` declaration 07:39
moritz \o 08:48
llfourn masak: Thanks for clearing that up. It's a bit weird but I get it now. 09:13
masak it's weird. I greatly prefer Perl 6's semantics: uses need to be textually downstream of declarations. 09:18
but I suspect things like function hoisting made that not an option in JavaScript. 09:19
llfourn I don't really understand what is meant by hoisting 09:20
but ES6 seems to have a lot of really handy perl6ish features
like being able to something similar to some.method(:$foo,:$bar)
or at least being able to do that in hash construction 09:21
masak aye
function hoisting is what makes it possible to call a JS function before it was declared, if it was declared using the `function foo() {}` statement form 09:22
llfourn foo(); function foo() { ... } # you can do this? 09:23
masak conceptually, it's a little bit as if all the function declarations were "lifted" (hoisted) to the top of their surrounding block
llfourn: yes
llfourn ah ok
masak one of the uses of that is mutual recursion
llfourn yep makes sense
masak but it's useful just in general -- for example, many people prefer a style where they have the "mainline code" first, and utility functions later 09:23
llfourn m: foo(); sub foo() {}; 09:24
camelia ( no output )
masak note that Perl 6 doesn't do function hoisting. it's just lenient with calls, resolving them at the latest possible time during the compile
llfourn hmm right foo() will still fail at compile time if it isn't declared later 09:25
masak m: say abs(5); sub abs() { "OH HAI" }
camelia rakudo-moar 08ad4b: OUTPUT«5===SORRY!5=== Error while compiling /tmp/KFPHhufhUL␤Calling abs(Int) will never work with declared signature ()␤at /tmp/KFPHhufhUL:1␤------> 3say 7⏏5abs(5); sub abs() { "OH HAI" }␤»
masak m: say abs(5); sub abs($n) { "OH HAI" }
camelia rakudo-moar 08ad4b: OUTPUT«OH HAI␤»
masak note that there's already an `abs($)` in the setting. but ours in the program overrides that -- and Perl 6 won't know that until it's parsed the whole program 09:26
same thing with operators, incidentally
m: say 4 + 4; sub infix:<+>($, $) { "ha-haa!" } 09:27
camelia rakudo-moar 08ad4b: OUTPUT«ha-haa!␤»
llfourn yes subs declarations are lexical
masak aye 09:28
my point is that the call doesn't "bind" right away when we see it. it binds after we parsed the compunit and know about all the declarations.
llfourn understood. I've never actually seen that code. It creates a list of things to bind later? 09:30
or is it something to do with a special QAST node
masak not sure where it's implemented, actually 09:31
in 007, we install "deferred checks" that go back and check after the parse that everything resolves
azawawi hi #perl6 09:32
llfourn o/
azawawi anyone know how to get lexically scoped variables information from rakudo?
llfourn azawawi: like get a list of them? 09:33
azawawi im working on something like this atom.io/packages/refactor
yup
in each scope
llfourn m: my ($a,$b,$c); .say for MY::.keys
camelia rakudo-moar 08ad4b: OUTPUT«$=pod␤!UNIT_MARKER␤$c␤EXPORT␤$_␤$!␤$b␤::?PACKAGE␤GLOBALish␤$¢␤$a␤$=finish␤$/␤$?PACKAGE␤»
llfourn hmm in each scode 09:34
in what context is this code executing?
azawawi js will be executing a `perl6` process
like the linter is currently doing a `perl6 -c`
llfourn hmmm 09:35
azawawi wrap the source code at END { ... } ?
i remember there was a perl6 --target command line for that information 09:36
llfourn you can get a text version of the AST
with --target=ast
but will that help you? 09:37
it sounds like you want to descend each lexical scope in the file and get a list of variables in each one?
i suppose you could grab some of that from the AST 09:38
look for QAST::Var declarations
azawawi im looking at it... thanks :) 09:39
llfourn good luck :)
azawawi atom.io/packages/refactor # way too cool animation :)
llfourn pretty nice 09:40
azawawi llfourn: it is perfect with one exception... line/column number information 09:42
llfourn HrrmHm
pmurias azawawi: is the info in QAST::Var.node incorrect?
llfourn pmurias: he's just looking at the text output which doesn't have it I don't think 09:43
--target=ast
azawawi yup
llfourn azawawi: maybe you can try and get your hands on the actual QAST...
and then tell me how you did it! 09:44
pmurias azawawi: did you try disabling the optimizer?
azawawi :)
pmurias azawawi: --target=ast is for human consumption only 09:46
azawawi pmurias: so how do I get the line number information? 09:47
llfourn pmurias: is there some nqp code where you can get the perl6 compiler to return you a QAST tree given some code
pmurias I'm trying to work out the snippet to get to the QAST tree 09:48
azawawi i like also the message "For more information, see the perl6(1) man page." which rakudobrew doesnt install any man page lol
llfourn pmurias++ # It would be great to be able to do it 09:49
azawawi llfourn: the reason that i asked for `perl6 --target=something` is that some time ago we had that line number information while i was doing syntax highlighting via rakudo :) 09:50
llfourn oh ok so there used to be line number info?
azawawi .tell moritz irclog.perlgeek.de/perl6/search is forbidden (403)
yoleaux azawawi: I'll pass your message to moritz.
azawawi llfourn: yup because that's what an AST is :) 09:51
llfourn well it could be that :P
shadowpaste "pmurias" at 217.168.150.38 pasted "getting the QAST from some chunk of Perl6 code" (4 lines) at fpaste.scsys.co.uk/506347 09:57
llfourn pmurias: awesome! 09:58
azawawi: so I guess you need to write a nqp helper script that will descend the tree and give you what you want. 10:00
azawawi cool
pmurias++
llfourn+
llfourn you could do some pretty spectactular things in atom with that I bet 10:01
you might need to write/copy some stuff from rakudo to do lexical lookups 10:02
azawawi pmurias: your excellent rakudo-js could work wonderfully with atom given that electron is chromium 10:08
pmurias: it means we could run it natively and that's way faster than the currrent `perl6 -c` process 10:09
llfourn that would be pretty nice
azawawi also it could be a perfect match for my `Electron` module :) 10:10
azawawi now im using a JSON::RPC bridge to call electron js API 10:10
nine How can loading a precompiled NativeCall error out with "Missing or wrong version of dependency '&return_hash_for'" when return_hash_for is defined _in_ NativeCall? 10:11
Red_ hi everyone
azawawi once rakudo-js is working, electron can host it and native Perl 6 can be truly written as desktop web apps :) 10:12
Red_ How can we move people from perl5 to perl6?
nine Red_: do we want to?
Red_ nine: If Perl6 is the future, why not? 10:13
llfourn I'd say we'd like to move python, ruby people just as much as perl people :)
or people that don't know any language yet
nine Red_: if Perl 6 is _the_ future of Perl, people will come one their own. 10:14
masak Perl 5 still has speed, stability, features, and modules on Perl 6. there are plenty of legitimate reasons not to move yet.
nine There are fewer reasons for not using both ;)
Red_ PHP, Perl, Python, Ruby. I hope that one day all 4 of these languages gets merged into one... 10:15
masak why?
llfourn with all these nice things in ES6 I am move likely to move p5 code to node than p6
masak heh. 10:16
Red_ in a world of Django, Rails and PHP where will Perl6 stand? 10:16
llfourn Red_: Django and rails and PHP are all losing ground to other things as far as I can tell 10:17
masak it will stand with web framewords of its own?
llfourn and Perl6 is growing and improving
azawawi llfourn: es6 is not that perfect btw yet... im using it already in atom-perl6-editor-tools :) 10:19
llfourn azawawi: do you have any good JS atom workflow
llfourn im just trying out atom -- what's the best way to run a node file? 10:19
azawawi llfourn: install `script` 10:20
llfourn azawawi: right this looks like what I'm missing
azawawi llfourn: script has already perl6 support :)
llfourn azawawi: I think I'll get used to it in node and then see if atom is a better fit than emacs for p6 10:21
azawawi it is :)
Perl 6 FE is way too cool
llfourn I am mostly just missing the way emacs feels
azawawi github.com/MadcapJake/language-perl6fe 10:22
atom.io/packages/atom-perl6-editor-tools
llfourn like where it puts my cursor when I move to different frames
I'm excited to see what the above^ can do
azawawi llfourn: install github.com/DanBrooker/file-icons and minimap ... and you'll never look back :) 10:24
llfourn will do thanks
azawawi llfourn: mind you... emacs and vim are better match for editing big data files
llfourn: s/better/a better/
pmurias azawawi: putting rakudo-js in electron/atom plugins/react.native/other cool places is definietly part of the plan for Perl 6 10:35
azawawi pmurias: so when does the grant start? :) 10:36
pmurias hopefully soon, it's currently voted on 10:37
pmurias azawawi: I'm hoping for next week 10:43
azawawi pmurias: good luck :)
pmurias thanks 10:44
Hotkeys Grant? 10:45
dalek kudo/nom: 138441c | lizmat++ | src/core/Buf.pm:
Make ~|, ~& and ~^ about 600x faster

  - for two 10K buffers, YMMV for larger / smaller buffers
  - no longer creates work copies of buffers in P6 space
  - buffers of unequal length just copy (~| and ~^) or set to 0 (~&)
10:48
azawawi Hotkeys: news.perlfoundation.org/2016/02/ian...plica.html 10:51
lizmat afk for most of the rest of the day& 10:54
Skarsnik Hello 11:10
sortiz \o Skarsnik
cognominal m: my class A {}; say A.WHICH; say A.^attributes; { my class A { has $a }; say A.WHICH; say A.^attributes }; say A.^attributes 11:13
camelia rakudo-moar 138441: OUTPUT«A␤()␤A␤(Mu $!a)␤()␤»
cognominal Hi. Two different homonymous classes with same .WHICH This must be wrong. 11:14
On a different but related matter, I think that class default scope should be lexical in interactive mode. 11:15
llfourn I guess Mu.WHICH isn't quite right? 11:16
cognominal m: say Mu.WHICH 11:18
camelia rakudo-moar 138441: OUTPUT«Mu␤»
cognominal m: say Mu.WHICH does True
camelia rakudo-moar 138441: OUTPUT«Mu␤»
cognominal oops
m: say (Mu does True).WHICH 11:19
camelia rakudo-moar 138441: OUTPUT«Cannot use 'does' operator with a type object.␤ in block <unit> at /tmp/o7nIoRqmlQ line 1␤␤»
cognominal m: say (1 does True).WHICH
camelia rakudo-moar 138441: OUTPUT«Int+{Bool}|1␤»
cognominal m: say (1 but True).WHICH
camelia rakudo-moar 138441: OUTPUT«Int+{<anon|68546912>}|1␤»
cognominal m: say (Mu but True).WHICH 11:20
camelia rakudo-moar 138441: OUTPUT«Mu+{<anon|62720752>}␤»
masak m: say ((1 does True) does False).WHICH 12:01
camelia rakudo-moar 138441: OUTPUT«Int+{Bool}+{Bool}|1␤»
timotimo o/ 12:08
RabidGravy is the resolution of Supply.interval milliseconds? 15:59
psch m: Supply.interval(1).tap(-> $_ { say now }); sleep 5 16:00
camelia rakudo-moar 138441: OUTPUT«Instant:1456588847.753151␤Instant:1456588848.753479␤Instant:1456588849.754596␤Instant:1456588850.755744␤Instant:1456588851.756780␤»
psch not sure how to interpret "resolution" there
m: Supply.interval(.1).tap(-> $_ { say now }); sleep 1
camelia rakudo-moar 138441: OUTPUT«Instant:1456588881.599752␤Instant:1456588881.699183␤Instant:1456588881.799324␤Instant:1456588881.899514␤Instant:1456588881.999679␤Instant:1456588882.099817␤Instant:1456588882.199981␤Instant:1456588882.300210␤Instant:1456588882.400348␤Inst…»
RabidGravy perl6 -e 'my $a = 0; Supply.interval(0.01).tap({$a++}); sleep 1; say $a 16:03
m: my $a = 0; Supply.interval(0.01).tap({$a++}); sleep 1; say $a
camelia rakudo-moar 138441: OUTPUT«99␤»
RabidGravy so good for hundreds
psch m: my $a = 0; Supply.interval(0.00001).tap({$a++}); sleep 1; say $a
camelia rakudo-moar 138441: OUTPUT«1␤»
psch m: my $a = 0; Supply.interval(0.001).tap({$a++}); sleep 1; say $a
camelia rakudo-moar 138441: OUTPUT«932␤»
RabidGravy so sorta kinda 16:04
RabidGravy just about good enough for 96ppqn for a sane tempo 16:12
psch heh, the repo i played around with just went with Supply.interval(1/8) 16:16
psch i probably showed that off already, it's definitely broken in current nom, and i'm not sure it'd work on the jvminterop branch either vOv 16:17
psch m: my $a = 0; Supply.interval(0.001).tap({$a++}); sleep 1; say $a # curious about variance... 16:18
camelia rakudo-moar 138441: OUTPUT«934␤»
psch m: my $a = 0; Supply.interval(0.001).tap({$a++}); sleep 1; say $a # curious about variance... 16:19
camelia rakudo-moar 138441: OUTPUT«937␤»
timotimo relying on exact timing from a Supply.interval is likely foolish. running a measurement on camelia is also a very bad idea, as the server camelia runs on also does other stuff
psch timotimo: oh, it's not about exact measurements for me right now, just a completely unscientific first impression :) 16:20
timotimo i'd even go as far as to call it anti-scientific :P
RabidGravy I'm calling it "close enough for jazz"
psch haha
timotimo hehe, jazz 16:21
RabidGravy Roger Linn spent years perfecting the "swing" in the MPC devices and then the DSI Tempest, we just get it for free
I'll leave the 960ppqn resolution to the hardware though 16:22
psch wonders what ex tempore (or similar) support on that front 16:24
i've been meaning to have an actual look at that for a year or so, but (1) lisp and (2) tuits... vOv
timotimo you wanna see how my local machine fares with the 0.001 thing?
psch sure 16:25
i don't have a local rakudo atm
timotimo gist.github.com/timo/fcc7e78808dd2dda89ca
RabidGravy mine's actually a lot worse
psch huh
jnthn Hah, mine's owning it: gist.github.com/jnthn/77ad2eed127aafe4f1c0 16:26
timotimo wow, windows!
jnthn was a little surprised :) 16:27
timotimo i've updated mine with more results
timotimo mine basically makes a sawtooth wave 16:28
RabidGravy doesn't Windows have a millis event in the eventloop thingy (years since I touched any of that) 16:29
Skarsnik hu, what kind of error is that 17:22
Skarsnik ===SORRY!=== 17:22
Missing serialize REPR function for REPR VMException
ugexe the 'ol randomly change things until it works error 17:30
RabidGravy Skarsnik, it almost certainly means that you are doing something in the compile time mainline that is causing a Failure 17:32
such as "try require Foo" which seems quite common
RabidGravy horrible, horrible error message though, almost my least favourite after "cannot invoke this object" 17:33
Skarsnik Oh must have been UA when missing the ssl module 17:34
because I don't have it anymore x)
RabidGravy that's fixed in H::UA now
Skarsnik maybe, but I am using a old rakudo
or should I forget to panda update?
FROGGS try require Foo shouldnt return anything when being sink 17:35
RabidGravy it was indeed "try require IO::Socket::SSL" in the mainline
Skarsnik I just installed H::UA
RabidGravy well it definitely causes that error in the mainline
timotimo "panda update" doesn't actually update packages, just the ecosystem list 17:58
Skarsnik oh just a list 18:01
timotimo yeah
Skarsnik hm \w does not catch line return? 18:02
timotimo m: say "\n\n\n".comb(/\w/).perl 18:02
camelia rakudo-moar 138441: OUTPUT«().Seq␤»
timotimo seems like
m: say "\n\n\n".comb(/\W/).perl
camelia rakudo-moar 138441: OUTPUT«("\n", "\n", "\n").Seq␤»
Skarsnik m: say "dd \n\r\n\n dd" ~~ /dd\w+dd/ 18:04
camelia rakudo-moar 138441: OUTPUT«Nil␤»
timotimo i think \w is for "horizontal whitespace" and \s is for "whitespace", eh?
and then \v is for "vertical whitespace" if i'm not mistaken
Skarsnik m: say "dd \n\r\n\n dd" ~~ /dd\s+dd/ 18:05
camelia rakudo-moar 138441: OUTPUT«「dd ␤
geekosaur mrrr
looks to me like \w is the same as in perl 5: word characters 18:06
Skarsnik Oh yeah 18:08
nvm
w = word, not whitespace xD
psch m: say " \n" ~~ /\h\v/ 18:12
camelia rakudo-moar 138441: OUTPUT«「 ␤」␤»
lucs A WHAT is showing me 「(Foo])」 -- what's that closing square bracket? 18:26
Skarsnik a capture 18:27
huggable, Capture 18:28
huggable Skarsnik, class Capture [Argument list suitable for passing to a]: doc.perl6.org/type/Capture
Skarsnik hm
or it's an ast. I am not sure, it's the type a regex return you when you capture thing 18:29
lucs Uh, okay. 18:30
timotimo uh, what 18:32
that's weird
moritz Skarsnik: that's a Match 18:33
yoleaux 09:50Z <azawawi> moritz: irclog.perlgeek.de/perl6/search is forbidden (403)
moritz is that forbidden for anybody else?
timotimo i get the search page
lucs No problem here either. 18:34
moritz too
.tell azawawi cannot reproduce (re 403 for irclog.perlgeek.de/perl6/search); if the problem persists, please /msg me your public IP address
yoleaux moritz: I'll pass your message to azawawi.
ugexe m: for ^5 { next() R, say $_ if 1; say 666; } # i like being able to put the next() before the message it should produce sometimes. is there a better way to express it? 18:38
camelia rakudo-moar 138441: OUTPUT«0␤1␤2␤3␤4␤»
ugexe as to why i like to do that, its usually because the message itself is long and would otherwise conceal the small `next` itself 18:39
if it were on the right side
moritz just put it on the next line
that way the long message doesn't obscure the next 18:40
ugexe i could, but many times the conditional is postfix and thus on the next line
moritz if the message is so long that you fear it obscures the next, you shouldn't use a postfix conditional 18:42
it seems to me you're stretching some shortcuts to (and maybe past) their limits, but instead of recognizing that, and stopping to use the shortcut, you're looking for more tricks to stretch those limits 18:44
which won't lead to readable code, in my experience 18:45
atweiden flussence: with the libtommath 1.0 release, are you building moarvm with system libtommath? 18:54
atweiden i ask because you note in your ebuild "Note that the bundled libtommath has patches that have been sent upstream, but aren't in any released version; 0.42 will compile but causes slight bugs." 18:56
flussence didn't know it had a release, I'll go try it 18:56
it *can* build with the system libtommath already, I've just force-disabled the option due to that bug
ugexe i suppose it just depends. for debugging/output/unimportant details of a routine i prefer to be as concise as possible, letting the important bits express themselves verbosely and (to me) improving the overall readability 18:59
rudi_s Hi. I know you can exclude a function from a stacktrace but I can't find it anymore. Any ideas? 19:03
flussence sub foo() is hidden-from-backtrace
rudi_s Thank you! 19:04
rudi_s feels stupid, first hit in the search doc.perl6.org - but didn't find it using $SEARCH-ENGINE.
rudi_s Can I modify the message of an existing exception? 19:08
FROGGS rudi_s: do you ask if you can do it technically or do you ask whether this will be a back-compat breaking change? 19:22
rudi_s FROGGS: Technically. I want to include additional information in a X::Proc::Unsuccessful exception. 19:24
FROGGS rudi_s: you can augment it at first
rudi_s: and also augment the class/method that throws it 19:25
and when you are happy, you move your changes to the rakudo sources, and create a pull request
rudi_s FROGGS: It's not because there's an issue in rakudo. I just want to add additional information which are then later used in my program. 19:26
Hm. Now that I think about it, maybe it would be nice to have in Rakudo. I want to add the original command to the exception message. 19:27
FROGGS then perhaps subclass it, and throw your own
ohh...
sounds helpful indeed
ugexe maybe should be added to Proc object itself 19:45
RabidGravy yeah, that would make sense 19:46
rudi_s That was the plan. 19:48
Btw. I'm confused. Should run 'foo'; cause an exception? 19:49
:m run 'foo';
m: run 'foo';
camelia rakudo-moar 138441: OUTPUT«run is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting line 1␤ in sub run at src/RESTRICTED.setting line 14␤ in block <unit> at /tmp/EQC2apOtT1 line 1␤␤»
rudi_s Obviously it failed to start the program so I'd except an exception, but it seems to work fine.
timotimo well, it gives an exception on camelia 19:50
timo@schmetterling ~> perl6 -e 'run "false"'
The spawned process exited unsuccessfully (exit code: 1)
Skarsnik false is a real cmd
rudi_s > run 'wtf' 19:51
Proc.new(in => IO::Pipe, out => IO::Pipe, err => IO::Pipe, exitcode => -1, pid => Any, signal => 254, args => ["wtf"])
(The args part is from my workings on a patch.)
Hm, even more confused: 19:52
$ ./perl6 -e 'run "foo"'
The program foo exited unsuccessfully (exit code: -1)
in block <unit> at -e line 1
But when I run that in perl6's interactive mode it doesn't raise an exception.
Ok, it works in a normal program. 19:53
FROGGS: Proposed patch regarding the arguments: pbot.rmdir.de/awHAobg1S4lbaTPxu-Ka7g 19:54
ugexe i wouldnt just dump $.proc.args, that could be a pretty long line of text 19:55
rudi_s Basically that's the idea. Personally I often want to know which exact program failed to run - and normally I have to fall back to strace. Printing everything sounds like a good solution to me. 19:56
ugexe its a good idea if you only run process with a few arguments
if you run processes with many arguments, often times long such as absolute paths, it would be confusing 19:57
timotimo if you have code that tries to run, it can catch the exception and just decorate it with the extra information from local variables
ugexe if you want to dump all of that, just catch the exception and dump if if you want
its like the JSON exception that dumps the entire json data structure, so most times you dont even know it just dumped out an exception. just that a bunch of json was printed on your screen for some reason 19:58
FROGGS I +1 outputting the cmd that failed by default... I'd just print it below the known error message 19:59
RabidGravy I'd actually go for putting it in the exception and not printing it 20:01
rudi_s Like this? "The spawned process exited unsuccessfully (exit code: $.proc.exitcode())\n" ~ "Process arguments: {$.proc.args}" 20:02
That doesn't help me as user of the program which just raised the exception.
ugexe it does if its caught and then output
RabidGravy "/usr/lib64/erlang/erts-6.3/bin/beam.smp -W w -A 64 -P 1048576 -K true -B i -- -root /usr/lib64/erlang -progname erl -- -home /var/lib/rabbitmq -- -pa /usr/lib/rabbitmq/lib/rabbitmq_server-3.5.7/sbin/../ebin -noshell -noinput -s rabbit boot -sname rabbit@coriolanus -boot start_sasl -config /etc/rabbitmq/rabbitmq -kernel inet_default_connect_options [{nodelay,true}] -sasl errlog_type error -sasl sasl_error_logger false -rabbit error_logger {file," 20:03
/var/log/rabbitmq/rabbit@coriolanus.log"} -rabbit sasl_error_logger {file,"/var/log/rabbitmq/rabbit@coriolanus-sasl.log"} -rabbit enabled_plugins_file "/etc/rabbitmq/enabled_plugins" -rabbit plugins_dir "/usr/lib/rabbitmq/lib/rabbitmq_server-3.5.7/sbin/../plugins" -rabbit plugins_expand_dir "/var/lib/rabbitmq/mnesia/rabbit@coriolanus-plugins-expand" -os_mon start_cpu_sup false -os_mon start_disksup false -os_mon start_memsup false -mnesia dir "/v
ar/lib/rabbitmq/mnesia/rabbit@coriolanus" -kernel inet_dist_listen_min 25672 -kernel inet_dist_listen_max 25672"
rudi_s But I want to get the output per default.
RabidGravy just saying
rudi_s RabidGravy: So? Looks good to me. I can immediately see which program failed. 20:03
ugexe CATCH { when X::Proc::Unsuccessful { say $_.proc.args }; };
Hotkeys Morning nerds
rudi_s ugexe: But the program must do this. And most of them won't.
RabidGravy no
ugexe that is a fault of the program 20:05
rudi_s My work flow without full output is always this: 1.) swearing that the programm is stupid, 2.) starting the program with strace -e execve -f ..., 3.) finding the command line - I'd like to skip that step.
Sure, but I don't see the problem of providing good defaults. If you don't like the long exception, just catch it and replace it with something shorter.
ugexe because thats backwards compared to catching it and outputting the additional details as needed if you ask me 20:06
RabidGravy or if you want the full command just catch it and print it
rudi_s RabidGravy: And how do I do that for a program I don't write? Sure I can patch it, but that doesn't help if it's distributed on the system and I don't have root access. 20:07
ugexe: But it helps all users who need the additional information. Which is IMHO everybody who stumbles over that exception.
RabidGravy sorry, I'm confused
rudi_s "failed to start program" <- how is that useful? - it's like "failed to open file" <- wow, thanks, I really know whats going on. 20:08
I want to see "failed to start /usr/bin/program-which-is-not-installed" or "failed to start /usr/bin/foo file-which-doesnt-exist" so I know exactly what's going on.
RabidGravy right, but you can catch the exception and it will have which command it is, i don't understand how that requires changing the program
timotimo can't we just extract the first argument, which ought to be the command name?
RabidGravy you want tto change the way the exception is constructed, changing it so that it has the command 20:09
rudi_s RabidGravy: I'm not talking about what I'd do in the programs _I_ write, but what happens when other people use run in their programs without catching the exception.
RabidGravy so you put that it in the exception, you catch the exception
dalek kudo/nom: b7db53a | (Salvador Ortiz)++ | src/Perl6/Compiler.nqp:
Multi-line REPL: Detect grammar's failed goals.

That allows the following session:
  > my $a = <
241e5e5 | lizmat++ | src/core/IO/ (2 files): Make .slurp-rest(:bin)/.slurp(:bin) 8x faster
for a 2.5MB file
More importantly, it no longer allocates a new Buf to accomodate for data already read + new chunk. So this is now *much* more memory friendly than before. All thanks to wonder that is Buf.push.
20:09
timotimo anyway, exceptions are now a thing of 6.c conformance; adding new attributes, is that fine? probably only for 6.d, eh?
RabidGravy that isn't *your* problem, or mine or anyone apart from the author of the program
rudi_s timotimo: I'd prefer the full command line. 20:10
rudi_s RabidGravy: Well, it's mine as a user of Perl6 programs. 20:10
ugexe i'd argue the average user who isnt a develoeper is not interested in the full path of the command that failed. if you are catering to developers, then catch the exception and add stuff they would be interested in 20:11
RabidGravy sticking 2048 characters of garbage into an exception message is profoundly unhelpful to most people
rudi_s Of course the author could have checked the exception and whatever. But I just want to make it easier for all users of the program.
ugexe maybe it only seems easier to you, a developer 20:12
rudi_s Of ourse.
If a program raises an exception then it won't be easy for the user even if we don't print the full path.
RabidGravy I'll paste that rabbitmq command line again if you insist and you tell me how that is useful to a *user*
ugexe joe blow who doesnt care about the details will likely be able to do more with a short sensible default than some multi line monster 20:13
rudi_s RabidGravy: It's useful because he can paste it and send it in the bug report to the dev without starting strace.
psch i'd suggest RAKUDO_VERBOSE_EXCEPTIONS 20:15
ugexe the developer who isnt catching the exception to do that themselves probably isnt the developer who cares about bug reports
psch as env var
rudi_s ugexe: Are you serious?
psch otoh, that might as well be something a given developer wants to put into their script vOv
rudi_s I really really like to program without ever catching any exception which will "never" occour. Why should I make my program more complicated with useless exception checks when it can just die if an unlikely error occurs. And when that happens, I really want to get the full output so I can fix it. 20:16
timotimo actually i wouldn't mind if the exception had a field for the args
but putting it into the output by default - especially in full - i wouldn'n be for 20:17
FROGGS ugexe: did you ever write services that run unattended and where your only source of information is log files?
wrote*
FROGGS timotimo: that's like "Unable to fetch file" without stating the url or protocol or anything 20:18
timotimo hmm
ugexe yes. i generally log the commands I run when the settings are at a somewhat high verbosity level
timotimo but why would you not catch the exception close to the code that uses &run?
psch fwiw, i don't like using programs that give me untreated, language specific exception
timotimo yes, exactly 20:19
mspo rudi_s: let it crash
psch so i do agree with ugexe here. if the developer doesn't anticipate a &run call ever failing he's not paying enough attention
mspo oh wait, wrong channel :)
rudi_s timotimo: Because the developper is/was stupid or lacy.
Still I was user, want to get the information I need to debug this issue.
Like FROGGS said, it's like "could not open file". Absolutely useless error message. 20:20
timotimo it also gives you a backtrace
rudi_s And I want software (and languages) which generate helpful error messages per default. And to debug the issue, I need the path.
timotimo hmm
rudi_s timotimo: Sure, and what? I don't speak perl6 (assuming I'm a normal user/sys admin) and can't read the code. 20:21
psch rudi_s: note i don't disagree with having the field, but i don't think always printing (potentially 2**11 chars long) command lines is the right idea
hence RAKUDO_VERBOSE_EXCEPTIONS
timotimo rudi_s: well, hopefully methods and subs are named well by the developer
psch i'm pretty sure there's other Exceptions that could benefit form that, if not now then later
rudi_s psch: RAKUDO_VERBOSE_EXCEPTIONS doesn't help, because I (as user) don't know about it.
timotimo i.e. "load_configuration_file" rather than "a"
FROGGS timotimo: often enough the files you work with or the commands you rung are kinda dynamic... and you need a way to get information to reproduce the case
what if that command only fails one out of 100 runs?
psch eh, nevermind then vOv 20:22
timotimo k
FROGGS how do you debug that just with the stack trace
rudi_s timotimo: That's besides the point. I want sane defaults even if (or especially when) the programmer was lazy/stupid. I want the language to help _me_, the user of the program.
FROGGS aye
psch thinks there's different definitions of "user" at work here
timotimo 'k
psch which is part of what makes this an actual argument
ugexe you mean _you_, a developer who uses the program. not _regular user_, the user of most programs
FROGGS psch: surely
psch: if we had dba we could generate messages for the "real user" 20:23
psch when i say "user" i mean the person who i can tell to type < RAKUDO_VERBOSE_EXCEPTION=1 $program > instead of < $program >, because they don't have any idea why it doesn't work in the first place
FROGGS: oh, :dba yeah 20:24
that's something i wanted to look into as well
iirc there was even a bug that stopped happening with :dba or something..?
rudi_s When I say user, I mean a person who knows to use a command line but has no idea about perl6 or what exactly the program is doing. Think of an sys-admin or a programmer.
ugexe why not just dump :err too?
FROGGS psch: it's not that easy... I've got a middleware service and I cant just "rerun the program"
rudi_s Of course there might be users which are discomforted by a longer error message, but I think the debug aid with the full output is more important than that. 20:25
FROGGS ... not when something starts to fail after weeks of incoming traffic from foreign company servers
so, the default should add enough information that you can start investigating
rudi_s +1
FROGGS imagine a "file not found" without the actual filename :D 20:26
and it really is the same here
psch FROGGS: like < mkdir $nested-path > ?
RabidGravy yes, but not a full unadorned possibly multi line bunch of command like
psch without -p that is
FROGGS psch: what do you mean? 20:27
FROGGS psch: it should print the path it tried (and failed) to create, no? 20:27
psch $ mkdir bar/baz/quux
mkdir: cannot create directory ‘bar/baz/quux’: No such file or directory
ugexe run 'perl6', '-e', $large-perl-script.IO.slurp
psch FROGGS: it does, yes, but doesn't say which level doesn't exist
that error might mean bar doesn't exist or bar/bar doesn't exist
FROGGS psch: yes, but you can check now easily without rerunning the program
and that's my point 20:28
psch well, i'm definitely back at "i don't have a strong opinion either way", from "i like this one solution" :) 20:32
the thing with mkdir, in my opinion, is that it still doesn't tell me enough
similar to a Proc::Unsuccessful that only tells me the line number and not the exact args 20:33
line number of the p6 program that is
mind, mkdir isn't supposed to be an example for what to strive for, but an example of what people deal with just fine
rudi_s I've just created a pull request for rakudo and I'd really like to get it merged. 20:34
ugexe mkdir isnt quite the same because its argument/exception output will always be a single line 20:36
run 'perl6', '-e', $large-perl-script.IO.slurp # it does not have the potential for gargantuan exception messages like this 20:37
FROGGS then we limit it to 100 chars 20:38
RabidGravy or less, such that it would fit in one line of an average terminal 20:39
rudi_s Could we at least say something like 300 or so? 100 is way too short to be useful. - I'm against cutting the output, but if we do, could we cut it in the middle, so the file names (which are most of the time at the end) are still present? 20:42
pmurias maybe it would make sense to print the command line arguments to a failed executions if they are short? 20:43
RabidGravy why is 100 too short to be useful 20:44
lizmat good *, #perl6! 20:46
pmurias lizmat: hi
rindolf lizmat: hello.
lizmat pmurias rindolf o/
rindolf lizmat: how are you? 20:47
lizmat pretty good: spent most of the afternoon at a NL comic-con like event (Stripdagen) 20:48
rindolf lizmat: ah, nice. 20:49
lizmat: I quite enjoy Sci-Fi/Fantasy/etc. cons.
lizmat: did you take any photos? 20:50
lizmat alas... none: too busy nosing around comics and associated memorabilia :-)
rindolf lizmat: ah. 20:51
lizmat still another day tomorrow... but we won't go there then. 20:52
rindolf lizmat: ah. 20:54
atweiden do p6 sub signatures allow for referencing parameters in the sig, e.g. 20:55
sub path-is-child-of-from(@from where *.elems == @path.elems, @path where *.elems == @from.elems) {*}
is there some other way to do that in the sig?
buharin hey 20:56
can I put smh like has constant $?MAIN_LINK
in my class?
I get an error
psch m: sub f(@a, @b where @a.elems == @b.elems) { }
camelia ( no output )
psch m: sub f(@a, @b where @a.elems == @b.elems) { }; f [1,2], [3,4,5]
camelia rakudo-moar 7c6254: OUTPUT«Constraint type check failed for parameter '@b'␤ in sub f at /tmp/BA4a_R6W1F line 1␤ in block <unit> at /tmp/BA4a_R6W1F line 1␤␤»
FROGGS buharin: dont use the question mark twigil for now 20:57
buharin ok
atweiden psch: got it
buharin FROGGS, how to make class constant 20:58
FROGGS m: class Foo { my constant $.bar = 42 }; say Foo.bar
camelia rakudo-moar 7c6254: OUTPUT«5===SORRY!5=== Error while compiling /tmp/14e4eVkE2o␤Variable $.bar used where no 'self' is available␤at /tmp/14e4eVkE2o:1␤------> 3class Foo { my constant $.bar7⏏5 = 42 }; say Foo.bar␤»
FROGGS m: class Foo { my $.bar = 42 }; say Foo.bar
camelia rakudo-moar 7c6254: OUTPUT«42␤»
FROGGS m: class Foo { constant $.bar = 42 }; say Foo.bar
camelia rakudo-moar 7c6254: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ycaTKnkI8l␤Variable $.bar used where no 'self' is available␤at /tmp/ycaTKnkI8l:1␤------> 3class Foo { constant $.bar7⏏5 = 42 }; say Foo.bar␤»
FROGGS m: class Foo { my $.bar := 42 }; say Foo.bar
camelia rakudo-moar 7c6254: OUTPUT«42␤»
buharin use :=?
FROGGS buharin: binding 20:59
buharin: this binds the constant value 42 to the class attribute
buharin ok
ugexe sounds like i need to redo some project benchmarks soon 21:03
dalek kudo/nom: cc0472b | FROGGS++ | src/core/CompUnit/PrecompilationRepository.pm:
fix precompiling a file that outputs to stdout

A file that gets precompiled outputs the hash and path of the compilation units it depends on. The process that invoked the precompilation records it and puts it into a file. Writing to stdout can therefore mess with this mechanism. This patch is just a bandaid until a more robust solution arrives.
21:06
lizmat FROGGS++ 21:07
FROGGS hoelzro: ^^ that should fix the issue we were talking about yesterday
there was an rt ticket but I cant find it
FROGGS .tell FreezeburnV This patch should solve your issue: github.com/rakudo/rakudo/commit/cc0472b43e 21:09
yoleaux FROGGS: I'll pass your message to FreezeburnV.
jnthn lizmat: You may be able to get binary slurp-rest even fasterer by asking for the length of the file. Be careful when that returns 0 'cus it's not actually a normal file, though. 21:16
lizmat: Or just by asking for a bigger amount 21:17
lizmat jnthn: yeah, I was thinking about that... but would that take info from directory, or would it actually do a seek to the end of the file internally at the OS level ?
jnthn lizmat: The former, I think 21:18
Since you can .s a file that ain't been opened
lizmat so that could work for IO::Path.slurp, but not IO::Handle.slurp-rest 21:19
jnthn: do you think a 64K buffer for reading is too conservative ?
jnthn Can perhaps got a bit bigger... Asking for more than is available isn't really a problem though. 21:20
lizmat wouldn't it allocate a buffer of that size beforehand ? 21:21
I mean, I'd like to see things go faster, but I would also like to see things run on R Pi's
jnthn Yeah...which is why I suggested using file size as a guess 21:22
lizmat yeah, that's for IO::Path, will do that shortly 21:23
but that won't work for IO::Handle, or I should also find out its current seek position
moritz oooh, Monday is leap day! 21:24
I wonder if some big site or service goes down again :-)
like Azure for years ago 21:25
(wow, Azure is already 4 years old?) 21:26
RabidGravy leap monday! 21:30
lizmat I guess we should also run the 6.c-errata spectest on Monday, to check for any artefacts :-) 21:31
lizmat
.oO( a storm ate my local back log )
21:54
RabidGravy Boom! 21:56
moritz good thing that the cloud keeps a backlog for lizmat (and everybody else) 21:57
lizmat moritz++ # indeed! 21:58
timotimo aye 22:00
lizmat moritz: your comment isn't actually in the backlog 22:07
lizmat nor is mine 22:07
timotimo huh, that seems quite strange 22:44
timotimo i think strace has a mode that can time individual system calls for you 22:44
timotimo perhaps we can see what's up by observing that? 22:44
oh, is that binary vs string reading?
lizmat timotimo: did you just repeat those lines? 22:45
lizmat is seeing weird timewarps 22:45
timotimo i did not, i think? 22:52
timotimo since we're just coming out of a netsplit, i guess things are just wacky in general 22:52
revhippie it's astounding! 22:54
lizmat timotimo: your lines from 22:35 GMT in the backlog, arrived with me at 22:44 GMT 22:56
timotimo weird timowarps? 23:00
dalek kudo/nom: fb74abc | lizmat++ | src/core/Buf.pm:
Make prefix ~^ Blob:D about 300x faster

  - on a 10K buffer
  - more importantly, it now also handles Buf's correctly
23:19
RabidGravy right, bed time for bonzo 23:21
lizmat yeah, was just about to say the same 23:21
RabidGravy: toodles
#perl6: hope to see you tomorrow after the storm is over