🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel! Set by lizmat on 25 August 2021. |
|||
00:05
reportable6 left
00:07
jjido left
00:28
andinus left
|
|||
tonyo | m: my \x = "line 1\nline 2\nline a\n"; grammar a { rule TOP { :my $*LINE = 0; ^ <line>+ $ }; token line { \s* "line" \s+ <number-or-fail> <nlr> }; regex number-or-fail { | \d+ | <.dieln> }; token nlr { ("\r\n" | "\n") {$*LINE++} }; token dieln { { die "Expected number on line $*LINE" } }; }; say a.parse(x) | 00:40 | |
camelia | Expected number on line 2 in regex dieln at <tmp> line 1 in regex number-or-fail at <tmp> line 1 in regex line at <tmp> line 1 in regex TOP at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
01:28
linkable6 left,
evalable6 left
01:29
evalable6 joined
02:04
frost joined
02:28
vasko joined
|
|||
guifa | curiosa: if you're also going to be using the default whitespace, you'd redefine it similarly to what tonyo has | 02:32 | |
tellable6 | guifa, I'll pass your message to curiosa | ||
03:24
guifa left
03:30
linkable6 joined
03:45
mahafyi joined
03:58
frost left
04:04
guifa joined
04:19
guifa left
04:21
andrea[m] joined
04:24
lockywolf_ left
04:28
lockywolf_ joined
|
|||
tonyo | very low magic example | 04:57 | |
05:00
yonnybg joined
05:06
reportable6 joined
|
|||
elcaro | hi tonyo. just used fez for the first time and got a little confused by 'Meta error: "auth" is absent or not a string' | 05:19 | |
I fixed the error, and tried upload again, but kept getting the same error... | |||
... because I hadn't actually committed my changes. | 05:20 | ||
maybe a clearer error might mention that the meta located at source url "blah" has an error | |||
05:25
jaguart left
05:39
mexen joined
06:06
reportable6 left
|
|||
Voldenet | m: say DateTime.new('2021-12-24T12:23:00.43Z').day-fraction; | 06:15 | |
camelia | 0.5159772 | ||
06:15
frost joined
|
|||
elcaro | that's an interesting method. | 06:28 | |
elcaro wonders why there's no .year-fraction | |||
Voldenet | well, it's relatively new api | 06:35 | |
lizmat | and month-fraction :) | 06:38 | |
and week-fraction for that matter :-) | |||
Voldenet | in fact, I wonder why those methods are available only on DateTime and not Dateish role | 06:46 | |
m: say now.Date.DateTime.julian-date | |||
camelia | 2459619.5 | ||
lizmat | I guess that was an oversight | 06:59 | |
Voldenet | it makes sense when you look at the code, which uses .day-fraction | 07:08 | |
07:15
evalable6 left,
linkable6 left
07:16
Garbanzo__ left
07:17
evalable6 joined
07:47
Sgeo left
07:51
jjido joined
07:53
lockywolf_ left
07:54
abraxxa joined
07:57
lockywolf_ joined
08:00
abraxxa left
08:01
abraxxa joined
|
|||
Geth | doc: jaffa4++ created pull request #4026: Update nativecall.pod6 |
08:12 | |
08:14
frost left
08:44
Darkcoal joined
08:48
lichtkind joined
09:02
jjido left
09:07
dakkar joined,
reportable6 joined
09:13
jjido joined
09:22
kybr left,
kybr joined
09:24
jmcgnh left
09:35
jmcgnh joined
09:55
jjido left
10:09
mahafyi left
|
|||
moritz | a recent discussion about perl made me notice that I had the implicit assumption that heredoc markers must be idneitfiers | 10:26 | |
both in perl and in raku, this is not the case | |||
m: print q:to<!$ ?>;just a string here!$ ? | 10:27 | ||
camelia | just a string here | ||
moritz | I hope y'all appreciate the beauty of terminating a heredoc by a single . on a line of its own :-) | 10:28 | |
nine | I wonder how many actually know where this comes from :) | 10:30 | |
lizmat | moritz: there was a time you could end a heredoc with an empty line in Per | 10:31 | |
l | |||
moritz | nine: you mean besides "from larry" or "from the shell"? | 10:35 | |
11:11
jjido joined
11:15
lichtkind left
11:18
linkable6 joined
11:35
lichtkind joined
|
|||
Geth | ecosystem: 893c7828d9 | (Elizabeth Mattijsen)++ | META.list Fix MIME::Base64 on github ecosystem to last commit While we're working on moving it to the zef ecosystem |
11:42 | |
11:53
jjido left
12:06
reportable6 left
|
|||
tbrowder | using a . instead of, say, HERE, is kinda like poetry vs a tech doc | 12:41 | |
i'll stick with HERE, but . would be cool for golfers | 12:42 | ||
fore \. | |||
12:52
lichtkind left
|
|||
moritz | (I don't plan to use it, just found it curious) | 12:56 | |
13:06
sena_kun left,
sena_kun joined
13:08
reportable6 joined
|
|||
tbrowder | it is curious, and kind of neat | 13:30 | |
is it smtp or mail that uses a . to end a transmission? | 13:32 | ||
moritz | smtp | 13:34 | |
lizmat | ah doing SMTP in a telnet session... the memories :-) | 13:36 | |
clarkema | Is it possible to call one grammar from another mid-parse? For example, suppose you're parsing a web page and have an HTML grammar and a separate one for CSS | 13:38 | |
moritz | that's possible, yes. Rakudo does that interleaving quotes and code and regexes etc. | 13:45 | |
I believe the syntax is <Other::Grammar::entry_regex>, but I could be mistaken | |||
13:49
Altai-man joined
|
|||
clarkema | \m/ it works! Thanks moritz | 13:51 | |
I was so close as well, I'd been guessing at something like <Other::Grammer.parse> | |||
doesn't really make sense now I think about it | |||
13:52
sena_kun left
|
|||
clarkema | looks like the two parsers end up both triggering methods in the action class assigned to the top parser; is it possible to disambiguate that somehow? | 14:00 | |
14:00
discord-raku-bot left
|
|||
moritz | well, one could also argue that <Other::Grammar.entry_regex> would be more fitting, after all the :: denotes namespace nesting, and the regex isn't part of the namespace table (but of the method table) | 14:00 | |
14:00
discord-raku-bot joined
|
|||
moritz | re action methods, I don't know; passing a separate action class to the sub-grammar seems more sensible to me | 14:01 | |
clarkema | that would make the most sense if possible | 14:02 | |
moritz | you'd need to do this like token call_other { { my $other-match = Other::Grammar.subparse($/.orig, :continue($/.to)); $m } } or so | 14:03 | |
I'm not entirely certain how to indicate the the outer grammar should be continue parsing where the inner left off | 14:06 | ||
clarkema | hmm, yeah, i've got it parsing the inner grammar (using :pos($/.to)), but the outer grammer needs to be aware of what's been consumed in that case | 14:09 | |
moritz | in the worst case, you could have it followed by something like (.*?)<?{ $0.to == $inner_match.to }> | 14:13 | |
clarkema | I'm having a look through the rakukdo source to see if I can find examples of this kind of madness | 14:15 | |
moritz | I suspect that rakudo uses some lower-level APIs, since its grammars are actually NQP grammars | 14:19 | |
14:50
guifa joined,
guifa left
|
|||
clarkema | something odd is going on | 14:57 | |
I can skip over the consumed characters with (.*? <?{ $/.pos == $m.to }>) | 14:58 | ||
I thought I'd try to do something like . ** { $inner.to - $/.pos } but that fails | |||
.. at the same point (immediately after the inner match) also fails, and I know there is more than one character available | 14:59 | ||
. succeeds, matching a character that was a lookbehind match in the outer grammer, and the first character of the match in the inner grammar | 15:00 | ||
15:06
abraxxa left
15:19
Sgeo joined
|
|||
clarkema | well, that was an adventure | 15:32 | |
It works now, thanks moritz | 15:33 | ||
moritz | you're welcome | 15:52 | |
15:53
curiosa joined
|
|||
curiosa | One difficulty I find when writing a Raku grammar is where should be the limit of using dynamic variables while parsing, and how much to put into Actions instead of the Grammar | 15:55 | |
tellable6 | 2022-02-09T02:32:26Z #raku <guifa> curiosa: if you're also going to be using the default whitespace, you'd redefine it similarly to what tonyo has | ||
curiosa | guifa: thank you I've done that way | ||
tellable6 | curiosa, I'll pass your message to guifa | ||
curiosa | what I mean is that dynamic variables fit in extremely well in the design, and are extremely useful for instance to provide warnings or other feedback | 15:56 | |
but then I am left wondering if I shouldn't just use them and load the info directly in match object, instead of replicating work in the Actions | 15:57 | ||
moritz | the answer is pretty simple: dynamic variables are scoped to a rule and (recursively) all of its subrules. If that's the scope you need, a dynamic variable is almost always best | 15:58 | |
if you want to put data into the action object, ask yourself: can I still parse with this grammar in the absence of an action? If the answer is "no", that might not be the best approach | 15:59 | ||
(this heuristic might not quite work when you parse something with declarations that influence the rest of the parse) | 16:00 | ||
16:00
andinus joined
|
|||
curiosa | what would be the situation where you surely need an action to solve a parsing problem? Maybe I just didn't study the right science or I suffer from dunner gruger effect, but it feels to me that you can always parse without actions? | 16:00 | |
moritz | the prime example is raku itself: code like 'use MyModule; say 1 <+> 2'; can only be parsed successfully if you actually *execute* the 'use MyModule;' that imports the infix:«<+>» operator | 16:02 | |
and to execute the 'use' statement, you have to actually run the code, which (in a sensible compiler design) happens in/through the actions, not the grammar itself | 16:03 | ||
curiosa | ah, so actions can provide feedback to the grammar, how, through dynamic variables? | ||
moritz | that's the easiest case | 16:04 | |
curiosa | more basic question: are actions called while parsing, or after it? | ||
moritz | and there's crazy shit like mixing roles with additional rules/regexes/mutlis into the grammar while it's parsing | ||
actions are called while parsing | |||
if you have token a { <b> 'c' }, then the action for <b> is run before 'c' is parsed | 16:05 | ||
curiosa | wow that's powerful | ||
moritz promptly considers an "advanced" addenunm to his parsing book | |||
curiosa | please do, I think that the current docs don't do the honors to Raku enough, but don't take it as a critics it is a lot of work I understand it | 16:06 | |
if you read the docs you get the impression that actions are there as a convenient way to transverse the parse graph | 16:08 | ||
moritz | that is indeed one of their functions | 16:18 | |
16:21
curiosa left
16:33
Garbanzo__ joined
16:37
yonnybg left
16:49
ph88 left,
ph88 joined
16:58
[Coke] left
17:04
curiosa joined
17:12
mexen left
17:16
[Coke] joined
17:25
curiosa left
17:38
dakkar left
|
|||
gfldex | lolibloggedalittle: gfldex.wordpress.com/2022/02/09/fuzzy-commands/ | 17:59 | |
18:08
reportable6 left
18:09
reportable6 joined
18:59
Darkcoal left
19:11
Guest9360 joined
|
|||
Guest9360 | I'm trying to install Raku on Linus per the instructions outlined at raku.guide/#_installing_raku and it breaks on the final step. I receive this message: Can't open perl script "Configure.pl": No such file or directory. Any suggestions? | 19:11 | |
Should I try again, later? | 19:13 | ||
El_Che | try maybe these linux packages github.com/nxadm/rakudo-pkg#os-repositories? | ||
moon-child | Guest9360: I don't think Linus will appreciate that | 19:14 | |
ugexe | that is for building rakudo star, which you probably don't want to do | 19:16 | |
Guest9360: ^ | |||
19:16
Guest9360 left
|
|||
ugexe | my preference is rakubrew.org/ | 19:18 | |
`rakubrew build moar-2020.10 && rakubrew switch moar-2020.10 && rakubrew build-zef` | 19:21 | ||
`rakubrew build moar 2020.10` rather | |||
my preference for building from source anyway | 19:22 | ||
Geth | doc: f5f26bd447 | (JJ Merelo)++ | doc/Language/nativetypes.pod6 Adds pointer to index, closes #4028 Also adds a bit of introduction |
19:30 | |
linkable6 | Link: docs.raku.org/language/nativetypes | ||
19:31
linkable6 left
19:33
linkable6 joined
|
|||
Geth | doc: 1fc1d1ebc4 | (JJ Merelo)++ | doc/Language/nativecall.pod6 Fixes syntax error closes #4027 |
19:34 | |
linkable6 | Link: docs.raku.org/language/nativecall | ||
19:34
linkable6 left
19:40
Garbanzo_ joined
19:41
Garbanzo__ left
19:44
Garbanzo_ left
|
|||
Geth | doc: 48b3951f5c | (JJ Merelo)++ | 2 files This place is probably better for definition |
19:50 | |
doc: 736519413f | (JJ Merelo)++ | doc/Language/nativetypes.pod6 Add link |
19:52 | ||
[Coke] | did JJ force push!? | 20:05 | |
ah, whew. | 20:08 | ||
Geth | doc: 50f4853bef | Coke++ | doc/Language/nativetypes.pod6 typo |
20:11 | |
clarkema | I put together a summary of this afternoon's discussion on multiple grammars: clarkema.org/lab/2022/2022-02-09-ra...-grammars/ | 20:36 | |
20:36
linkable6 joined
20:44
jjido joined
|
|||
MasterDuke | weekly: clarkema.org/lab/2022/2022-02-09-ra...-grammars/ | 20:47 | |
notable6 | MasterDuke, Noted! (weekly) | ||
20:51
djerius left
20:52
djerius joined
21:08
bluemtn895 joined
|
|||
[Coke] | is there a way to get a trace? I have a script that is just stopping at some point, would love to see what it's doing before it stops. (--ll-exception shows nothing) | 22:00 | |
MasterDuke | add a nqp::sin right before it stops, break on that in gdb, then run `call MVM_dump_backtrace(tc)` | 22:05 | |
[Coke] | ... I don't know where it's stopping | 22:06 | |
that's what I'm trying to find out. :) | |||
debug output it is... | |||
22:08
linkable6 left,
evalable6 left
22:09
evalable6 joined
|
|||
MasterDuke | could create a coverage log instead | 22:09 | |
22:10
linkable6 joined
|
|||
[Coke] | ... note "Project: $project" if $debug; note $Project.IO.d; ... - I get the Project, but not the output of the .d | 22:11 | |
I get one line of output, it hangs for several seconds, then exits. | 22:14 | ||
MasterDuke | if it hangs for long enough you could get the pid and attach gdb that way | ||
[Coke] | this is windows | 22:15 | |
running inside git bash. | |||
v2021.12-171-g382f2f1084 | |||
MasterDuke | then i got nothing | 22:16 | |
[Coke] | building HEAD... | 22:17 | |
22:32
bluemtn895 left
|
|||
[Coke] | oh hey, forgot to hit nmake 30m ago... | 22:52 | |
23:26
djerius left,
djerius joined
23:45
jjido left
|