[00:29] *** epony left [00:30] *** epony joined [00:36] *** tejr left [00:38] *** tejr joined [01:03] *** pamplemousse joined [01:19] *** pamplemousse left [01:28] *** xinming_ left [01:29] *** xinming_ joined [01:35] *** mowcat left [01:52] *** epony left [01:57] *** epony joined [01:59] *** epony left [02:00] *** epony joined [02:04] *** rbt left [02:06] *** Manifest0 left [02:06] *** Manifest0 joined [02:41] *** Xliff joined [02:42] Hi. I am trying to run my own RakuAST examples, but I keep getting errors that I am not seeing when I run files in t/12-spectest [02:42] I do this `RAKUDO_RAKUAST=1 perl6 test-ast.pl6` [02:43] And I get this error: "Cannot find method 'typed_panic' on object of type Raku::Grammar" [03:15] *** holli__ left [03:38] *** ensamvarg3 joined [03:43] *** benlit left [03:44] *** Black_Ribbon left [03:44] *** benlit joined [03:50] *** frot-lab joined [04:08] *** holli__ joined [04:15] *** benlit left [04:17] *** benlit joined [04:27] *** MilkmanDan left [04:33] *** mrsolo left [04:46] *** mrsolo joined [05:11] *** holli__ left [05:49] *** MilkmanDan joined [05:58] *** AlexDaniel joined [05:58] *** AlexDaniel left [05:58] *** AlexDaniel joined [05:58] codesections: hey [05:59] 2020-10-02T20:36:37Z #raku AlexDaniel: Yes. That's what I meant [05:59] *** tejr_ joined [06:01] *** tejr left [06:01] *** tejr_ is now known as tejr [06:17] *** AlexDaniel left [06:28] *** ensamvarg3 left [06:44] jnthn: ^^ Errors when attempting to run RakuAST code from branch [06:44] Xliff, I'll pass your message to jnthn [06:45] *** skids left [07:00] *** sena_kun joined [07:01] *** grep0r left [07:11] *** kylese joined [07:34] *** xinming_ left [07:34] *** xinming_ joined [07:37] Greetings! Sorry, probably I can't see the wood for the trees. But if there is, what is the recommended and native way of editing one single line or a few lines in a text file, preferable without re-writing the whole file, e.g. to (un-) comment some lines? (Or is it intended to call external tools, like 'sed'?) [07:39] my @lines = "fname".IO.lines; @lines[whatever] = '# ' ~ @lines[whatever]; spurt "fname", @lines.join("\n") [07:59] *** oodani left [07:59] moon-child, thank you! Works good. [07:59] *** oodani joined [08:06] *** epony left [08:35] *** rindolf joined [08:42] *** epony joined [08:48] *** frot-lab left [08:59] *** xinming_ left [09:00] *** xinming_ joined [09:00] *** aborazmeh joined [09:00] *** aborazmeh left [09:00] *** aborazmeh joined [09:00] *** rbt joined [09:07] *** aindilis` joined [09:07] *** orinthe3 joined [09:08] *** orinthe left [09:08] *** orinthe3 is now known as orinthe [09:08] *** aindilis left [09:08] *** cpan-raku left [09:11] *** cpan-raku joined [09:11] *** cpan-raku left [09:11] *** cpan-raku joined [09:26] *** [Sno] joined [09:27] *** sftp left [09:28] *** natrys joined [09:29] *** sno left [09:31] *** Sgeo_ joined [09:31] *** esh joined [09:33] *** esh_ left [09:33] *** Sgeo left [09:34] *** benlit left [09:34] *** benlit joined [09:35] *** sftp joined [09:37] *** xinming_ left [09:39] *** xinming_ joined [09:42] *** Altai-man joined [09:43] *** molaf joined [09:44] *** sena_kun left [09:51] *** holli__ joined [09:52] *** jakar joined [10:02] *** xinming_ left [10:03] *** xinming_ joined [10:06] *** Altreus_ joined [10:08] *** codesections left [10:08] *** codesections joined [10:08] *** Altreus left [10:26] *** xinming_ left [10:27] *** xinming_ joined [10:29] *** xelxebar left [10:30] *** xelxebar joined [10:40] *** xinming_ left [10:40] *** xinming_ joined [10:50] *** Sgeo_ left [11:07] *** andrzejku joined [11:16] *** xinming_ left [11:16] *** xinming_ joined [11:27] *** rir left [11:27] *** k-man left [11:28] *** rir joined [11:34] utterly baffled here. This morning I installed IO::String to help write some tests. Presumably when I did so it passed all its tests. But when I try to use “say” on an IO::String, I always get “Cannot do 'say' on a handle in binary mode”. But looking at the IO::String tests, they are almost ALL using say. What gives? [11:37] *** xinming_ left [11:37] *** xinming_ joined [11:44] colomon_, maybe the "String context operator" '~' ? (https://docs.raku.org/routine/~) (https://github.com/hoelzro/p6-io-string/) [11:54] *** k-man joined [11:56] *** Kaiepi left [11:58] *** Kaiepi joined [11:59] kylese: othedr way around: my $file = IO::String.new; $file.say: “Hello”; # fails with above message [12:01] *** andrzejku left [12:06] *** holli__ left [12:08] *** Kaiepi left [12:11] *** leont joined [12:11] *** Kaiepi joined [12:16] *** Kaiepi left [12:18] *** k-man_ joined [12:19] *** k-man left [12:19] *** xinming_ left [12:21] *** xinming_ joined [12:30] *** Kaiepi joined [12:39] *** k-man__ joined [12:40] *** k-man_ left [12:41] *** xinming_ left [12:41] *** xinming_ joined [12:42] *** holli__ joined [12:45] *** mowcat joined [12:57] *** jakar left [12:57] colomon_, my $file = IO::String.new; $file = open 'output.txt', :w; $file.say: “Hello”; $file.close; ? [12:59] that doesn't use IO::String though [12:59] *** andrzejku joined [12:59] $file is immediately overwritten with a regular IO::Handle [13:00] *** natrys left [13:09] *** Kaiepi left [13:09] *** Kaiepi joined [13:21] *** __jrjsmrtn__ joined [13:23] *** _jrjsmrtn left [13:33] *** guest74637 joined [13:42] *** sena_kun joined [13:44] *** Altai-man left [14:12] *** rir_ joined [14:14] *** rir left [14:19] *** k-man joined [14:20] *** k-man__ left [14:36] *** vike left [14:46] Will there be a code path for converting RakuAST to bytecode? What about the inverse operation? [14:52] RakuAST currently produces QAST, so the old compilation chain that produces MAST and MovarVM bytecode also applies to it [14:53] no idea about deparsing bytecode; I think that's pretty much separate from RakuAST [14:56] *** holli__ left [14:57] *** vike joined [15:01] *** domidumont joined [15:07] *** kylese left [15:11] *** vike left [15:15] *** aindilis` left [15:16] *** aindilis joined [15:16] *** holli__ joined [15:20] *** domidumont1 joined [15:22] *** domidumont left [15:28] *** aborazmeh left [15:28] *** ggoebel left [15:38] *** zacts joined [15:39] *** vike joined [15:50] *** holli__ left [15:52] *** holli__ joined [15:55] *** aindilis left [16:04] *** aindilis joined [16:09] ¦ ecosystem: gfldex++ created pull request #553: add Operator::DynvarOr [16:09] ¦ ecosystem: review: https://github.com/Raku/ecosystem/pull/553 [16:14] *** xinming_ left [16:14] *** xinming_ joined [16:21] ¦ ecosystem: a8039ef243 | (Wenzel P. P. Peppmeyer)++ (committed using GitHub Web editor) | META.list [16:21] ¦ ecosystem: add Operator::DynvarOr [16:21] ¦ ecosystem: review: https://github.com/Raku/ecosystem/commit/a8039ef243 [16:21] ¦ ecosystem: ddbeefc73f | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list [16:21] ¦ ecosystem: Merge pull request #553 from gfldex/patch-8 [16:21] ¦ ecosystem: [16:21] ¦ ecosystem: add Operator::DynvarOr [16:21] ¦ ecosystem: Gonna merge this. Will figure it out later. [16:21] ¦ ecosystem: review: https://github.com/Raku/ecosystem/commit/ddbeefc73f [16:24] *** hankache joined [16:26] *** holli__ left [16:36] *** klebs joined [16:36] hi everybody! [16:37] i was writing some raku just now, and i thought of a bit of syntax which would sometimes be very useful to me in my codebases [16:37] i thought id post it in here to see what you all think! [16:37] in some of my c and c++ programs, we could do something like this: [16:37] *** virtualsue joined [16:38] #if 0 [16:38] do_something(); [16:38] #else [16:38] do_something_else(); [16:38] #endif [16:39] i liked that syntax quite a bit, because i could flip that bit at compile time from zero to one to easily toggle which path the code took at runtime [16:39] *** virtualsue left [16:39] to me, it is much different than writing: [16:39] if 0 { do_something(); } else { do_something_else(); } [16:41] because that second way happens completely at runtime. to me, it indicates stylistically that it might be valid for one instance of the program to take either path at runtime [16:41] right now, in raku, i am basically just using block comments to comment blocks of code like so: [16:41] =for comment [16:41] **wait wrong keyword 'for', lets try this again: [16:42] =begin comment [16:42] stuff_i_dont_want_right_now(); [16:42] =end comment [16:43] this is pretty good, but missing the flexibility of the c preprocessor stuff i described above [16:45] cutting right to the chase, what i am looking for is a clean way to switch between one of several blocks of code at *compile time*, with the same sort of semantics as the c preprocessor #if statements [16:46] klebs, I am not sure words "flexibility" and "c preprocessor" are so close. The problem (IMO) is that the preprocessor is a completely separate language which knows absolutely nothing about actual code. Thus it is not only a horrible scary pain for everyone writing tooling, but also additional layer of complexity for the reader. E.g. you have variables A if Foo, but variables B if Bar, then you do some stuff with them without having even a real visual [16:46] difference (such as in if blocks, for example). [16:47] totally agree :) [16:47] klebs, is there a reason for e.g. conditionals to be strictly compile-time? [16:48] klebs: can't experiment myself right now, but the BEGIN phaser might be helpful [16:48] I wonder if our optimizer is clever enough to do a right thing in `if True {} else { (something very big) }` [16:48] really, at this moment, i would like a way to indicate to myself as the program writer that i am trying out several different options of code paths for this algorithm. only one of which is ever going to make it into the final program [16:49] the c preprocessor is ugly and hackish enough that it indicates to me that something needs to be cleaned up :) [16:49] actually, i take back the term 'ugly' [16:50] but 'hackish', i keep [16:50] i basically want a switch that i can flip *only during development* that indicates "take one of two paths" [16:51] the mechanism could be more flexible than "take one of two", but this is the common case, for me [16:51] *** hankache left [16:51] i basically want to know, whenever i look at that bit of code, no matter how far in the future, that i was experimenting with something and the two branches should never coexist at runtime [16:52] *should never coexist at runtime, or even in the final compilation unit [16:52] the c preprocessor was nice for this, but all that token pasting stuff was icky [16:53] there could already be something in raku that does exactly this or better, im just not quite sure what to grep for [16:54] maybe someone here has a trick they use for this kind of thing which is even better? [16:54] Raku is different in this regard, as, of course, modules are precompiled, but you cannot really divide sources and executables. [16:55] So you can't do "I compiled it with flag foo, so now this flag is immovable", because the user will 1)compile it; 2)if needed, recompile it. Not consume a ready executable. [16:55] So not really sure what to suggest except comments. [16:55] *** pamplemousse joined [16:57] ah, yeah that makes total sense [16:57] You can e.g. populate a constant with e.g. env var and then use it in conditionals. And this constant will be compile-time. But user will be able to run it with e.g. env var set to something different and will have different results. [16:58] Oops, last "run" implies "compile and run". [16:58] at the end of the day, this is not exactly an essential feature, as i could write something like: [16:58] if 1 { [16:59] take_path_one(); [16:59] else{ [16:59] take_path_two(); [16:59] } [17:00] but it seems like the existing =begin comment feature is already so close to what i am looking for [17:03] what my mind wants to put in that spot is something that sounds like, "if 1, comment, else uncomment" [17:04] but that also does not indicate that i want a runtime "if" [17:04] the differences between these cases are indeed quite subtle, but i think important [17:05] it could be something like: [17:05] =begin comment(True) [17:05] codepath1(); [17:05] =else [17:05] *** xinming_ left [17:05] codepath2(); [17:05] =end comment [17:06] *** xinming_ joined [17:06] a slang can be made for this purpose [17:08] *** domidumont1 left [17:09] ah, this looks promising! [17:09] otherwise, your two paths could be in different modules and you can comment one use statement and uncomment the other, or use the "if" module if that still works and hasn't bit-rotted [17:09] or use a sub EXPORT to decide what to export [17:10] *** pamplemousse left [17:10] thank you, these are all useful leads [17:11] creating a slang seems quite interesting to me, but I dont know very much about them. my understanding is that they can be used to modify the underlying grammar [17:11] of course building a slang is a little bit of work [17:11] that's right [17:12] there are slangs that add new stuff, like Slang::SQL, and there are slangs that modify existing stuff, like Slang::Tuxic [17:12] You shouldn't give up on D1 [17:13] the string formatter for DateTime is rounding - isn't it more conventional to just truncate? [17:13] You can develop two languages ​​at the same time like perl and raku. [17:14] Let them compete [17:14] @timotimo the fact that this can even be done in raku is why I am 100% sold on raku, its infrastructure, and its ecosystem for the century [17:15] absolutely top notch functionality. this is the absolute highest caliber of engineering. i love raku [17:15] the argument against slangs is that you can make your code unreadable and unmodifiable for other developers, be that devs from the outside like opensource contributors, or devs from your team or company [17:15] yeah, totally get that :) [17:16] .oO ( another argument against slangs is they are not compatible with editors. totally so ) [17:17] comma gotta fix this man [17:20] what are your thoughts on raku macros? I have read a few articles about them but have not yet fully understood [17:21] lizmat: looks like you worked on time stuff. why is there rounding instead of truncating? [17:25] what are modern raku books? [17:26] or best resources to learn [17:26] https://github.com/Raku/doc [17:27] ^that was incredibly useful to me [17:27] very high quality information [17:28] ok [17:31] I am still learning perl😂 [17:35] have a nice day everybody! [17:36] thank you for the help sena_kun and timotimo! [17:36] *** klebs left [17:36] *** xinming_ left [17:38] *** xinming_ joined [17:41] *** Altai-man joined [17:43] *** mowcat left [17:43] *** oneeggeach joined [17:44] *** sena_kun left [17:50] *** domidumont joined [17:54] *** skids joined [17:56] *** xinming_ left [17:56] *** xinming_ joined [18:02] *** xinming_ left [18:02] *** xinming_ joined [18:03] *** domidumont left [18:14] *** andrzejku left [18:18] *** xinming_ left [18:18] *** holli__ joined [18:18] *** xinming_ joined [18:29] *** zacts left [18:30] *** oneeggea_ joined [18:34] *** oneeggeach left [18:40] *** xinming_ left [18:41] *** xinming_ joined [18:42] *** Xliff left [18:51] *** xinming_ left [18:51] *** xinming_ joined [18:54] *** oneeggeach joined [18:57] *** oneeggea_ left [19:02] *** Sgeo joined [19:02] *** xelxebar left [19:02] *** xelxebar joined [19:14] colomon_, (As of @ 2 months ago.) Gnome::Gtk3 seems pretty good. I didn't know gtk at all, so found it a large bite. GTK::Simple was missing a couple widgets I felt necessary. [19:22] *** rir_ left [19:24] rir_++ [19:26] *** nige left [19:27] *** nige joined [19:28] *** |Sno| joined [19:30] *** zacts joined [19:31] *** [Sno] left [19:44] *** rindolf left [19:58] *** mowcat joined [20:26] *** oneeggeach left [20:29] *** zacts left [20:35] *** cpan-raku left [20:36] *** cpan-raku joined [20:36] *** cpan-raku left [20:36] *** cpan-raku joined [20:38] *** Altai-man left [20:41] *** xinming_ left [20:42] *** xinming joined [22:01] *** wamba joined [22:26] *** xelxebar left [22:27] *** xelxebar joined [22:35] *** skids left [22:49] *** guest74637 left [23:08] *** leont left [23:09] *** xinming left [23:10] *** xinming joined [23:17] *** xinming left [23:18] *** xinming joined [23:31] *** rbt left [23:49] *** wamba left [23:50] *** mowcat left