»ö« 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. |
|||
00:08
atweiden-air joined
00:09
p6bannerbot sets mode: +v atweiden-air
|
|||
atweiden-air | rakudo has landed in homebrew github.com/Homebrew/homebrew-core/...1c9fce7b68 | 00:09 | |
00:10
Jmlv joined,
p6bannerbot sets mode: +v Jmlv
00:11
Jmlv left
00:14
scovit left,
dct left
|
|||
Geth | doc: 2dcce0a0b0 | cfa++ | doc/Language/traps.pod6 Formatting. |
00:15 | |
synopsebot | Link: doc.perl6.org/language/traps | ||
00:17
cpage_ joined
00:18
p6bannerbot sets mode: +v cpage_
00:19
cpage left,
cpage_ is now known as cpage,
MilkmanDan left
00:20
MilkmanDan joined,
p6bannerbot sets mode: +v MilkmanDan
00:23
rindolf left
00:29
cfa left
00:40
MorayJ left
|
|||
lookatme_q | morning #perl6 | 00:43 | |
sena_kun | o/ | 00:46 | |
00:46
atweiden-air left
|
|||
lookatme_q | sena_kun, o/ | 00:47 | |
sena_kun | though it's 02:47 here. :) | ||
lookatme_q | here is 08:47 | 00:48 | |
sena_kun | all hail timezones! | 00:49 | |
lookatme_q | haha :) | 00:50 | |
sena_kun | anyway, I'll go to sleep soon, I think | 00:51 | |
lookatme_q | sena_kun, good night, bye :) | 00:52 | |
sena_kun | just give me 5 more minutes to stare into to code... | ||
01:10
scovit joined
01:11
p6bannerbot sets mode: +v scovit
01:14
DarthGandalf joined,
p6bannerbot sets mode: +v DarthGandalf
01:18
lizmat left
01:19
sena_kun left
|
|||
zachk | how can i compare types of variables? | 01:29 | |
timotimo | you can get an object's type object with the .WHAT pseudo-method | ||
if you are interested in the variable, actually, like the constraint it was declared with, you'll need to access the .VAR | 01:30 | ||
01:34
Ven`` joined
01:35
p6bannerbot sets mode: +v Ven``
|
|||
zachk | but say i want to compare two variables and see if their types are equal? | 01:47 | |
01:51
kurahaupo_ joined
01:52
kurahaupo left,
p6bannerbot sets mode: +v kurahaupo_
|
|||
timotimo | there are many different ways to interpret that | 01:58 | |
m: my Int $foo; my Str $bar; say "$foo.VAR.WHAT.^name() equal to $bar.VAR.WHAT.^name()?" | |||
camelia | Scalar equal to Scalar? | ||
timotimo | m: my Int $foo; my Str $bar; say "$foo.VAR.of.^name() equal to $bar.VAR.of.^name()?" | 01:59 | |
camelia | Int equal to Str? | ||
timotimo | m: my Int $foo = <0xff>; my Int $bar = 255; say "$foo.VAR.of.^name() equal to $bar.VAR.of.^name()?"; say "$foo equal to $bar?" | ||
camelia | Int equal to Int? 0xff equal to 255? |
||
timotimo | m: my Int $foo = <0xff>; my Int $bar = 255; say "$foo.WHAT.^name() equal to $bar.WHAT.^name()?"; say "$foo equal to $bar?" | ||
camelia | IntStr equal to Int? 0xff equal to 255? |
||
timotimo | what semantics are you interested in? | 02:00 | |
the kind of variable, aka Scalar vs Proxy vs Native Reference? | 02:01 | ||
the constraint the variable was declared with? i.e. my Int $foo vs my Str $bar? | |||
the type of the value that's in the variable? that'd be $foo.WHAT vs $bar.WHAT | |||
and do you want to accept subclasses of one in the other? | |||
02:02
mowcat joined,
p6bannerbot sets mode: +v mowcat
|
|||
timotimo | i think what you want will be $foo.WHAT === $bar.WHAT | 02:03 | |
not many prog languages have first-class scalar variables or introspectable lexicals or stuff like that | 02:04 | ||
Ven`` certainly can't think of many off the top of their head | 02:14 | ||
m: subset MyInt of Int; say MyInt ~~ Int; say Int ~~ MyInt; | 02:15 | ||
camelia | True True |
||
Ven`` | interesting | ||
02:22
jme` joined
02:23
p6bannerbot sets mode: +v jme`,
Ven`` left
|
|||
vrurg | Can I have own control exceptions defined? I.e. to have them processed in a CONTROL block? Application of X::Control is not sufficient, seemingly. | 02:26 | |
zachk | whats that triple equals? === ? | 02:27 | |
vrurg | zachk: same object equality. | 02:28 | |
m: my $a = 1; my $b = 1; say $a === $b; $b := $a; say $b === $a | |||
camelia | True True |
||
vrurg | Ah, constant. | 02:30 | |
m: class Foo {}; say Foo.new === Foo.new | |||
camelia | False | ||
lookatme_q | m: say 1 == True; say 1 === True; say True === True; | 02:32 | |
camelia | True False True |
||
lookatme_q | zachk, you can using === check if they are same object | ||
zachk | does that compare instance variables too inside an object instance? | 02:33 | |
02:38
ryn1x joined
02:39
p6bannerbot sets mode: +v ryn1x
|
|||
vrurg | zachk: It would compare whatever is in the variables. | 02:41 | |
02:51
melezhik joined,
p6bannerbot sets mode: +v melezhik
|
|||
melezhik | Hi! How do I declare dependency on version equal or greater in META.json file? | 02:52 | |
02:54
molaf left
|
|||
lookatme_q | melezhik, I don't think they support that things | 02:54 | |
melezhik | yeah ... I guessed ... just wanted to ensure ... | 02:55 | |
02:58
Kaiepi left
|
|||
lookatme_q | melezhik, maybe you can submit a ticket for that, but IDK which repo to | 02:59 | |
zachk | so my code was working, compiled and installed the latest perl6, now I get this This Seq has already been iterated, and its values consumed | 03:02 | |
lookatme_q | zachk, refer this documents: docs.perl6.org/type/Seq | 03:03 | |
03:09
kurahaupo_ left
03:10
kurahaupo joined,
p6bannerbot sets mode: +v kurahaupo
|
|||
zachk | do i still need to apply the execstack fix for ubuntu on windows to rakudo? | 03:11 | |
er moarvm or whichever | |||
lookatme_q | yes, I think so, for moarvm | ||
03:23
ryn1x left
03:27
zachk left
03:32
w_richard_w left
03:42
melezhik left
03:52
leont left
04:34
Cabanossi joined,
Cabanoss- left
04:35
p6bannerbot sets mode: +v Cabanossi
04:42
sauvin joined,
p6bannerbot sets mode: +v sauvin
04:47
jast left
04:50
jast joined
04:51
p6bannerbot sets mode: +v jast
05:02
ferreira left
05:05
jme` left
05:16
molaf joined
05:17
p6bannerbot sets mode: +v molaf
05:23
w17t joined,
p6bannerbot sets mode: +v w17t
05:28
reach_satori left
05:41
w_richard_w joined
05:42
p6bannerbot sets mode: +v w_richard_w
05:44
w_richard_w1 joined
05:45
p6bannerbot sets mode: +v w_richard_w1,
w_richard_w left
05:46
zacts joined,
p6bannerbot sets mode: +v zacts
05:48
MilkmanDan left
05:49
kurahaupo left,
MilkmanDan joined,
p6bannerbot sets mode: +v MilkmanDan,
kurahaupo joined
05:50
p6bannerbot sets mode: +v kurahaupo
05:52
curan joined,
p6bannerbot sets mode: +v curan
05:56
reach_satori joined
05:57
p6bannerbot sets mode: +v reach_satori
06:03
ZzZombo joined,
p6bannerbot sets mode: +v ZzZombo
06:10
zacts left
06:18
vrurg left
06:20
jmerelo joined
06:21
p6bannerbot sets mode: +v jmerelo
06:26
domidumont joined,
p6bannerbot sets mode: +v domidumont
06:27
molaf left
|
|||
SmokeMachine | Isn’t just: “MudileName:ver<2.0>”? | 06:28 | |
06:29
vrurg joined
06:30
p6bannerbot sets mode: +v vrurg
|
|||
SmokeMachine | .tell melezhik something like this: "Pod::To::Markdown:ver<0.1.4+>" | 06:36 | |
yoleaux | SmokeMachine: I'll pass your message to melezhik. | ||
SmokeMachine | lookatme_q: something like this: "Pod::To::Markdown:ver<0.1.4+>" | ||
06:44
vrurg left
|
|||
jmerelo | squashable6: status | 06:45 | |
squashable6 | jmerelo, Next SQUASHathon in 24 days and ≈3 hours (2019-02-02 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day | ||
jmerelo | releasable6: status | ||
releasable6 | jmerelo, Next release in ≈11 days and ≈12 hours. 3 blockers. 0 out of 173 commits logged | ||
jmerelo, Details: gist.github.com/64dbb6ca855c7b2ebf...ee28ce5ce1 | |||
06:46
domidumont left
|
|||
jmerelo | .tell AlexDaniel I'll go for Kaiepi as a winner. Actually, you made the most contributions, but I guess you're not eligible | 06:47 | |
yoleaux | jmerelo: I'll pass your message to AlexDaniel. | ||
jmerelo | .tell Kaiepi congratulations! You're the winner of the plush Camelia for your contributions to the last Squashathon! | ||
yoleaux | jmerelo: I'll pass your message to Kaiepi. | ||
jmerelo | .tell Kaiepi to contact lizmat to get your plush Camelia shipped to you. | 06:53 | |
yoleaux | jmerelo: I'll pass your message to Kaiepi. | ||
jmerelo | .tell AlexDaniel I'm going to propose Squashathons for the next 6 months. Feedback is welcomed and appreciated. | 06:59 | |
yoleaux | jmerelo: I'll pass your message to AlexDaniel. | ||
jmerelo | .tell AlexDaniel do you have some script to extract info from the log? I seem to remember you did... | 07:00 | |
yoleaux | jmerelo: I'll pass your message to AlexDaniel. | ||
07:02
domidumont joined,
p6bannerbot sets mode: +v domidumont
|
|||
jmerelo | SmokeMachine: Why did you remove Red from the ecosystem? Any major problem? | 07:08 | |
squashable6: status | 07:19 | ||
squashable6 | jmerelo, Next SQUASHathon in 24 days and ≈2 hours (2019-02-02 UTC-12⌁UTC+14). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day | ||
jmerelo | ^^^^ OK, I have inserted squashathon proposals for the next 6 months. Comments and suggestions welcome and appreciated | ||
And we're still commenting on the issue of splitting the doc repository: github.com/perl6/doc/issues/2542 | 07:20 | ||
07:21
scovit_ joined,
p6bannerbot sets mode: +v scovit_
07:24
scovit left
07:26
jmerelo left
07:53
mowcat left
08:11
w_richard_w1 left
08:15
robertle_ joined
08:16
p6bannerbot sets mode: +v robertle_
08:27
kurahaupo left
08:28
w_richard_w joined,
p6bannerbot sets mode: +v w_richard_w
08:31
sftp left
|
|||
Geth | doc: d7841111e6 | (JJ Merelo)++ | doc/Language/modules.pod6 Restores the information on the `api` field As requested by @jonathanstowe and @ugexe |
08:35 | |
synopsebot | Link: doc.perl6.org/language/modules | ||
08:38
sftp joined,
p6bannerbot sets mode: +v sftp
08:42
w_richard_w left
08:45
dakkar joined,
p6bannerbot sets mode: +v dakkar
08:50
patrickb joined
08:51
p6bannerbot sets mode: +v patrickb
09:00
w17t left
|
|||
lookatme_q | SmokeMachine, don't know this usage, is that mention in the documents ? :) | 09:02 | |
09:08
w17t joined,
p6bannerbot sets mode: +v w17t
09:18
rindolf joined,
p6bannerbot sets mode: +v rindolf
09:26
ZzZombo left
09:41
reach_satori left
|
|||
AlexDaniel | . | 09:42 | |
yoleaux | 06:47Z <jmerelo> AlexDaniel: I'll go for Kaiepi as a winner. Actually, you made the most contributions, but I guess you're not eligible | ||
06:59Z <jmerelo> AlexDaniel: I'm going to propose Squashathons for the next 6 months. Feedback is welcomed and appreciated. | |||
07:00Z <jmerelo> AlexDaniel: do you have some script to extract info from the log? I seem to remember you did... | |||
09:56
kensanata joined,
p6bannerbot sets mode: +v kensanata
10:09
scovit_ left
10:13
dpk joined
10:14
p6bannerbot sets mode: +v dpk
10:15
w17t left
10:16
Kaiepi joined
10:17
p6bannerbot sets mode: +v Kaiepi
10:21
lizmat joined,
p6bannerbot sets mode: +v lizmat
10:22
w17t joined,
p6bannerbot sets mode: +v w17t
10:34
Kaiepi left,
zakharyas joined,
reach_satori joined,
w17t left
10:35
p6bannerbot sets mode: +v zakharyas,
p6bannerbot sets mode: +v reach_satori
10:36
w17t joined,
p6bannerbot sets mode: +v w17t
10:37
Kaiepi joined
10:38
p6bannerbot sets mode: +v Kaiepi
11:10
mbichon joined,
p6bannerbot sets mode: +v mbichon
11:14
mbichon left
11:21
domidumont left
11:41
sena_kun joined
11:42
scovit joined,
p6bannerbot sets mode: +v sena_kun
11:43
p6bannerbot sets mode: +v scovit
11:45
Xliff_ left
11:47
Xliff joined
11:48
p6bannerbot sets mode: +v Xliff
11:51
Xliff left,
Xliff joined,
mike_swie joined,
p6bannerbot sets mode: +v mike_swie
11:52
p6bannerbot sets mode: +v Xliff
|
|||
lizmat | And yet another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2019/01/08/...-for-2019/ | 11:57 | |
11:59
rindolf left,
Xliff left
12:01
rindolf joined
|
|||
moritz | lizmat++ | 12:01 | |
retweeted | |||
12:02
p6bannerbot sets mode: +v rindolf,
Xliff joined
|
|||
mike_swie | lizmat++ | 12:02 | |
12:03
p6bannerbot sets mode: +v Xliff
|
|||
mike_swie | I'm assuming the ++ is a thanks, or like, or complimentary. If I got that wrong, please forgive the accidental etiquette breach. | 12:03 | |
lizmat | mike_swie: it's interpreted as such | 12:04 | |
12:04
scovit left
|
|||
lizmat | the usage is from the days that bots where roaming the channels assigning karma :-) | 12:04 | |
it indicates an increase in karma after things done | 12:05 | ||
12:05
yoleaux joined,
ChanServ sets mode: +v yoleaux
|
|||
lizmat | prefix ++ indicates karma to assigned for things to be done still | 12:05 | |
mike_swie | Heh. I was using telnet chat in the '90s, I never got into IRC, Usenet, and similar. Funny how I missed them all at the time. | ||
12:06
p6bannerbot sets mode: +v yoleaux,
AlexDaniel left
|
|||
masak | it doesn't matter that bots are not actually accumulating karma at any given moment | 12:07 | |
somewhere, somehow, A Score is Being Kept | 12:08 | ||
moritz | Karma keeps score :) | ||
masak | exactly | ||
anyway, lizmat++ for the post | |||
Xliff | masak: Ah! Spirituality! Surprising! :) | ||
yoleaux | 1 Jan 2019 12:34Z <jjmerelo> Xliff: it was a generic "Advent calendar" post, not specifically devoted to Perl 6. It was published Dec 2nd, I think. | ||
masak | and I had missed the thing with Zoffix leaving. that's sad. :/ | 12:09 | |
12:09
reach_satori left
|
|||
Xliff | Ah.... Slashdot. Those were the days. | 12:09 | |
masak almost wrote something about the Naming/Alias issue, but instead decides not to | 12:10 | ||
SmokeMachine | .tell jmerelo I removed Red from the ecosystem because I sent it to CPAN | 12:17 | |
yoleaux | SmokeMachine: I'll pass your message to jmerelo. | ||
SmokeMachine | .tell lizmat Any reason to not mentioning Red on p6weekly? | 12:25 | |
yoleaux | SmokeMachine: I'll pass your message to lizmat. | ||
lizmat | SmokeMachine: it's mentioned in the New Modules section | 12:26 | |
yoleaux | 12:25Z <SmokeMachine> lizmat: Any reason to not mentioning Red on p6weekly? | ||
SmokeMachine | Sorry o just saw it!!! | ||
lizmat | and it's the module I consider the potential killer feature | ||
SmokeMachine | I think I’m becoming blind... | 12:27 | |
lizmat | just write a nice blog post about it and you'll get much more exposure :-) | ||
SmokeMachine | lizmat: thanks! | ||
12:28
reach_satori joined
|
|||
SmokeMachine | lizmat: I didn’t mean mentioning outside the new modules... I couldn’t see the on the new modules area... (I’ve just waked up) | 12:29 | |
12:29
Xliff left,
p6bannerbot sets mode: +v reach_satori
|
|||
SmokeMachine | lizmat: sorry... | 12:29 | |
lizmat | SmokeMachine: should I mention it as RED (in full capitals) in the future ? | 12:32 | |
then it will stand out more ? | 12:33 | ||
SmokeMachine | I call it Red... I have not decided why it’s called Red yet... :) | 12:34 | |
lizmat | Really Excellent Databaseabstraction | 12:35 | |
timotimo | 04Red | ||
SmokeMachine | :) | ||
timotimo | ReDorm | ||
12:37
MorayJ joined,
p6bannerbot sets mode: +v MorayJ
12:40
Guest87s joined,
p6bannerbot sets mode: +v Guest87s
|
|||
lizmat | afk for a bit& | 12:46 | |
12:50
reach_satori left
12:55
scovit joined
12:56
p6bannerbot sets mode: +v scovit
12:58
domidumont joined
12:59
p6bannerbot sets mode: +v domidumont,
tobs` joined
13:00
p6bannerbot sets mode: +v tobs`
13:03
scovit left
13:05
Guest87s left
13:08
lucasb joined,
p6bannerbot sets mode: +v lucasb,
AlexDaniel joined,
p6bannerbot sets mode: +v AlexDaniel
13:29
salva joined
13:30
p6bannerbot sets mode: +v salva
13:32
w17t left
|
|||
lucasb | I just noticed the comments about the departure of our fellow developer. I'm sorry to hear that and hope he returns when he wants. | 13:47 | |
His modules should be preserved. Anyone did that already? | 13:49 | ||
maybe a github.com/zoffixmirror org? :) | |||
lizmat | AlexDaniel has rights to Zoffix' repos as far as I knonw | 13:51 | |
*know | |||
sena_kun | isn't moving those under perl6-community-modules org enough? | ||
lucasb | yes, that should work | 13:52 | |
13:57
Xliff joined,
sjoshi joined,
sjoshi left,
p6bannerbot sets mode: +v Xliff
14:05
AlexDaniel left
14:06
reach_satori joined,
leont joined
14:07
p6bannerbot sets mode: +v reach_satori,
p6bannerbot sets mode: +v leont
14:12
HaraldJoerg joined
14:13
p6bannerbot sets mode: +v HaraldJoerg
|
|||
HaraldJoerg | p6: say २०१९; | 14:13 | |
camelia | 2019 | ||
tadzik | :o | 14:14 | |
14:14
scovit joined
|
|||
HaraldJoerg | p6: say '२०१९' | 14:14 | |
camelia | २०१९ | ||
14:15
p6bannerbot sets mode: +v scovit
|
|||
HaraldJoerg | p6: say २०१९ - ٢٠١٩ | 14:16 | |
camelia | 0 | ||
HaraldJoerg | Is there a way to have Perl 6 *write* integers as non-ASCII numerals? | 14:17 | |
timotimo | well, there is a module for roman numerals | 14:18 | |
SmokeMachine | there is a module for japanese too... | ||
HaraldJoerg | I know this one, but I'm more interested in extant systems | 14:19 | |
14:22
vrurg joined
|
|||
timotimo | it's relatively easy if the other numeral system is 10-based | 14:22 | |
14:23
p6bannerbot sets mode: +v vrurg
|
|||
HaraldJoerg | I've used two 10-based here: indian and devanagari | 14:23 | |
Geth | DBIish: jnthn++ created pull request #137: Performance improvements, with a focus on SQLite and re-use of statement handles |
||
14:23
leont left
|
|||
jnthn | 5x-6x faster DBIish, anyone? :) | 14:23 | |
(OK, only for one benchmark, but still... :)) | 14:24 | ||
timotimo | um, yes please?!? | ||
sena_kun | >+16 −14 | ||
masak | \o/ | ||
sena_kun | line count is just wow. :) | ||
14:25
tankf33der joined,
p6bannerbot sets mode: +v tankf33der
14:27
andrzejku left
|
|||
masak | I read "TRUE_ZERO" entirely the wrong way :) | 14:27 | |
jnthn | :P | ||
masak | "wait, but isn't that... hasn't it been... oooooooh" | ||
14:28
curan left
|
|||
lizmat | commute to Amsterdam.pm& | 14:28 | |
14:29
lizmat left
|
|||
AlexDaniel` | Yes, I should move the modules eventually | 14:36 | |
[Coke] | the memory panic I got for 32-bit moarvm on windows doesn't happen on the R* 64bit distro. | ||
HaraldJoerg | p6: my $year= २०१९; $year++ | 14:39 | |
camelia | ( no output ) | ||
HaraldJoerg | p6: my $year= २०१९; say ++$year | ||
camelia | 2020 | ||
HaraldJoerg | p6: my $year= "२०१९"; say ++$year | 14:40 | |
camelia | २०२० | ||
14:53
fluca1978 joined
14:54
p6bannerbot sets mode: +v fluca1978
14:59
zakharyas left
|
|||
HaraldJoerg | my $year = 𝟐𝟎𝟏𝟗; say ++$year | 15:05 | |
evalable6 | 2020 | ||
HaraldJoerg | p6: my $year = "𝟐𝟎𝟏𝟗"; say ++$year | ||
camelia | 𝟐𝟎𝟏𝟗 | ||
HaraldJoerg | p6: my $year = 𝟐𝟎𝟏𝟗; say ++$year | ||
camelia | 2020 | ||
15:23
fluca1978 left
15:25
fluca1978 joined
15:26
p6bannerbot sets mode: +v fluca1978,
zacts joined
15:27
p6bannerbot sets mode: +v zacts
|
|||
Geth | DBIish/master: 7 commits pushed by (Jonathan Worthington)++, (Salvador Ortiz)++ | 15:28 | |
15:28
aindilis left
|
|||
Kaiepi | aw man zoffix quit? | 15:29 | |
yoleaux | 06:47Z <jmerelo> Kaiepi: congratulations! You're the winner of the plush Camelia for your contributions to the last Squashathon! | ||
06:53Z <jmerelo> Kaiepi: to contact lizmat to get your plush Camelia shipped to you. | |||
Kaiepi | oh sweet | 15:30 | |
.tell lizmat msg me once you're on | 15:31 | ||
yoleaux | Kaiepi: I'll pass your message to lizmat. | ||
15:31
aindilis joined
15:32
p6bannerbot sets mode: +v aindilis
15:33
glom joined,
p6bannerbot sets mode: +v glom
|
|||
tadzik | the backstories of those commits are fun to read, like github.com/perl6/DBIish/commit/113...c237e6b656 | 15:38 | |
github.com/perl6/DBIish/commit/972...b5392e715d I find the most surprising | 15:40 | ||
Kaiepi | i had no idea conditional method calls were possible | ||
15:41
glom left
|
|||
fluca1978 | I read about conditional method calls in brian d foy's book | 15:46 | |
however I did not realized it was optimized with regard to .^can | 15:47 | ||
jnthn | It's optimized to the point that, if in type-specialized code, it can even throw out the conditional part, rendering it as a constant or a normal method call, and the latter is then an inline candidate. | 15:48 | |
Kaiepi | brian d foy's book? | ||
jnthn | So in the best cases it's "free" | ||
fluca1978 | Kaiepi:Learning Perl 6: Keeping the Easy, Hard, and Impossible | 15:49 | |
jnthn | Goodness, punctuation really saves that book title :P | ||
fluca1978 | anyone can help me understanding the relationship between nqp and rakudo? I mean, nqp is somehow used to implement rakudo (bootstrapping) or am I misunderstanding? | 15:51 | |
Kaiepi | is it worth giving a read if you've already been using perl 6 for around a year? | ||
jnthn | fluca1978: It's a little confusing in that we tend to use "NQP" to refer to two things. One of them is NQP the language, which is a bootstrapped subset of Perl 6 that's easier to implement and optimize. | 15:52 | |
fluca1978 | Kaiepi: I don't think, one year is enough to get all the concepts expressed in the book. But, on the other side, brian is a very proficent developer and writer, so... | ||
jnthn | However, also contained in the NQP repository is a bunch of compiler infrastructure (such as code generation) that Rakudo uses too | 15:53 | |
So you can see NQP as being a mini Perl 6 that includes a compiler toolkit in its standard library. :) | |||
fluca1978 | jnthn: but what compiles NQP then? | 15:54 | |
jnthn | fluca1978: NQP. The repository includes a snapshot that is good enough to compile the current version. | 15:55 | |
fluca1978: Of course, if you go back enough years, there was an NQP written in something else. | |||
Just like there was a first C compiler not written in C, for example. | 15:56 | ||
fluca1978 | jnthn: therefore, there is a binary snapshot of NQP to bootstrap the compiler that in turn compiles NQP the language, so in this sense it is meta-circular, right? | 15:57 | |
sena_kun | it is | 15:58 | |
jnthn | fluca1978: Yes | ||
At some point it stops hurting to think about. :) | 15:59 | ||
fluca1978 | and what does it mean that NQP is lighter than Perl6? I mean, NQP has classes itself, so what makes the runtime smaller? | ||
[Coke] | supports less language syntax, for example | 16:00 | |
fewer builtin classes. | |||
jnthn | It has simplified/cheating versions of a lot of Perl 6 language features, and then excludes quite a number of other features. | ||
[Coke] | only binding, no assignment. | 16:01 | |
jnthn | That also, which is a big simplification. | ||
Also no laziness | |||
No high-level concurrency stuff | |||
No operator overloading or custom operators, etc. | 16:02 | ||
fluca1978 | got it | ||
vrurg | The above mentioning of .^can reminded me: what is the best way of getting method object of a class? So far, I'm stuck to find_method. | 16:03 | |
jnthn | vrurg: What does "best" mean? .^find_method is best if you're just after something to invoke; .^lookup is best if you're after it for introspection. | ||
Xliff | jnthn: At which point does it stop hurting, and when it does, should I worry? | 16:04 | |
16:04
simple joined,
p6bannerbot sets mode: +v simple
|
|||
Xliff | (and you are right about that title! LOL) | 16:04 | |
vrurg | jnthn: For invoking. Thanks! I just thought that I might be missing something like &sub but for methods. | 16:05 | |
jnthn | Xliff: I guess the point I really got settled with it was when I was working on the JVM porting, and realized that one can write a bytecode generator, then run the compiler on the VM that already exists but have it "cross-compile", and then use that cross-compiler to compile NQP itself. | 16:06 | |
So basically, you get it to spit itself out but for another virtual machine | |||
I've done that twice over by now. Whether that's worrying, well... :-) | |||
Xliff | So kinda like Java and Android?!? | 16:07 | |
16:07
jmerelo joined
|
|||
jmerelo | O/ | 16:07 | |
yoleaux | 09:51Z <AlexDaniel> jmerelo: no, I just looked at the numbers and wrote the summary :) | ||
12:17Z <SmokeMachine> jmerelo: I removed Red from the ecosystem because I sent it to CPAN | |||
fluca1978 | Xliff: java and jikesrvm | ||
16:08
p6bannerbot sets mode: +v jmerelo
|
|||
Xliff | fluca1978: So similar situation. jikesrvm uses the Java language spec, but does not compile to the JVM | 16:08 | |
Android apps work in the same way. | |||
fluca1978 | Xliff: jikesrvm is written in java and does compile to java bytecode (JIT), it bootstraps out of an image obtained by another virtual machine | 16:09 | |
jnthn | Yeah, it's all the same kind of stuff. | ||
16:11
ferreira1 joined,
p6bannerbot sets mode: +v ferreira1
|
|||
Xliff | OK. So meta-circular. Got it. | 16:12 | |
Would that mean that NQP should be on this list: en.wikipedia.org/wiki/Meta-circular_evaluator | |||
16:12
fluca1978 left
|
|||
sena_kun | is NQP interpreting though? | 16:13 | |
as in, a C compiler written in C doesn't really belong to the list. | 16:14 | ||
jnthn | Yeah, I'd tend to refer to it as a "bootstrapped compiler" | ||
sena_kun | yup | ||
Kaiepi | i only just noticed the MONKEY-SEE-NO-EVAL pragma's a pun | 16:17 | |
16:17
cfa joined,
p6bannerbot sets mode: +v cfa
|
|||
Kaiepi | smh putting puns in my code | 16:18 | |
16:19
kensanata left
16:28
zacts left
|
|||
SmokeMachine | how can I create a function that `is native` and returns this (code.woboq.org/gcc/gcc/jit/libgccj..._context)? | 16:32 | |
I mean this function: code.woboq.org/gcc/gcc/jit/libgccj...xt_acquire | 16:34 | ||
Xliff | SmokeMachine: Any reason you can't use a CPointer repr for that? | ||
class gcc_jit_context is repr('CPointer') { }; | 16:35 | ||
SmokeMachine | Xliff: Im trying this... but doesnt feel right... www.irccloud.com/pastebin/EMO9XDFb/ | ||
Xliff | sub my_jit_func(...) returns gcc_hit_context is native (...) | ||
Why doesn't it feel right? | 16:36 | ||
SmokeMachine | Xliff: this? www.irccloud.com/pastebin/nB4tDswi/ | 16:37 | |
16:37
qqq joined,
p6bannerbot sets mode: +v qqq
|
|||
Xliff | No. Your first one was better. | 16:37 | |
16:38
qqq left
|
|||
Xliff | 2nd one isn't wrong. You just wouldn't need GccJitContext.new. | 16:38 | |
GccJitCont3ext.new doesn't really do anything. | |||
my $jitc = gcc_jit_context_aquire() would return a GccJitContext, though. | 16:39 | ||
16:39
zacts joined,
p6bannerbot sets mode: +v zacts
|
|||
SmokeMachine | Xliff: you mean this? www.irccloud.com/pastebin/YwxZ69N9/ | 16:45 | |
16:47
domidumont left
|
|||
Xliff | Looks fine. You won't know until to try to do something with that pointer. | 16:47 | |
sjn | o/ | 16:48 | |
Xliff | You used gcc_jit_context_get_type() and got something back. That's a good sign. | ||
\o sjn | |||
16:51
robertle_ left
|
|||
sjn | .tell lizmat link in 2019.01 weekly to Brad Gilbert's tweet seems wrong | 16:52 | |
yoleaux | sjn: I'll pass your message to lizmat. | ||
17:00
mux__ joined,
p6bannerbot sets mode: +v mux__
|
|||
mux__ | I'm experiencing a strange behavior from perl6 + tmux. I want to record the cursor position and restore it using tput. | 17:01 | |
This works as expected in a bare Xterm or VT: perl6 -e'print "save"; run <tput sc>; say ""; sleep 1; print "restore"; run <tput rc>; sleep 1; print 42' | |||
But running it in tmux seems to only restore the column, not the row. | |||
Using tput in the shell works just fine everywhere though: echo -n save; tput sc; sleep 1; echo; sleep 1; echo -n restore; sleep 1; tput rc; echo 42 | |||
Maybe someone here has a clue whats going on? | 17:02 | ||
17:04
domidumont joined
|
|||
timotimo | huh, interesting. can you try outputting %*ENV<TERM> inside perl6 and echo $TERM outside perl6? | 17:05 | |
i see no reason for them to differ, but if they do it'd be a sure sign for trouble | |||
17:05
p6bannerbot sets mode: +v domidumont
|
|||
mux__ | timotimo: No, it's the same in both | 17:08 | |
Kaiepi | how do i get the \c name for a character? | ||
17:08
AlexDaniel joined,
p6bannerbot sets mode: +v AlexDaniel
|
|||
SmokeMachine | Xliff: until the CArray it was working... www.irccloud.com/pastebin/FdNjcm7R/ | 17:15 | |
jnthn | Kaiepi: If you have the codepoint? uniname, I think | ||
SmokeMachine | Xliff: wrong parameter value... | 17:18 | |
but with error yet... | |||
xLIFF: www.irccloud.com/pastebin/eoP5pRIQ/ | |||
Xliff: ^^ | |||
Kaiepi | m: '😂'.uniname | 17:19 | |
camelia | ( no output ) | ||
Xliff | I'm reading. Be aware, I am also trying to eat lunch. :) | ||
Kaiepi | m: say '😂'.uniname | ||
camelia | FACE WITH TEARS OF JOY | ||
Kaiepi | thanks | ||
m: sub term:<<\c[FACE WITH TEARS OF JOY]>> is rw { state $ = 0 }; 😂 = e ** (i * pi); say 😂 | 17:20 | ||
camelia | -1+1.2246467991473532e-16i | ||
Kaiepi | shouldn't that be -1? | ||
SmokeMachine | Fixed!!! wrong parameters! | 17:21 | |
Xliff | Ah! OK. | 17:23 | |
17:23
zacts left
|
|||
Xliff | m: i².say | 17:27 | |
camelia | -1+1.2246467991473532e-16i | ||
AlexDaniel | Kaiepi: isn't it close enough? | ||
e-16 that's really small | |||
Xliff | That's a really small imaginary portion. | ||
AlexDaniel | yeah | 17:28 | |
17:28
lizmat joined,
p6bannerbot sets mode: +v lizmat
|
|||
Xliff | Not smallest representable floating point value, though. | 17:28 | |
That's probably a residue of the imaginary math, though. | 17:29 | ||
17:30
dakkar left
17:31
dakkar joined,
zacts joined,
p6bannerbot sets mode: +v zacts,
p6bannerbot sets mode: +v dakkar
|
|||
[Coke] | e and pi are approximate constants here. | 17:31 | |
moritz | just standard floating point arithmetics | 17:32 | |
SmokeMachine | how can I receive a function pointer? | ||
Xliff | SmokeMahcine: That's one thing NativeCall does NOT make easy. | 17:33 | |
s/SmokeMahcine/SmokeMachine/ | |||
SmokeMachine | :( | ||
Xliff | Besides... what good is a C function pointer going to do for you in Perl6? | ||
SmokeMachine | I think that's the last think I need to make my sample work... | ||
Kaiepi | how do i generate a range like 1,2,3,3,4,5,5,6,7,7,8,9? | 17:34 | |
Xliff | (there is utility, but it's limited) | ||
17:34
rindolf left
|
|||
SmokeMachine | Xliff: please, show me | 17:34 | |
Xliff | SmokeMachine: I can't. | ||
17:34
rindolf joined
|
|||
Xliff | I mean, about the best you can do is say "returns Pointer" | 17:35 | |
sena_kun | Kaiepi, what's the rule of this progression? are 1,2,9 hard-coded? | ||
17:35
p6bannerbot sets mode: +v rindolf
|
|||
Kaiepi | it starts with 1,2,3, then the next three digits are the last digit of the previous triple and its consecutive digits | 17:36 | |
so 1,2,3, then 3,4,5, then 5,6,7, etc. | |||
SmokeMachine | Xliff: but how do I call it? | ||
Xliff | SmokeMachine: You can't. | 17:37 | |
Not from Perl6. | |||
sena_kun | hmm... that seems quite specific to me, I'd go with a simple iterative approach to make later understanding easier. though it sounds like a golfing task where cryptic == better, yes? | ||
Xliff | SmokeMachine: About the only thing you could do is write a wrapper that would take the pointer and do the invocation from C. Then you have the whole hassle of parameters. | ||
C calling C is best left to C. | 17:38 | ||
sena_kun, Kaiepi: That looks like something better for Iterator.pull-one | 17:39 | ||
s/better/better-suited/ | |||
Since some numbers in the sequence are duped. | |||
Kaiepi | m: my @nums = lazy gather { my $x = 1; loop { take ($x, ++$x, ++$x) } }; say @nums[0..^3] | ||
camelia | ((7 2 3) (7 4 5) (7 6 7)) | ||
17:40
molaf joined
|
|||
Kaiepi | 7? | 17:40 | |
m: my @nums = lazy gather { my $x = 1; loop { take ($x, $x + 1, $x + 2); $x += 2 } }; say @nums[0..^3] | |||
camelia | ((5 2 3) (5 4 5) (5 6 7)) | ||
17:40
p6bannerbot sets mode: +v molaf
|
|||
Kaiepi | m: my @nums = lazy gather { my $x = 1; loop { take $x..$x+2; $x += 2 } }; say @nums[0..^3] | 17:41 | |
camelia | (1..3 3..5 5..7) | ||
Kaiepi | m: my @nums = lazy gather { my $x = 1; loop { take $x..$x+2.flat; $x += 2 } }; say @nums[0..^3] | ||
camelia | (1..2 3..4 5..6) | ||
Kaiepi | m: my @nums = lazy gather { my $x = 1; loop { take $x..$x+2.List; $x += 2 } }; say @nums[0..^3] | ||
camelia | (1..2 3..4 5..6) | ||
Kaiepi | m: my @nums = lazy gather { my $x = 1; loop { take $x..$x+2.list; $x += 2 } }; say @nums[0..^3] | ||
camelia | (1..2 3..4 5..6) | ||
Kaiepi | m: my @nums = lazy gather { my $x = 1; loop { take ($x..$x+2).list; $x += 2 } }; say @nums[0..^3] | 17:42 | |
camelia | ((1 2 3) (3 4 5) (5 6 7)) | ||
[Coke] wonders if he can get unicode working this cmd.bat/ssh/tmux combo | |||
Kaiepi | there we go | ||
17:43
dakkar left
|
|||
Geth | doc: 1075133cef | (JJ Merelo)++ | doc/Language/modules.pod6 Moves `source-type` to a footnote refs #2543 |
17:45 | |
doc: 72c02cbfe0 | (JJ Merelo)++ | 2 files Extends the description of the *-depends fields. Including the *hash* form, with examples. Closes #2543. |
|||
synopsebot | Link: doc.perl6.org/language/modules | ||
17:52
mux__ left
|
|||
Xliff | m: my @nums = lazy gather { my $x = 1; loop { take ($x..$x+2).list; $x += 2 } }; @nums[0..2].map(|*).say | 17:53 | |
camelia | (1 2 3 3 4 5 5 6 7) | ||
sena_kun | m: my @nums = lazy gather { my $x = 1; loop { take ($x..$x+2).list; $x += 2 } }; @nums[0..2].join.say | 17:54 | |
camelia | 1 2 33 4 55 6 7 | ||
sena_kun | ouch | ||
Xliff | :) | ||
sena_kun | shame on me. :P | ||
Kaiepi | m: sub pi(Int $prec) { my @denominators = lazy gather { my Int $x = 2; loop { take [*] ($x..$x+2).list; $x += 2; } }; my Rat $total = 3.Rat; for @denominators -> $a, $b { $total = $total + 4/$a - 4/$b; }; $total }; say pi(100) | 17:56 | |
camelia | Type check failed in assignment to $total; expected Rat but got Num (3.1415766854350315e0) in sub pi at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Kaiepi | m: sub pi(Int $prec) { my @denominators = lazy gather { my Int $x = 2; loop { take [*] ($x..$x+2).list; $x += 2; } }; my Num $total = 3.Num; for @denominators -> $a, $b { $total = $total + 4/$a - 4/$b; }; $total }; say pi(100) | ||
m: sub pi(Int $prec) { my @denominators = lazy gather { my Int $x = 2; loop { take [*] ($x..$x+2).list; $x += 2; } }; my Num $total = 3.Num; for @denominators -> $a, $b { $total = $total + 4/$a - 4/$b; }; $total }; say pi(1) | |||
m: sub pi(Int $prec) { my @denominators = lazy gather { my Int $x = 2; loop { take [*] ($x..$x+2).list; $x += 2; } }; my $total = 3; for @denominators -> $a, $b { $total = $total + 4/$a - 4/$b; }; $total }; say pi(100) | |||
m: sub pi(Int $prec) { my @denominators = lazy gather { my Int $x = 2; loop { take [*] ($x..$x+2).list; $x += 2; } }; my $total = 3; for @denominators[0..$prec] -> $a, $b { $total = $total + 4/$a - 4/$b; }; $total }; say pi(100) | 17:57 | ||
camelia | (timeout) | ||
Too few positionals passed; expected 2 arguments but got 1 in sub pi at <tmp> line 1 in block <unit> at <tmp> line 1 |
|||
Kaiepi | m: sub pi(Int $prec) { my @denominators = lazy gather { my Int $x = 2; loop { take [*] ($x..$x+2).list; $x += 2; } }; my $total = 3; for @denominators[0..^$prec].rotor(2) -> ($a, $b) { $total = $total + 4/$a - 4/$b; }; $total }; say pi(100) | ||
camelia | 3.141592410971983 | ||
Kaiepi | m: sub pi(Int $prec) { my @denominators = lazy gather { my Int $x = 2; loop { take [*] ($x..$x+2).list; $x += 2; } }; my $total = 3; for @denominators[0..^$prec].rotor(2) -> ($a, $b) { $total = $total + 4/$a - 4/$b; }; $total }; say pi(1000) | ||
camelia | 3.1415926533405445 | ||
[Coke] | m: say (1..*).rotor(3=>-1).flat[^10] | 17:58 | |
camelia | (1 2 3 3 4 5 5 6 7 7) | ||
Kaiepi | m: sub pi(Int $prec) { my @denominators = lazy gather { my Int $x = 2; loop { take [*] ($x..$x+2).list; $x += 2; } }; my Rat $total = 3.Rat; for @denominators[0..^$prec].rotor(2) -> ($a, $b) { $total = $total + Rat(4/$a) - Rat(4/$b); }; $total }; say pi(10000) | 17:59 | |
camelia | Type check failed in assignment to $total; expected Rat but got Num (3.1415766854350315e0) in sub pi at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Kaiepi | m: sub pi(Int $prec) { my @denominators = lazy gather { my Int $x = 2; loop { take [*] ($x..$x+2).list; $x += 2; } }; my Rat $total = 3.Rat; for @denominators[0..^$prec].rotor(2) -> ($a, $b) { $total = Rat($total + 4/$a - 4/$b); }; $total }; say pi(10000) | ||
camelia | 3.141592920353982451 | ||
Kaiepi | m: sub pi(Int $prec) { my @denominators = lazy gather { my Int $x = 2; loop { take [*] ($x..$x+2).list; $x += 2; } }; my Rat $total = 3.Rat; for @denominators[0..^$prec].rotor(2) -> ($a, $b) { $total = Rat($total + 4/$a - 4/$b); }; $total }; say e ** (i * pi(10000)) | 18:00 | |
camelia | -0.9999999999999645-2.6676418928249877e-07i | ||
Kaiepi | m: say (1..*).rotor(3 => -1).rotor(3).first(10) | ||
m: say (1..*).list.rotor(3 => -1).rotor(3).first(10) | 18:01 | ||
m: say (1..*).list.rotor(3 => -1).rotor(3).first | |||
evalable6, say 1 | |||
evalable6 | 1 | ||
camelia | (timeout) | ||
((1 2 3) (3 4 5) (5 6 7)) | |||
Kaiepi | evalable6, say (2..*).rotor(3 => -1).first(10) | 18:02 | |
evalable6, say (2..*).list.rotor(3 => -1).first(10) | |||
evalable6, [1,2,3].first(2) | |||
evalable6 | (signal SIGHUP) «timed out after 25 seconds» | ||
(signal SIGHUP) «timed out after 25 seconds» | 18:03 | ||
Kaiepi | evalable6, say [1,2,3].first(3) | ||
evalable6 | 3 | ||
Kaiepi | evalable6, say [1,2,3].first(0..^3) | ||
evalable6 | 1 | ||
Kaiepi | evalable6, say [1,2,3].head(3) | ||
evalable6 | (1 2 3) | ||
[Coke] wonders why rotor takes a pair to indicate the special arg, and not a named parameter | 18:04 | ||
Kaiepi | what does the pair in rotor do? | ||
the way you used it | |||
[Coke] | If the element of @cycle is a Pair instead, the key of the pair specifies the length of the return sublist, and the value the gap between sublists; negative gaps produce overlap: | 18:06 | |
(from the docs) | |||
Kaiepi | ah | 18:07 | |
[Coke] | ah, because you can have multiple pair rules also, duh. | 18:09 | |
m: say (^100).rotor: 3=>-1, 2=>2 | |||
camelia | ((0 1 2) (2 3) (6 7 8) (8 9) (12 13 14) (14 15) (18 19 20) (20 21) (24 25 26) (26 27) (30 31 32) (32 33) (36 37 38) (38 39) (42 43 44) (44 45) (48 49 50) (50 51) (54 55 56) (56 57) (60 61 62) (62 63) (66 67 68) (68 69) (72 73 74) (74 75) (78 79 80) (8… | ||
18:10
tobs` left
|
|||
Xliff | m: say (1..*).rotor(3=>-1).flat[^12] | 18:11 | |
camelia | (1 2 3 3 4 5 5 6 7 7 8 9) | ||
Xliff | Now why couldn't I come up with that?! | ||
m: say (1..*).rotor(3=>-2).flat[^12] | |||
camelia | (1 2 3 2 3 4 3 4 5 4 5 6) | ||
[Coke] | beacus rotor is weird. | 18:12 | |
Xliff | LOL! | ||
18:13
ExtraCrispy left
18:16
Kaiepi left
|
|||
[Coke] | *because | 18:18 | |
Xliff | I got it. | ||
18:19
zakharyas joined,
vrurg left
18:20
p6bannerbot sets mode: +v zakharyas
|
|||
simple | what's the perl6 equivalent of perl5's " $var =~ /(.begin .* .end)/smg " ? | 18:20 | |
i tried m:smg | |||
but that adverb inot allowed on m | |||
18:22
Kaiepi joined,
p6bannerbot sets mode: +v Kaiepi
18:25
rindolf left,
sauvin left
|
|||
[Coke] | . already matches \n, so you don't need s | 18:25 | |
simple | ah | ||
[Coke] | you're not using ^ or $, so you don't need m even on the p5 side | 18:26 | |
simple | well, same error, just one less letter now | ||
oh, true | |||
that's all better then =) thanks | 18:27 | ||
[Coke] | m: say "i have a hat" ~~ m:g/ 'ha' / | ||
camelia | (「ha」 「ha」) | ||
[Coke] | :) | ||
18:37
lucasb left
|
|||
Xliff | Is this Rakudo's way of telling me I have an endless loop? -- "Failed to register: Timeout was reached" | 18:42 | |
If there's an endless look, it's in compile then. Weird! | 18:45 | ||
18:47
molaf left
|
|||
[Coke] | failed to register doesn't sound rakudo specific. | 18:55 | |
Xliff | Actually, no it was GTK, weirdly enough. | 19:02 | |
What's the best way to get the types passed into a signature capture? | |||
Ala "method something(|c) | |||
m: sub cap(|c) { | 19:03 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Missing block at <tmp>:1 ------> 3sub cap(|c) {7⏏5<EOL> |
||
Xliff | m: sub cap(|c) { say c.^name } | ||
camelia | ( no output ) | ||
Xliff | m: sub cap(|c) { say c.^name }; cap(1, 2, 'A') | ||
camelia | Capture | ||
Xliff | m: sub cap(|c) { say c.signature.^name }; cap(1, 2, 'A') | ||
camelia | No such method 'signature' for invocant of type 'Capture' in sub cap at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
Xliff | m: sub cap(|c) { .^name say for c }; cap(1, 2, 'A') | 19:04 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> 3sub cap(|c) { .^name7⏏5 say for c }; cap(1, 2, 'A') expecting any of: infix infix stopper statement end sta… |
||
Xliff | m: sub cap(|c) { .^name.say for c }; cap(1, 2, 'A') | 19:05 | |
camelia | Int Int Str |
||
SmokeMachine | Xliff: its working!!! \o/ www.irccloud.com/pastebin/FdZRxIbF/ | 19:11 | |
Xliff: getting home, Ill make a nice oo frontend to it! | 19:12 | ||
19:15
zacts left
|
|||
Xliff | SmokeMachine: :-O \o/ | 19:20 | |
NICE! | |||
SmokeMachine needs to go back to Red... | 19:24 | ||
SmokeMachine is loosing to much time playing with bernalang... | 19:25 | ||
19:26
guifa joined,
p6bannerbot sets mode: +v guifa
|
|||
guifa | When calling a grammar with an action, the grammar can refer directly to its action class with .actions but is there any built-in way to do the reverse (reference the grammar in the action) | 19:28 | |
masak | no | 19:29 | |
what is it you want to do, more broadly? | |||
SmokeMachine | can you, from the Grammar, do something like `self.actions.grammar = self`? | 19:30 | |
guifa | Just trying to better separate grammar from actions. I'm writing a pretty extensive/customizable brainfuck interpreter using grammar/actions, the main stumbling block I've had is handling the loops. Their inner code has to parsed separate from regular code to avoid early execution, but then sent back to get parsed as runnable code, which is easily done with the actions code is embedded in the grammar, but no really elegant way to do | 19:34 | |
masak | hm | 19:36 | |
what you do sounds like a bit of a grammar code smell, if you don't mind me saying | |||
notably, I'm pretty sure it should be possible to parse everything with one pass, and then not again | 19:37 | ||
that should be your goal, too ;) | |||
guifa | Single pass would be optimal haha, but I'm a bit stumped at doing that | ||
I mean, obviously there are more efficient ways to process BF, but I wanted to try to learn Grammar/Actions and it's actually be pretty useful as a exercise in learning | 19:38 | ||
SmokeMachine | guifa: I've been doing something like it... not with brainfuck, but with bernalang... github.com/FCO/bernalang | 19:41 | |
guifa: here is my grammar: github.com/FCO/bernalang/blob/mast...rammar.pm6 | 19:42 | ||
Xliff: Im thinking of doing a machine-code bernalang^^ compiler using gccjit... :) | 19:43 | ||
19:44
zakharyas left
|
|||
guifa | I'm glancing it over really fast but it looks like you're parsing/compiling and then doing a separate execution phase yeah? | 19:46 | |
masak | oh, you're not? then I understand your predicament better | 19:47 | |
so your actions are basically an interpreter? | |||
guifa | Indeed. BF is sufficiently simple enough that you can do that. When it parses a +, it increments the value at the point as the action right then and there. | ||
19:49
cfa left
|
|||
masak | I think you'll find the order the actions fire is a bad fit for your interpreter idea | 19:49 | |
with the example of a +, at the point the action sees it, you don't know if that + is inside a loop (and should be deferred) or not inside one (and shouldn't) | 19:50 | ||
because actions fire bottom-up, and loops (kinda) are more top-down :) | |||
guifa | Yeah. That was something that took me a bit to work around, but I did get it all working. | ||
masak | heh :) | ||
don't really know what to say except it seems you're working against the grain | 19:51 | ||
guifa | Probably :-) | ||
masak | I think you'll find it's a lot easier to write a brainfuck *compiler* than a brainfuck *interpreter* using grammar/actions | ||
guifa | Possibly. I might do a later modification for that. My real goal wasn't so much learning to write compilers, but just getting a good feel for grammar rules that adequately catch stuff, and then attaching some actions. I had tortured myself way back when making an Applescript Brainfuck interpreter so figured what the hell ;-) | 19:53 | |
but as is typical for me, once I start, I like to see how far I can take it | |||
masak | moritz++ might amend what I'm about to say here, but... | 19:54 | |
...I find actions work best when you exploit the fact that they're bottom-up, rather than try to fight it | |||
19:54
sena_kun left
|
|||
masak | it's one of those things, I realize that nowadays I've started to *think* that way, and I try to do stuff bottom-up even outside of actions sometimes | 19:54 | |
19:56
xinming_ joined,
p6bannerbot sets mode: +v xinming_
19:58
abraxxa1 joined
|
|||
moritz | I agree | 19:58 | |
19:59
xinming left,
p6bannerbot sets mode: +v abraxxa1
|
|||
masak | second more advanced rule (for free, even though nobody asked): | 20:00 | |
20:00
El_Che joined
|
|||
masak | never *ever* fire a side effect before you know you're in the right rule | 20:00 | |
guifa | Yeah, the only way to handle (AFAICT) a loop is to do a separate inner code rule from the main rule that doesn't have actions attached, and then inside the action call .parse(:rule<maincode>, :actions(self.actions) repeatedly. For anything more complex than BF I don't think an interpreter inside of the grammar itself is really feasible just because you'd have to include both executing and not executing rules for all code | ||
20:00
p6bannerbot sets mode: +v El_Che
|
|||
masak | also, you're multiple-parsing, which is maybe fine for an interpreter, but just generally problematic :) | 20:01 | |
how do you handle missing `]` ? | |||
guifa | At the moment, I don't. The joys of BF is there's no single specification (which did let me have fun with some adverbs) | 20:02 | |
:8bit :16bit :32bit for instance is a cool way to take advantage of the adverbs | 20:03 | ||
20:05
rindolf joined
20:06
p6bannerbot sets mode: +v rindolf
|
|||
masak | yes, that reads quite well :) | 20:06 | |
guifa | I originally included ? as a built in dump command, but then I figured it'd be cooler as a grammar extension. I get that the not-best-practices in handling the loop but… I think I can make a pretty cool tutorial with it to show off some of the nicer features of p6 (while including a warning that it's probably best not to make an interpreter out of grammars in the real world ;-) ) | 20:09 | |
20:09
El_Che left
20:11
domidumont left,
El_Che joined
20:12
p6bannerbot sets mode: +v El_Che
20:16
El_Che left
20:18
El_Che joined
20:19
p6bannerbot sets mode: +v El_Che
20:23
jmerelo left
20:32
guifa left
20:34
MorayJ left
|
|||
scovit | Hello, can anybody here help me to make an object of type Signature? Not a literal | 20:38 | |
moritz | I can try :-) | 20:39 | |
what's your question? | 20:40 | ||
masak | m: say Signature.new | ||
camelia | () | ||
masak | ...do I win an internet? :P | ||
moritz | m: say :().^name | 20:41 | |
camelia | Signature | ||
21:12
jast left
21:18
rindolf left,
patrickb left
21:22
sena_kun joined
|
|||
Xliff | m: use MONKEY-SEE-NO-EVAL; my $m = 42; EVAL 'say $m'; | 21:22 | |
camelia | 42 | ||
21:22
p6bannerbot sets mode: +v sena_kun
21:26
molaf joined
21:27
p6bannerbot sets mode: +v molaf
21:28
abraxxa1 left
21:29
Kaiepi left
21:32
lizmat left
|
|||
sena_kun | can someone point me to how names declared as enum values are promoted to types? I am reading github.com/rakudo/rakudo/blob/mast....nqp#L4851 but no much luck. When I am constructing an enum using MOP with base_type == Int and with a simple `add_enum_value($str-int-pair))`, is type created? If yes, how can I get it to set it a name and export appropriately? If not, how can I create one? | 21:40 | |
As in... | |||
m: enum Normal <One Two>; say Two; | |||
camelia | Two | 21:41 | |
sena_kun | but... | ||
m: my $new-enum = Metamodel::EnumHOW.new_type(name => 'custom', base_type => Int); $new-enum.^add_enum_value((Two => 2)); $new-enum.^add_role(Enumeration); $new-enum.^add_role(NumericEnumeration); $new-enum.^compose; say $new-enum.^enum_values; | |||
camelia | {Two => 2} | ||
sena_kun | `Two` here is just a Str key, not a type object that can be assigned to e.g. `my Custom $aa`. | 21:43 | |
looking at how `add_enum_value` implementation simply binds pair value to an internal storage, it seems that I have to create each "type object" manually. | 21:45 | ||
21:48
zachk joined
|
|||
simple | m: (5802..5830).map( {.chr} )[*-10..*-5] | 21:48 | |
camelia | ( no output ) | ||
21:48
p6bannerbot sets mode: +v zachk
|
|||
simple | =( | 21:49 | |
scovit | sorry moritz, I explain | 21:50 | |
I have a slurpy argument | 21:51 | ||
I want to use the types passed in this slurpy | |||
to setup a signature that corresponds to it | |||
21:51
zachk left
21:52
zachk joined,
cherryh.freenode.net sets mode: +v zachk,
p6bannerbot sets mode: +v zachk
|
|||
scovit | Signature.new(params => (do for @args { $_.WHAT }), returns => Str) | 21:52 | |
something like this | |||
but probably needs nqp | |||
i need this signature to pass it to NativeCall | 21:53 | ||
21:53
Kaiepi joined
|
|||
scovit | I do not care about performances now (I plan to add caching) | 21:53 | |
21:54
p6bannerbot sets mode: +v Kaiepi,
Cabanossi left
21:56
Cabanossi joined,
p6bannerbot sets mode: +v Cabanossi
|
|||
Kaiepi | is it possible to hotpatch a module? | 21:56 | |
21:58
tadzik joined
21:59
p6bannerbot sets mode: +v tadzik
22:01
rindolf joined
22:02
p6bannerbot sets mode: +v rindolf
22:09
Kaypie joined,
Kaiepi left
22:10
p6bannerbot sets mode: +v Kaypie
22:11
melezhik joined,
p6bannerbot sets mode: +v melezhik
|
|||
Xliff | Does $a infix:<eqv> $b do the equivalent of $a.eqv($b) ?? | 22:12 | |
sena_kun | m: 1.eqv(5) | 22:15 | |
camelia | No such method 'eqv' for invocant of type 'Int' in block <unit> at <tmp> line 1 |
||
Xliff | m: 1 eqv 5 | ||
camelia | WARNINGS for <tmp>: Useless use of "eqv" in expression "1 eqv 5" in sink context (line 1) |
||
sena_kun | Xliff, if $a type has `eqv` method implemented using infix op, maybe? | ||
Xliff | m: role Comp { method eqv(Cool $b) { $b.eqv(self) } }; my $a = 1 but Comp; my $b = 2 but comp; say $a eqv $b | 22:16 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: comp used at line 1. Did you mean 'chomp', 'comb'? |
||
Xliff | m: role Comp { method eqv(Cool $b) { $b.eqv(self) } }; my $a = 1 but Comp; my $b = 2 but Comp; say $a eqv $b | ||
camelia | False | ||
Xliff | m: role Comp { method eqv(Cool $b) { $b.eqv(self) } }; my $a = 1 but Comp; my $b = 1 but Comp; say $a eqv $b | 22:17 | |
camelia | True | ||
Xliff | m: my ($a, $b) = (1, 1); $a eqv $b; | 22:18 | |
camelia | WARNINGS for <tmp>: Useless use of "eqv" in expression "$a eqv $b" in sink context (line 1) |
||
Xliff | m: my ($a, $b) = (1, 1); say $a eqv $b; | ||
camelia | True | ||
Xliff | m: say 1 eqv 5 | ||
camelia | False | ||
Xliff | OK. So not as elegant as I was expecting, but... | ||
m: my $gtext = 'grammar Phil'; my $name = ($gtext ~~ /^^ \s* 'grammar' \s+ (\w+) // [])[0]; say $name | 22:22 | ||
camelia | Cannot resolve caller Numeric(Regex:D: ); none of these signatures match: (Mu:U \v: *%_) in block <unit> at <tmp> line 1 |
||
Xliff | m: my $gtext = 'grammar Phil'; my $name = ($gtext ~~ /^ \s* 'grammar' \s+ (\w+) // [])[0]; say $name | ||
camelia | Cannot resolve caller Numeric(Regex:D: ); none of these signatures match: (Mu:U \v: *%_) in block <unit> at <tmp> line 1 |
||
Xliff | m: my $gtext = 'grammar Phil'; my $name = ($gtext ~~ /^ \s* 'grammar' \s+ (\w+)/ // [])[0]; say $name | ||
camelia | 「Phil」 | ||
Xliff | m: my $gtext = 'grammar Phil'; my $name = ($gtext ~~ /^ \s* 'grammar' \s+ (\w+)/ // [])[0].Str; say $name | ||
camelia | Phil | ||
Xliff | m: my $gtext = 'rammar Phil'; my $name = ($gtext ~~ /^ \s* 'grammar' \s+ (\w+)/ // [])[0].Str; say $name | 22:23 | |
camelia | Use of uninitialized value of type Any in string context. Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful. in block <unit> at <tmp> line 1 |
||
Xliff | m: my $gtext = 'grammar Phil'; my $name = ($gtext ~~ /^^ \s* 'grammar' \s+ (\w+)/ // [])[0].Str; say $name | 22:25 | |
camelia | Phil | ||
22:33
sena_kun left,
sena_kun joined
22:34
p6bannerbot sets mode: +v sena_kun
22:36
rindolf left,
rindolf joined
22:37
p6bannerbot sets mode: +v rindolf
|
|||
rindolf | hi all | 22:38 | |
sena_kun | o/ | ||
rindolf | how was the squashathon? | ||
sena_kun | testneeded tickets... Some were closed, I think. :) | 22:40 | |
AlexDaniel | not very active actually | 22:41 | |
there were many easy tickets but people didn't feel like resolving any of them | |||
maybe every month is too often, I dunno :) | |||
sena_kun | any ideas on how to imitate nqp::rebless op from high level code? I really don't want to do `use nqp` and copy-paste what rakudo does. | 22:42 | |
Kaypie | i'm surprised i was considered to have made the most/best prs during the squashathon in order to win the camelia plushie | 22:56 | |
i only made one pullreq and it was like 5 lines | |||
22:56
molaf left
|
|||
sena_kun | next one may be more popular. :) | 23:02 | |
23:03
Ven`` joined
23:04
p6bannerbot sets mode: +v Ven``
|
|||
scovit | I do not care about performances now (I plan to add caching) | 23:06 | |
sorry | |||
jnthn | sena_kun: nqp::rebless is used by .^mixin, so that's probably what you want | 23:15 | |
(This is in turn what's used to implement does and but) | |||
(Which is also what would normally be used) | 23:16 | ||
sena_kun | jnthn, so if I want to turn `1` into my created enum type, it'd be like... hmm. `but` gives me `Int+{foo-enum}`, which fails a check against plain `my custom $a` type. | 23:21 | |
I have found github.com/rakudo/rakudo/blob/mast....nqp#L3900 but not yet sure how to recreate it without nqp. :) | 23:22 | ||
jnthn | sena_kun: You don't want to do that :) | 23:23 | |
m: enum A <B C D>; say A(1) | |||
camelia | C | ||
jnthn | Just use the coercion form like that | ||
sena_kun | jnthn, well, I have to create enum without using explicit `enum Foo <>`. And I hope to do it without EVAL. This is what I "want" to do. :) | 23:25 | |
jnthn | Ah | 23:26 | |
sena_kun | or, rather, I can create it, but values. | ||
that's the issue. | |||
as in, well... | |||
I can create a type, but `add_enum_value` MOP call just does a binding, so I cannot just bind some Int as a value, it'll break typing. | 23:27 | ||
jnthn | Can you do $the-enum-type-object.new($the-integer) ? | ||
sena_kun | so I looked at how rakudo creates stuff and found out that e.g. Int value can be reblessed to newly created enum type(not even composed yed as I get it), but... Nope, I can't. | ||
my $new-enum = Metamodel::EnumHOW.new_type(name => 'custom', base_type => Int); $new-enum.new(1).say; | 23:28 | ||
m: my $new-enum = Metamodel::EnumHOW.new_type(name => 'custom', base_type => Int); $new-enum.new(1).say; | |||
camelia | P6opaque: must compose custom before allocating in block <unit> at <tmp> line 1 |
||
sena_kun | not how it would work. | ||
jnthn | Try $new-enum.^compose before the .new call | ||
Or at least .^compose_repr | |||
sena_kun | jnthn, will it be possible to still `^add_enum_value` after compose? That's why I avoided it... Let me try... | 23:29 | |
jnthn | I think yes, and if there's issues you can perhaps always re-compose | ||
I wonder if we should provide some nice MOP method to save people figuring this all out... | |||
sena_kun | woooah | 23:30 | |
^compose_repr | |||
ugh | |||
sorry. *compose_repr has helped. \o/ | |||
jnthn | yay ;) | ||
*:) | |||
sena_kun | m: my $new-enum = Metamodel::EnumHOW.new_type(name => 'custom', base_type => Int); $new-enum.^compose_repr; my \Two = $new-enum.new(2); say Two; | ||
camelia | 2 | ||
sena_kun | m: my $new-enum = Metamodel::EnumHOW.new_type(name => 'custom', base_type => Int); $new-enum.^compose_repr; my \Two = $new-enum.new(2); say Two.^name; | ||
camelia | custom | ||
sena_kun | one less issue towards the goal. \o/ | 23:31 | |
jnthn, thanks a lot! | |||
jnthn | Welcome :) | 23:32 | |
scovit | m: gist.github.com/scovit/d328be9817e...98f99ee3a3 | 23:33 | |
camelia | Signature $sign = :(Int $roof, Str $banter --> Str) | ||
scovit | no idea what I did here! | 23:34 | |
but it might wojust some cargo cult code, it might work | |||
23:40
rindolf left
23:46
melezhik left
23:53
vrurg joined
23:54
p6bannerbot sets mode: +v vrurg
|
|||
scovit | m: gist.github.com/scovit/d328be9817e...98f99ee3a3 | 23:55 | |
camelia | (signal SEGV)Signature $sign = :(Str $text --> int32) | ||
scovit | is working on my mac | 23:56 | |
:( | 23:58 | ||
ok, works on mac | 23:59 | ||
dies on linux |