»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by masak on 12 May 2015.
00:12 tinyblak joined
ugexe wise to remember that use lib with a relative directory is a free ticket to test failures, as you shouldnt expect the test to take place from a specific CWD 00:17
00:18 mohij_ joined
skids Testing almost always does happen with CWD set to the package root, and almost all packages presume it does when they look for test data files. It's the de-fact standard and I don't see where the entire ecosystem is going to adjust if some tool decides it wants to do otherwise. 00:20
In fact, it's an invitation to failure NOT to do it, as you are more likely to find stale copies of your lib in the install path. 00:21
ugexe its makes any kind of parallelization stupid if you have to watch what CWD you are in at all times 00:24
if you just invoke your tests with -I or PERL6LIB then a relative path is fine, as the user can control the path 00:25
skids But not all users do that, and that still leaves the issue of where to find data files.
ugexe whats wrong with $?FILE.IO.dirname.child('data') or wahtever 00:27
skids what's wrong with "use lib $?FILE.IO.dirname('lib')"?
ugexe you cant use a variable inside a use statement?
skids Well, maybe we should fix that instead. 00:28
Anyway I don't think the larger community is going to sacrific the convenience for the sake a parallelization.
00:29 DarthGandalf left
skids Better if any tool that wants to run outside the package root make sur it is in a directory with no './lib' present, then problem solved. 00:30
00:30 DarthGandalf joined
dalek kudo-star-daily: a783cb9 | coke++ | log/ (9 files):
today (automated commit)
00:30
rl6-roast-data: be291aa | coke++ | / (8 files):
today (automated commit)
ugexe precompiled code doesnt have to go in lib or any specific directory
skids Anyway, use lib "{$?FILE.IO.parent.dirname ~ '/lib'}" does in fact work. 00:41
(not that I advise using it.) 00:43
00:59 pullphinger joined 01:00 VinceDee joined 01:06 muraiki joined 01:09 BenGoldberg joined 01:10 yeahnoob joined
ugexe glad to see variable interpolation works in use lib now, sweet. but i wouldnt say the larger community holds a strong opinion on having to be in CWD, and as far as ive always experienced in perl5 you would be encouraged to do it the nearly the same way if reuse is an expectation: use lib $FindBin::Bin/../lib 01:13
skids It's just more convenient for the more hands-on users if they can cd there and not have to use -l/PERL6LIb to run tests. 01:14
If you use "use lib './lib'" the only time that blows up is if the user is in another directory with a ./lib with modules with your same name. 01:15
While automatic test tools can be coded to avoid that.
So it makes more sense to just put in "use lib './lib'"
ugexe you dont have to have a /lib. your tests would just fail when they cant find any of the modules 01:16
01:16 rmgk_ joined, rmgk_ is now known as rmgk
skids If you are running outside the package and running its test, it does not matter if there is a "use lib './lib'" in the test file. You have to supply the path if you choose to do that. 01:17
01:18 muraiki left
skids The only time it matters is if you try to run version A of the package while your CWD is in version B. 01:18
ugexe ah, i was speaking exclusively
i guess i just see it as your average user isnt cding into the project directory themselves and testing anything. they want to run 'install' and be done with it. and ive never felt it was too much for a developer familiar with his enviroment to add a -l or just code his use'es approrpriately 01:22
raiph .ask jnthn I'd love to be able to show off Grammar::Generative... github.com/jnthn/grammar-generativ...-121105324
yoleaux raiph: I'll pass your message to jnthn.
skids Well, personally I enjoy the convenience of not have to type it, and I'm a developer.
(kinda) 01:23
ugexe do you enjoy it more than all the users who just want to install a module and not have to deal with wierd failures?
that is what i am more concerned with 01:24
skids What weird failures? When will they happen?
ugexe when panda loses its CWD context through any number of ways 01:25
01:25 vendethiel joined
skids If panda is running tests on the package without caring about its CWD, it is using PERL6LIB, so the presence of a "use lib" in your test files does not matter to it. 01:26
raydiak raiph++ thanks for keeping that issue alive
01:27 kurahaupo joined
ugexe thats not how it works 01:27
skids I've had 0 problems and had "use lib './lib'" in my test files for years now. I fail to see any likely scenario where it would cause issues. 01:29
raiph raydiak: I wasn't aware of it. But I have what I consider a perfect use case for GG. I got excited, wrote the grammar first, and then...
ugexe maybe i just run a lot of tests
kurahaupo skids: what's the point of "./" there? 01:30
skids I don't think there are many packages with as many tests as Sum.
ugexe i dont think anyone runs more p6 tests than me
skids kurahaupo: so if you are in the package's directory you can just run "perl6 t/foo.t" 01:31
I just haven't seen an example of an actual problem.
01:31 tinyblak left
kurahaupo skids: no, that's what "use 'lib'" is for; I'm asking why you inserted the apparently superfluous "./" there 01:31
skids kurahaupo: it's self-documetary. 01:32
kurahaupo or is it not superfluous and actually does something?
raydiak raiph: I had started writing a shoddy version of something like it before someone pointed it out to me...sadly it hasn't worked for quite a while, it seems 01:33
kurahaupo skids: putting "use lib blah blah" at the top level is fine. Putting it inside lib files is fraught, because it then depends on what order they're loaded. (I've seen some truly nightmarish systems with multiple levels of overrides of lib files based on putting the same name in different directories...) 01:34
skids kurahaupo: I only use it in t files.
kurahaupo skids: which are top level, so that's fine 01:35
skids That's all I've been arguing for.
01:35 tinyblak joined
kurahaupo skids: but what happens when you run cd ~ ; perl6 /path/to/test/perl/t/foo 01:36
skids You have to set a PERL6LIB if you want to find the mods. Just like if the "use lib" was not there.
kurahaupo skids: ok, but what about cd /path/to/live/perl ; PERL6LIB=/path/to/test/perl perl6 /path/to/test/perl/t/foo 01:37
skids: is that "use 'lib'" going to override PERL6LIB ? 01:38
skids Dunno, haven't tried actually. But why would you have a stale copy of my mod in /path/to/live/perl/lib ? And if you do, you should know what you are doing. 01:39
Yes, the "use lib" goes before PERL6LIB so it will be used. 01:42
raiph raydiak: As I hint in the GH issue, GG looks eminently debuggable via jnthn's debugger by someone who knows what an $ast.rxtype is. 01:43
01:46 dayangkun joined 01:47 dayangkun left
ugexe so what happens when you want it to test against the blib instead 01:49
01:50 lsm-desktop joined
ugexe it would get the /lib version first, no? 01:50
skids Don't be in someplace that has someting you don't want to test in "./lib"?
(doctor that hurts...)
ugexe dont test the precompiled modules. got it 01:51
skids What?
01:51 dayangkun joined
ugexe how do you test against the blib/, the precompiled modules, if your tests are including 'lib' no matter what 01:52
skids What "blib"?
ugexe well, taking only panda into consideration, its the directory where your precompiled output goes 01:55
skids Right but the moduleloader finds precomps based on their compiled filename in the database, not by fs search. 01:56
ugexe you can test before installing it
skids I'm not following the implication. 01:57
ugexe its not in the database anywhere until you install it
01:57 dj_goku joined
ugexe hence prove having a -b/--blib flag 01:58
(for when you dont want to test -l)
raydiak raiph: I had thought about trying to track it down myself, but it's way over my head as-is, temporarily have a day job so lacking solid blocks of time for diving in the deep end like that 01:59
02:00 colomon joined, atroxaper joined
ugexe and fwiw, it does infact do a fs search for the precomp modules during CompUnitRepo::Local::Installation.install($path) 02:03
or rather, expects you to hand them over
and iterates over those 02:04
02:04 atroxaper left
raiph raydiak: Sure. I'm poking at it a bit. My first guess is it's some rejig of QAST structure, perhaps a Stmt/Stmts thing. I'll update the issue if I find anything interesting. 02:04
how does one search the commit messages of commits to a repo on GH? 02:06
02:06 aborazmeh joined, aborazmeh left, aborazmeh joined
raydiak raiph: exciting :) good luck! 02:06
skids Well, all I know is I have "use lib './lib'" in there and panda has no problem failing on compile-only bugs when installing. 02:08
*precomp-only 02:10
but perhaps it would be prudent to add 'blib' to the use lib statement. 02:11
02:12 noganex joined
ugexe if you assume it will always be precompiled to blib. if you use CompUnit.precomp directly it goes in /lib next to your source code 02:21
in otherwords, you shouldnt expect it to be in any specific spot
i have no problem with blib being assumed though. it just doesnt seem to be set in stone anywhere as of yet 02:24
skids All I expect is this: a) automated utilities will deal with it rather than making everyone else at large type -llib all the time B) people cding into the package and doing things will be abe to just perl6 t/test and C) anyone doing anythin unusual enough to have problems because of it should be prepared for unusual things. 02:27
ugexe i dont think typing -l is asking much of a developer vs user's ease of use, and even more so for the ability for any user to distinguish which lib he wants to test 02:34
or, just writing your tests in such a way that it doesnt matter what directory they are invoked from 02:35
dont even get me started on windows 02:36
skids Asking developers to repeatedly do that versus just coding it once into utilities is a no-brainer for the letter IMO. 02:37
*latter 02:38
ugexe asking developers not to be able to diferentiate between lib and blib is more insane
skids I dunno I never used a blib myself. FWIW it seems panda installs both source and mbc in blib/lib and then runs from inside blib. I think. 02:39
I think working with precomps is a rarer activity than working on source. 02:42
If they are going that deep they know how to work around it.
02:42 VinceDee left
ugexe if you expect your users to do all the extras so the developer doesnt have to, sure 02:43
skids When is a user going to have problems? 02:44
ugexe with?
skids (I don't mean to be argumentative, btw I'm just trying to understand the supposed issues so I can weigh the decision of what to do.) 02:45
What extras are the users supposedly doing? 02:46
ugexe you are asking the user to do whatever is required to fix the test so it can be tested against blib
skids I would call that a developer, no a user. A user is more likely to cd into the directory, say "hey these are test files let me perl6 them" and then say "hey why is it still behaving like the old package I used to have installed" 02:47
ugexe thats the type of person i expect to know better 02:48
skids I don't.
ugexe i expect a user to just do install essentially
most cpanm users do not do cpanm look, cpanm test, cpanm install
skids right, so, as long as the utilities work around it they never see a problem. 02:49
ugexe but they cant work around a test with use lib '../whatever' other than being in $*CWD
so if any of your dependencies or your module it self does a chdir and fails to return, you just end up with errors that wont immediately make sense 02:50
skids Sure they can. Don't be in the package directory and -lblib.
well -l/path/to/package/blib 02:51
ugexe heres the panda scenario that kept happening over smoke testing: indir 'whatever' { <tests some threaded code that crashes without exiting this block properly> } <now im in the wrong directory>
(indir is expected to return to its original directory at the end) 02:52
skids panda should probably stay in the same dir, then, and use explicit paths. 02:53
kanl b2gills: good to know, tyvm!
02:55 BenGoldberg left
ugexe then panda would have to download the repo over top of whatever directory you are in 02:55
skids No just stay in .panda_work
ugexe if you have dependencies you have to jump between those at least 02:57
skids just build them al in their own directory while never leaving .panda_work and add lots of search paths. 02:58
ugexe ive already overcome all of these problems myself, but other tooling hasnt 02:59
the solution is generally spawnning new processes. so it has a rather big drawback of being slow. it would be nice to not have to invoke a new p6 interpreter for each tests to get the neccesary CWD protections from modules gone haywire 03:00
skids Yeah well changing CWD in module code is cheezy IMO. 03:01
03:03 kaare_ joined 03:14 colomon left 03:16 telex joined 03:26 colomon joined
ugexe it may best be solved if/when { temp $*CWD = $&FILE.dirname; } does all the magic and makes it trivial for the user or the developer to work around expectations in an elegant manner 03:43
03:43 colomon left 03:45 lizmat joined
ugexe including whatever heisenbugs are able to break the usual implementations of that without using `temp` 03:45
tony-o i think trying to keep track of 20 search paths for spawning a process is a little more convoluted than just temporarily changing cwd to spawn a process in the directory it should be in originally - then youre hacking prove and whatever else is needed to be in the module root dir 03:46
03:47 tinyblak left
tony-o all the hooks, evwrything else kind of makes the assumption that youre in the root module dir 03:50
skids Well, anyway so far I've settled on 'use lib <blib/lib lib>' and using $?FILE to find data files since they will probably not be ripped out of t/ for any reason. I think that will be least-average-surprise. 03:52
ugexe use lib IO::Path.new-from-absolute-path("lib".IO.absolute(CWD => $&FILE.dirname).IO.resolve).child('MANIFEST').slurp andthen %(from-json($_)).<provides>>>.values>>.abspath; # this might be safest 03:58
skids I'll parse that tomorrow after sleep :-) 04:00
Thanks a lot for the discussion.
04:00 kurahaupo left
ugexe sure. ive taken up enough chat log for one day myself 04:06
04:10 TEttinger joined 04:18 skids left 04:21 AlexDaniel joined
AlexDaniel how can I create a new sub from a macro? 04:23
m: macro FOO { quasi { sub Bar { say 'woohooo'}; }; }; FOO; Bar(); 04:24
camelia rakudo-moar 533d1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/PGtnDGc7Nt␤Undeclared name:␤ Bar used at line 1. Did you mean 'Bag'?␤␤»
04:24 vendethiel left
AlexDaniel it might be a scoping problem? 04:24
04:25 vendethiel joined 04:27 atroxaper joined, atroxaper left, atroxaper joined
AlexDaniel m: macro FOO { "sub Bar { say 'woohooo'}" }; FOO; Bar(); 04:40
camelia rakudo-moar 533d1a: OUTPUT«woohooo␤===SORRY!===␤Too few positionals passed; expected 3 arguments but got 2␤»
AlexDaniel too few positionals? huh? 04:41
where?
ugexe m: "sub Bar { say 'woohooo'}" 04:44
camelia rakudo-moar 533d1a: OUTPUT«woohooo␤»
ugexe $string = "sub Bar" ~ do { say 'woohoo' } 04:46
04:47 kurahaupo joined
AlexDaniel ugexe: what's that? :) 04:47
ugexe the { and } in your double quoted string executes the code inside 04:48
AlexDaniel oooooh
m: macro FOO { ‘sub Bar { say 'woohooo'}’ }; FOO; Bar(); 04:49
camelia rakudo-moar 533d1a: OUTPUT«===SORRY!===␤Too few positionals passed; expected 3 arguments but got 2␤»
AlexDaniel nope, still don't get it
ugexe: that's not the case in single quotes? 04:50
ShimmerFairy m: macro foo { 1 }; foo; 04:51
camelia rakudo-moar 533d1a: OUTPUT«===SORRY!===␤Too few positionals passed; expected 3 arguments but got 2␤»
ShimmerFairy m: macro foo { quasi { 1 } }; foo;
camelia ( no output )
ugexe nope. "" interpolates
AlexDaniel ugexe: but then I don't get it at all 04:52
ugexe yeah i dont see anything wrong with your syntax after you changed it
ShimmerFairy Perl6 macros aren't string-based, so I don't know what you're hoping to accomplish there :) 04:53
AlexDaniel ShimmerFairy: not really?
"Macros may return either a string to be reparsed, or a syntax tree that needs no further parsing. The textual form is handy, but the syntax tree form is generally preferred because it allows the parser and debugger to give better error messages."
from design.perl6.org/S06.html#Macros 04:54
but yeah, I don't want to return a string. How can I create a sub? 04:55
ShimmerFairy The portion you quoted hasn't been touched since 2008. I'd be extremely surprised if that "string to be reparsed" is still considered a part of macros. 04:57
AlexDaniel m: macro FOO { 'say 1' }; FOO; 04:59
camelia rakudo-moar 533d1a: OUTPUT«===SORRY!===␤Too few positionals passed; expected 3 arguments but got 2␤»
AlexDaniel hm
ShimmerFairy m: macro FOO { quasi { sub Bar { say "woohooo"}; } }; FOO()()
camelia rakudo-moar 533d1a: OUTPUT«woohooo␤»
ShimmerFairy Of course, that's probably not what you're after :P
AlexDaniel ShimmerFairy: nope. 05:00
ShimmerFairy m: macro FOO { quasi { sub Bar { say "woohooo"}; } }; our &Bar = FOO(); Bar # you could use 'anon sub' or '->' instead of 'sub Bar' in this case 05:01
camelia rakudo-moar 533d1a: OUTPUT«woohooo␤»
ShimmerFairy I'm not familiar enough with macros to know how to make it work properly, or if it's a bug that the way you're trying isn't working.
AlexDaniel ShimmerFairy: all this trickery does not help, I need multiple dispatch to work in the end 05:03
unless there are tricks to make that work... 05:05
05:26 AlexDaniel left 05:29 kurahaupo left 05:35 ][Sno][ is now known as [Sno] 05:50 vendethiel left 05:55 davido___ joined 05:57 vendethiel joined
dalek ar: 6571779 | FROGGS++ | tools/star/release-guide.pod:
state that I did the 2015.06 release
06:12
06:17 FROGGS joined 06:21 vendethiel left 06:24 dayangkun left
JimmyZ FROGGS: 2013.03 moritz 06:29
+ 2013.06 FROGGS
FROGGS: it is 2015 now :)
moritz: ^^
FROGGS ewww 06:33
dalek ar: 40e2bfd | FROGGS++ | tools/star/release-guide.pod:
fix typo in release year, JimmyZ++
06:35
06:35 abraxxa joined 06:44 rindolf joined 06:45 diana_olhovik joined 06:47 zakharyas joined
moritz it is? 06:47
maybe that's why nobody's paying my invoices 06:48
FROGGS :P
FROGGS has to do that on his own too :o(
I want self-paying invoices!
06:49 zostay joined 06:52 verzz joined
moritz don't need to be self-paying; it's enough if somebody else reliably pays them 06:53
06:54 tinyblak joined 07:04 diana_olhovik left
FROGGS true 07:04
07:10 vendethiel joined 07:11 darutoko joined 07:13 kurahaupo joined 07:19 aborazmeh left 07:23 FROGGS left 07:29 RabidGravy joined 07:33 vendethiel left 07:38 FROGGS joined 07:39 vendethiel joined, tinyblak_ joined 07:43 tinyblak left 07:45 espadrine joined 07:48 amurf left 07:55 g4 joined, g4 left, g4 joined 08:00 vendethiel left 08:06 virtualsue joined 08:09 dakkar joined, vendethiel joined 08:10 coffee` joined 08:12 atroxaper left, ely-se joined
ely-se Hello, Perl! 08:12
DrForr Marnin'. 08:22
08:24 spider-mario joined
ely-se Why is MVM register-based instead of stack-based? 08:25
08:25 aborazmeh joined, aborazmeh left, aborazmeh joined
moritz ely-se: because it's easier to generate code for register-based machines 08:26
and in terms of performance, both are about the same
ely-se In my experience generating code for such machines is more difficult. 08:27
However I can imagine generating machine code _from_ them is easier. 08:28
08:29 yeahnoob left
jnthn wrote much of the QAST to JVM and QAST to MoarVM code-gen, and the MoarVM one was easier for me, at least :) 08:29
yoleaux 01:22Z <raiph> jnthn: I'd love to be able to show off Grammar::Generative... github.com/jnthn/grammar-generativ...-121105324
ely-se though maybe it depends on the source language
with order of evaluation and such
jnthn *nod*
ely-se I'm currently implementing a stack-based VM in JavaScript. 08:30
08:30 Woodi joined 08:32 vendethiel left, samgwise joined 08:36 vendethiel joined
ely-se it can already execute hello world xd 08:39
samgwise Hi #perl6 :) 08:40
kanl m: my %h = a => 1; %h<b> = %h.values; %h.say;
samgwise I've been trying to compile from source on win 7 without success :(
camelia rakudo-moar 533d1a: OUTPUT«(timeout)»
samgwise I'm using VS 2015 RC and I run into a failure at stirngs/unicode.c 08:41
the compiler is complaining that it's encountered fatal error c1026: parser stack overflow 08:42
moritz samgwise: sounds like a bug in the compiler 08:43
ely-se MSVC is well known for being buggy.
samgwise I've used the same 2015.06 source and built it on a windows 8 laptop useing the VS 15 RC any ideas?
08:43 dayangkun joined
jnthn samgwise: It seems it's an MSVC compiler bug that didn't exist in any previous version of MSVC :( 08:43
So "use an older version of MSVC" is the only known workaround at the moment. 08:44
08:46 atroxaper joined
samgwise OK, thanks, I'll give that a shot :) 08:46
moritz please report the bug to microsoft.
samgwise Good idea too :)
moritz (if MS makes that possible, that is)
samgwise I'll find out I guess. 08:47
ely-se moritz: yeah it does
here's my favourite bug report: connect.microsoft.com/VisualStudio...all-my-ram
FROGGS samgwise: I know it works with MSVC 2010 and 2012 08:48
samgwise Thanks FROGGS 08:50
08:52 bjz joined, verzz left
DrForr And the status tells you the rest you need to know: Closed as Won't Fix. 08:53
TEttinger samgwise: I had the same issue btw, 2013 worked fine
08:53 bin_005 joined
TEttinger (2013 community) 08:53
RabidGravy question of self-doubt here, if I had a method that may return either a Buf or a [ CArray[uint8], Int] depending on some named parameter it would be better to make it a multi irrespective of the return type taking part in the multi? 08:55
moritz the return type doesn't take part in multi dispatch 08:57
so you must distinguish it on the named param
and yes, a multi would be fine for that
RabidGravy yes, I knew all that, it was a "style question" (would it be better to make a multi or make the return Positional to handle both cases ;) 08:58
09:00 ely-se left
RabidGravy so "sub foo(:$raw?) returns Positional vs multi foo() returns Buf ... multi foo(:$raw!) returns Array" 09:00
09:00 yeahnoob joined, bin_005_d joined
jnthn RabidGravy: For me it'd depend on how different the implementations of the two were 09:01
RabidGravy to be honest the 'raw' case simply omits the copying the CArray into the Buf 09:02
09:02 bin_005 left 09:05 kurahaupo left 09:07 spider-mario left 09:09 spider-mario joined
RabidGravy already got four multis "foo(Array, Array), foo(Array), foo(CArray, CArray, Int), foo(CArray, Int)" so doubling them for each of the five cases (foo-short, foo-int, foo-long, foo-float and foo-double) for a total of eighty methods might be over-kill ;-) 09:10
moritz RabidGravy: ok, then I'd probably not do it as more multis 09:12
or find a way to generate them :-)
RabidGravy :-) 09:13
FROGGS TimToady: do you want to get the indirect object syntax in place before September? 09:14
moritz don't we already have indirect object syntax?
RabidGravy being able to multi on shaped arrays would help somewhat
jnthn m: say is-prime: 42 09:15
camelia rakudo-moar 533d1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/A_wiO51C81␤Calling is-prime() will never work with proto signature ($, $?)␤at /tmp/A_wiO51C81:1␤------> 3say 7⏏5is-prime: 42␤»
jnthn Hm, what was the syntax again... :)
moritz std: say is-prime: 42
camelia std 28329a7: OUTPUT«ok 00:00 137m␤»
jnthn oh, so that *is* the syntax 09:16
I too thought we did it
m: is-prime: 42
camelia ( no output )
jnthn Oh...it only works at statement level?
moritz m: say(is-prime: 42)
camelia rakudo-moar 533d1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/MoSxfcoiz4␤Calling is-prime() will never work with proto signature ($, $?)␤at /tmp/MoSxfcoiz4:1␤------> 3say(7⏏5is-prime: 42)␤»
FROGGS jnthn: implementing &?BLOCK.leave is hard :/ 09:20
jnthn: and I've not pushed yet my latest changes
jnthn FROGGS: Yeah, I'd been pondering how to do that 09:21
(no, I don't have a great answer yet) 09:22
FROGGS leave() works now, as well as Label.leave which worked yesterday already 09:23
09:24 vendethiel left
FROGGS Label.leave works because we use nqp::handle(..., 'RETURN', {...}) there 09:24
jnthn I'd rather we didn't steal RETURN for that... 09:26
But maybe we can make LEAVE control exceptions also check the code object of the current block against the "label"...
So if you put &?BLOCK in the label it just works out
FROGGS hmmm 09:27
surely we can use LEAVE instead 09:28
jnthn Yes, let's add LEAVE
FROGGS and yeah, I understand what you said
jnthn I think RETURN eventually wants to work through control exceptions too, not the magical lexotic mechanism we have today
09:30 araujo joined 09:33 vendethiel joined 09:36 amurf joined 09:40 yeahnoob left 09:41 amurf left 09:42 verzz joined 09:50 bjz left 09:55 samgwise left
kanl is Set no longer extendable? 09:58
m: class Foo is Set { method foo( $foo ) { self{$foo} = True; self } }; my $f = Foo.new.foo: 'a'; $f.say;
camelia rakudo-moar 533d1a: OUTPUT«Method 'BUILD' not found for invocant of class 'Foo'␤ in block <unit> at /tmp/75lUH25_wJ:1␤␤»
09:59 verzz left
kanl what (else) is an immutable hash-like container to extend then? 10:00
10:00 bjz joined
nine [TuxCM]: I couldn't reproduce my random test failures on my desktop at home, so I nuked my install directory on my work laptop and now they are gone here, too. 10:10
10:11 xfix joined 10:12 g4 left 10:14 g4 joined 10:16 domidumont joined
kanl question rephrased, how do i extend Hash and make it immutable? 10:16
10:17 xfix left, domidumont left
jnthn kanl: I think it's a bug that you can't inherit from Set. 10:17
10:17 domidumont joined
kanl jnthn, i'd suspect so. i remember seeing an example of Set being extended somewhere before. 10:18
[TuxCM] nine, were you able to reproduce the failures with an *installed* I::P5?
kanl jnthn: is there any way to realized my 2nd question though? 10:19
nine [TuxCM]: spoke too early :( Just took very long for the first failure to occur
kanl i.e. to extend a Hash/List and the like and make it immutable?
jnthn kanl: Well, you could use EnumMap, which Hash extends
kanl: Which doesn't put values in Scalar containers 10:20
kanl jnthn: thank you! i'll investigate.
oh, and i'll open a bug on Set not extendable. 10:21
is it by designed that this can't/shouldn't be done? 10:27
my %h = a => 1; %h<b> = %h.values; %h<b>.say;
the equivalent of which is legal in p5
jnthn It isn't legal Perl 6? 10:31
RabidGravy there's bug in there somewhere
jnthn m: my %h = a => 1; %h<b> = %h.values; %h<b>.say;
camelia rakudo-moar 533d1a: OUTPUT«(timeout)» 10:32
jnthn m: my %h = a => 1; %h<b> = eager %h.values; %h<b>.say;
camelia rakudo-moar 533d1a: OUTPUT«1␤»
jnthn ah
RabidGravy just sits there consuming increasing amounts of memory
I guess it would coredump when it ran out of memory 10:34
kanl so can the compiler advise in time before that happens? 10:36
jnthn How can it know?
kanl i thought not
jnthn But I think maybe it's a bug that the "eager" is needed there
But I'm not sure. 10:37
RabidGravy or = @ = if you don't like typing eager ;-) 10:38
right, rebboot 10:40
10:41 RabidGravy left 10:42 xfix joined, xfix left, xfix joined 10:50 atroxaper left, dayangkun left 10:56 Ven joined
cognominal When I juggle with too many balls in Perl 6, I am often confused about which particular ball I dropped and start making false assumption :( Probably a case of searching dropped keys under streetlights to use another metaphor. 11:01
moritz cognominal: juggling more than one ball is the real problem 11:04
kanl is Parcel "final"?
class Foo is Parcel { method foo { self = ( 1, 2, 3 ) } }; my $f = Foo.new.foo;
m: class Foo is Parcel { method foo { self = ( 1, 2, 3 ) } }; my $f = Foo.new.foo;
camelia rakudo-moar 533d1a: OUTPUT«Method 'foo' not found for invocant of class 'Parcel'␤ in block <unit> at /tmp/9CjbhH4lpG:1␤␤»
11:05 ely-se joined
FROGGS jnthn: instead of adding leave method to Block I can also just add it to Code, right? 11:07
11:07 pullphinger left
jnthn FROGGS: I'd put it on Block 11:08
FROGGS k
jnthn FROGGS: We use Code for thunks
FROGGS we then need it in Sub and Routine too...
but I'll care about that later
jnthn m: say Routine.^mro; say Sub.^mro
camelia rakudo-moar 533d1a: OUTPUT«(Routine) (Block) (Code) (Any) (Mu)␤(Sub) (Routine) (Block) (Code) (Any) (Mu)␤»
FROGGS ohh
jnthn :) 11:09
FROGGS :D
jnthn Code = thing we can invoke, Block = Code + lexical scope
Routine = Block + maybe multi-dispatch
:)
FROGGS yeah, that knowledge is in my head somewhere already :o)
ely-se is there an article on how to choose between arrays, lists and parcels? 11:10
jnthn I dunno if we had it that way in the very early days, I think at some point I remember figuring out it was the right factoring.
FROGGS jnthn: I don't know the early days... my first contact was back in 2012
so, I'm a n00b after all
jnthn I think my first Rakudo commit was around December 2007 and I didn't have a darn clue what I was doing :) 11:11
FROGGS jnthn: but you improved, slightly :P 11:12
jnthn pmichaud++ had made a pretty sane design overall
11:12 ely-se left
jnthn So it was quite learnable :) 11:13
11:13 domidumont left
jnthn I mean, in hindsight there was a bunch of things the design was never going to cope with, but we had to run with it for a while to see that. 11:13
FROGGS sure 11:14
11:14 atroxaper joined
FROGGS you need a working base, and way to try and change things while you learn how things are meant to work 11:14
jnthn The architecture we have today really is derived from the "nom" (new object model) time
Yeah, I think a lot of the time in software we too quickly try to build "the thing" and don't allow ourselves the space we need to learn the problem. 11:15
And when I came to Perl 6 it was like "arrgh this project is taking AGES" so there was a real pressure to deliver The Thing. 11:16
In hindsight, my first couple of years here were really about learning various ways to not build a Perl 6 implementation...and unlearning various assumptions from compiler classes at uni, I guess. :) 11:17
FROGGS jnthn: I try to teach the students here at work what the first step/milestone contain, and in what way it should allow evolution and what level of emplexity it should not contain 11:18
complexity*
11:18 atroxaper left
FROGGS they often try to tackle the hard bits, which are often enough just minor details 11:18
jnthn Tackling unknowns early is good generally, but it's actually sometimes hard to know where the hard problems lie 11:19
It took a while for me to realize how deep the whole "OK, so we're going to compile to bytecode *AND* have BEGIN time" problem actually goes. 11:20
11:20 atroxaper joined
jnthn And how to square that with meta-programming, optimization, etc. 11:21
FROGGS about tackling unknowns - tackling these early just because they seem hard when they are just a 'nice to have' is just wasting time IMO 11:22
jnthn Oh, you have to know if they're actually your core problem before spending time on them.
FROGGS getting the framework right, in a way to be able to involve in several ways ist a good approach to me
jnthn If you know they're a "nice to have" then yeah, sure, it's a waste of time.
FROGGS and I'm happy that I was able to do that for the last two big projects I did/do 11:23
jnthn *nod*
11:24 bin_005_d left, brrt joined
brrt \o 11:24
FROGGS++ 11:25
FROGGS hmm?
what have I done?
brrt on the LEAVE thingies :-)
FROGGS ahh :o)
brrt yesterday I guess
:-)
anyway
11:26 amurf joined
FROGGS brrt: I'm still working on it, searching for the right approach 11:26
jnthn: is leave() meant to return from that spot?
or are statements after leave() meant to get executed?
jnthn FROGGS: It has immediate effect 11:27
11:27 ely-se joined
ely-se ah 11:27
readying both doc.perl6.org/language/variables and doc.perl6.org/language/containers helps a lot
jnthn my $x = -> { my $y = &?BLOCK; sub foo() { $y.leave(42); say 'not here' }; foo(); say 'nor here'; }; $x()
FROGGS: Hopefully ^^ clears it up a bit 11:28