🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
guifa codesections: the trick is the JS side — which is on both sides of the equation lol 00:03
00:11 vrurg_ left, vrurg joined
codesections guifa: Oh, well, I guess that 00:19
*'s what happens when you use a less powerful language :D 00:20
JS does have tagged template literals with their raw strings: developer.mozilla.org/en-US/docs/W...aw_strings
00:21 wamba left
guifa codesections: Hmm, I didn’t knwo about them 00:31
I swear JS gets so many new stuff hacked on it’s impossible to keep up
and the syntax and stuff keeps getting weirded too
weirder*. There’s only so much you can do and keep old code still valid 00:32
I think I can get some of it out by creating a method on a nonce class 00:33
Webperl has this weird thing where classes stick around between different runs of Raku.eval(), but subs don’t. 00:34
timotimo urrrgh i think the network flakiness is happening again for zef 00:38
oh! i was wrong, just this exact moment it finished
rypervenche guifa: With in-browser testing for the exceptions, will I be able to see an example of what the exception would look like in context? 00:39
guifa rypervenche: Depends on what you mean in context. Basically, the “test message” button will take a few representative exceptions, pass it to the method, and display the output. (so if there’s a boolean attribute, there will be one where it’s false, one where it’s true; if an array, one with a single element, and one with two, etc) 00:40
For more contextual information, there’s the “notes” field 00:41
I’m going through slowly but surely to add commentary and (even slower) adding the sample ones. Trying to ducment in a giant spreadsheet what exceptions are now unused, or have adhoc stuff that could be separated out into new exceptions, etc 00:42
rypervenche Mkay. I'm excited to see it. I think that would help a lot with translations.
timotimo github.com/rakudo/rakudo/wiki/Work...o-NQP-Land - feels like there could be some changes here, or some community work or something 00:44
squashable6: status
squashable6 timotimo, The date for the next SQUASHathon is not set
timotimo have we paused squashathons? we don't have anybody to host them, or we have no ideas for topics?
github.com/rakudo/rakudo/wiki/Mont...Squash-Day - maybe no-event-will-take-place entries should be added for the previous months 00:47
guifa rypervenche: the other thing I’m trying to figure out is navigation. with 471 one of them, a popup menu is unweildy haha 00:48
00:49 cpan-raku left 00:52 cpan-raku joined, cpan-raku left, cpan-raku joined 00:57 kent\n left 00:58 kent\n joined 01:18 molaf left 01:25 Skarsnik left 01:31 molaf joined 02:02 Manifest0 left 02:04 Manifest0 joined 02:13 bdju left 02:14 bdju joined 02:25 vgrato_ left 02:34 vrurg_ joined 02:37 vrurg left 02:40 stanrifkin_ joined 02:43 stanrifkin left 03:00 camelCaser left 03:01 camelCaser joined 03:09 vrurg joined 03:13 vrurg_ left 03:17 vrurg left, vrurg_ joined 03:49 zacts joined 03:55 sjaveed left 03:56 sjaveed joined 04:00 sjaveed left 04:24 sjaveed joined 04:28 sjaveed left 05:00 sjaveed joined 05:05 sjaveed left 05:10 stanrifkin_ left 05:11 bocaneri joined 05:14 sjaveed joined 05:18 wamba joined 05:21 sjaveed left 05:33 sjaveed joined 05:39 sjaveed left 05:46 sjaveed joined 05:48 wamba left 05:50 sjaveed left 06:14 stanrifkin joined 06:36 sjaveed joined 06:42 sjaveed left 06:44 patrickb joined 06:49 sjaveed joined 06:53 ufobat_ left, cpan-raku left 06:54 cpan-raku joined, cpan-raku left, cpan-raku joined, sjaveed left 06:56 stoned75 joined 07:01 jmerelo joined
jmerelo releasable6:status 07:01
releasable6 jmerelo, Next release in ≈11 hours. 3 blockers. Changelog for this release was not started yet
jmerelo, Details: gist.github.com/4125e31772b6e25eaf...cee92d936e
07:04 aborazmeh joined, aborazmeh left, aborazmeh joined
Geth doc: 98f7a7bb14 | (Stoned Elipot)++ | doc/Type/Seq.pod6
Fix link to routine
07:09
linkable6 Link: docs.raku.org/type/Seq 07:10
07:24 stoned75 left, stoned75 joined 07:27 sena_kun joined
Geth doc: 65dcf5a760 | (Stoned Elipot)++ | doc/Type/Seq.pod6
Add missing formatting on 'Seq'
07:29
linkable6 Link: docs.raku.org/type/Seq
07:48 sjaveed joined 07:53 dakkar joined 07:54 sjaveed left 07:59 stoned75 left 08:05 stoned75 joined 08:27 stoned75 left 08:34 stoned75 joined 08:46 wamba joined 08:52 nexysno left 08:57 mark[m]1 left 08:58 aborazmeh_ joined, aborazmeh_ left, aborazmeh_ joined, aborazmeh left, aborazmeh_ is now known as aborazmeh 09:00 cheer[m] left 09:03 stanrifkin left 09:07 pecastro joined 09:23 sjaveed joined 09:27 sjaveed left 09:31 sno left 09:52 jjmerelo joined 09:54 jmerelo left 10:01 rindolf joined 10:05 rindolf left 10:11 bocaneri left 10:12 rindolf joined 10:15 natrys joined 10:17 dakkar left 10:23 sjaveed joined 10:24 bocaneri joined 10:25 Celelibi left 10:30 sjaveed left 10:46 Sgeo left 11:02 Altai-man joined 11:04 sena_kun left 11:06 sjaveed joined 11:12 sjaveed left
stoned75 m: releases say (1..5).map({$_}).skip; 11:35
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
releases used at line 1. Did you mean 'repeated', 'reverse'?
stoned75 m: release say (1..5).map({$_}).skip;
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
release used at line 1. Did you mean 'reverse'?
11:35 sftp left, molaf left, Tirifto joined
stoned75 commit: releases say (1..5).map({$_}).skip; 11:36
committable6 stoned75, gist.github.com/84ba150807640ea6b8...4bc55fe902
patrickb ping rba 11:38
11:39 sftp joined 11:42 sjaveed joined
Geth doc/seq-simpler-eg: c1ec4a087b | (Stoned Elipot)++ | doc/Type/Seq.pod6
Simpler examples
11:43
doc: stoned++ created pull request #3645:
Simpler examples
11:46 wamba left, squashable6 left, sjaveed left 11:47 squashable6 joined 11:51 wamba joined
jjmerelo m: say (1..5).map({$_}).^name 11:57
camelia Seq
jjmerelo m: say (1..5).^name
camelia Range
jjmerelo m: say (1...5).^name 11:58
camelia Seq
12:07 sjaveed joined 12:09 squashable6 left 12:10 squashable6 joined 12:13 kensanata joined, sjaveed left, aborazmeh left 12:29 oneeggeach joined
Geth doc/promote-is-map-is-set-better: d3ffb4cd09 | (Patrick Böker)++ (committed using GitHub Web editor) | doc/Type/Map.pod6
Promote `%m is Map` syntax more

Mention the `%m is Map` syntax on the `Map` documentation page. Previously the syntax was only mentioned on the `Syntax` page.
12:38
doc: patrickbkr++ created pull request #3646:
Promote `%d is Map/Set` syntax more
12:43
12:44 oneeggeach left 12:45 Black_Ribbon left
Geth doc/promote-is-map-is-set-better: 7063385cf9 | (Patrick Böker)++ | doc/Type/Map.pod6
Promote `%m is Map` syntax more

Mention the `%m is Map` syntax on the `Map` documentation page. Previously the syntax was only mentioned on the `Syntax` page.
12:51
doc: 7063385cf9 | (Patrick Böker)++ | doc/Type/Map.pod6
Promote `%m is Map` syntax more

Mention the `%m is Map` syntax on the `Map` documentation page. Previously the syntax was only mentioned on the `Syntax` page.
12:54
doc: 679ea7823f | (Patrick Böker)++ (committed using GitHub Web editor) | doc/Type/Map.pod6
Merge pull request #3646 from Raku/promote-is-map-is-set-better

Promote `%d is Map` syntax more
12:54 wamba left
linkable6 Link: docs.raku.org/type/Map
12:55 patrickb left, wamba joined
xinming_ How do we alias a class? 13:13
moritz m: constant Integer = Int;
camelia ( no output )
xinming_ What I mean is, alias a class, and use that new name in sub signature.
hmm, bbl
moritz m: constant Integer = Int; sub f(Integer $x) { say $x**2 }; f 42 13:14
camelia 1764
moritz xinming_: ^^ like this :D
xinming_ Worked, Thanks.
moritz m: constant Integer = Int; sub f(Integer $x) { say $x**2 }; say &f.signature.params[0]
camelia Int $x
xinming_ I tried something like my \Integer = Int; But doesn't seem to work.
13:17 __jrjsmrtn__ left 13:18 __jrjsmrtn__ joined 13:29 sjaveed joined 13:35 sjaveed left 13:38 kensanata left 13:46 patrickb joined
xinming_ m: constant X::y = "1"; X::y.say; 13:52
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing initializer on constant declaration
at <tmp>:1
------> 3constant X:7⏏5:y = "1"; X::y.say;
xinming_ How do we create constant with namespace please? :-)
Or, we can't.
moritz m: package X { constant y = "1 }; say X::Y 13:53
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in double quotes; couldn't find final '"' (corresponding starter was at line 1)
at <tmp>:1
------> 3package X { constant y = "1 }; say X::Y7⏏5<EOL>
expecting a…
moritz m: package X { constant y = "1" }; say X::Y
camelia Could not find symbol '&Y' in 'X'
in block <unit> at <tmp> line 1
moritz m: package X { constant y = "1" }; say X::y 13:54
camelia 1
xinming_ Got it, thanks.
13:54 sjaveed joined
xinming_ Then, another problem rises. 13:54
how do we also make the package X also alias for other classes? 13:55
I know we can add namespaced constants within class X directly.
hmm.. 13:56
moritz what problem are you trying to solve?
xinming_ m: class C1 { }; class C1::B { }; constant C = C1; constant C::B = C1::B; 13:58
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing initializer on constant declaration
at <tmp>:1
------> 3C1::B { }; constant C = C1; constant C:7⏏5:B = C1::B;
xinming_ create some alias for some classess under the same namespace
13:58 sjaveed left
moritz m: class C1 { }; class C1::B { }; constant C = C1; say C::B 13:59
camelia (B)
13:59 jjmerelo left
xinming_ Ok, got it, thanks. 14:00
14:00 ThaEwat joined 14:09 sjaveed joined 14:15 sjaveed left 14:18 Manifest0 left 14:25 stoned75 left 14:26 zacts left, zacts joined, stoned75 joined 14:30 sjaveed joined 14:34 sjaveed left 14:47 Tirifto left 14:56 gnufr33dom joined 15:02 Celelibi joined 15:03 sena_kun joined 15:04 Altai-man left 15:22 sjaveed joined 15:24 zacts left 15:26 sjaveed left 15:32 kylese joined 15:39 zacts joined 15:42 jmerelo joined 15:51 Manifest0 joined 15:57 sjaveed joined 16:01 sjaveed left 16:07 El_Che_ joined, El_Che_ left 16:08 gnufr33dom left 16:14 aluaces left 16:21 zacts left 16:42 Tirifto joined
codesections m: say 'a' ~~ /<:Upercase_Map('A' ~~ /./)>/ 16:51
camelia 「a」
codesections m: say 'a' ~~ /<:Upercase_Map('A')>/
camelia Nil
codesections So *that's* surprising! I need to pass in a match to the Unicode property 16:52
SmokeMachine Hi! How can I dynamically use a rule on a grammar? 16:56
I mean something like this:
m: grammar Bla { my %cmds = bla => "ble"; rule ble {"ble"}; rule TOP { :my $a; $<cmd>=\w+ { $a = ::(%cmds{$<cmd>}) } <$a> } }; say Bla.parse: "bla ble"
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared
at <tmp>:1
------> 3 $<cmd>=\w+ { $a = ::(%cmds{$<cmd>}) } <7⏏5$a> } }; say Bla.parse: "bla ble"
17:08 zacts joined
guifa SmokeMachine: I changed it to a dynamic variable and it sudenly worked 17:26
grammar Bla { my %cmds = bla => "ble"; rule ble {"ble"}; rule TOP { :my $*a; $<cmd>=\w+ { $*a = %cmds{$<cmd>} } <$*a> } }; say Bla.parse: "bla ble" 17:27
evalable6 「bla ble」
cmd => 「bla」
17:37 Sgeo joined
SmokeMachine guifa: thanks! but why $a was not available on <$a>? 17:45
guifa SmokeMachine: no idea. It should be in scope, but it’s a compile time error, so maybe for some reason the :$foo declaration isn’t be acknowledged when <$foo> is being handled for some reason 17:52
That’s the best explanatino I’ve got, given that the dynamic works — which allows the compile to ignore questions of scope until runtime 17:53
SmokeMachine hum... that's not using the rule... 17:59
grammar Bla { my %cmds = bla => "ble"; rule p-ble {"ble"}; rule TOP { :my $*a; $<cmd>=\w+ { $*a = "p-%cmds{$<cmd>}" } <$*a> } }; say Bla.parse: "bla ble" 18:00
m: grammar Bla { my %cmds = bla => "ble"; rule p-ble {"ble"}; rule TOP { :my $*a; $<cmd>=\w+ { $*a = "p-%cmds{$<cmd>}" } <$*a> } }; say Bla.parse: "bla ble"
camelia 5===SORRY!5===
Unrecognized regex metacharacter - (must be quoted to match literally)
at /home/camelia/EVAL_0:1
------> 3anon regex { p7⏏5-ble}
Malformed regex
at /home/camelia/EVAL_0:1
------> 3anon regex { p-7⏏5ble}
SmokeMachine how can I use a rule dynamically?
m: grammar Bla { my $a = "a-b"; rule a-b { "bla" }; rule TOP { <$a> } }; say Bia.parse: "bra" 18:02
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
Bia used at line 1. Did you mean 'Bla'?
SmokeMachine m: grammar Bla { my $a = "a-b"; rule a-b { "bla" }; rule TOP { <$a> } }; say Bla.parse: "bla"
camelia 5===SORRY!5===
Unrecognized regex metacharacter - (must be quoted to match literally)
at /home/camelia/EVAL_0:1
------> 3anon regex { a7⏏5-b}
Malformed regex
at /home/camelia/EVAL_0:1
------> 3anon regex { a-7⏏5b}
guifa SmokeMachine: 18:05
m: grammar Bla { my %cmds = bla => "x"; rule x {"ble"}; rule TOP { :my $*a; $<cmd>=\w+ { $*a = "<" ~ %cmds{$<cmd>} ~ ">" } <$*a> } }; say Bla.parse: "bla ble"
camelia 「bla ble」
cmd => 「bla」
SmokeMachine guifa: interesting... I was trying with .^find_method... 18:06
guifa it makes sense too
<$foo> should be interpreted as if regex. But we were just putting in “ble” — which is interpreted as a literal ble. Need <ble> to call the rule. 18:07
guifa is afk&
18:07 thundergnat joined
SmokeMachine m: grammar Bla { rule params-bla { "ble" }; rule TOP { :my $*a; $<cmd>=\w+ { $*a = "<params-{ ~$<cmd> }>" } <$*a> } }; say Bla.parse: "bla ble" 18:07
camelia 「bla ble」
cmd => 「bla」
SmokeMachine :) 18:08
18:13 aluaces joined
thundergnat codesections: to the best of my knowledge, and as I understand it, the only Unicode properties from unicode.org/reports/tr44/#Property_List_Table that can be used as a matcher in a regex are those that have a B (binary) in the second column. 18:19
18:19 stoned75 left
thundergnat The others are things that can be queried. 18:19
m: say 'a'.uniprop('Uppercase_Mapping');
camelia A
18:19 ThaEwat left
thundergnat your above example only matched by accident' 18:20
m: say 'a' ~~ /<:Irelavant_Map('Q' ~~ /./)>/
camelia 「a」
18:20 stoned75 joined
thundergnat That list doesn't have the _only_ properties that can be used for matching though. 18:21
m: say '௫' ~~ /<:Numeric>/; # Numeric is not in that list 18:22
camelia 「௫」
thundergnat though Numeric_Type and Numeric_value are 18:23
18:30 jmerelo left
timotimo are there multiple different empty answers for some of the questions? 18:31
18:36 aluaces left 18:42 zacts left
codesections thundergnat: Thanks, that's all very helpful – though it makes me realize I'm further from understanding this corner of Raku than I thought 18:46
m: say 'foo' ~~ /<:bar(True)>+/
camelia 「foo」
codesections ಠ_ಠ 18:47
thundergnat It's complicated...
Unicode in general is difficult. (I guess anything trying to regularize natural language needs to be._ 18:48
tobs hah, I was wondering if Raku wasn't going too far correcting the "Upercase_Map" typo
moritz travis-ci.org/github/niner/Inline-.../728618708 says "===> Failed to find dependencies: python3:from<native>" 18:49
should that be removed from META.json?
or is there some way to each zef what that means?
moritz <- packaging newb 18:50
timotimo is it a system where "python" is python3 and "python2" is python2 and "python3" is missing? 18:53
codesections I get that it's complicated, and have worked my way through many of the ways the complication is handled. But I don't quite get why a Regex match can't do things the same as &unimatch.
m:say 'a'.unimatch('A', 'Uppercase_Mapping') 18:54
evalable6 True
codesections So Raku _knows_ the relevant Unicode properties 18:55
(which, at least on MoarVM, it really should – it compiles the whole Unicode Character Database.
) 18:56
But I guess it just hasn't told Regexen about some of them :)
moritz m: say 'A' ~~ / <:Uppercase_Mapping> / 18:59
camelia Nil
moritz m: say 'A' ~~ / <:Lu> /
camelia 「A」
codesections m: say 'aA' ~~ / <:Uppercase> / # also works 19:00
camelia 「A」
codesections it's just the ones that require a Str parameter that seem to be the issue
m: say 'Roman: Ⅴ' ~~ /<:numeric_value(5)>/; 19:01
camelia 「Ⅴ」
codesections well, some of them, anyway 19:02
19:02 Altai-man joined
moritz m: say 'Roman: Ⅴ' ~~ /<:numeric_value(5)>/; 19:02
camelia 「Ⅴ」
moritz m: say 'Roman: Ⅴ' ~~ /<:numeric_value(1)>/;
camelia Nil
19:04 sena_kun left, aluaces joined 19:07 sjaveed joined
sjaveed hello everyone! 19:14
tellable6 hey sjaveed, you have a message: gist.github.com/cb62d9fd9abcffca3b...cb419d547a
sjaveed i do?
oh nice 19:15
thanks for the info tbrowder!
and thanks tellable6 :-) nice bot 19:16
tellable6 sjaveed, Anytime!
sjaveed ok so i'm trying to figure out a couple of things: 1. how to organize code in modules - so far I've just been making each class its own module (in a corresponding .rakumod file) 19:23
not sure if there's an idiomatic way of organizing code or e.g. multiple classes within a module 19:24
that might be partly because of some confusion on my part about the meaning of a module - is it essentially like a Java package? The namespace for a class if you would?
the other question is about creating reusable modules that can be published to cpan - there don't seem to be any decent guides on that 19:25
i'd love some pointers
solving the second might also solve the first but not sure 19:26
this seems to be pretty bare bones: docs.raku.org/language/modules#Pre...the_module but seems to indicate that i might be on the right path 19:33
codesections m: say '1Ⅰ2Ⅱ 3Ⅲ 4Ⅳ 5Ⅴ 6Ⅵ ' ~~ m:g/<:Numeric_Value(2..6)>/ # wow
camelia (「2」 「Ⅱ」 「3」 「Ⅲ」 「4」 「Ⅳ」 「5」 「Ⅴ」)
codesections sjaveed: I haven't used Java, but isn't the general rule there "one class" == "one file"? That's not nearly a universal rule in Raku, ime 19:34
sjaveed you *can* have inner classes in Java 19:36
codesections I think Raku code organization turns more on style/how it makes the most sense to future readers
sjaveed so how does that work in the Rakuniverse?
codesections Oh, ok. Like I said, I don't really know Java
sjaveed understood
my other context is ruby where you can have multiple classes in the same file 19:37
but the concept of modules there is a bit different
or seems to be in any case
so codesections you've put multiple classes in a single rakumod file?
and in that case when you use that module, what gets injected into the namespace? 19:38
both classes?
19:41 kylese left
SmokeMachine m: my token number { \d*\d+ }; say "100" ~~ /<number>/ # should it be matching? 19:41
camelia Nil
SmokeMachine ok, I got it! thanks!
token...
codesections sjaveed: yeah. (I just tested that to make sure. I _tend_ not to use a ton of classes – I lean more towards functional programming. So I wanted to make sure that didn't cause any issues 19:44
)
thundergnat SmokeMachine: tokens don't backtrack, \d* gobbles up all of the digits and doesn't leave at least one for the \d+ 19:45
so it fails
SmokeMachine thundergnat: yes, I got it, thanks!
sjaveed nice ok i think i'm starting to get a better understanding of module structure at least 19:47
thanks codesections
now to see if i can create ruby-style dsl 19:48
codesections Glad I could help :) “ruby-style dsl” ooh, that sounds fun! 19:49
timotimo we do have an example nqp compiler "rubyish" 19:50
sjaveed oh? i'm guessing it doesn't work on all of ruby but a decent subset 19:51
and nqp is the underlying bytecode right? what parrot runs?
still getting up to speed on everything sorry
19:52 zacts joined
thundergnat m: say join ' ', (0x20 .. 0x0FFF).map( { .chr ~~ /<:nv(1|2|3)>/ or next } ).batch(3)».join; 19:52
camelia 123 ²³¹ ١٢٣ ۱۲۳ ߁߂߃ १२३ ১২৩ ੧੨੩ ૧૨૩ ୧୨୩ ௧௨௩ ౧౨౩ ౹౺౻ ౼౽౾ ೧೨೩ ൧൨൩ ෧෨෩ ๑๒๓ ໑໒໓ ༡༢༣
thundergnat cool
codesections parrot is pretty much dead, actually (insert your own monty python joke).
The main VM right now is MoarVM
there are also a runtime on JVM and one for JS, though they aren't as far along as far as I know 19:53
sjaveed lol it's an ex-parrot?
tadzik oh, rubyish. I remember contributing to that
codesections (I've only used MoarVM)
sjaveed ah ok
tadzik that might have been one of the only things on my resume that I sent for a real job
sjaveed some of my knowledge is from looking at perl6 a few years ago and while i've been using moarvm, i wasn't sure if that was still tied to parrot or not 19:54
tadzik: so with that in mind - assuming i'm looking to replicate ruby-style dsl, thoughts on a direction i should investigate? 19:55
tadzik oh no, that was cardinal
github.com/parrot/cardinal
codesections Nope. MoarVM is a new runtime, written in (fairly minimal amounts of) C
sjaveed grammars, from what i read briefly, seem to rely on reading from a file so might be useful for somethings
codesections grammars can read from a file (with the `.parsefile` method) or parse a string (the `.parse` method) 19:56
tadzik sjaveed: hm, I'm not sure. What makes a ruby-style dsl ruby-style? :)
but yes, you definitely want to use grammars for this 19:57
cardinal's parser may be servicable for this still
sjaveed so what if i wanted to mix grammars within my ruby code?
er
raku code
tadzik github.com/parrot/cardinal/blob/ma...grammar.pg
probably won't work as-is, but may serve as at least an inspiration
grammars are raku code :) 19:58
so there's nothing you need to do to mix them in
MasterDuke maybe look at Slang::SQL for inspiration
sjaveed no what i meant was - i wanted to use a grammar to parse in a rakumod file as raku with some augmented functionality
oh hmmm
MasterDuke: that sounds interesting 19:59
19:59 rindolf left
sjaveed oh that does look interesting 20:00
this is the correct github, right? github.com/tony-o/perl6-slang-sql
looks like it hasn't been updated in a while but the examples are promising
tadzik there's a chance that it just works perfectly today and doesn't need any updates :) 20:01
sjaveed hah the code is minimal so it seems plausible 20:02
so it looks like SQL::Slang relies on a single sub named sql which accepts a string (the sql query/command), a list of query param values it seems like and a block and then uses the defined grammar to parse that string and then execute it 20:07
so two things of interest there: first, that whole mechanism is very cool, and second, I've not looked at defining subs directly on a module which would be the other aspect of getting to a ruby-style dsl 20:08
MasterDuke there's also Inline::(Perl5|Python)
sjaveed yeah but i'm not interested in using ruby directly 20:09
MasterDuke ah
sjaveed just using this project to learn raku
it's such a vast language that i feel like it would be very hard to learn everything unless you learn it with a purpose 20:10
a set of goals in mind
i just played with raku regexes recently and they're familiar but also so different 20:11
now its on to seeing how to do ruby-style dsls in raku since that's something i loved about ruby
and i feel like raku has everything *and* the kitchen sink so there's likely a way to get that done as well 20:12
anyway - sorry for the oversharing :-)
timotimo there was a nice talk about DSLs in perl6 two or so years ago 20:14
and another article very recently
have you had a look at how Cro's HTTP Router does Its Thing?
sjaveed yeah i saw the talk
yup went through that as well
timotimo cool
that'd be a good start
sjaveed ended up finding another router that uses regexes
but i ended up creating my router which was nice
got a link that that article though timotimo? 20:15
timotimo hmm, let's see
i don't remember much about it
it was for dynamic variables and what they enable
sjaveed oh interesting
i came across the term recently - related to closures right? 20:16
20:17 patrickb left
timotimo sorry, rather distracted 20:17
dynamic vars are more about call stack than closures 20:18
sjaveed ah ok - yeah another thing i'll have to look at - hoping something leads mw that way
timotimo cro's "router" is a sub that just takes a block (closure, essentially), sets a dynamic variable with a specific name, then calls the block you give it 20:19
the "get" and "put" and other subs also take a block (pointy block, so it also has a signature) and will look up the dynamic variable and that's where the block gets "installed" 20:20
sjaveed right
when i initially looked at Cro::Router it was for the string -> regex conversion
but i need to look at it again for how it handles its dsl
timotimo dynamic variable is a little like "global variable", except essentially per-thread without being a Thread Local Variable 20:21
by virtue of living on the callstack
sjaveed oh interesting
timotimo they are also not exactly blazing fast
sjaveed so is it used as a thread local variable? or are thread locals still idiomatic?
timotimo we do have a dynamic variable cache, though, so it's not as tragically slow as it could be
sjaveed nice 20:22
reading this now with an eye on dsl: www.jnthn.net/papers/2020-gpw-cro.pdf - i'll start looking at the Cro::Router code shortly to see how that's laid out 20:23
there's a concept of subsets? my subset UUIDv4 of Str where //? 20:24
timotimo aye
sjaveed it's amazing how often i find things like this that just fit a use case 20:25
timotimo it's all run-time checked, though
sjaveed how's raku not the slowest language on the planet?
timotimo oh it's pretty slow :P
i meant the subsets, though, not everything
sjaveed admittedly my scripts are small but seems ok so far lol
maybe i'll start cursing its speed at some point when i stop gawking at its features
20:26 zacts left
timotimo the difference between rakus fast features and its slow features can be biiiig 20:26
sjaveed yeah?
timotimo but most of the time a very simple tweak to your code can get you from slow to fast-enough
also, post your code on the channel for a chance to win fabulous speed increases 20:27
to rakudo itself
sjaveed oh nice!
timotimo have you read the raku weekly at all?
sjaveed but yeah i'd probably never imagine something like subset exists and would've implemented it myself so if it turns out to be slow, i figure i can always go back to doing things manually 20:28
nope
is that a newsletter?
timotimo often you see messages a la "made $feature $number times faster" or "made $feature $number percent as fast"
sjaveed nice
MasterDuke rakudoweekly.blog/2020/09/14/2020-...ally-raku/
sjaveed looks like there's plenty of opportunity to contribute to moarvm itself then
timotimo yeah, every week it lists blog posts, interesting (or maybe just "all") tweets and comments and such, as well as stuff people have been working on in rakudo and such 20:29
sjaveed very cool
timotimo the optimization opportunities live at every level of the stack 20:30
sjaveed i might have to pick up moritz' book as well
timotimo: yeah feels like that
timotimo there's an interesting branch in moarvm at the moment for implementing a paper called "zero-overhead metaprogramming" or something like that 20:31
sjaveed oh that sounds like an over-promise lol 20:32
but definitely interesting
timotimo it's a cool thing, it's based on recording stuff and reacting accordingly 20:33
and also, lets you write stuff in nqp code that handles policies 20:35
sjaveed so mixing nqp code with raku?
timotimo well, parts of rakudo are written in nqp
this is really deep internal stuff :) 20:36
sjaveed hah yeah and i'm a total beginner at this but some of these insights are fascinating
20:37 aborazmeh joined, aborazmeh left, aborazmeh joined
timotimo for some reason, not finding the code i wanted to show 20:38
hm 20:39
not really something you can just look at and realize why it's cool 20:40
sjaveed hah yeah i was just thinking that'd be like pearls before swine
timotimo haha
sjaveed i might not understand why it's so awesome
timotimo anyway, one part of it is that you can write stuff in C and it'll be fast, but moarvm's "record and optimize based on what we've seen" can't just look in there and toss out unnecessary overhead or anything 20:42
sjaveed i have to say that i didn't think i'd find as welcoming a community as i did when i went to ruby but #raku and /r/rakulang are pretty cool :-) 20:43
timotimo so we're moving things from C to nqp where moar's optimizer can observe and toss out repeated checks and such
sjaveed ah nice
that makes sense
is this part of the rakuast branch?
timotimo is much easier to grasp when jnthn does the explaining :D
sjaveed that talk got me fired up 20:44
timotimo rakuast is a separate project
El_Che timotimo: will there be a day where nqp code will be replaced by raku?
timotimo possible, but not necessary
sjaveed ah ok
timotimo um
i mean, it's possible, but not necessarily going to happen soon
sjaveed can i access any of the raku internals that are coded in nqp? 20:45
i'd imagine c would be a bit harder to reach
20:45 sno joined
timotimo you can reach relatively deep into the internals from raku itself 20:46
sjaveed nice
timotimo m: say Str.^methods
camelia (BUILD Capture Int Num Version chomp pred succ match subst-mutate parse-base samecase samemark samespace word-by-word trim-leading trim-trailing trim encode NFC NFD NFKC NFKD unival univals wordcase trans parse-names uniparse indent codes chars uc lc …
timotimo m: say Str.^methods[5].signature
camelia (Str:D: *%_ --> Str:D)
timotimo m: say Str.^methods[5].signature.parameters[0]
camelia No such method 'parameters' for invocant of type 'Signature'
in block <unit> at <tmp> line 1
20:47
sjaveed <3
alright - getting pulled away but i'll be back for more questions 20:48
thanks codesections and timotimo!
timotimo ah, see ya later
20:51 [Sno] joined 20:52 sno left, aluaces left
Geth doc/seq-op-variants: 2be59b347d | (Stoned Elipot)++ | doc/Language/operators.pod6
document sequence operator variants ^... and ^...^ ref #3360

while here add output to an example for this operator
20:57
doc: stoned++ created pull request #3647:
document sequence operator variants ^... and ^...^ ref #3360
linkable6 DOC#3360 [open]: github.com/Raku/doc/issues/3360 [checklist][docs][versions] Checklist for 2020.05
21:20 molaf joined
codesections um. After all that, it just needed different brackets 21:21
m: say 'ab' ~~ /<:Uppercase_Mapping{'A'}>/
camelia 「a」
codesections m: say 'ab' ~~ /<:Uppercase_Mapping{'C'}>/ 21:22
camelia 「a」
codesections er, no, still not right
oops
21:38 sjaveed left 21:39 sjaveed joined 21:45 natrys left 21:47 mowcat joined 21:50 sjaveed left, Altai-man left, sjaveed joined 21:52 wamba left 21:53 mowcat left 22:08 leah2 left
rypervenche lizmat: Hmm, I wonder. Should we maybe replace the camel with a butterfly instead of just removing the camel? In github.com/rakudo/rakudo/pull/3908 22:15
codesections m: say '{' ~~ /<:bmg('}'.ord)>/ # This works *only* if you convert the argument to a number 22:16
camelia 「{」
22:26 zacts joined, leah2 joined 22:27 zacts left 22:30 gnufr33dom joined 22:42 zacts joined 22:47 Black_Ribbon joined 23:21 pecastro left 23:27 stoned75 left 23:30 sjaveed left, sjaveed joined 23:34 zacts left, stoned75 joined 23:36 sjaveed left 23:55 sjaveed joined