🦋 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.
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, Manifest0 joined 02:41 Xliff joined
Xliff 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`
And I get this error: "Cannot find method 'typed_panic' on object of type Raku::Grammar" 02:43
03:15 holli__ left 03:38 ensamvarg3 joined 03:43 benlit left 03:44 Black_Ribbon left, 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, AlexDaniel left, AlexDaniel joined
AlexDaniel codesections: hey 05:58
tellable6 2020-10-02T20:36:37Z #raku <Xliff> AlexDaniel: Yes. That's what I meant 05:59
05:59 tejr_ joined 06:01 tejr left, tejr_ is now known as tejr 06:17 AlexDaniel left 06:28 ensamvarg3 left
Xliff jnthn: ^^ Errors when attempting to run RakuAST code from branch 06:44
tellable6 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, xinming_ joined
kylese 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:37
moon-child my @lines = "fname".IO.lines; @lines[whatever] = '# ' ~ @lines[whatever]; spurt "fname", @lines.join("\n") 07:39
07:59 oodani left
kylese moon-child, thank you! Works good. 07:59
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, aborazmeh joined, aborazmeh left, aborazmeh joined, rbt joined 09:07 aindilis` joined, orinthe3 joined 09:08 orinthe left, orinthe3 is now known as orinthe, aindilis left, cpan-raku left 09:11 cpan-raku joined, cpan-raku left, cpan-raku joined 09:26 [Sno] joined 09:27 sftp left 09:28 natrys joined 09:29 sno left 09:31 Sgeo_ joined, esh joined 09:33 esh_ left, Sgeo left 09:34 benlit left, 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, codesections joined, Altreus left 10:26 xinming_ left 10:27 xinming_ joined 10:29 xelxebar left 10:30 xelxebar joined 10:40 xinming_ left, xinming_ joined 10:50 Sgeo_ left 11:07 andrzejku joined 11:16 xinming_ left, xinming_ joined 11:27 rir left, k-man left 11:28 rir joined
colomon_ 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:34
11:37 xinming_ left, xinming_ joined
kylese colomon_, maybe the "String context operator" '~' ? (docs.raku.org/routine/~) (github.com/hoelzro/p6-io-string/) 11:44
11:54 k-man joined 11:56 Kaiepi left 11:58 Kaiepi joined
colomon_ kylese: othedr way around: my $file = IO::String.new; $file.say: “Hello”; # fails with above message 11:59
12:01 andrzejku left 12:06 holli__ left 12:08 Kaiepi left 12:11 leont joined, Kaiepi joined 12:16 Kaiepi left 12:18 k-man_ joined 12:19 k-man left, xinming_ left 12:21 xinming_ joined 12:30 Kaiepi joined 12:39 k-man__ joined 12:40 k-man_ left 12:41 xinming_ left, xinming_ joined 12:42 holli__ joined 12:45 mowcat joined 12:57 jakar left
kylese colomon_, my $file = IO::String.new; $file = open 'output.txt', :w; $file.say: “Hello”; $file.close; ? 12:57
timotimo that doesn't use IO::String though 12:59
12:59 andrzejku joined
timotimo $file is immediately overwritten with a regular IO::Handle 12:59
13:00 natrys left 13:09 Kaiepi left, 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
Xliff Will there be a code path for converting RakuAST to bytecode? What about the inverse operation? 14:46
moritz RakuAST currently produces QAST, so the old compilation chain that produces MAST and MovarVM bytecode also applies to it 14:52
no idea about deparsing bytecode; I think that's pretty much separate from RakuAST 14:53
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, holli__ joined 15:20 domidumont1 joined 15:22 domidumont left 15:28 aborazmeh left, 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
Geth ecosystem: gfldex++ created pull request #553:
add Operator::DynvarOr
16:09
16:14 xinming_ left, xinming_ joined
Geth ecosystem: a8039ef243 | (Wenzel P. P. Peppmeyer)++ (committed using GitHub Web editor) | META.list
add Operator::DynvarOr
16:21
ecosystem: ddbeefc73f | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Merge pull request #553 from gfldex/patch-8

add Operator::DynvarOr Gonna merge this. Will figure it out later.
16:24 hankache joined 16:26 holli__ left 16:36 klebs joined
klebs hi everybody! 16:36
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!
in some of my c and c++ programs, we could do something like this:
16:37 virtualsue joined
klebs #if 0 16:38
do_something();
#else
do_something_else();
#endif
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
16:39 virtualsue left
klebs to me, it is much different than writing: 16:39
if 0 { do_something(); } else { do_something_else(); }
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:
=for comment
**wait wrong keyword 'for', lets try this again:
=begin comment 16:42
stuff_i_dont_want_right_now();
=end comment
this is pretty good, but missing the flexibility of the c preprocessor stuff i described above 16:43
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:45
sena_kun 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).
klebs totally agree :) 16:47
sena_kun klebs, is there a reason for e.g. conditionals to be strictly compile-time?
MasterDuke klebs: can't experiment myself right now, but the BEGIN phaser might be helpful 16:48
sena_kun I wonder if our optimizer is clever enough to do a right thing in `if True {} else { (something very big) }`
klebs 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
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'
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"
the mechanism could be more flexible than "take one of two", but this is the common case, for me 16:51
16:51 hankache left
klebs 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:51
*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
there could already be something in raku that does exactly this or better, im just not quite sure what to grep for 16:53
maybe someone here has a trick they use for this kind of thing which is even better? 16:54
sena_kun Raku is different in this regard, as, of course, modules are precompiled, but you cannot really divide sources and executables.
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
klebs ah, yeah that makes total sense 16:57
sena_kun 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.
Oops, last "run" implies "compile and run". 16:58
klebs at the end of the day, this is not exactly an essential feature, as i could write something like:
if 1 {
take_path_one(); 16:59
else{
take_path_two();
}
but it seems like the existing =begin comment feature is already so close to what i am looking for 17:00
what my mind wants to put in that spot is something that sounds like, "if 1, comment, else uncomment" 17:03
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
it could be something like: 17:05
=begin comment(True)
codepath1();
=else
17:05 xinming_ left
klebs codepath2(); 17:05
=end comment
17:06 xinming_ joined
timotimo a slang can be made for this purpose 17:06
17:08 domidumont1 left
klebs ah, this looks promising! 17:09
timotimo 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
or use a sub EXPORT to decide what to export
17:10 pamplemousse left
klebs thank you, these are all useful leads 17:10
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
timotimo of course building a slang is a little bit of work
that's right
there are slangs that add new stuff, like Slang::SQL, and there are slangs that modify existing stuff, like Slang::Tuxic 17:12
kiti_nomad[m] You shouldn't give up on D1
jdv79 the string formatter for DateTime is rounding - isn't it more conventional to just truncate? 17:13
kiti_nomad[m] You can develop two languages ​​at the same time like perl and raku.
Let them compete 17:14
klebs @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
absolutely top notch functionality. this is the absolute highest caliber of engineering. i love raku 17:15
timotimo 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
klebs yeah, totally get that :)
sena_kun .oO ( another argument against slangs is they are not compatible with editors. totally so ) 17:16
timotimo comma gotta fix this man 17:17
klebs what are your thoughts on raku macros? I have read a few articles about them but have not yet fully understood 17:20
jdv79 lizmat: looks like you worked on time stuff. why is there rounding instead of truncating? 17:21
andrzejku what are modern raku books? 17:25
or best resources to learn 17:26
klebs github.com/Raku/doc
^that was incredibly useful to me 17:27
very high quality information
andrzejku ok 17:28
kiti_nomad[m] I am still learning perl😂 17:31
klebs have a nice day everybody! 17:35
thank you for the help sena_kun and timotimo! 17:36
17:36 klebs left, xinming_ left 17:38 xinming_ joined 17:41 Altai-man joined 17:43 mowcat left, oneeggeach joined 17:44 sena_kun left 17:50 domidumont joined 17:54 skids joined 17:56 xinming_ left, xinming_ joined 18:02 xinming_ left, xinming_ joined 18:03 domidumont left 18:14 andrzejku left 18:18 xinming_ left, holli__ joined, 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, xinming_ joined 18:54 oneeggeach joined 18:57 oneeggea_ left 19:02 Sgeo joined, xelxebar left, xelxebar joined
rir_ 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:14
19:22 rir_ left
colomon_ rir_++ 19:24
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, cpan-raku left, 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