[00:03] it is also possible to just write rules and tokens in a set of roles and then just compose sets of roles with "does" [00:07] so, in other words, you can have a file in your repository that looks like this: ```raku [00:07] our class Handler { [00:07] has $.exception-declaration is required; [00:07] has $.compound-statement is required; [00:07] } [00:07] *** discord-raku-bot left [00:07] *** discord-raku-bot joined [00:07] so that's basically a little piece of a fuller grammar [00:07] all in one file [00:08] then you can have a number of these files [00:08] maybe this one is called, for example gcpp-try.rakumod [00:09] maybe this one is called, for example `gcpp-try.rakumod` [00:09] so then you can have another file `gcpp-actions.rakumod` which has `Cpp::Actions` [00:09] and `Cpp::Actions does Try::Actions does If::Actions does StringLiteral::Actions does etc etc etc {}` [00:11] same thing with `Cpp::Rules does Try::Rules does If::Rules does StringLiteral::Rules does etc etc etc {}` [00:11] but Cpp::Actions and Cpp::Rules are both roles... well at least Cpp::Rules is. Cpp::Actions can be a class if you dont want any further customization [00:13] then, at the top, you can have a `grammar Cpp::Grammar does Cpp::Rules { rule TOP { ... } }` as well as a `class Cpp::Grammar::Actions does Cpp::Actions {} ` [00:13] that's the strategy i use when the grammars are complex [00:14] *** elcaro_ is now known as elcaro [00:15] it might get a bit more complicated if you wanted to fit two grammars into one -- then you could follow that article [00:16] you could, also imo gate access to a grammar subtree with a dynamic variable [00:17] so in other words, when you detect that you are at a certain place in the tree, you can set a dynamic variable before accessing a toplevel rule for that subtree, which is gated by that dynamic variable [00:21] ie, with [00:26] *** discord-raku-bot left [00:26] *** discord-raku-bot joined [00:30] *** discord-raku-bot left [00:30] *** discord-raku-bot joined [03:05] yeah, i'm going to need a firmer conceptual map of how raku works before I can piece all that together. [03:07] by the time I'm done parsing out some of the syntax and looking at it, I lost sight of what I'm trying to figure out in the first place [03:07] by the time I'm done parsing out some of the syntax and looking at it, I lose sight of what I'm trying to figure out in the first place [06:09] i made this scrape -- hope it helps! [06:11] i read it all over a week or two before starting to write any raku and it helped immensely! [06:11] couldnt remember everything right away of course, but it was great to get a sense of what the language could actually do [06:11] highly recommend! [06:13] (excuse the first page, which isnt useful) [06:15] looking back at it, my explanation is a bit verbose -- basically, i am describing a way of breaking down a large grammar into many smaller roles which can be composed together, mixed and matched, etc. it makes it possible to model full languages, etc. useful for really anything you might encounter [06:17] nice, i'll def check it out [06:17] np! enjoy! [06:18] looks like it's in html format, is there a link? [06:18] oh, yea that's just the first page [06:19] it is literally just a formatted scrape of all the pod files in the raku-doc repository [06:19] so that it can be printed [06:19] rest is pod [06:19] for me, it made it easier to understand as a unit [06:19] yeah pretty much [06:19] there might be some odd formatting blips like that, but the information is more or less all there [06:19] can you post a text doc that I can covert? [06:21] https://github.com/Raku/doc/tree/master/doc [06:21] so is that the same documentation on the website? [06:21] i think so yes [06:21] i think it is the source for the website [06:22] not totally sure how/when it is managed/synced [06:23] so that pdf is basically a giant scrape of the website content as pod [06:23] oh, i missed the part where you said you "made this scrape" [06:23] it was done by just catting together all the pod files in that directory, running it through vim for the syntax highlighting, printing to xhtml and converting to pdf [06:23] yeah, i've been going over the online documentation quite a bit [06:23] i thought it was nice to be able to print it, go offline, carry it around, mark it up, etc while i initially learned [06:23] that way i wouldnt consume it piece by piece online [06:24] but could actually get it in one shot [06:24] what explanation were you referring to, then? [06:24] what do you mean? [06:25] you said looking back you think your explanation was too long [06:25] oh, i meant what i was describing about the grammars/roles etc above [06:25] the explanation before i sent the pdf link [06:25] i was describing how to decompose a large grammar into a set of roles [06:25] ok, gotcha. i thought you were sending me a basic overview of how raku works [06:26] yea, that is the pdf! [06:26] that will describe pretty much everything [06:26] heh, well, I wouldn't call that basic [06:27] like learning to swim by jumping in the deep end! [06:27] it was actually pretty helpful to just hit the docs all in one shot right at the beginning [06:27] i dont remember everything from them [06:27] but i have this feeling in my mind when something should be possible [06:27] that works for some who operate in a different symbolic plane than most mortals [06:27] now i just started thinking in unicode [06:27] "different symbolic plane" 🀣 [06:27] but yeah, it's good to at least know what's out there even if you don't understand it right away [06:28] a "known unknown" [06:28] exactly [06:28] my method is a little different [06:28] i start at the shallow end [06:29] then I get scared and wander back to the ankle deep water [06:29] then I get brave and wade out a few more feet, get scared, then come back. repeat forever. [06:30] it is a good way haha [06:30] need one of those floating foam things [06:30] eventually, I'm swimming, but usually just because I'm flailing my arms around like a nut [06:32] with raku, there are so many pieces which can make your life much easier a bit farther out [06:32] yeah, I definitely get that sense. [06:33] then I come back and use perl and php and I'm like, this is so damn easy. [06:33] but tedios [06:33] but tedious [06:33] raku is like a meta language in some respects [06:33] im at the point where i wouldnt even attempt a thing in another language because i have raku [06:34] when i say meta langauge im referring to how grammars, rules, regexes are so well thought out and integrated into the core [06:34] yeah, I get that. but I gotta use it a lot and basically rewire my brain to think like that [06:34] one great way is to translate something from one language into another with raku [06:35] and then never repeat steps, so write raku functions for everything you find yourself repeating [06:35] eventually u just get so fast doing taht [06:35] i've been writing my new scripts in raku (but not bash scripts, too slow) [06:35] me too [06:36] i have basically completely dropped bash, python, awk, perl, etc etc for raku [06:36] i wrote a couple of raku modules in my first week or two. Nothing fancy. but I impressed myself [06:36] you write bash scripts with raku? [06:36] yep, everything in the shell [06:36] i have consolidated everything to raku and rust [06:37] the start up time is too slow for me with raku. [06:37] those two languages are like a perfect pair in some ways [06:37] probably a way around it but I don't know it [06:37] yeah, i feel that too [06:37] it would be nice if it was blazing fast [06:37] right now it is like a super utility to me [06:38] i'm sure it'll get there eventually [06:38] if i need to deploy something or want it fast/safe i just use rust [06:38] but raku for everything else [06:38] raku is the glue [06:38] yeah, rust is getting into linux core now [06:38] like a replacement for c I guess, in some cases [06:38] i think it does that job well [06:38] replacing c/c++ [06:40] when I become a real programmer I'll check it out [06:40] when is that? 😁 [06:40] i just don't have any real need to do any low level stuff [06:40] hopefully within a couple more years. I decided to get serious about it a few years ago [06:40] always just been a dabbler for the most part [06:42] what do you like to use it for? [06:42] programs, that is [06:42] programs (and programming languages), that is [06:42] knew enough to hack someone else's php code or javascript or write bad spaghetti code in perl, but that was about it [06:42] what do I use raku for? major think I'm working on right now is processing my markdown files that I publish [06:44] building a hyper efficient system for writing and shareing notes in a wiki: https://climatechangechat.com [06:44] raku will be my glue language for this project [06:44] sounds like a good use case for raku! it is the best for anything with text! [06:44] https://climatechangechat.com/raku-programming-language.html [06:44] yeah, so far I'm liking it. just a lot of work to get proficient with it. [06:44] nice! i subscribed to your youtube [06:45] just started using Comma IDE which I determine is a must have. [06:46] thanks! yeah, I had to stop doing those for a bit. too much stuff going on but I plan to start it up again. on hiatus for at least a couple more months [06:47] what kind of stuff do you write? [06:49] writing some compilers/transpilers [06:49] so i do the parsing layers in raku [06:50] yeah, you're hard core [06:50] i just love it haha [06:50] grammars were totally foreign to me because I never had to write anything like a parser before [06:50] i used raku to translate a synthesizer from c++ to rust [06:50] but I do enjoy processing text for whatever reason [06:50] then i started using raku to read back the rust program [06:50] so i started to feel like raku could be used to read programs [06:50] yeah, that kind of stuff is nuts [06:51] break them down into their constituent parts, to fully understand the components [06:51] and then rearrange them to suit new tasks [06:51] so that started to turn into a compiler system [06:52] grammars were totally foreign to me when i first saw them too [06:52] and then i realized they solve this problem i had all the time anyway [06:52] in some way everything is parsing [06:52] I've read enough about compiling to know it's ridiculously complicated [06:52] squeezing out efficiences and that kind of thing [06:52] it can teach so much about how to write better programs and do more with the machine [06:53] yeah, I can imagine [06:53] first it has to understand the structure of the programs it encounters [06:53] I get the big picture, but almost no details [06:54] but then, all of this information gets built in which reflects more specific knowledge about how each architecture/target works [06:54] i can imagine once you learn that, everything else is just child's play [06:54] my kid just started freshman year in college. I'm jealous [06:54] computer science [06:55] haha wow freshman year of college -- i'd run it back πŸ™‚ [06:55] congrats [06:56] yeah, he seems to enjoy it, but not the calculus courses. [06:58] alright, 3am here. gotta head off to bed. thanks for the chat. catch you later [06:58] night! [08:07] *** dakkar joined [09:01] *** MasterDuke left [09:11] *** MasterDuke joined [12:11] *** razetime joined [12:22] *** discord-raku-bot left [12:23] *** discord-raku-bot joined [14:17] *** zacts joined [14:19] what's a good text or resource to learn how to program raku for a complete beginner thru advanced? [14:28] https://www.reddit.com/r/rakulang/comments/teimhl/what_are_the_best_materials_for_learning_raku/ lists a few [14:30] thanks [16:23] *** discord-raku-bot left [16:23] *** discord-raku-bot joined [16:47] *** dakkar left [17:00] Is the Perl6 book still worth a look or is it too old? I’m thinking it’s probably the highest quality book but may be too far out of date. [17:03] *** razetime left [17:09] *** zacts left [17:47] *** zacts joined [18:01] *** zacts left [18:04] stevied if you mean Think Perl 6 (aka Think Raku), that *is* pretty much up-to-date [18:05] also Learning Perl6 is also pretty much up-to-date