»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
Xliff No. It can exist in a module. 00:00
It can exist anywhere, really, but it's better in a module.
It sorta loses its usefulness in program code, since it occurs after compile-time but before precomp.
Scripts are always compiled, so....
s/precomp/serialization to disk/ 00:02
00:06 pecastro left 00:11 aborazmeh joined, aborazmeh left, aborazmeh joined 00:12 wildtrees left 00:25 MilkmanDan left 00:26 MilkmanDan joined
tbrowder so, how about this: global var exported vi 00:33
*via a local module. then, in the program script, run BEGIN (or INIT?) the 00:35
*to calculate its value.
00:44 aborazmeh left 00:46 aborazmeh joined, aborazmeh left, aborazmeh joined
Xliff Um. 00:46
Why not in the local module?
If you are going to do this in the script, INIT makes more sense.
tbrowder: Do you have some code? 00:47
tbrowder no yet, its a wip for a PR for Documentable and i haven't pushed any code to my fork yet. 00:49
Xliff Can you coble together a quick example of what you are trying to do?
tbrowder i'll try the module first and see how that goes.
Xliff: thnx, bye for now. 00:50
Xliff o7
00:56 cwilson1 joined 00:59 aborazmeh left 01:00 cwilson left 01:14 Doc_Holliwood left 01:18 cwilson joined, cwilson1 left 01:30 cpan-p6 left 01:34 cpan-p6 joined, cpan-p6 left, cpan-p6 joined 01:42 isBEKaml joined 01:49 cwilson left 01:55 lucasb left, xiaoyafeng joined 01:56 Black_Ribbon left
Grinnz timotimo: perl.bot can do neat stuff with editing and executing, though i think the rakudo there is out of date 02:17
02:18 netrino left 02:40 vrurg left 02:42 Cabanossi left 02:47 Cabanossi joined 02:50 vrurg joined 03:09 MilkmanDan left 03:11 MilkmanDan joined 03:12 Xliff left 03:33 kst left 04:16 isBEKaml left 04:21 Black_Ribbon joined 04:45 Black_Ribbon left 05:18 wamba joined 06:07 Actualeyes left 06:08 Actualeyes joined 06:16 Xliff joined 06:36 Doc_Holliwood joined 07:00 k0Le left 07:01 molaf joined 07:05 xiaoyafeng left 07:16 k0Le joined 07:21 domidumont joined 07:22 domidumont left 07:23 domidumont joined
Xliff gist.github.com/Xliff/236bca60acd9...e2abd2ba54 07:33
:>
07:35 k0Le left 08:19 cpan-p6 left 08:24 cpan-p6 joined, cpan-p6 left, cpan-p6 joined 08:25 xiaoyafeng joined 08:32 molaf left 08:34 domidumont left 08:46 Xliff left, chloekek joined 08:47 Doc_Holliwood left 08:48 domidumont joined 09:21 p9s` joined 09:25 p9s left 09:45 chloekek left 09:46 sftp left, sftp joined 09:48 wamba left 09:51 pecastro joined 10:10 xiaoyafeng left 10:32 wamba joined 10:36 reach_satori left 10:41 chloekek joined 10:49 molaf joined 10:50 Actualeyes left, Actualeyes joined 10:58 sftp left, sftp joined 11:04 chloekek left 11:07 Doc_Holliwood joined 11:16 reach_satori joined 11:21 sena_kun joined 12:13 domidumont left 12:21 ordchr joined 12:26 ordchr left 12:29 APic left 12:36 Ven`` joined 12:44 perlmaros joined 12:46 chloekek joined 12:52 reach_satori left
perlmaros hi, i started recently with my first perl6 project. however i do have an issue with the type system that i don't know how to solve (well apart from not using types at all) 12:52
paste.scsys.co.uk/586185
12:53 APic joined
perlmaros is there a way to predeclare class types? "class BearManager {} class Bear { ... } augument BearManager { ... }" didn't work as expected 12:53
sena_kun perlmaros, try `class Foo {...}` 13:02
m: class Foo {...}; class Bar {...}; class Foo { has Bar $.bar; }; class Bar { has Foo $.foo }
camelia ( no output )
sena_kun ^ something like this 13:03
perlmaros that does the trick. thank you sena_kun 13:04
13:04 chloekek left
sena_kun perlmaros, my pleasure 13:04
13:09 rbt left 13:14 aborazmeh joined, aborazmeh left, aborazmeh joined
timotimo the "illegally post-declared type" error could totally spit out a hint how to pre-declare the type 13:15
13:15 Ven`` left
timotimo but without looking ahead to find the actual declaration it can't know what kind of type it is, i.e. grammar vs class etc 13:15
13:16 Ven`` joined, Ven`` left
timotimo unicodable6: ↑⃗ 13:17
unicodable6 timotimo, U+2191 UPWARDS ARROW [Sm] (↑)
timotimo, U+20D7 COMBINING RIGHT ARROW ABOVE [Mn] ( ⃗)
timotimo m: my \v⃗ = (1, 10); say sqrt v⃗[0] ** 2 + v⃗[1] ** 2 13:18
camelia 10.04987562112089
timotimo m: sub infix:<+⃗>($a, $b) { $a >>+<< $b }; say (3, 4) +⃗ (9, 9) 13:20
camelia (12 13)
timotimo turns out neo2 has capslock + numberpad 9 as combining ⃗ 13:21
13:24 perlmaros left 13:27 lucasb joined, isBEKaml joined 13:43 isBEKaml left 13:53 aborazmeh left 13:58 cpan-p6 left 13:59 cpan-p6 joined, cpan-p6 left, cpan-p6 joined 14:09 perlmaros joined 14:19 netrino joined 14:33 perlmaros left 14:35 perlmaros joined 14:53 cinch joined 14:58 perlmaros left 15:03 rbt joined 15:11 cinch left 15:18 APic left 15:21 perlmaros joined 15:36 APic joined 15:50 MilkmanDan left 15:52 MilkmanDan joined 16:03 Black_Ribbon joined
guifa perlmaros: also another way to do it (in particular if you have things in different modules) is to use ::(‘ClassName’) as a reference which is resolved runtime rather than compile time. It’s a bit inelegant but in some situations I’ve found it’s the optimal route to use 16:04
16:07 Ven`` joined 16:13 domidumont joined
discord6 <RaycatWhoDat> it me 16:40
<Rogue> Who dat? It's Raycat 16:47
16:56 zakharyas joined
Kaiepi does a library for writing stuff involving graph theory exist? 16:57
guifa Kaiepi: all I found was a gist someoen posted on github I’m afraid 17:01
gist.github.com/MadcapJake/efbcb24...13a263c7c7
discord6 <RaycatWhoDat> ye 17:06
<RaycatWhoDat> Also, Ripcord's having a bit of a fit
<RaycatWhoDat> Never mind, we good 17:07
17:08 f0x left
guifa Is it possible to grab Unicode data from a given char? 17:11
17:11 f0x joined
guifa Like that it’s UC/LC/digit/ws/etc 17:11
sena_kun .u a 17:13
unicodable6 sena_kun, U+000A <control-000A> [Cc] (control character)
sena_kun, U+001A <control-001A> [Cc] (control character)
sena_kun, Cowardly refusing to gist more than 5000 lines
sena_kun unicodable6, help
unicodable6 sena_kun, Just type any Unicode character or part of a character name. Alternatively, you can also provide a code snippet. # See wiki for more examples: github.com/perl6/whateverable/wiki/Unicodable
sena_kun unicodable6, ふ
unicodable6 sena_kun, U+3075 HIRAGANA LETTER HU [Lo] (ふ)
sena_kun guifa, I think you may want to look at unicodable6 source code
unicodable6, source 17:14
unicodable6 sena_kun, github.com/perl6/whateverable
sena_kun guifa, ^
AlexDaniel you mean this stuff?
uniprop: aふ
unidump: aふ
unicodable6 AlexDaniel, gist.github.com/b0ee086cba2b1cc6ee...9d247e5650
17:15 Sgeo__ joined 17:18 Sgeo_ left
guifa aha 17:18
it was under Cool not Str that’s why I missed it
.uniprop
actually, even better with .unimatch 17:21
(I’m rewriting a weird token I had to see if I can improve speed with straight code instead 17:22
17:24 sftp left
AlexDaniel guifa: example of some fancy matching based on properties and other stuff: github.com/perl6/whateverable/blob...6#L99-L107 17:25
guifa AD++ right now I’m trying to port over my number parser. After coming back to it after a while, I have a far better way to integrate it 17:26
goal is to have you be able to say
17:27 sftp joined 17:28 perlmaros left
guifa grammar PercentComplete { use Intl::Regex::Numbers; #`(name tbd) token TOP ( <local-number(:percent)> complete ) } 17:28
17:29 perlmaros joined 17:33 kst joined 17:35 cinch joined
guifa Err NM I think I found a far less clunky way to do it ha 17:49
Actually, a *really* elegant way to do it 17:51
discord6 <RaycatWhoDat> So, I don't think I know enough about Perl 6 yet but, are there any good first issues I could try my hand at? 18:03
<RaycatWhoDat> Or is this a question better suited for #perl6-dev? 18:04
18:05 finanalyst joined
tobs RaycatWhoDat: Rakudo issues have a "good first issue" label. Browse that for something that's to your liking: github.com/rakudo/rakudo/labels/go...st%20issue 18:06
18:08 jmerelo joined
discord6 <RaycatWhoDat> oh neat 18:09
<RaycatWhoDat> thanks
finanalyst I'm just updating a META6.json file for Pod-To-Cached, which is now in the perl6 organisation. I want to change the auth field. Is `auth: perl6` correct? or `auth: perl6/Pod-To-Cached`?
tellable6 2019-09-17T15:37:28Z #perl6 <[Coke]> finanalyst Sent you several emails, looks like you missed the first one, check your spam filter?
18:10 netrino left
guifa <.foo> in grammars is supposed to just be non-capturing? It seems to execute in a different scope than <foo>? 18:11
jmerelo guifa: what kind of scope?
guifa so I have a module that exports a single token, which uses other private tokens
finanalyst jmerelo: hi 18:12
guifa if I use <private-token> in the exported token, there’s no problem, it calls the token from inside my module
jmerelo finanalyst: hi, Richard!
finanalyst jmerelo: did you see my question about the auth field?
guifa but if I use <.private-token> it seems to want to use the scope from the grammar, rather than from my module, and bombs
jmerelo finanalyst: I don't think so. Just arrived home from the beach 18:13
18:13 mtj left, mtj_ joined
jmerelo finanalyst: where is that? 18:14
finanalyst jmerelo: in the META6.json file for Pod-To-Cached, should the 'auth' field be set to 'perl6'?
18:14 netrino joined
jmerelo finanalyst: it's simply the repo it's in 18:14
finanalyst if so I will commit a change now to test my setup.
18:15 _jrjsmrtn joined
finanalyst jmerelo: comma was giving me a warning that the auth field was missing 18:15
jmerelo finanalyst: so, yes... Comma complained that that field wasn't set, so I used that, which is standard.
finanalyst ok
jmerelo finanalyst: ah, so I didn't do it for Pod-To_Cached... I thought I had.
finanalyst: You've seen I spun off CompUnit::RepositoryWhatever::Document and am kinda rewriting it... Pod::To::Cached will go next 18:16
finanalyst: I'm trying to hide all nqp calls in the class itself. You do have access to that repo, right? 18:17
18:17 __jrjsmrtn__ left 18:20 sftp left 18:21 sftp joined
guifa jmarelo: details in this SE post: stackoverflow.com/questions/581580...egex-scope 18:27
18:29 domidumont left
SyrupThinker p6: (0..*).kv.is-lazy # This should be true, right? 18:31
camelia ( no output )
SyrupThinker p6: say (0..*).kv.is-lazy
camelia True
SyrupThinker Hmm, nevermind I guess
tbrowder question about a local compunit repository for installed distribution: are the contents of each actually compressed in the local filesystem? i.e., does a module author need to compress large resource sets to minimize space in the installed module? 18:33
18:34 Ven`` left 18:43 perlmaros left 18:47 molaf left
AlexDaniel SyrupThinker: is-lazy is weird sometimes 18:54
SyrupThinker: see github.com/rakudo/rakudo/wiki/is-lazy
finanalyst jmerelo: back from dinner
jmerelo: I saw you spun off Cu--Doc 18:55
tbrowder jmerelo: hi
finanalyst tbrowder: ho 18:56
tbrowder the merryostill fooling with Documentable.
can you answer the question ref CURI? are the installed distros actually compressed? 18:58
finanalyst tbrowder: the cache would be in the local system. So far it is only for the perl6 documentation
Don't know much about CompUnit at all. I only subclassed Documentable for the documentation system so that changes in Documentation files were not frozen. 19:00
tbrowder right, but i'm talking about modules in general. when one does "zef install Foo", is the installation representatio of that module actually compressed on the file system?
finanalyst don't know
tbrowder jmerelo? 19:01
.seen ugexe
tellable6 tbrowder, I saw ugexe 2019-09-24T11:24:41Z in #perl6-dev: <ugexe> te Example doesn’t explicitly use .p6 but it just as easily could
19:01 perlmaros joined
finanalyst tbrowder: I'm told you're the person to ask about the behaviour of --doc=Module in perl6 19:02
tbrowder finananlyst: hi, long time no see!
19:02 cpan-p6 left
finanalyst It calls Module::render twice 19:02
tbrowder ugh, spelling..l 19:03
finanalyst jbrowder: relocated from Hong Kong to UK.
Only just settling in
19:03 jmerelo left, cpan-p6 joined, cpan-p6 left, cpan-p6 joined
finanalyst tbrowder: spelling? I'm English :) 19:04
tbrowder i'm sorry i can't answer about doc=Module. and i'm behind on my self-inflicted todo list :-(
i meant my finger fumbling
finanalyst i found the issue a while ago. JJ said I might need to deal with it myself. It might be in nqp 19:05
cpan-p6 New module released to CPAN! ORM::ActiveRecord (0.0.6) by 03GDONALD
finanalyst Basically, I tried to replace --doc=HTML with --doc=HTML2 (my module), but HTML2 was 2x slower 19:06
Couldn't work out why. Then I found HTML2::render was called twice.
tbrowder i think he's right.
finanalyst Couldn't think how to work around the problem. Any hints? 19:07
JJ said the ast tree wasn't being passed to the render ????
tbrowder does the output look as expected? 19:09
sena_kun finanalyst, I am sorry to jam in, but do you know the two places where the module is called? I mean the stacktraces. 19:10
if you know the second path, you can likely trace it down to why it happens and write a patch
finanalyst sena_kun: thanks for the help. I reduced the problem to a short class with a do nothing render function. That was some months ago. I will need to go back and look. 19:11
sena_kun finanalyst, you can add `note Backtrace.new.Str` inside of the `render` function and get the code that calls it. 19:13
sena_kun goes afk
finanalyst sena_kun: just about to ask you that. You're a mind reader
tbrowder sena_kun: does the bactrace show nqp code? 19:20
19:31 chloekek joined
sena_kun tbrowder, dunno, but it should 19:33
tbrowder ok, thnx.
btw, i published my version of a File::Copy module which you helped me with. i would appreciate any suggestions or bug reports. 19:35
sena_kun tbrowder, saw that, was very happy to see inlined documentation. :) 19:36
tbrowder well, that is my first use of it. formatting could use some work from the pod handler in core, but that is NYI. 19:38
19:38 awwaiid joined
tbrowder the module definitely needs some tweaking. for instance, i'm not real sure about when one really needs to specify .IO on a name. 19:41
afk..
Doc_Holliwood i hate inline documentation.
it's so distracting 19:42
El_Che Doc_Holliwood: indeed 19:43
guifa Doc_Holliwoo: it depends on the project, I think.
20:00 chloekek left
finanalyst sena_kun: Backtrace does not provide much info. My Pod::To::HTML2 has a `sub render($podtree)` function with `note Backtrace ...` and `say $podtree` . Backtrace only gives the line numbers of these two statements, twice for each call to perl6 --doc=HTML2 20:26
sena_kun finanalyst, this is odd. :/ how can I try to reproduce it? 20:27
finanalyst sena_kun: Write a short module Pod::To::HTML2 , eg. .../lib/Pod/To/HTML2.pm6 . Have a sub render($pod) is export with just a say. In directory ... run `perl6 --doc=HTML2 -I lib some-perl6-prog-with-pod-in-it.p6` 20:30
sena_kun: is that clear?
sena_kun finanalyst, should be, let me see... 20:31
finanalyst, I am getting "No such symbol 'Pod::To::Foo'" for `perl6 -Ilib --doc=Foo a.pm6` and `lib/Pod/To/Foo.pm6` contains `sub render($pod) is export {...}` 20:34
MasterDuke does `Backtrace.new.full` give more useful info? 20:35
finanalyst sena_kun: trying to send you my HTML2.pm6 file by IRC. 20:37
I can cancel if this is bad ettiquette
MasterDuke: trying ...full 20:38
sena_kun well, I am trying to get it, but the connection is not going anywhere...
finanalyst, and timeout. :S 20:39
finanalyst, ok, changed that to class and `render` being a method, now it works, and is indeed called twice 20:41
and backtrace is not horribly helpful even with .full 20:42
finanalyst sena_kun: pastebin.com/z3zUssgZ
MasterDuke also, instead of manually inserting Backtraces, you could --profile=foo.sql and then look at the profile in moarperf. it'll give you callers/callees of functions
finanalyst sena_kun: my bad. I'm just coming back to the Module after a long time, and forgot the detail. 20:45
sena_kun finanalyst, no problem, and the thing I suggested is useless anyway, as I see...
finanalyst I raised this as an issue somewhere, in rakudo I think, when I first came across it. But it is a low priority thing. 20:47
sena_kun github.com/rakudo/rakudo/issues/2588
finanalyst I have rewritten Pod::To::HTML so that everything is in templates. That way, the same Module could be used to render eg MarkDown by changing the templates. But the Module is 2x slower than the standard Pod::To::HTML and I can;t work out why 20:49
I think Pod::To::HTML (the default for perl6) is special-cased in some way inside perl6
s/perl6/rakudo/ 20:50
20:53 zakharyas left
sena_kun ok, so I see it is installed to be called in Actions.nqp, method `install_doc_phaser` 20:54
the rule in Grammar.nqp is token install_doc_phaser { <?> } which obviously always matched, and is referenced in `comp_unit` rule 20:55
the question is how many times `comp_unit` rule is matched for this situation we are in
MasterDuke finanalyst: i'm not sure what special casing there would be. have you looked at any profiles of the default compared to using your module? 20:56
sena_kun github.com/rakudo/rakudo/blob/mast....nqp#L1416 20:57
github.com/rakudo/rakudo/blob/mast...r.nqp#L833
maybe the fix is to check if it was called once?
unfortunately, I am not much of a core hacker to know how to do that 20:58
finanalyst I tried to use a state variable in the render method, but since the method is being called by the compiler, it isn't recognising existing state. 21:00
sena_kun finanalyst, I mean to check if the phaser is already installed in rakudo itself, not in the module
lizmat weekly: perl6.eu/historical-intersection.html 21:02
notable6 lizmat, Noted! (weekly)
finanalyst MasterDuke: "looked at profiles of the default ..." I haven't because I don't know how. I'm running on Ubuntu. Can a profile be generated with perl6, or do I need another tool? 21:03
MasterDuke finanalyst: there's a built in profiling tool
`perl6 --profile` will create an html file you can just open in a browser. if the file is too big for the browser or you want some more functionality, timotimo++ is working on github.com/timo/moarperf. you use it with .sql files from the profiler 21:05
docs.perl6.org/language/performanc...le_locally has some more details/examples 21:06
sena_kun MasterDuke, the profiler says `render` is called twice for core#sources/D47B7F04B51CBB19CDF1E266B32AF87ACAE3A08B (Pod::To::Text):3 too 21:07
as well as for /home/koto/Devel/tester/lib/Pod/To/Foo.pm6 (Pod::To::Foo):3
so that means that it is a universal bug
MasterDuke yep, looks like
sena_kun left a comment at github.com/rakudo/rakudo/issues/25...-536341002 21:08
finanalyst MasterDuke: was just reading about profiling, then came back here. I see that sena_kun has already identified there is a double call, but the default still works 2x faster than mine. I'll work on this more 21:11
MasterDuke cool, hope the profiles help 21:13
21:13 krychu joined 21:16 Xliff joined
Xliff \o 21:17
21:21 perlmaros left 21:37 molaf joined 21:38 Ven`` joined
finanalyst MasterDuke: Something odd with Pod::To::HTML. I cloned it locally, then ran perl6 --I <path to local lib> --doc=HTML and I got an error that there is no render method. True Pod::To::HTML is written using sub's. So how does rakudo use Pod::To::HTML? 21:38
MasterDuke finanalyst:i'm not sure, i haven't looked at how the doc stuff is implemented in a while, definitely not since the recent refactor 21:40
but i'd suggest looking at the output of --target=ast 21:41
when it's working
that should show you what's going to be executed
finanalyst MasterDuke: Thanx. Getting late for me. Fuzzy thinking now. I'll look again tomorrow. 21:42
MasterDuke same here. i'd also suggest .asking jmerelo, he might be able to give a definite answer 21:43
sena_kun ast has two `QAST::Op(callmethod render)` 21:44
finanalyst JJ doesn't know. He suggested asking TBrowder, who also can't remember.
At first glance, it seems that rakudo uses the Pod::To::HTML module to create HMTL. But that doesn't seem to be true. 21:46
or perhaps not the whole truth 21:49
21:49 sena_kun left
MasterDuke finanalyst: hm, i can repro. `perl6 -I Pod-To-HTML/lib/ --doc=HTML -e ''` gives `No such method 'render' for invocant of type 'Pod::To::HTML'` 21:52
finanalyst yes thats what I get.
tbrowder try adding a mini pod block in the expression 21:54
MasterDuke same with `-e '=pod hi'`
tbrowder the incantation looks wrong 21:55
MasterDuke finanalyst: do you get the same thing if you install Pod::To::HTML with zef and don't try to -I the local clone? 21:56
finanalyst i'm trying that now 21:57
I tried to install a local version of Pod::To::HTML and it didn't work
lizmat weekly: blogs.perl.org/users/laurent_r/2019...alues.html 21:58
notable6 lizmat, Noted! (weekly)
finanalyst MasterDuke: uninstalled Pod::To:HTML, then installed. --doc=HTML does not work at all!!!!! 22:00
22:00 pecastro left
finanalyst 'no such method 'render' for invocant of type .... 22:00
MasterDuke finanalyst: i'd suggest creating an issue in the repo 22:01
but i'm to bed. later all... 22:02
tbrowder bye
finanalyst me too. goodnight
tbrowder g'night 22:03
22:03 finanalyst left 22:17 khisanth_ left 22:30 khisanth_ joined 22:42 krychu left 22:55 Doc_Holliwood left 23:03 Ven`` left 23:06 lucasb left 23:14 redhands joined 23:35 uvb joined 23:39 uvb left