»ö« 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.
johnnymacs Who is le macro expert around here 02:51
unless I am already interrupting a support question/convo in which case ignore me
Geth doc: ec139cb312 | (Zoffix Znet)++ | doc/Language/functions.pod6
Document sub MAIN usage cares about WHY on candidates

Looking at the code it also cares about .WHYs on individual parameters, but I don't know Pod enough to figure out how to set those.
02:57
synopsebot Link: doc.perl6.org/language/functions
johnnymacs I got some macro ideaz 03:07
Basically I have been thinking about perl6 and it's macro system and how complex it is. And I've been thinking about forth's macro system and how simple it is 03:08
I think if the perl6 macro system could be coerced to work more like the forth macro system that would make a simpler way to add syntax features to the language
I do not have the chops to do that but anyone who is interested in that idea need only read the gforth manual to see what I mean 03:09
Pm me if you are interested in that. I leave irc running 03:11
AlexDaniel johnnymacs: masak is 04:00
geekosaur wonders if he should look up what ANS Forth did to macros 04:01
since pre-ANSI Forth's macro system was rather specific to its outer interpreter setup 04:02
johnnymacs masak: pm me sometime I got some cool macro hax
Well other forth systems have macros too it's just that gforth is some of the best and easiest documentation to learn forth by
it also is the only docs that go extensively into the function of forth macros 04:03
There are a few nice properties of using forth as a macro system. First of all you can implement it purely out of a dynamic array of ints. Second of all it does not take many lines of code to implement. Thirdly it is a very simple system. 04:07
Also it ends up not being much slower than the language beneath it if implemented correctly 04:08
Zoffix .tell jkramer the `where` on variable thing makes sense to me and contrary to what was suggested in the channel earlier, I don't think it's a bug. The difference lies in that when you use a `where` in a parameter, it concerns a single transaction: binding a value to parameter. When you use `where` with attribute/variable, however, it checks the *values* whenever they're modified. It'd be weird if doing 04:14
yoleaux Zoffix: I'll pass your message to jkramer.
Zoffix @foo[42] = 1337 would invoke `where` callable with the entire array instead of just the value we're interested in
.tell jkramer @foo[42] = 1337 would invoke `where` callable with the entire array instead of just the value we're interested in 04:15
yoleaux Zoffix: I'll pass your message to jkramer.
dorothyw by the way I change nicknames freqently but I will still get messages from you 04:31
araraloren_ Hi, I have a question about NQP source code. Where is the source code of stage0 ? 11:46
geekosaur src/vm/*/stage0 ? 11:49
araraloren_ yeah 11:51
geekosaur, that's it, I wonder where is the source code ?
geekosaur "strings" on the moarvm files suggests the compiled files were generated by a stage2 build 11:54
geekosaur strings src/vm/moar/stage0/QAST.moarvm | grep '\.nqp$' 11:55
basically, to build nqp from scratch you need some prebuilt stuff. once you have that, you can use it to build the normal source. 11:56
but all the source involved is a subset of the normal NQP source
araraloren_ Hmm , I see it 11:59
geekosaur, How about JVM 12:00
geekosaur why would it be different 12:01
I think you did not understand what I meant
those files are just the compiled output of an NQP build
the source for them is the nqp source tree itself 12:02
geekosaur but to "bootstrap" an nqp build when nqp is not currently installed, you need an nqp. so that's a precompiled nqp. 12:02
araraloren_ Hmm, I want know how the first stage0 of JVM generated ? 12:03
geekosaur presumably it's a copy of a stage2 build's output, just as the moar one is
araraloren_ Okay, let me go on study the source code 12:04
geekosaur tools/build/Makefile-JVM.in the j-bootstrap-files target 12:07
presumably something similar for the other backends
I don't know how the very first one would have been built. possibly a minimal was written in PIR, then that used to build a more complete one/ 12:19
(or in perl 5 but producing PIR output)
araraloren_ Oh 12:20
I just think the first version would be written in Java
geekosaur yes, nqp goes back to parrot, and any initial bootstrap is probably in git history with the rest of the Parrot support
araraloren_ hmm
jnthn For Parrot it was indeed written PIR. For JVM and MoarVM we cross-compiled to get the initial bootstrap.
geekosaur once you have nqp, the first version of a new backend could be writtne in an nqp running on a different backend 12:21
cross-compilation at that level is relatively simple
jnthn "relatively" :D
araraloren_ so, I have a NQP, and can produce the stage0 of JVM backend?
jnthn But yeah, the slightly trickier part was getting the cross-compiled output to self-host
(Mostly through discovering all the bits that'd been missed...) 12:22
araraloren_: These days we just use a particular backend to produce the new version of its stage0
The cross-compilation setups haven't been maintained; they were just to get us onto other VMs. 12:23
araraloren_ oh, Actually, we want make a C++ backend of Perl6
geekosaur that will be difficult
jnthn wonders what a C++ backend means :)
araraloren_ yeah, I want learn the NQP more 12:24
geekosaur perl 6 somewhat depends on backends that are dynamic in nature. EVAL will be difficult in native code, for example. 12:24
araraloren_ I don't have much sense now
jnthn EVAL will be one bit of fun, memory management another :) 12:26
geekosaur (NQP would generate C++, which would need to be compiled, dlopen-ed into the running executable, invoked, then unloaded without disturbing the result. for some results, this may be difficult; consider a Promise instantiated in said code. you'd have to delay unloading until no references exist --- and what then if you run that EVAL again? 12:27
araraloren_ Hmm, maybe use some tools like LLVM, I heard they support dynamic Language. I said before I am not have too much sense about this 12:28
geekosaur memory management is not that difficult if it's linking into the existing memory management stuff. (and if it's not then you have much bigger problems)
araraloren_ I have to learn more :) 12:33
Thanks
shinobi_cl r: say (2, 4, 6, 8); say (2, 4 ... 8); say (2, 4, 6, 8) eqv (2, 4 ... 8); 13:11
camelia (2 4 6 8)
(2 4 6 8)
False
shinobi_cl How should i compare them if not with eqv? 13:11
araraloren_ r: say (2, 4, 6, 8); say (2, 4 ... 8); say (2, 4, 6, 8) (=) (2, 4 ... 8); 13:12
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3, 8); say (2, 4 ... 8); say (2, 4, 6, 8)7⏏5 (=) (2, 4 ... 8);
expecting any of:
infix
infix stopper
postfix
5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3, 8); say (2, 4 ... 8); say (2, 4, 6, 8)7⏏5 (=) (2, 4 ... 8);
expecting any of:
infix
infix stopper
postfix
araraloren_ r: say (2, 4, 6, 8); say (2, 4 ... 8); say (6, 4, 2, 8) [==] (2, 4 ... 8); 13:15
camelia (2 4 6 8)
(2 4 6 8)
True
araraloren_ I thought it would have a (==) operator, but not found it :( 13:17
shinobi_cl So, what happened with eqv? This used to work before... 13:18
also, the idea is that the order is also checked. 13:19
araraloren_ m: (2, 4 ... 8).is-lazy.say 13:19
camelia False
jnthn How long ago is "before"?
m: say (2, 4, 6, 8); say (2, 4 ... 8); say (2, 4, 6, 8) eqv (2, 4 ... 8).list 13:20
camelia (2 4 6 8)
(2 4 6 8)
True
jnthn m: say (2, 4, 6, 8); say (2, 4 ... 8); say (2, 4, 6, 8) >>==<< (2, 4 ... 8)
camelia (2 4 6 8)
(2 4 6 8)
(True True True True)
shinobi_cl maybe 2 years ago :)
jnthn m: say (2, 4, 6, 8); say (2, 4 ... 8); say [&&] (2, 4, 6, 8) >>==<< (2, 4 ... 8)
camelia (2 4 6 8)
(2 4 6 8)
True
araraloren_ m: say (2, 4, 6, 8); say (2, 4 ... 8); say (2, 4, 6, 8) eqv [2, 4 ... 8]
camelia (2 4 6 8)
(2 4 6 8)
False
jnthn eqv wants the types to be the same
Thus why putting .list on the right makes it work out 13:21
(Sequences return a Seq)
araraloren_ That make sense :)
lizmat m: use nqp; my $a := nqp::list(1); dd nqp::atpos($a,0); dd nqp::isnull(nqp::atpos($a,0),0) # this feels wrong ?? 13:38
camelia 1
0
lizmat arghhh 13:40
isnull/ifnull
pmurias samcv: I have implemented the collation algorithm in js, and I'm encountering a problem when running roast tests 13:43
samcv: <START OF HEADING> has 0,0,0 weights yet it seems to affect the comparision on the moarvm backend 13:44
pmurias samcv: paste.debian.net/1004976 - test trimmed to show the problem 13:45
sumdoc qq:to/HERE/ ........... HERE 14:22
What does that mean?
Where can I fond the doc?
gfldex sumdoc: go to: docs.perl6.org/language/quoting#Heredocs:_:to 14:23
sumdoc gfldex: Thanks 14:26
sumdoc Is anyone working on using markdown to write package documentation? 14:28
After all POD is rendered to markdown or html.
geekosaur POD also contains semantic information. eventually we'd like e.g. the repl to be able to get at docs 14:30
gfldex sumdoc: see docs.perl6.org/language/variables#The_=_Twigil 14:36
geekosaur I assume this is "gotta make it easy as possible to dop "docs" woithout thinkiing else you don;t get docs at all" 14:37
but as such docs are invariably LTA, I see no reason to encourage them
sumdoc gfldex: ?? !! can you help me find the docs on it 14:50
Looks like its related to conditionals
gfldex sumdoc: hit Esc and type "??"
(on the docs page that is)
araraloren_ yeah, pls use the search feature of docs page :) 14:52
sumdoc gfldex: docs.perl6.org/routine/??%20!! 15:04
i am not getting what i was expecting
araraloren_ maybe have some bug :) 15:05
This is all the operator : docs.perl6.org/language/operators
Then press `CTRL + F` search in the page
sumdoc araraloren_: Gotch it !! Thanks docs.perl6.org/language/operators#infix_??_!! 15:13
Voldenet What's the shortest and smartest way to write "dir.grep(<p6 pl>>>.&is-extension-of(*).any)" with default operators (and while avoiding regexps)? 15:29
not to mention that the above probably won't work
m: say <a.txt b.txt c.pl>.grep(*.split(".")[*-1].lc (elem) <pl pm>.any) 15:31
camelia (c.pl)
jnthn I'd probably write it like dir.grep(*.extension eq any <p6 pl>)
El_Che that is what I call cool syntax 15:32
Voldenet m: <a.txt b.txt c.pl D.PL>.grep(*.IO.extension eq any <pl pm>).say 15:33
camelia (c.pl)
Voldenet m: <a.txt b.txt c.pl D.PL>.grep(*.IO.extension.lc eq any <pl pm>).say 15:34
camelia (c.pl D.PL)
Voldenet apparently that's the best way to go
jnthn++
gfldex m: say ‚⟨‘ «~« dir('.').grep(*.extension eq any <log txt>) »~» ‚⟩‘ 15:36
camelia (⟨evalbot.log⟩ ⟨file.txt⟩ ⟨hs_err_pid27879.log⟩ ⟨hs_err_pid26960.log⟩ ⟨hs_err_pid1105.log⟩)
DrForr .o ( ',(..,)' - we have macros finally? 16:23
timotimo yeah, no wonder /routine/??%20!! doesn't give you what you want 16:25
that's just a /routine/ and a botched query string
the ? would have bo te escaced for this to work, and i'd say urlencode won't cut it perhaps?
geekosaur you type like I do >.> 16:28
timotimo wow, "bo te escaced", that's quite the bumble 16:29
DrForr Typeahead writ large.
lizmat
.oO( you really aced the esc )
16:31
PlxP I'm having trouble installing perl6 17:25
When I do "make" it says no targets specified and no makefile found 17:26
moritz PlxP: what operating system are you on?
PlxP Debian
moritz PlxP: the easiest way is to use the .deb package from github.com/nxadm/rakudo-pkg 17:27
PlxP mortiz: I tried that it didn't work for me either
moritz PlxP: how did it not work? 17:27
DrForr How...guh.
moritz and regarding the build from source: have you read the INSTALL.txt? 17:28
PlxP moritz: I'll try again now because I don't remember the error message 17:30
moritz: Do you mean the README?
When I try the .deb package it initially installs successfully, but then when I do "perl6" it says bash: command not found. I've added the PATH to my bash profile 17:39
moritz PlxP: you might need to start a new login shell for the change in the bash profile to take effect 17:41
PlxP: or do "source .bash_profile"
DrForr Or 'rehash' to get completion to work, though simply logging in with a new shell should suffice.
PlxP Oh nice it works now 17:42
Like magic xD
mortiz: Thanks
DrForr Just noting something - on current Rakudo '=begin table :caption<foo>' actually populates Pod::Block::Table's %.config, not caption. 18:03
smls m: say (1..Inf).skip(100_000_000).head(10); 19:25
camelia (timeout)
smls m: say (42 xx *).skip(1_000_000_000).head(10); 19:30
camelia (timeout) 19:30
smls It looks like Range and xx don't yet implement an optimized Iterator.skip-at-least :) 19:34
Would this make for a good LHF task?
tbrowder DrForr: the caption attribute value change (rakudo PR #1303) was merged to the master branch on 2017-12-11 by AlexDaniel. 19:35
using :caption<title> will also put it in the %config hash. 19:37
DrForr tbrowder: Thanks. It just seemed odd since the %config was there. 19:40
lizmat smls: it would, but note that Range has several iterator classes to handle the different cases 19:41
tbrowder you can lobby AlexDaniel if you think the caption should NOT be in both places. and i would agree with you. i’m not sure if S26 says anything either way. 19:42
DrForr Not looking to start a fight, just checking. 19:44
smls m: sub f (+sequence) { say sequence.^name; }; f 1...*; 19:55
camelia Seq
smls m: sub f (+sequence) { say sequence.^name; }; f 1..*;
camelia List
smls ^^ Is it intentional, that a + parameter without @ sigil turns an infinite Range into a List? 19:56
(Rather than turning it into a Seq or keeping it as a Range, to avoid the needless memory overhead of building up the whole list while `sub f` iterates over it...) 19:57
gfldex m: sub f (+sequence is raw) { say sequence.^name; }; f 1..*; 20:00
camelia List
gfldex smls: yes 20:01
m: sub f (+sequence) { say sequence.shift; }; f 1..*; 20:02
camelia Cannot call 'shift' on an immutable 'List'
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
gfldex but that might be a bug
it should be Array
not List
TimToady might know more 20:03
smls gfldex: Isn't +@sequence what one would use if one wants it to be an Array?
with the @ sigil
gfldex m: sub f (+sequence) { say sequence.shift; }; f 42;
camelia Cannot call 'shift' on an immutable 'List'
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
gfldex goes to read roast 20:04
smls gfldex: And do you think that Seq remaining a Seq (first example I showed), is a bug too?
gfldex I'm not sure if a slurpy sequence makes sense at all. 20:05
I'm not a language designer. I just docs that stuff. :)
smls I think it's pretty useful to have sigil-less + params work without memory overhead on infinite Seq's, and was just wondering why it doesn't do the same for Range. 20:06
gfldex roast defines +name as a Seq 20:08
so my gut was wrong :)
S06-signature/slurpy-params.t:237
m: sub f (+sequence) { say sequence.shift; }; f 1..∞; 20:09
camelia Cannot call 'shift' on an immutable 'List'
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
gfldex m: sub f (+sequence) { say sequence.WHAT; }; f 1..∞;
camelia (List)
gfldex roast doesn't define what should happen with a Range 20:10
smls gfldex: Isn't +foo meant to provide single-argument-rule behavior akin to the built-in list processing routines such as `zip`? 20:13
gfldex yes
smls Well, those builtins work on Ranges without memory leak. 20:14
gfldex m: my List \l := (1..∞).List; say l.elems; 20:16
camelia Cannot .elems a lazy list
in block <unit> at <tmp> line 1
gfldex smls: you may want to file a bugreport 20:17
smls: put it at github.com/rakudo/rakudo/issues and you at least get a proper discussion
smls gfldex: Ok. 20:18
gfldex (with folk who know what they write about, e.g. not me :)
pmurias unicode collation (unicmp) now works on rakudo.js 20:53
lizmat pmurias++ 21:03
samcv nice! 21:10
herby_ o/ 21:30
ctilmes m: sub foo(int32 $x) { say "ok" if $x }; foo(12); 21:32
camelia ===SORRY!===
Unhandled kind 3
ctilmes What is an unhandled kind 3?
geekosaur o.O 21:34
that's a compiler bug
ctilmes It is already filed, or should I file that example to rakudo bug? 21:35
geekosaur doesn't look familiar to me 21:36
ctilmes I'll file, they can merge if dup
geekosaur the SORRY! indicates compile time; and that is not a user-facing error message but something from the guts 21:37
ctilmes rt.perl.org/Public/Bug/Display.html?id=132718 21:39
Geth doc: 80c0da6775 | (Zoffix Znet)++ | doc/Type/Any.pod6
Document .toggle method

This is how it fits into my brain. Feel free to reword/rewrite if the description is confusing.
Closes github.com/perl6/doc/issues/1716 Rakudo impl: github.com/rakudo/rakudo/commit/78...6bceb5ab99 Spec: github.com/perl6/roast/commit/0bca7906b7
22:26
synopsebot Link: doc.perl6.org/type/Any
AlexDaniel DrForr: IIRC it wasn't working properly anyway 22:53
mch: sub foo(int32 $x) { say "ok" if $x }; foo(12);
committable6 AlexDaniel, ¦2015.12: «===SORRY!===␤unhandled kind 3␤ «exit code = 1»» ¦HEAD(cc19507): «===SORRY!===␤Unhandled kind 3␤ «exit code = 1»»
AlexDaniel c: all sub foo(int32 $x) { say "ok" if $x }; foo(12);
awesome bug
committable6 AlexDaniel, gist.github.com/9f0029e1d42291f9d8...3521a2be12
geekosaur if nothing else, that error message needs to be better 22:54
AlexDaniel bisect: old=2015.11 sub foo(int32 $x) { say "ok" if $x }; foo(12);
bisectable6 AlexDaniel, Bisecting by exit code (old=2015.11 new=cc19507). Old exit code: 0
AlexDaniel, bisect log: gist.github.com/87d2fa48e507e101a0...3dc2542a77
AlexDaniel, (2015-12-17) github.com/rakudo/rakudo/commit/ec...4ee1d1a75e
AlexDaniel c: ec18f24d27c^,ec18f24d27c sub foo(int32 $x) { say "ok" if $x }; foo(12); 22:55
committable6 AlexDaniel, ¦ec18f24d27c^: «ok␤» ¦ec18f24: «===SORRY!===␤unhandled kind 3␤ «exit code = 1»»
AlexDaniel that doesn't really help I think
Geth: ver github.com/rakudo/rakudo/commit/ec...4ee1d1a75e
… thanks geth!
geekosaur what you get(h) for trusting an alien bot :p 22:56
AlexDaniel c: 2017.12,HEAD 'abc'.ords.List.Seq.rotor( 2=>-1, :partial ) 23:20
committable6 AlexDaniel, ¦2017.12,HEAD(cc19507): «»
AlexDaniel c: 2017.12,HEAD abc'.ords.rotor( 2=>-1, :partial )
committable6 AlexDaniel, gist.github.com/8b3b16b479f32a5eda...e03529a7d2
AlexDaniel c: 2017.12,HEAD 'abc'.ords.rotor( 2=>-1, :partial )
committable6 AlexDaniel, ¦2017.12,HEAD(cc19507): «Cannot invoke this object (REPR: Uninstantiable; Callable)␤ in block <unit> at /tmp/1gPdUVbLEd line 1␤␤ «exit code = 1»»
AlexDaniel c: 2017.12,HEAD dd 'abc'.ords.rotor( 2=>-1, :partial )
committable6 AlexDaniel, ¦2017.12: «Cannot invoke this object (REPR: Uninstantiable; Callable)␤ in block <unit> at /tmp/cNtD7MU605 line 1␤␤ «exit code = 1»» ¦HEAD(cc19507): «(low-level Seq)␤»
AlexDaniel c: 2017.11,2017.12,HEAD 'abc'.ords.rotor( 2=>-1, :partial ) 23:21
committable6 AlexDaniel, ¦2017.11,2017.12,HEAD(cc19507): «Cannot invoke this object (REPR: Uninstantiable; Callable)␤ in block <unit> at /tmp/V7FQze_8ca line 1␤␤ «exit code = 1»»
AlexDaniel c: 2017.11,2017.12,HEAD 'abc'.ords.rotor(2=>-1,:partial)
committable6 AlexDaniel, ¦2017.11,2017.12,HEAD(cc19507): «Cannot invoke this object (REPR: Uninstantiable; Callable)␤ in block <unit> at /tmp/J5QIPML3n8 line 1␤␤ «exit code = 1»»
AlexDaniel ah! It happened one year ago 23:24
AlexDaniel lost track of the years :)