»ö« 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 Zoffix on 25 May 2018. |
|||
00:04
MasterDuke left
00:07
imcsk8 left,
imcsk8 joined
00:08
MasterDuke joined
|
|||
wbn | tyil: i am not #1 expert at this but wouldn't you use a Grammar here? | 00:08 | |
to parse the module name into a class with like $!name, $!ver, $!api etc | 00:09 | ||
tyil | possibly | ||
wbn | then you could match based on class attributes | ||
tyil | preferably I'd do as little work as possible, of course | ||
perhaps someone knows of a module, or other thing that will Just Work for me | 00:10 | ||
I'd expect something would exist for this, for use in zef for instance | |||
wbn | yeah | 00:11 | |
just as a first go though you might find it fairly simple (as long as the parameters of the problem are known to you) | 00:12 | ||
tyil | all tags that work for module dependency entries must be supported | 00:13 | |
wbn | yeah maybe not so simple | ||
tyil | I could match all :(key)<(value)> stuff and throw it into a hash, and then check if all the things provided in the query are correct in the hash | 00:14 | |
if nothing exists for it, it sounds like an interesting project for tomorrow :p | |||
00:16
raynold joined
00:20
imcsk8 left,
imcsk8 joined
00:23
epony left
00:28
noganex joined
00:31
noganex_ left
00:34
molaf left
|
|||
lookatme | tyil, some project need to parse the META6.json, such as zef, maybe you can have a look at their code, | 00:34 | |
wbn, some project need to parse the META6.json, such as zef, maybe you can have a look at their code, | 00:35 | ||
sorry :) | |||
00:35
aindilis left
00:36
aindilis joined
00:38
markoong left
00:41
Zoffix joined
|
|||
Zoffix | tyil: just eval the entries and extract it that way? | 00:42 | |
Like, "Config::Parser::toml:ver('1.0.1+')" is also a valid way to write that stuff | 00:43 | ||
m: my $v := 「Config::Parser::toml:ver('1.0.1+'):api<meows>」; with 'class \qq[$v] {}'.EVAL { [.^ver, .^api].say } | 00:45 | ||
camelia | ( no output ) | ||
Zoffix | m: my $v := 「Config::Parser::toml:ver('1.0.1+'):api<meows>」; given 'class \qq[$v] {}'.EVAL { [.^ver, .^api].say } | ||
camelia | [v1.0.1+ meows] | ||
Zoffix | m: my $v := 「Config::Parser::toml:ver('1.0.1+'):api<meows>」; given 'class \qq[$v] {}'.EVAL { [.^name, .^ver, .^api].say } | ||
camelia | [Config::Parser::toml v1.0.1+ meows] | ||
lookatme | Zoffix, great! | ||
wbn | oh wow | 00:46 | |
Zoffix | Depending on what you're building it might be OK to use &EVAL for this (if it's not obvious, you're executing arbitrary code so someone can stick evil things into "depends" key to make this stuff run evil things) | ||
00:47
lex_ joined
|
|||
Zoffix | And if you don't wanna use it, might look into stealing `token longname` and related machinery from github.com/rakudo/rakudo/blob/mast...rammar.nqp | 00:47 | |
The $*W you might see is the Perl6::World object: github.com/rakudo/rakudo/blob/mast.../World.nqp | 00:48 | ||
00:55
stmuk_ joined
00:57
stmuk left,
epony joined
00:59
jameslenz joined
01:00
lex_ left
01:01
lex joined,
lex is now known as lindylex
01:04
jameslenz left
01:12
fake_space_whale joined
01:13
DarthGandalf left
01:15
DarthGandalf joined
01:27
Zoffix left
01:44
spycrab0 left
01:49
stmuk joined
01:50
subroot joined
01:51
stmuk_ left
01:57
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
benji__ | What HTML parser do we recommend? | 02:06 | |
Gumbo, HTML::Parser, and HTML::MyHTML seem outdated | 02:08 | ||
02:28
imcsk8 left,
imcsk8 joined
02:29
lindylex left
02:38
ufobat___ joined
02:41
ufobat_ left
|
|||
b2gills | benji__: This is the the time when the fewest people are active. It may be best to ask again in 6+ hours. (I haven't had a need to parse HTML) | 02:43 | |
03:00
jameslenz joined
03:04
jameslenz left
03:14
psychoslave joined
03:20
MasterDuke left
03:31
salasrod joined
03:32
subroot left
03:34
epony left
03:42
benji__ left
04:05
BenGoldberg joined
04:16
epony joined
04:35
Aceeri_ left
04:47
ToddAndMargo joined
|
|||
ToddAndMargo | Hi All, How do I do an "or" inside a subsitute (I am converting from Perl 5)? p6 'my $x="1_2-3:4u5"; $x ~~ s:global/ "-|_|:|u" / "." /; say $x;' I want `1.2.3.4.5` | 04:48 | |
figured it out. It is all in the quotes: p6 'my $x="1_2-3:4u5"; $x ~~ s:global/"-"|"_"|":"|"u" /./; say $x;' 1.2.3.4.5 | 04:51 | ||
04:52
imcsk8 left,
imcsk8 joined
04:57
aborazmeh left
04:58
curan joined
|
|||
tobs | ToddAndMargo: or use a character class with <[...]> | 04:58 | |
m: say S:g/<[-_:u]>/./ given $ = "1_2-3:4u5" | |||
camelia | 1.2.3.4.5 | ||
tobs | (you can even forget about the "$ =" part) | 04:59 | |
04:59
imcsk8 left
05:00
imcsk8 joined,
jameslenz joined
05:03
xtreak joined
05:05
jameslenz left
05:08
BenGoldberg left
05:10
fake_space_whale left
05:15
sauvin joined
05:23
troys left
05:24
fake_space_whale joined
|
|||
ToddAndMargo | $ p6 'my $x="1_2-3:4u5"; $x ~~ s:global/ <[-_:u]> /./; say $x;' 1.2.3.4.5 Thank you! | 05:25 | |
05:26
Sgeo__ left
05:27
ToddAndMargo left
05:34
kerframil left
05:38
Ven` joined
05:42
sno left,
Ven` left
05:43
psychoslave left
05:46
fake_space_whale left
05:51
robertle joined
05:58
sno joined
06:01
wamba joined
06:03
xinming_ left
06:04
raynold left,
xinming joined
06:06
x[LGWs4x4i]uG2N0 joined
06:39
konsolebox left
06:41
konsolebox joined
06:51
hami joined
06:54
psychoslave joined
|
|||
lookatme | m: my $x="1_2-3:4u5"; $x ~~ s:global/ <[-_:u]> /./; say $x; | 06:58 | |
camelia | 1.2.3.4.5 | ||
07:00
domidumont joined,
jameslenz joined
07:04
jameslenz left
07:06
domidumont left
07:07
domidumont joined
07:12
benjikun joined
07:39
gregf_ left
07:40
salasrod left,
xtreak left
07:42
lizmat joined
07:43
xtreak joined
07:55
wamba left
08:08
casdr joined,
hami left
08:18
dakkar joined
08:23
Technato1 joined
08:27
wamba joined
08:30
Ven` joined
08:34
ChoHag_ joined,
ChoHag left
08:41
wamba left
08:43
xtreak left
|
|||
Geth | doc: 1ddd7c8858 | (JJ Merelo)++ | README.md Adds notice for p6doc installation closes #2166 |
08:46 | |
08:46
spycrab0 joined
08:50
wamba joined
08:58
Technato1 left
08:59
wamba left
09:00
jameslenz joined
09:05
jameslenz left
09:07
wamba joined
09:16
lizmat left
09:18
sena_kun joined
09:19
xtreak joined,
lizmat joined
09:22
robertle left
09:25
Yogesh joined
09:27
Yogesh left
09:30
nativecallable6 joined
09:38
lizmat_ joined
09:40
lizmat left
09:48
jmerelo joined
|
|||
Ulti | weekly: news.ycombinator.com/item?id=17496789 | 09:49 | |
notable6 | Ulti, Noted! | ||
lizmat_ | Ulti++ | ||
09:49
lizmat_ is now known as lizmat
|
|||
Ulti | little front page trend there thanks to brrt | 09:49 | |
jmerelo | Ulti++ | 09:54 | |
Geth | Pod-To-HTML: f121904216 | (JJ Merelo)++ | README.md Clarifies minimum version Refs to perl6/doc#2166, which reported the problem. |
10:03 | |
synopsebot | DOC#2166 [closed]: github.com/perl6/doc/issues/2166 [docs] zef install p6doc fails on tests | ||
jmerelo | "Routines are the smallest means of code reuse in Perl 6". Is that true? Aren't blocks "smaller"? (that's from the functions doc) | 10:05 | |
lizmat | yes, Blocks are the smallest that make sense at the HLL level | 10:07 | |
jnthn | WhateverCode is even smaller, since it doesn't have its own lexical scope :P | 10:08 | |
lizmat | you could consider Code smaller still | ||
jnthn | You can't really write a Code explicitly though :) | ||
lizmat | that's what I mean, for "normal" usage I think we should consider "Block" the smallest, no? | 10:09 | |
jnthn | Probably yes :) | ||
Geth | doc: deb3c72da7 | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/functions.pod6 “one” refers to a person |
10:12 | |
synopsebot | Link: doc.perl6.org/language/functions | ||
jmerelo | jnthn, lizmat: better then to change that in the documentation, right? | 10:21 | |
10:22
pmurias joined
|
|||
jmerelo | Maybe simply "Routines are a way to reuse code in Perl t" | 10:23 | |
Maybe simply "Routines are a way to reuse code in Perl 6" | |||
Geth | doc: 6f9840a739 | (Luca Ferrari)++ | doc/Language/functions.pod6 Fix ambigous statement about %*SUB-MAIN-OPTS. See <github.com/perl6/doc/commit/deb3c7...668834> |
10:26 | |
synopsebot | Link: doc.perl6.org/language/functions | ||
Geth | doc: 9761710770 | (Luca Ferrari)++ | doc/Language/functions.pod6 Change truthy to true. |
||
doc: 64d8419049 | (Luca Ferrari)++ | doc/Language/functions.pod6 Small rephrasing of named-anywhere problem. |
|||
doc: 01e8a77f97 | (JJ Merelo)++ | doc/Language/functions.pod6 Rephrases routine def Explanation in the #perl6 channel log colabti.org/irclogger/irclogger_log...07-11#l182 |
10:28 | ||
doc: 6dec88921d | (Luca Ferrari)++ | doc/Language/functions.pod6 Change script to program. |
10:29 | ||
doc: 1d721a4202 | (Luca Ferrari)++ | doc/Language/functions.pod6 Merge branch 'master' of github.com:perl6/doc |
|||
synopsebot | Link: doc.perl6.org/language/functions | ||
10:42
jmerelo left
10:45
Some-body_ joined,
DarthGandalf left
|
|||
tbrowder_ | i would like to use a unit scoped MAIN but can i somehow specify an option parameter? i have tried putting a ? after the param as well as a default value. shouldn’t that work (assuming i don’t mess up anything else) | 10:45 | |
10:46
Some-body_ is now known as DarthGandalf
10:47
Zoffix joined
|
|||
tbrowder_ | *optional parameter? | 10:47 | |
Zoffix | eco: DOM::Tiny | ||
buggable | Zoffix, DOM::Tiny 'Very small, self-sufficient DOM parser manipulator': github.com/zostay/p6-DOM-Tiny 1 other matching results: modules.perl6.org/s/DOM%3A%3ATiny | ||
Zoffix | benjikun: I assume you are the benji___ ? ^ that's a good HTML parser | ||
(might want to install with --/test as it got a ton of them and takes forever to install) | 10:48 | ||
10:48
Zoffix left
10:50
Ven` left
|
|||
tyil | tbrowder_: got a link to the source you're using? | 11:01 | |
on the MAIN thing | |||
11:01
jameslenz joined
|
|||
tbrowder_ | tyil: hi! give me a few minutes and i’ll gist it. goona be here long? | 11:02 | |
tyil | I might have to go shower and to the store inbetween, but after that I'll be back for ~ 10 hours I think | 11:03 | |
when the shower and store are depends on samcv :> | |||
samcv | wow | ||
tbrowder_ | er, i won’t ask, thnx | 11:04 | |
samcv | hah. yeah we need to go to the store | ||
tyil | preferably before 5, so you can get the things you want | ||
I think that store closes at 5 | |||
11:04
psychoslave left
11:05
jameslenz left
|
|||
samcv | is there anything equivilant to python's range(0, 100, 2) in perl6 | 11:13 | |
11:13
markoong joined
|
|||
samcv | which would go from 0 to 99 inclusive but add 2 every time | 11:13 | |
equivilant to loop (my $i = 0; $i < 100; $i += 2) in perl6 essentially. but is there some more ideomatic way to wright it | 11:14 | ||
timotimo | the ... operator comes closest | ||
tyil | m: 0, 2, 4 ... 100 | ||
camelia | Potential difficulties: Useless use of ... in sink context at <tmp>:1 ------> 030, 2, 4 ...7⏏5 100 |
||
tyil | m: dd 0, 2, 4 ... 100 | ||
camelia | (0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100).Seq | ||
tyil | this? | ||
samcv | yeah that seems like it | ||
tbrowder_ | tyil: i solved my problem—misunderstanding of docs, plus fumble fingers | ||
samcv | though how can i do that programmatically | ||
tyil | tbrowder_: alright :D | ||
timotimo | samcv: you can put any numbers in there that you want, it's Just Lists™ | 11:15 | |
samcv | gist.github.com/samcv/9a65a586ea21...le-time-p6 so this | ||
tyil | samcv: my $step = 2; dd 0, $step ... 100; | ||
ilmari | m: dd 0, { * + 2 } ... 100 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Malformed double closure; WhateverCode is already a closure without curlies, so either remove the curlies or use valid parameter syntax instead of * at <tmp>:1 ------> 3dd 0, { * + 2 }7⏏5 ... 1… |
||
ilmari | m: dd 0, * + 2 ... 100 | ||
camelia | (0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100).Seq | ||
timotimo | m: sub myrange($start, $end, $step) { $start, $start + $step ... $end }; .say for myrange(0, 10, 2); .say for myrange(10, 20, 3) | ||
camelia | 0 2 4 6 8 10 10 13 16 19 |
||
tyil | I think timotimo's solution is the cleanest for what you want to get to | 11:16 | |
but take your pick from the options :> | |||
tbrowder_ | yep, docs need some love on unit sub MAIN, issue filed | ||
Geth | ¦ doc: tbrowder self-assigned sub MAIN needs better examples github.com/perl6/doc/issues/2167 | 11:17 | |
tyil | samcv: feel free to ask that question on SO as well (on the range stuff) | 11:20 | |
samcv | well that takes 2 minutes :) | ||
compared to 27 seconds if using loop() | |||
timotimo | yeah, loop is basically completely inlined | ||
tyil | samcv: a nice topic to optimize next? :p | 11:21 | |
samcv | 5 seconds for nqp, 27 secs for perl 6 with loop(), 2 mins with 0, $interval ... $end -1 | ||
python takes 0.5 sec | |||
tyil | hmm | ||
samcv | tyil: yeah | ||
11:22
wamba left
|
|||
samcv | for 0..$x has code in the optimizer but the other one doesn't | 11:22 | |
Geth | Pod-To-HTML: c20d3388cd | (Zoffix Znet)++ | t/01-basic.t Skip non-break test on older rakudos github.com/perl6/Pod-To-HTML/issues/39 |
||
timotimo | for 0..$x also only optimizes if the $x is compile-time-known | ||
Geth | Pod-To-HTML: a0635fb657 | (Zoffix Znet)++ | META6.json Bump version |
||
timotimo | otherwise for at least turns into a while with explicit .pull-one calls | ||
samcv | timotimo: ah | ||
timotimo | so it at least doesn't have to go through map | ||
samcv | it can't turn it into a while loop? | 11:23 | |
make a new lexical just in case $x was changed somewhere else and do the while loop i'd assume | |||
timotimo | if it's not compile-time-known, we can't be sure it's not funky | 11:25 | |
even if the variable has an Int type constraint, it could still have mixins or so | |||
samcv | m: <1 str thing>.perl.say | ||
camelia | (IntStr.new(1, "1"), "str", "thing") | ||
samcv | is this expected to make an IntStr? | ||
11:25
eliasr joined
|
|||
timotimo | yes | 11:26 | |
<1> doesn't but < 1 > does | |||
11:26
psychoslave joined
|
|||
lizmat | .oO( significant whitespace, we haz it ) |
11:26 | |
tyil | I thought every element in < > was stringified | ||
but apparently only if there's space | |||
lizmat | well, if you have more than 1 element, there's a space | 11:27 | |
the special casing is only for single element <foo> | |||
tyil | I also generally write it as < some list of items > | ||
tbrowder_ | turns out, at least for my purposes, i JUST discovered unit SUB main, and all its dressing, is EXACTLY what i’ve been looking for since i first dipped into p6. in mid-2015 it looked useful, but i didn’t get much help with ironing out details so i couldn’t see how to use my p5 style of code writing and arg handlng without an extra scope and multi subs, and, imo for a p6 noob, the docs were confusing, so i gave up and | 11:30 | |
kept rolling my own. | |||
p6 is AWESOME | 11:31 | ||
tyil | heh | ||
MAIN is my favourite thing about Perl 6 | |||
it takes all the pain out of writing a cli application for me | |||
El_Che | MAIN became useful once lizmat++ enable random order or parameters like gnu (and most useful UNIX commands) | 11:32 | |
tbrowder_ | amen, bruddah, i can now agree (plus kebab case, etc.) | ||
El_Che | how a little change tranformed a feature from meh to superb | ||
tyil | kebab case results in nicer syntax imo | ||
tbrowder_ | thnx to ++lizmat | ||
and kebab case is so useful for non-touch typists! | 11:33 | ||
tyil | also for touch typists | ||
El_Che | docs.perl6.org/routine/MAIN#%*SUB-MAIN-OPTS <-- maybe %*SUB-MAIN-OPTS<named-anywhere> = 1 should be the default in 6.d? | ||
tyil | no need to hold shift | ||
tbrowder_ | yepper! | 11:34 | |
El_Che | better link: docs.perl6.org/routine/MAIN#named-anywhere | ||
tyil | El_Che: it would be nice to have that as a default | ||
11:35
robertle joined
|
|||
tyil | I asume -- is also interpreted as the end of all named opts, so calling script.pl --foo -- --bar would result in $foo = True, and --bar passed as a positional string | 11:36 | |
it does | 11:37 | ||
I should add that to the docs for clarity | 11:38 | ||
lizmat wouldn't mind seeing that as default for 6.d | 11:40 | ||
11:42
rindolf joined
11:43
Ven` joined
|
|||
AlexDaniel | .seen zostay | 11:48 | |
yoleaux | I saw zostay 30 Jun 2018 21:43Z in #perl6: <zostay> Yes, I was using it for the first time just this week and it just worked for what I needed. | ||
AlexDaniel | fwiw for some MAIN is still not good enough | 11:50 | |
github.com/rakudo/rakudo/pull/688 | |||
↑ that's just one example, I'd say | |||
zostay: ping :) | 11:53 | ||
zostay: I was trying to figure out why array-hash module tests are failing on HEAD, but I'm a bit confused | 11:55 | ||
zostay: first of all, these two test sets seem to be identical? github.com/zostay/perl6-ArrayHash/....t#L33-L46 | 11:56 | ||
masak | m: my $x; role R { method foo { say $x } }; class C does R {}; $x = "OH HAI"; C.new.foo | ||
camelia | OH HAI | ||
masak | strangelyconsistent.org/blog/lexpad...eed-fixups (in case anyone was wondering) | 11:57 | |
(as I re-read that post, I'm a bit surprised that I never use the word "frame", only "lexpad") | 11:58 | ||
moritz | does the fame contain the lexpad? | 12:02 | |
or is it the same? | |||
lizmat | moritz: I seem to recall things have changed since then | 12:03 | |
timotimo | frames also have the locals | ||
lizmat | e.g., frames used to be refcounted :-) | ||
masak | moritz: yes, a frame has a lexpad | 12:04 | |
locals (as far as I understand them) are essentially an optimization where we don't have to do look up to outer frames because the variable is *right here* in ours | |||
timotimo | there's still a little difference between locals and registers | 12:05 | |
masak | (and it makes sense to separate out that case for other reasons too, such as escape analysis) | ||
timotimo | every local has a register, but there's more registers than locals usually | ||
though registers are allowed to be re-used between locals based on their lifetimes | |||
moritz | frames exists in the language (can be accessed by callframe() or whatever we call it), registers are purely a VM construct | 12:06 | |
masak | hehe. I'm guessing "there's more registers than locals" comes from the fact that we're talking about a VM, not a physical M | ||
timotimo | right :) | ||
masak | frames are the noun, and "call this routine/block" is the verb :) | 12:07 | |
tyil | AlexDaniel: on that issue, his `which perl6 -a` actually doesn't work like `which -a perl6` :p | 12:11 | |
but subcommands are technically already possible | 12:12 | ||
by making a multi sub MAIN ("subcommand", *@args) | |||
just replace the subcommand string to any other subcommands you want to have | |||
AlexDaniel | tyil: yeah, seems to be the wrong example | 12:13 | |
in fact makes me wonder which tools actually allow that | 12:15 | ||
tyil | ls for instance allows it | ||
ls . -a is similar to ls -a . | |||
but things like echo are even more of a pain to deal with, as echo -- -n "hi" will show "-- -n hi" | 12:16 | ||
timotimo | d'oh | 12:17 | |
tyil | but echo -n -- "hi" shows "-- hi" on most shells | ||
El_Che | "Torture the implementers for the sake of the users.” kind of thing. Make the CLI work whatever users throw at it is my idea of a good cli | ||
12:18
xtreak left
|
|||
AlexDaniel | well, echo is stupid :) | 12:18 | |
El_Che | is stupid | 12:19 | |
pid | |||
id | |||
:) | |||
tyil | I personally dislike the use of echo for any use other that interactive and without any args | ||
printf is much more sane, and also POSIX | |||
AlexDaniel | I mean, you actually have to do `printf "%s\n" "$foo"` if you want to print arbitrary stuff | ||
because -- is not supported for whatever random reason | |||
timotimo | "echo injection" | 12:21 | |
12:26
itaipu joined
|
|||
Altreus | I heard that unix sockets aren't supported on moarvm and therefore there's no p6 interface to them. Is that still current? | 12:31 | |
timotimo | you can use NativeCall for unix domain sockets as a work-around | 12:32 | |
Altreus | has anyone written a thing to abstract this so I don't have to learn stuff? | 12:33 | |
Which is to say, I'm already learning P6 so I dunno if I can cope with learning sockets too | |||
timotimo | hm, you can open the socket and get a fileno for it, then you'll use it just like a regular pipe | 12:34 | |
a file that can't be rewound | |||
12:34
sarna joined
|
|||
Altreus | rw? | 12:36 | |
timotimo | no, seek | ||
Altreus | sorry, I meant would it be a rw pipe or would I have to open one for reading and another for writing? | ||
guy at work is inventing problems :P | |||
12:36
itaipu left
|
|||
timotimo | ah, no, sockets are actually duplex | 12:36 | |
Altreus | I'll have to TIAS when I get around to trying it | 12:37 | |
timotimo | on top of that, you don't have to open a domain socket as a stream socket, it can be a datagram socket, too | ||
Altreus | And there's the bounds of my knowledge :D | ||
12:37
itaipu joined
|
|||
Altreus | datagram makes me think TCP | 12:38 | |
timotimo | nah, tcp is stream, and udp is datagram | 12:40 | |
actually, i'm not so sure about unix domain sockets; do they have a "listen socket" with "accept" as well? | |||
Altreus | I'm just going to smile until someone else answers - :) | ||
(this is how I remain employed) | 12:41 | ||
timotimo | yup, smile and nod | ||
El_Che | www.userfriendly.org/cartoons/smili...ingman.gif | ||
12:42
wamba joined
|
|||
Altreus | looks like either Northernlion or Frontalot | 12:43 | |
tbrowder_ | ref MAIN: is there any way to get the gnu way of handling an arg like “-m someval” and some-val is taken as m’s value? | 12:44 | |
lizmat | tbrowder_: you mean, have one argument serve as the default for another ? | 12:45 | |
or do you mean: support named parameters | |||
Altreus | Presumably named parameters, except with single-letter short options as aliases | 12:46 | |
El_Che | I don't get it either | ||
timotimo | there's a problem with that and multis; imagine one candidate takes a Str as the argument to :$m, and one candidate takes :$m as a bool, and a positional | 12:47 | |
it'd be ambiguous if -m foo is m => True, "foo" or m => "foo" | |||
Altreus | In P5, you have one option spec and a manual dispatch to decide what to do. P6 is nice because you can have a multi MAIN, but suffers therefore in that a single script has multiple option specs | 12:48 | |
tbrowder_ | hm, i think Altreus is right, single letter dhort option. instead of “—long-name=value” one can use “-m value” | ||
Altreus | I would say that if you make a single script in which -m foo can mean different things, that's the developer's fault | 12:49 | |
furthermore | |||
I discovered that it only supports -m=foo | |||
or --m=moo | |||
12:50
psychoslave left
|
|||
Altreus | basically: it doesn't do it GNU style | 12:50 | |
masak | it's interesting to read back and realize that the entire promise of strangelyconsistent.org/blog/macros...ak-shaving is now known to be wrong | ||
(that Q::Unquote is a Qnode) | |||
Altreus | you can do -moo=foo or --moo=foo and it means the same | ||
tbrowder_ | i can definitely live with = for assigning value, just curious | ||
Altreus | Whereas, GNU style, -moo is -m -o -o=foo | ||
Given that I only ever want to write GNU-style scripts myself I don't think i'd ever use the named parameters version of MAIN anyway, which puts us back almost in the perl5 camp | 12:51 | ||
tbrowder_ | the single letter (not grouped) option would be nice though | ||
12:52
wamba left
12:53
dj_goku joined,
scimon joined
12:58
psychoslave joined
13:00
p6noob left
13:01
lizmat left,
jameslenz joined
13:02
wamba joined
13:04
lizmat joined
13:06
jameslenz left
13:10
wamba left
13:13
raschipi joined
13:39
psychoslave left
13:40
warriors joined
13:44
bdmatatu joined
|
|||
tyil | .tell AlexDaniel you said Matrix gets much better performance when using a homeserver that is not matrix.org, do you know of a list of different public home servers so I can try that out? | 14:00 | |
yoleaux | tyil: I'll pass your message to AlexDaniel. | ||
14:00
psychoslave joined
|
|||
ilmari | tyil: www.hello-matrix.net/public_servers.php | 14:02 | |
tyil | ilmari: thanks :> | ||
I couldn't find anything on matrix.org about it | |||
ilmari has finally got around to getting himself a bytemark VM and is planning to run his own homeserver | |||
tyil: first ddg hit for "matrix public homeserver" | 14:03 | ||
;) | |||
raschipi | Is it really a homeserver then? | ||
tyil | I searched for "matrix alternativ home server" | ||
:( | |||
ilmari | raschipi: "homeserver" is where users live | ||
and room aliases (but not rooms themselves, they are distributed) | 14:04 | ||
raschipi | I see, thanks ilmari. | ||
tyil | rooms have some relation to the homeserver, don't they | ||
for instance, you have #matrix:matrix.org | |||
ilmari | tyil: that's just the alias. the room itself is distributed between all the servers that have users participating in it | 14:07 | |
tyil | ah | ||
ilmari | the internal id also has the homeserver name in it, but that's just for namespacing | ||
tyil | I'm regging at matrixim.cc to see if that's a bit more responsive | ||
matrix.perl.org when tho | 14:10 | ||
14:17
molaf joined
14:21
tyil[m]1 joined,
tyil[m]1 is now known as tyil[m]2
|
|||
tyil | hmm | 14:22 | |
failed to join room, CORS request rejected | |||
when I try to join #perl6 from matrixim.cc | |||
14:24
raschipi left
14:25
curan left
14:26
itaipu left,
kerframil joined
14:27
itaipu joined
14:29
tyil[m]2 is now known as tyil[m4,
itaipu left
14:33
itaipu joined
|
|||
Geth | doc: 4e62a0f976 | (Will "Coke" Coleda)++ | Makefile The script that did this was removed when adding xt/examples* |
14:33 | |
14:34
itaipu left
14:37
itaipu joined
|
|||
warriors | guys, this is a general question .. how do you deal with focus and attention issues, i mean for me for example, i keep jumping from learning one language to the other, i end up knowing a little about a lot | 14:40 | |
i am afraid, me now trying to spend time on perl6, is just my bad habbits, jumping to perl6 instead of ... learning more about one the languages i already know a bit | 14:41 | ||
lizmat | as long as you learn from what you spend time on, it's not a waste, is it ? | 14:43 | |
moritz | warriors: I typically spend more time with a technology/language when I use it to solve a problem I have | ||
I tried to learn golang for example, but didn't have a use case. Gave up after 1.5 days | |||
14:44
itaipu left
|
|||
warriors | i see your point, but .. my use cases dont always fit the thing i want to learn, and i feel i have weird psychological barriers, my work in BI (business intelligence) | 14:45 | |
14:45
itaipu joined
|
|||
warriors | so it make more sense to me, to learn python, R maybe even julia | 14:45 | |
but , man, those R and Python, are so dry | 14:46 | ||
14:46
itaipu left
|
|||
warriors | anyway .. i know the problem and i know the solution ... its always will power | 14:47 | |
moritz | are you learning for work, or in your spare time? | ||
warriors | well, i try to do both | ||
again fragmenting my time | |||
moritz | I only manage to learn stuff for work in my spare time if I'm really into the topic | ||
scimon | I learnt Golang. Spent the entire time going "Perl6 does this bit better" (string, arrays, threading...) | 14:49 | |
masak | performance... :P | ||
masak , troll | |||
but yes, I think I agree on the others | 14:50 | ||
14:50
itaipu joined
|
|||
masak | though with threading, I think Go at least has some neat ideas | 14:50 | |
scimon | Ah yes. Though speed of development wasn't as fast. | ||
masak | largely I think Go looks like a very polished packaging of some fairly old ideas | 14:51 | |
scimon | It does, but I think Perl6 has done them better. Fire and forget async functions where you have to wire in your own communications aren't as fully features. | ||
masak | I can see it being a step up from C++ for Google | ||
warriors | Go is GC lang, cant really compete with C++, where C++ make sense | ||
El_Che | I don't think perl6 does a lot of things better than Go | ||
masak | especially with things like modularity and build times | ||
warriors | Go is step between Python and C++ | 14:52 | |
El_Che | it just does a lot of things go doesn't do | ||
warriors | Rust is the true C++ replacement | ||
masak | warriors: I do think a garbage-collected language can be constructively compared to C++ | ||
lizmat | El_Che: which things does Perl 6 do not as well as Go ? Just OOC :-) | ||
masak | warriors: as far as I understand, a lot of the features that were prioritized in Go were pain points from C++ | ||
14:52
itaipu left
14:53
pukku joined
|
|||
masak | at least, I don't think that just because Go is a GC'd language, any comparison to C++ just goes out the window. | 14:53 | |
El_Che | lizmat: eg the array/list methods | ||
lizmat: you need to write a lot of loops to do simple things like contains | 14:54 | ||
lizmat | El_Che: specifically ? | ||
El_Che | one loop for each type | ||
warriors | sure not C++ have been used in so many domain, from application programming to systems programming | ||
lizmat | El_Che: example ? | ||
El_Che | lizmat: "is this element part of this array?" | ||
write a for loop | |||
warriors | i am just saying, C++ really have an edge when you need to be GC free | ||
El_Che | let me see I I can show you code | ||
warriors | go wont replace C++ in those domains | ||
lizmat | m: my @a = ^100; say 42 (elem) @a | 14:55 | |
camelia | True | ||
lizmat | m: my @a = ^100; say 142 (elem) @a | ||
camelia | False | ||
El_Che | lizmat: github.com/nxadm/ldifdiff/blob/mas...ff.go#L138 | ||
timotimo | i think you got liz' question the wrong way around, El_Che | ||
warriors | i learnt a little C++ at some point :) | ||
14:55
itaipu joined
|
|||
El_Che | lizmat: the other way around. Perl 6 has built-in methods, Go has 1 for loop | 14:55 | |
warriors | never touched Go though | ||
lizmat | "I don't think perl6 does a lot of things better than Go" # El_Che | 14:56 | |
El_Che | yes | ||
lizmat | so you're saying Go is better or not ? | ||
El_Che | quote also the second line | ||
no | |||
perl 6 is not better for the same features | |||
but it has more features | |||
lizmat | ok, then maybe what do you mean by "better" ? | ||
warriors | for me, Go doesnt offer any novelty .. Go is .. the Python of compiled languages | ||
timotimo | a friend told me that go is more pythonic than python is, iirc | 14:57 | |
El_Che | lizmat: I mean go is nog lacking is the quality of it's implementation or regular features, like concurrency | ||
lizmat: but it misses a lot of fatures that you have to implement yourself | 14:58 | ||
like that small loop for trivial things | |||
lizmat | I see, I think :-) | ||
El_Che | it's the mini-maxi discussion :) | ||
not better-worse | |||
my brain can handle both :) | |||
14:59
itaipu left
|
|||
pmurias | warriors: building something using a language is a good way to learn more about it | 14:59 | |
timotimo | building a compiler for the language is also a good way to learn more about it :P | 15:00 | |
15:00
itaipu joined,
epony left,
fake_space_whale joined
|
|||
Geth | doc: 52194a8e97 | (Tom Browder)++ (committed using GitHub Web editor) | Makefile add Gnu standard distclean target |
15:01 | |
15:01
jameslenz joined
|
|||
El_Che | lizmat: Cro is moving perl6 into golang's space by making it easy to create webservices. | 15:02 | |
pmurias | timotimo: you do learn a lot of silly details that way | 15:03 | |
warriors | pmurias, i completely agree, i think the way i always learned was fundamentally problemetic ... i spend too much learning, without doing ... i need to learn to use a language before i know all its quirks | 15:04 | |
scimon | (Sorry if I put the cat among the pigeons there. Go being like Python makes sense to me. They are both dull ;) ) | ||
El_Che | lizmat: I did some POC code with cro for a rest service I needed to write, but I end up writing it in go because I needed oauth2 support (web and db looked ok) | ||
15:05
jameslenz left
|
|||
warriors | Go is a very safe bet, it is popular, simple have good ide, tons of code on github | 15:05 | |
El_Che | scimon: depends what your workspace is. If you're thinking SRE, devops and cloud, golang is pretty much the nr 1 option (and python non-existent) | ||
scimon | While failing to write slides I have started on a new project : github.com/Scimon/p6-Range-SetOps Updates the Set Operations to work on Ranges as continous Set (so 3 (elem) (1.5..9.7) would work) | 15:06 | |
scovit | I think nothing around will replace C++ | ||
jnthn | Nor C :) | ||
warriors | rust will, eventually | ||
15:06
gabiruh left
|
|||
warriors | rust i a must learn in my opinion, it is really the future, super solid community and interesting language | 15:06 | |
15:06
gabiruh joined
|
|||
moritz | maybe a language a generation later that picks up ideas from rust, but makes the concepts easier accessible | 15:07 | |
El_Che | golang was supposed to replace C/C++, but ended killing big parts of the ecosystems held by python and ruby (they moved, C/C++ people didn't) | ||
15:07
epony joined
|
|||
El_Che | jnthn: every time more impressed by Cro. Great job! | 15:07 | |
warriors | i also think the c/c++ combination is unfair to C, i think C is a lot harder to replace than C++ ... this is mainly because C is more niche compared to C++ which is more general | 15:08 | |
El_Che | warriors: yet C++ seems to be very entranched in some niches | 15:09 | |
I think more people will move from C to Rust, than from C++ to Rust | |||
(my very subjective prediction) | |||
jnthn | :) | ||
15:10
domidumont left
|
|||
warriors | maybe :) ... but regardless i think rust is very worthy of learning | 15:10 | |
moritz | replacing C only really helps you if you also manage to replace the calling conventions that C brought about | ||
and the lack of type information in the ABI | |||
15:10
Khisanth left
|
|||
El_Che | moritz: one ABI compatible piece of Rust code at the time, they say :) | 15:10 | |
warriors | C is like some people describe it, the lowest common denominator | 15:11 | |
scovit | with C you almost know exactly what the code run by the processor will look like | 15:12 | |
hobbs | because everything else comes with some baggage that makes it harder to interoperate with than C | ||
except Fortran :) | |||
scovit | C++ adds the possibility to abstract algorithms over complex data structures, if needed | 15:13 | |
15:13
robertle left
|
|||
moritz | scovit: except when you manage to write undefined behavior and have a clever compiler | 15:13 | |
15:14
diakopter joined,
itaipu left,
troys joined
15:15
itaipu joined,
salasrod joined
|
|||
scovit | moritz at least it will be easy to debug | 15:16 | |
Ulti | scovit: the one exception is C doesn't really have nice abstractions that fit caching and branch prediction in modern CPUs which are sort of outside of what code is emitted | 15:19 | |
though are there any languages that kind of make those problems obvious? | 15:20 | ||
scovit | Ulti: this is right, and could be that the future will be heterogeneous computer architectures that can only be optimally programmed by much more sophisticated runtimes. But is it going to ever happen? | 15:22 | |
my impression is that it could be that there will always be a spot for something with minimal abstraction (that requires lot of work to program with) | 15:23 | ||
15:30
Khisanth joined
15:31
lizmat left
15:33
lizmat joined
|
|||
b2gills | warriors: If you learn *all* of Perl 6's quirks, you would probably be the first. (backlogging) | 15:38 | |
15:38
robertle joined
|
|||
SmokeMachine | m: sub bla { KEEP { .say }; 42 }; bla | 15:41 | |
camelia | (Any) | ||
SmokeMachine | shouldn't it print 42? | ||
b2gills | m: sub bla { $_ = 255; KEEP { .say }; 42 }; bla | 15:44 | |
camelia | 255 | ||
15:44
psychoslave left
|
|||
b2gills | m: sub bla { $_ = 255; KEEP { .say }; 42 }; say bla | 15:44 | |
camelia | 255 42 |
||
SmokeMachine | docs.perl6.org/language/phasers#KEEP | 15:45 | |
15:45
psychoslave joined,
p6noob joined
15:49
psychoslave left
15:59
psychoslave joined
|
|||
vrurg | Empirical observation: <?after <rule>> doesn't work despite the fact is not mentioned in the docs. Am I right? Similarly, <?before <rule>> works. Example: f.perl.bot/p/mbmiu4 | 16:02 | |
mst | please don't send #perl6 pastes to #perl, it's confusing | 16:03 | |
vrurg | mst: f.perl.bot supports rakudo. What's wrong with it? | 16:04 | |
timotimo | the bot also puts the link in the channel you select | 16:05 | |
and #perl denizens aren't happy about getting perl6 unexpectedly | |||
mst | vrurg: yes? because perlbot is in here. so you select #perl6 to send the paste to. | ||
vrurg: it would also be rude if we sent random perl5 pastes to here. | |||
hobbs | vrurg: you just want to set the "where" to Freenode #perl6 if it's relevant to here, not to #perl :) | 16:06 | |
vrurg | Sorry guys, missed the 'where" field. | ||
hobbs | np | 16:07 | |
vrurg | Any way, is there a workaround for <?after>? I can use same regex in a token and a lookbehind – but rule would me logically more the right way to do it. | 16:08 | |
tyil[m4 | o/ | 16:09 | |
b2gills | vrurg: I think you may just have to remove the `?` | ||
zostay | AlexDaniel: They are identical. I clearly intended for them to be different, but I'm not able to recall at the moment what my intention was. | 16:10 | |
AlexDaniel: I've been intending to check on those failing tests myself, but I haven't made time for it yet. | |||
vrurg | b2gills: Nah, makes no difference. Basically, <?after and <after should be the same. | 16:11 | |
b2gills | Exactly why I thought that removing the `?` might work. (Just because they should be the same doesn't mean they work the same) | 16:12 | |
16:13
sjn left
|
|||
vrurg | b2gills: It seems that in this particular case 'should be' ~~ 'are' ;) | 16:13 | |
16:16
psychoslave left
|
|||
b2gills | vrurg: Actually maybe it is the `&&` as I don't see a reason for them being there | 16:16 | |
m: say 'abcd' ~~ m:g/ <alpha> && c / | 16:17 | ||
camelia | (「c」 alpha => 「c」) |
||
vrurg | b2gills: Ah, sorry. && shouldn't be there. I was just playing around and forgot to remove it. Though it makes no difference. | 16:18 | |
b2gills | vrurg: I'm having a little difficulty understanding why it isn't just `token paragraph { <line>+ }` | 16:19 | |
16:20
sjn joined
|
|||
vrurg | b2gills: Strict approach. Paragraph is what comes after an empty line of the beginning of text. Only. | 16:20 | |
Basically, it's more about studying grammars for now. So, mostly experimenting. | 16:21 | ||
b2gills | vrurg: Well I am absolutely sure that everything after `<line>*` can just be removed as token is ratcheting. (doesn't backtrack) | 16:22 | |
Actually I wonder if the reason `<after>` isn't working is because it is a `token` and not a `regex` | 16:23 | ||
16:23
Ven` left
|
|||
vrurg | Basically, for this demo <?before> isn't needed, you're right. But I extracted it from a bit more complex grammar where paragraph definition is slightly different. | 16:24 | |
16:25
epony left
|
|||
vrurg | I tried a regex too. Fails the same way. It only works with <?after [^^ \h* \n]> | 16:26 | |
b2gills | token doc { ^$ | <emptyLine>  <paragraph>+ %% <emptyLine> } | 16:27 | |
vrurg | b2gills: %%.. Hm, nice solution! Thanks! | 16:29 | |
16:29
fake_space_whale left
|
|||
b2gills | vrurg: You may have stumbled onto a bug, as the people who understand grammars rarely use `<after>` | 16:31 | |
16:31
scimon left
|
|||
b2gills | Basically when I see a `<after>` that means to me that the grammar may need to be restructured. | 16:31 | |
vrurg | Though still might fail in more complex setup. Basically, I'm training myself of markdown-like format. A paragraph might be followed by a list/quote/whatever. But then instead of <paragraph> I might use a compound rule... Just thinking aloud. ;) | 16:32 | |
16:32
pukku left
|
|||
vrurg suspected that there must be a simpler solution. | 16:32 | ||
b2gills | vrurg: You will want to look into proto tokens. For an example see github.com/moritz/json/blob/master...Grammar.pm | 16:33 | |
vrurg: Perl 6 has a lot of really useful features. The biggest problem is finding out that they exist. | 16:34 | ||
vrurg | I already use a proto in the bigger one. Though don't see how it applies to this example. | 16:35 | |
b2gills | It's one of the features that gets often overlooked. So just making sure you knew about it in case it proved useful | 16:36 | |
vrurg | Aha, I agree. Wonder how to manage to fit both perl5 and perl6 together in the limited space of my skull. :) Though perl6 might overtake some areas of my work already. | ||
b2gills | I remember one person who wrote a bunch of code to make sure that a Hash doesn't overwrite other values that hash to the same value. At which point I told him that Perl 6 already does that. | 16:37 | |
vrurg: I've forgotten how to do symbolic references in Perl 5. | 16:38 | ||
vrurg | protos and multi are definitely not something /me would miss because it's the only feature I was missing since departing from C++ almost two decades ago. ;) | ||
Ulti | < b2gills> warriors: If you learn *all* of PerlxA06's quirks, you would probably be the first. (backlogging) <--- you'd also be a human that can pass the test suite and thus an actual implementation of Perl 6 | 16:41 | |
16:42
epony joined,
dakkar left
16:45
kerframil left
|
|||
mst | vrurg: btw, f.perl.bot/#perl6 as a bookmark should I think send it to the right place to start with | 16:45 | |
b2gills: unless you're using that to mean something other than what it usually means ... good. you shouldn't be doing those in the first place :D | 16:46 | ||
vrurg | mst: thanks. | ||
AlexDaniel | tyil: I don't know how bridging with IRC works, but I guess it doesn't matter that much if it's #freenode_#perl6:matrix.org or #freenode_#perl6:perl.org | 16:49 | |
yoleaux | 14:00Z <tyil> AlexDaniel: you said Matrix gets much better performance when using a homeserver that is not matrix.org, do you know of a list of different public home servers so I can try that out? | ||
AlexDaniel | tyil: but maybe I misunderstood your question | 16:50 | |
b2gills | mst: I've also forgotten how to do it without using symbolic refs (%::MAIN or whatever it is) | ||
Geth | ecosystem: ec6ee28869 | (Zoffix Znet)++ (committed using GitHub Web editor) | META.list Add App::Lang::French::VerbTrainer to ecosystem "Training program for learning tenses and conjugations of French verbs": github.com/zoffixznet/perl6-App-La...erbTrainer |
16:52 | |
vrurg | b2gills: Tracing down stashes in Perl5 is really a headache. Must easier and faster with the refs. | 16:55 | |
vrurg wrote a special sub for fetching symbols from a namespace... | 16:56 | ||
17:02
jameslenz joined
17:06
jameslenz left
17:14
sarna left
17:22
koto joined
17:24
koto left,
sena_kun left
17:25
domidumont joined
17:27
diakopter left
17:29
bwisti joined
|
|||
SmokeMachine | m: sub bla { KEEP { .say }; 42 }; bla # shouldnt it print 42? | 17:30 | |
camelia | (Any) | ||
timotimo | m: sub bla { KEEP .say; 42 }; bla | 17:31 | |
camelia | (Any) | ||
timotimo | i think it should | ||
m: sub bla { POST { .say }; 42 }; bla | |||
camelia | 42 | ||
SmokeMachine | is that a bug? | 17:32 | |
timotimo | possibly an NYI? | 17:33 | |
17:33
psychoslave joined
|
|||
SmokeMachine | I thought I already used that... I think I'm wrong... | 17:34 | |
bisectable6: sub bla { KEEP { .say }; 42 }; bla | |||
bisectable6 | SmokeMachine, On both starting points (old=2015.12 new=88e913b) the exit code is 0 and the output is identical as well | ||
SmokeMachine, Output on both points: «(Any)» | |||
17:37
pecastro joined
|
|||
SmokeMachine | m: sub bla { LEAVE { .say }; 42 }; bla | 17:38 | |
camelia | (Any) | ||
17:40
psychoslave left
17:42
domidumont left
17:52
molaf left
17:56
itaipu left,
itaipu joined
17:58
pecastro left
18:05
itaipu left
18:07
pecastro joined
18:16
w17t joined,
w17t left
18:19
w17t joined,
w17t left
18:22
wamba joined,
itaipu joined
18:23
Schepeers left
18:24
sauvin left
|
|||
TimToady | in general, LEAVE-style phasers are there for the purpose of maintaining invariants that are not related to the return value, so there's little point in binding them to $_ (and in so doing shadowing any $_ in the outer scope) | 18:36 | |
we have POST if you want to do the other thing | |||
18:37
gabiruh left,
psychoslave joined
|
|||
TimToady | though arguably KEEP/UNDO are related to the return value insofar as they select one of two sets of invariants based on the return value | 18:37 | |
18:38
gabiruh joined
|
|||
TimToady | but LEAVE/KEEP/UNDO have to run even if there is no return value (such as when unrolling the stack for an exception) | 18:38 | |
18:38
konsolebox left
18:41
vrurg left,
konsolebox joined
|
|||
tyil | AlexDaniel: I've asked a freenode oper more on bridging, and asked in the matrix channel about it as well | 18:41 | |
it seems freenode irc bridges will most always be slow on matrix, since they mostly still use the matrix.org bridge | |||
which is overloaded | 18:42 | ||
it is possible to setup a home server with our own bridge to freenode | |||
which would then probably not be as overloaded, and thus faster | |||
SmokeMachine | TimToady: So the docs are what's wrong? | ||
tyil | however, we would have to contact the iline team about it as well, so we not get banned | ||
18:43
molaf joined
|
|||
tyil | the bridging part itself seems to be part of matrix appservices | 18:43 | |
TimToady | SmokeMachine: well, perhaps the docs copied the speculations, which still say: "For phasers such as C<KEEP> and C<POST> that are run when exiting a scope normally, the return value (if any) from that scope is available as the current topic within the phaser." | 18:47 | |
but rakudo has never done that, and I think the fact that nobody has noticed till now is indicative of how useful a feature that would be :) | 18:48 | ||
18:49
pmurias left
|
|||
TimToady | also working against this is the fact that in a "will leave { .close }" the topic is actually whatever the object is that the trait was applied to, not the return value | 18:49 | |
(I think) | 18:50 | ||
m: { my $x will leave { .say } = 42; } | |||
camelia | 42 | ||
TimToady | yep | 18:51 | |
SmokeMachine | makes sense... | ||
TimToady | so probably, if we want to make the return value (if any) available to exit phasers, we should put the onus on that code to dig it out, not just blindly bind to $_ | 18:52 | |
dunno if there's an implementation-independent way to dig it out currently... | |||
TimToady guesses not | |||
unless callframe(0).retval or some such works | 18:53 | ||
SmokeMachine | m: sub bla { $_ = 42; KEEP { .say } }; bla | ||
camelia | ( no output ) | ||
TimToady | you returned Nil | ||
18:53
Ven`` joined
|
|||
SmokeMachine | m: sub bla { return $_ = 42; KEEP { .say } }; bla | 18:53 | |
camelia | 42 | ||
SmokeMachine | :) | ||
m: sub bla { return $_ = 42; KEEP { .say } }; say bla | 18:54 | ||
camelia | 42 42 |
||
TimToady | and since we might have code that currently depends on not shadowing $_, we probably won't change it | ||
19:00
Zoffix joined
|
|||
SmokeMachine | m: sub bla { POST { .say }; 42 }; bla | 19:00 | |
camelia | 42 | ||
SmokeMachine | m: sub bla { POST { .say }; throw "bla" }; bla | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: throw used at line 1. Did you mean 'THROW'? |
||
SmokeMachine | m: sub bla { POST { .say }; die "bla" }; bla | 19:01 | |
camelia | (Mu) bla in sub bla at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Zoffix | It was noticed before (because the docs claimed it should work): R#1290 and looks like there was a trial implementation that did indeed break a few modules | ||
synopsebot | R#1290 [open]: github.com/rakudo/rakudo/issues/1290 KEEP does not set $_ to the return value | ||
TimToady | Zoffix++ | 19:02 | |
19:02
jameslenz joined
|
|||
SmokeMachine | Zoffix++ | 19:02 | |
m: sub bla { POST { .?say }; die "bla" }; bla | |||
camelia | (Mu) bla in sub bla at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
TimToady | but I think the "will leave" argument is pretty powerful here | ||
19:03
stephane_ left
|
|||
[Coke] | travis-ci.org/perl6/doc/jobs/402694645 - do we need to update some zef installs somewhere? | 19:03 | |
TimToady | we should, however, make some way of getting at the return value for the highly motivated :) | ||
SmokeMachine: the .say is succeeding, or the POST would fail | 19:05 | ||
m: sub bla { POST { .say; False }; die "bla" }; bla | |||
camelia | (Mu) Postcondition '{ .say; False }' failed in sub bla at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
19:06
jameslenz left
|
|||
SmokeMachine | TimToady: thanks | 19:07 | |
Zoffix | SmokeMachine: where in the docs does it say that it sets $_ to return value? | 19:08 | |
19:09
dogbert17 left
|
|||
SmokeMachine | Zoffix: docs.perl6.org/language/phasers#KEEP | 19:09 | |
geekosaur | "For phasers such as KEEP and POST that are run when exiting a scope normally, the return value (if any) from that scope is available as the current topic within the phaser." | ||
at that link | |||
Zoffix | [Coke]: the only avaiable version is 0.3.18, not 0.3.17. Previous versions aren't available for p6c ecosystem ATM, so it can't find it. The version prereq should be removed from docs prereqs IMO | 19:10 | |
Thanks. | |||
Geth | doc: d6d75b0397 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/phasers.pod6 Remove speculative $_ setting It's not part of the spec (just a speculative fudge exists) and might end up not being specced the way it's described: github.com/rakudo/rakudo/issues/12...-404277299 colabti.org/irclogger/irclogger_log...07-11#l776 |
19:12 | |
synopsebot | Link: doc.perl6.org/language/phasers | ||
doc: 225b7fc212 | (Zoffix Znet)++ (committed using GitHub Web editor) | META6.json Allow higher versions of HTML::To::Pod in prereqs |
19:13 | ||
19:15
psychoslave left
19:17
lizmat left
|
|||
[Coke] | Zoffix++ | 19:17 | |
Zoffix | Thinking of making "Your™" that does the very minimum to comply to the Perl 6 Specification. Other than having a laugh at how useless it will be, despite passing every test, it's main purpose will be to test our entire chain to ensure we fully support multiple compilers, so that when someone wants to join the ranks, they can easily do it. The places where "Your™ Compiler"'s description would appear would | 19:21 | |
be a plug to encourage people to write more Perl 6 compilers. | |||
19:24
lizmat joined
|
|||
warriors | hi in the repl "a".say.WHAT returns a , i was extpecting (Bool) which is the return type of .say | 19:24 | |
what am i missing | |||
Zoffix | + info on internals courses, etc, if people want to use the NQP toolchain | 19:25 | |
warriors: the autoprinting of the last value is done only if you did not produce any output | |||
warriors: and since you do, it assumes you don't want it to print bool | |||
m: "a".say.^name.asy | |||
camelia | a No such method 'asy' for invocant of type 'Str'. Did you mean 'any'? in block <unit> at <tmp> line 1 |
||
Zoffix | m: "a".say.^name.say | ||
camelia | a Bool |
||
warriors | i see, so its a repl thing | ||
i think ocaml repl does it better, it prints the return value, then what went to STDOUT :) | 19:26 | ||
Zoffix | (.WHAT isn't a good thing to find what a thing is. It's for getting the actual typeobjects, which don't stringify well and .gistify only to a shortname. It's also a fake method so you can't use it in some places. The .^name metamethod is better and returns a Str object) | ||
m: say IO::Handle.WHAT | |||
camelia | IO::Handle is disallowed in restricted setting in sub restricted at src/RESTRICTED.setting line 1 in method gist at src/RESTRICTED.setting line 33 in block <unit> at <tmp> line 1 |
||
Zoffix | e: say IO::Handle.WHAT | 19:27 | |
evalable6 | (Handle) | ||
Zoffix | e: say IO::Handle.^name | ||
evalable6 | IO::Handle | ||
Zoffix | e: say "The object is " ~ IO::Handle.WHAT | ||
evalable6 | Use of uninitialized value of type IO::Handle in string context. Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful. The object is in block <unit> at /tmp/kazvK_t0De line 1 |
||
Zoffix | e: say "The object is " ~ IO::Handle.^name | ||
evalable6 | The object is IO::Handle | ||
Zoffix | e: say "The objects are " ~ ($*OUT, $*ERR, $*IN).map: *.WHAT | ||
evalable6 | (exit code 1) Cannot resolve caller map(List: Whatever); none of these signatures match: ($: Hash \h, *%_) (\SELF: █; :$label, :$item, *%_) in block <unit> at /tmp/M63_hQP7oF line 1 |
||
Zoffix | e: say "The objects are " ~ ($*OUT, $*ERR, $*IN).map: *.^name | 19:28 | |
evalable6 | The objects are IO::Handle IO::Handle IO::Handle | ||
geekosaur | warriors, the REPL is as yet something of a hack | ||
warriors | :) | ||
Zoffix | m: sub new-thing-maker { $^v.WHAT.new }; my $o := class Meows {}.new; say [$o.WHICH, $o.&new-thing-maker.WHICH] | 19:29 | |
camelia | [Meows|67665248 Meows|67665280] | ||
warriors | the REPL needs autocompleton then it will be berfect | ||
:) | |||
Zoffix | I think CommaIDE has autocompletion now. Use that instead :D | 19:30 | |
hobbs | warriors, come out to play? | ||
19:30
cognominal joined
|
|||
warriors | it cost almost 200 canadian | 19:31 | |
i will wait for free comma | |||
Zoffix paid the 200 canadian... | |||
warriors | :( | ||
Zoffix | warriors: where in Canada are you at? | 19:32 | |
warriors | montreal | ||
Zoffix | C'est á Brampton :) | ||
warriors | qui? | ||
Zoffix | *à | ||
Damn it :) | |||
warriors | c'est quoi ca qui est a Brampton | ||
Zoffix | Not c'est. Je suis :) | 19:33 | |
warriors | je suis un immigrant, ca ne fait pas longtemp que je suis ici | ||
:) | |||
a toi, tu es a Brampton | |||
enchante | |||
:) | |||
Zoffix | I've been to Montreal like a month ago and started learning French 'cause I had trouble getting coffee there :) | ||
warriors | montreal is very bi langue | 19:34 | |
Zoffix | enchante aussi | ||
warriors | u can get by, with english only | ||
sepecially in down town | |||
Zoffix | Yeah, but it just feels like a dick move to speak in English when everything is in French :) | ||
warriors | well ... i didnt at first, it took me a while getting used to speak in french | 19:35 | |
:) .. french is cool though | |||
Zoffix | :) | ||
warriors | and its enchanté, i forget i have a french keybaord :) | 19:36 | |
Zoffix | :) | ||
[Coke] | (perl 6 compiles) - btw, did anyone see that someone make niecza compile with a recent mono? | 19:39 | |
tbrowder_ | an aside: anyone using a windows host (running win 10 pro) and using hyperV for a Linux VM? | 19:44 | |
Zoffix | tbrowder_: I do, except using VirtualBox for Linux VM | ||
tbrowder_ | i hear hyperV should be faster since its a level 1 vs level 2 for virtual box, thoughts? | 19:46 | |
Zoffix | vOv... VirtualBox is fast enough for me | 19:47 | |
moritz | tbrowder_: I don't think these theories applies anymore | ||
tbrowder_ | i’m condidering getting a new laptop and, for the first time in a long time, not using duel boot | 19:48 | |
dual | |||
has anyone tried hyperV? | |||
19:53
itaipu left,
itaipu joined
19:55
itaipu left,
Zoffix left
|
|||
tbrowder_ | well, i have used vbox a lot, so i guess i could start with that... | 19:56 | |
19:57
benjikun left
19:58
itaipu joined
20:06
itaipu left
20:07
itaipu joined
20:09
cognominal left
|
|||
Kaiepi | m: BEGIN $*LANG.refine_slang: 'MAIN', role Lolcode::Grammar { token scope_declarator:sym('I HAZ A') { <sym> <scoped('my')> }; token initializer:sym<ITZ> { <sym> <.ws> <EXPR('e=')> } }, role Lolcode::Actions { method scope_declarator:sym('I HAZ A')($/) { make $<scoped>.ast }; method initializer:sym<ITZ>($/) { make $<EXPR>.ast } }; I HAZ A $CHEEZBURGER ITZ 'EPIC'; say $CHEEZBURGER | 20:16 | |
camelia | ===SORRY!=== Type check failed in binding to parameter '$/'; expected Any but got Perl6::Grammar+{Lolcode::Grammar} (Perl6::Grammar+{Lolcode::Grammar}.new() #`[14001853426...) |
||
Kaiepi | is there something i'm doing wrong here? | ||
apart from reviving dead memes | |||
20:16
cognominal joined
20:18
p6noob left
20:25
Zoffix joined
|
|||
Zoffix | Kaiepi: based on the error, you're attempting to stick a non-Any object into Any param | 20:25 | |
stick a Mu type constraint on it | 20:26 | ||
tobs | Kaiepi: the $/ parameter is missing a Mu and you can't $<foo> somehow. See hastebin.com/mowepuyuko.rb | ||
I don't know why but I saw that in the sources of Slang::SQL | |||
TimToady | the Any constraint is coming from nqp's .refine_slang | ||
Kaiepi | ah perfect, that works | 20:28 | |
thanks | |||
20:29
psychoslave joined
|
|||
TimToady | ah yes, ignore what I said | 20:30 | |
the mention of $/ should'a clued me | |||
20:31
warriors left
|
|||
TimToady | not to mention I probably need a geezer nap... | 20:32 | |
20:34
psychoslave left
|
|||
Kaiepi | what does lk stand for? | 20:36 | |
tobs | Kaiepi: sLang cargo Kulting, maybe? :) github.com/tony-o/perl6-slang-sql/...QL.pm6#L41 | 20:37 | |
or "lookup key" | |||
20:40
MasterDuke joined
20:42
benjikun joined
|
|||
Kaiepi | i'm gonna make a port of c's version of lolcode to get to learn how Perl6::Grammar and Perl6::Actions work | 20:44 | |
SmokeMachine | m: multi bla() { say "not" }; multi bla(|c (:$bla!)) { say c }; bla :42bla | ||
camelia | Unexpected named argument 'bla' passed in sub bla at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
SmokeMachine | m: multi bla(|c (:$bla!)) { say c }; bla :42bla | ||
camelia | \(:bla(42)) | ||
SmokeMachine | m: class :: {multi method a() { say "not" }; multi method a(|c (:$bla!)) { say c } }.a: :42bla | 20:46 | |
camelia | not | ||
SmokeMachine | are those bugs? | 20:47 | |
TimToady | for subs, prolly, but methods have the *% thing going as well | 20:49 | |
timotimo | DrForr: the tensorflow repository has your perl6::parser's readme (but you haven't touched it in a year anyway, so maybe not useful any more? | 20:50 | |
Zoffix | SmokeMachine: no, named args do not participate in dispatch | ||
SmokeMachine: only for tie breaking | |||
20:51
p6noob joined
|
|||
Zoffix | m: multi bla(| ()) { say "not" }; multi bla(|c (:$bla!)) { say c }; bla :42bla | 20:51 | |
camelia | \(:bla(42)) | ||
Zoffix | Here now both candidates are tied, so it used the named args to tie break | ||
SmokeMachine | m: class :: {multi method a(|()) { say "not" }; multi method a(|c (:$bla!)) { say c } }.a: :42bla | 20:54 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Obsolete use of | or \ with sigil on param () at <tmp>:1 ------> 3class :: {multi method a(|()7⏏5) { say "not" }; multi method a(|c (:$bl |
||
SmokeMachine | m: class :: {multi method a(| ()) { say "not" }; multi method a(|c (:$bla!)) { say c } }.a: :42bla | ||
camelia | \(:bla(42)) | ||
SmokeMachine | Zoffix: thanks! | ||
Kaiepi | m: BEGIN $*LANG.refine_slang: 'MAIN', role Lolcode::Grammar { token multi_declarator:sym<LOTZA> { :my $*LINE-NO := HLL::Compiler.lineof(self.orig(), self.from(), :cache(1)); <sym><.kok> :my $*MULTINESS := 'multi'; [ <?before '('> { $*W.throw: $/, 'X::Anon::Multi', multiness => $*MULTINESS } ] [ <declarator> || <routine_def('sub')> || <.malformed('multi')> ] } }, role Lolcode::Actions { sub lk(Mu \h, \k) { use nqp; nqp::atkey(nqp::findmethod(h, 'hash')(h), | 20:55 | |
k) }; method multi_declarator:sym<LOTZA>(Mu $/) { my \declarator = lk($/, 'declarator'); $/.make: declarator ?? declarator.ast !! lk($/, 'routine_def').ast; } }; LOTZA sub HAI { say 'HAI' }; HAI | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1) at <tmp>:1 ------> 3qp::atkey(nqp::findmethod(h, 'hash')(h),7⏏5<EOL> expecting … |
||
Kaiepi | whoops too long | ||
when i try running that i get Undeclared name: LOTZA used at line 49 | |||
Zoffix | Kaiepi: what if you stick that code into its own block? | 20:56 | |
Some things are so fundamental any slang changes get picked up only in a new scope after slangification | |||
Kaiepi | like this? hastebin.com/zekohohuda.rb | 20:57 | |
Zoffix | Kaiepi: no, that just added a block into the begin. Not a block around the code that's meant to pick up slanged changes | 20:58 | |
Kaiepi | what do you mean then? | ||
Zoffix | nothing, never mind | 20:59 | |
Kaiepi | there's a line in src/Perl6/Grammar.nqp that's like token term:sym<multi_declarator> { <?before 'multi'|'proto'|'only'> <multi_declarator> } | 21:00 | |
maybe that's what's causing the problem? | |||
21:00
bdmatatu left
|
|||
Zoffix | yeah | 21:00 | |
Kaiepi | lemme compile and test again after removing the <?before> token | 21:01 | |
21:01
pmurias joined
|
|||
Zoffix | Just stick token term:sym<multi_declarator> { <?before 'multi'|'proto'|'only'|'LOTZA'> <multi_declarator> } into your grammar | 21:01 | |
21:02
jameslenz joined
|
|||
Zoffix | hm | 21:03 | |
it comes back after you fix the HLL::Compiler error | |||
oh works | 21:05 | ||
Ah, you missed the `?` on the `<before` thin in LOTZA | |||
Kaiepi | ohh | ||
Zoffix | m: gist.github.com/zoffixznet/b5197de...e482bbe45d | 21:06 | |
camelia | HELLA FRICKIN EPIC HALLO |
||
21:06
jameslenz left
21:13
Zoffix left
21:22
molaf left
21:30
itaipu left,
itaipu joined
21:32
itaipu left
|
|||
benjikun | What are the ways to use map asynchronously again | 21:33 | |
timotimo | are you refering to asynchronous as in supplies, or do you want to map over a list using multiple cores at the same time? | 21:34 | |
21:35
itaipu joined
|
|||
timotimo | supplies have a map method, and for mapping over a list in parallel you can use race or hyper (hyper will keep the same order, race won't necessarily) | 21:35 | |
don't forget to tune :batch() and maybe :degree() to fit your workload better | |||
Kaiepi | what's the difference between *@args and **@args in parameters? | 21:36 | |
El_Che | a pointer to a pointer? | 21:37 | |
El_Che ducks | |||
21:37
itaipu left
|
|||
timotimo | Kaiepi: changes how nested structures are handled | 21:38 | |
Kaiepi | ah | ||
yeah i found the documentation for it | |||
The single asterisk form flattens passed arguments. | |||
The double asterisk form does not flatten arguments. | |||
The plus form flattens according to the single argument rule. | |||
timotimo | m: sub onestar(*@args) { say @args.perl }; onestar(1, 2, (3, 4), (5, (6, 7), 8)) | ||
camelia | [1, 2, 3, 4, 5, 6, 7, 8] | ||
timotimo | m: sub twostar(**@args) { say @args.perl }; twostar(1, 2, (3, 4), (5, (6, 7), 8)) | ||
camelia | [1, 2, (3, 4), (5, (6, 7), 8)] | ||
tyil[m] | benjikun: are you looking for race/hyper? | ||
benjikun | timotimo: Map over a list | 21:39 | |
tyil[m]: Yeah, I'm aware of race/hyper, how would I use that with .map though? | |||
timotimo | you just @mylist.hyper.map({ }) | ||
tyil[m] | benjikun: @list.race.map(); | ||
or hyper | 21:40 | ||
yeah | |||
21:40
itaipu joined
21:41
MasterDuke left
|
|||
benjikun | ah I see, didn't realize it would be that simple | 21:41 | |
tyil[m] | benjikun: have you seen 6guts.wordpress.com/2017/03/16/con...semantics/ | 21:42 | |
21:42
itaipu left
21:44
MasterDuke joined
21:45
itaipu joined
21:47
itaipu left
21:48
Ven`` left
21:50
itaipu joined
21:52
itaipu left
21:55
itaipu joined
21:56
itaipu left
21:58
Ven`` joined
21:59
Ven`` left
22:00
itaipu joined
22:10
devmikey joined,
Schepeers joined,
itaipu left
22:11
itaipu joined
22:12
pmurias left
22:13
itaipu left
22:14
pmurias joined
22:16
itaipu joined
22:18
warriors joined
|
|||
warriors | hi | 22:18 | |
i noticed that you must include a space after a class name else, errors so for example class point{ ...} causes error but class point {...} is fine | 22:19 | ||
timotimo | greetings | 22:20 | |
yeah, { } after something is also syntax for hash access | |||
warriors | is this documented somewhere | ||
timotimo | m: sub class { }; my \point = %(a => 1); class point{"a"}.say | ||
camelia | ===SORRY!=== No compile-time value for point |
||
timotimo | oops :) | ||
warriors | hmmm | 22:21 | |
22:22
pmurias left
22:24
itaipu_ joined
|
|||
warriors | the error message was so criptic | 22:24 | |
is kiwi irc a safe client | 22:26 | ||
22:26
itaipu left
|
|||
warriors | i mean the web client kiwiirc | 22:27 | |
timotimo | i'd expect it to be reasonably good. why? | 22:29 | |
warriors | just asking | ||
timotimo | if you're using freenode.net's own kiwiirc, it shouldn't be a problem, since your chat messages go through their network anyway | 22:30 | |
22:35
warriors left
22:36
benjikun2 joined,
spycrab0 left
22:39
benjikun left
22:40
itaipu_ left
22:42
Zoffix joined
22:43
Zoffix left,
h44gsyefw6fw joined,
h44gsyefw6fw left,
wamba left
22:44
sgsdfgsdfg joined,
pecastro left
22:52
DarthGandalf left
22:53
sgsdfgsdfg left
22:57
vrurg joined
22:59
DarthGandalf joined
23:00
Khisanth left
23:02
jameslenz joined
23:04
Kaiepi left
23:05
Kaiepi joined
23:07
jameslenz left
|
|||
Geth | doc: f7c37c213a | 陈梓立++ (committed using GitHub Web editor) | README.zh.md sync |
23:10 | |
23:13
Khisanth joined
|
|||
Geth | doc: ace72dfa08 | 陈梓立++ (committed using GitHub Web editor) | README.zh.md Update README.zh.md though jp version is WIP, but `README.md` show a link to it. thus sync also add link to Dutch ver. |
23:15 | |
23:29
rindolf left
23:30
kerframil joined
23:37
devmikey left
|
|||
benjikun2 | If I have some array @a where I'm mapping each to a start block asynchronously, how do I await on each of the items in the array to finish? | 23:49 | |
timotimo | you can either just await @array-of-promises, or you can await Promise.allof(@array-of-promises) | 23:51 | |
the first version will throw on any broken promises | |||
the one for allof is only for synchronization | |||
if you use allof, you'll potentially silently lose exceptions | 23:52 | ||
jnthn | Yeah, the list form of `await` means you an just do my @results = await @promises; | 23:54 | |
If that's what you're wanting :) | |||
If you're doing that, though, you often want .race or .hyper instead :) | 23:55 | ||
timotimo changes the documentation | |||
"If a list of promises is provided a list of promises is returned. | |||
because that's wrong | |||
jnthn | indeed | 23:56 | |
timotimo | oh, it doesn't say anything about a list of mixed things, like two promises and two channels | 23:57 |