🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
00:00 reportable6 left 00:14 NemokoschKiwi joined 00:27 NemokoschKiwi left 00:28 MasterDuke joined 00:37 Xliff left 01:04 guifa_ joined 01:26 xwu1 left 01:40 xwu1 joined 02:19 reportable6 joined 02:24 squashable6 left 02:27 squashable6 joined 03:27 coverable6 left, unicodable6 left, committable6 left, greppable6 left, linkable6 left, squashable6 left, sourceable6 left, reportable6 left, notable6 left, quotable6 left, shareable6 left, tellable6 left, benchable6 left, evalable6 left, statisfiable6 left, nativecallable6 left, releasable6 left, bisectable6 left 03:28 nativecallable6 joined, greppable6 joined, linkable6 joined, reportable6 joined, releasable6 joined, benchable6 joined 03:29 tellable6 joined, unicodable6 joined 04:05 guifa_ left 04:13 xwu1 left 04:31 committable6 joined 04:32 bisectable6 joined, quotable6 joined 04:34 shareable6 joined 04:38 coverable6 joined 04:39 sourceable6 joined 04:40 sourceable6 joined 04:43 evalable6 joined 04:45 ProperNoun left, xwu1 joined 04:55 mark22k left 04:57 mark22k joined 05:10 _________ left, _________ joined 05:24 xinming left, xinming joined 05:31 sivoais left, sivoais joined 05:53 statisfiable6 joined 05:55 deoac left 06:00 reportable6 left, reportable6 joined 06:06 xwu1 left 06:39 xwu1 joined 07:19 merp left 07:23 wayland76 joined, wayland left 07:30 init left 08:10 Manifest0 joined 08:13 notable6 joined 08:21 tea3po joined 08:24 teatwo left 09:19 squashable6 joined 09:50 Xliff joined
Xliff m: my $p = Promise.in(100).then({ say "Hi!" }); $p.break; $p.status.say' 09:51
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> ({ say "Hi!" }); $p.break; $p.status.say⏏'
expecting any of:
infix stopper
statement end
statement …
Xliff m: my $p = Promise.in(100).then({ say "Hi!" }); $p.break; $p.status.say
camelia Access denied to keep/break this Promise; already vowed
in block <unit> at <tmp> line 1
Xliff m: my $p = Promise.new; $p.in(100).then({ say "Hi!" }); $p.break; $p.status.say
camelia Invocant of method 'in' must be a type object of type 'Promise', not an
object instance of type 'Promise'. Did you forget a 'multi'?
in block <unit> at <tmp> line 1
Xliff m: my $p = Promise.in(100).then({ say "Hi!" }); my $v = $p.vow; $p.status.say 09:52
camelia Access denied to keep/break this Promise; already vowed
in block <unit> at <tmp> line 1
Xliff So if I'd like to use a promise as a timeout mechanism... what's the trick to getting a vor out of Promise.in?
lizmat looking at the code, it looks like it is using a vow to allow the Promise to be kept by the timing mechanism only 09:56
so why would you need another vow?
Xliff No. I'd want a way to cancel a Promise.in() 09:57
That way it could funciton as a timeout mechanism.
That might be mauling Promise a bit though, so if you have another suggestion, I would greatly appreciate it! 09:58
lizmat well, usually you'd use the Promise.in together with another Promise that you *can* keep, and then use .any
or you could go directly to the scheduler: docs.raku.org/routine/cue
10:06 Sgeo left
Xliff Yeah. I think it's the scheduler for this one. Using await in GTK apps is a good way to lose hair! 10:11
lizmat I think raku.land/zef:finanalyst/GTK::Simple even uses its own scheduler for GTK events 10:22
github.com/Raku/problem-solving/issues/383 11:04
github.com/Raku/problem-solving/issues/384 11:06
11:06 evalable6 left, linkable6 left 11:07 linkable6 joined 11:08 evalable6 joined
nemokosch I'm immensely thankful for 383 11:13
oh my god, this is exactly the opposite direction xD 11:19
lizmat ah?
nemokosch "no version is not bleeding edge enough"
the problem is actually what you wrote down in the comment... 11:20
if the language is allowed to shapeshift without the versioning pragma, it should produce a warning at the very least
lizmat well you didn't specify a version, so you didn't care 11:21
or do you mean: there should be a warning every time you run code without a version indicator ? 11:22
nemokosch this whole mindset is so unfriendly 11:23
"you apparently didn't care if your code works or not - haha, I put a trap there, now you are caught" 11:24
this would be quite passive-aggressive in a universe where teaching Raku is ten times better
let alone in the current circumstances
lizmat how would this be worse than having someone now write a lot of code (without version) with 6.d semantics 11:25
nemokosch what happened to "it would be better to fix the language than the user?"
lizmat and then having a compiler upgrade that makes 6.e the default version, and the code breaks ?
nemokosch if it's consensually the right thing to specify use version, then let's enforce it
lizmat how would that work in the REPL or oneliners ? 11:26
tbrowder__ for module distros, the META shows the specific version
nemokosch the REPL doesn't work well anyway 11:27
the oneliners can have a flag, and also, why are we worrying about non-compunits all of a sudden, rather than the default for 99% of cases?
like really, point out the error in my reasoning 11:28
lizmat I'd rather this be done in the issue 11:29
to keep it in one place
nemokosch to be honest, I have bad experience with issues... but so be it 11:30
11:31 MoC joined 12:00 reportable6 left, Woodi left, Woodi joined 12:10 peder left, peder joined
tbrowder: have you seen my comments on the File::Find PR? 12:45
Could you take a look at them?
13:00 hythm joined
hythm m: dd "A", "🦋" ## is there a way to tell if a character is half or double width (like the difference between these two)? 13:12
camelia "A"
lizmat hythm: I think japhb has an algorithm for that in raku.land/zef:japhb/Text::MiscUtils 13:16
maybe not directly, but definitely internally :-) 13:17
hythm lizmat, Thanks, will check it out 13:19
antononcube I would be nice if “Text::MiscUtils” and “Text::Utils” are combined into one package.
13:30 guifa_ joined 13:33 ProperNoun joined
guifa_ ugh looks like i developed a parser for alphabets in cldr only for them to be about to use a new format in v44 ... to be released in like one month =/ 13:52
lizmat did the development of that parser teach you anything ? 14:09
14:14 xwu1 left 14:18 vrurg left 14:25 wayland76 left, wayland76 joined 14:40 guifa_ left 14:59 vrurg joined
guifa it taught me why they changed the format for v44 ^_- 15:13
15:31 reportable6 joined 16:02 abraxxa-home joined 16:03 abraxxa-home left 16:04 abraxxa-home joined 16:13 merp joined 16:24 stanrifkin joined 16:30 guifa_ joined 16:38 wayland joined, wayland76 left
guifa the new format is super easy too as long as they don't encode any literal combining characters and escape them properly 16:42
17:04 guifa_ left 17:12 deoac joined
lizmat guifa: well, that's something :-) 17:18
17:22 Sgeo joined
guifa Although I now realized that all the work I did to try to make things more efficient for chinese and japanese amounte to a minimal savings 17:23
There were only about 200-300 characters that were abbreviated out of a list of about 2200
go me, much efficiency, such smarts
17:54 pat_js left
gfldex lolibloggedalittle: gfldex.wordpress.com/2023/09/10/do...segfaults/ 17:54
17:54 pat_js joined 18:00 reportable6 left 18:02 reportable6 joined
Xliff gfldex: And I just left a comment... 18:31
18:38 squashable6 left 18:39 squashable6 joined 19:10 Foobar74 joined, Foobar74 left 19:29 jpn joined 19:39 jpn left 19:40 jpn joined, jpn left, jpn joined, jpn left 19:44 jpn joined 19:47 codesections joined 20:06 gugod_ left 20:07 gugod joined 20:14 abraxxa-home left, abraxxa-home joined 20:15 abraxxa-home left 20:18 codesections left 20:21 teatwo joined 20:22 teatwo left 20:23 teatwo joined 20:24 teatwo left, tea3po left 20:25 teatwo joined 20:31 jpn left 20:35 jpn joined
Xliff Given this code: class A { method b { say whereAmI; }; }; whereAmI.say; class B { method c { whereAmI.say }; }; 21:02
How can I make it so that the whereAmI sub prints "A" on the fist occurrence; "main" on the second and "B" on the third? 21:03
21:06 MoC left
MasterDuke check the depth of the callstack? 21:06
21:08 deoac left
gfldex Xliff: You be fighting the inliner. I'm afraid you will have to wait for RakuAST macros for that one. 21:10
21:11 jpn left 21:13 stanrifkin left 21:24 deoac joined 21:36 hythm left 21:43 haxxelotto joined
japhb Xliff: I can't comment there (no account), but see github.com/Raku-MUGS/MUGS-UI-CLI/b...kumod#L360 and following -- the breakdown that gfldex is doing is a subsignature, which can be separated out into a signature object that you can `where` with, which I do with `$common-args`. 22:21
tonyo do we have examples anywhere of entirely replacing the language for the rest of the file instead of doing mixins/slang? 22:22
eg once i do `use <something>` i want the rest of the file to be run through <something>'s actions
Xliff Ooooooooooo 22:26
japhb: So you can decomp via a where clause and a signature?
[Coke] tonyo: perhaps with "unit" 22:32
tonyo [Coke]: what do you mean?
i want to redefine $*LANG to use a custom grammar/actions only (and not mixin with MAIN) 22:33
[Coke] I have never tried it, but perhaps you could do a unit <something>; at the top of the file that imported the slang.
I don't think you can do that with raku 22:34
22:34 jrjsmrtn_ left
[Coke] Can I ask: what are you trying to do? 22:34
22:34 jrjsmrtn joined
[Coke] like, the use case you're trying to solve, not the technical problem you posed. 22:34
tonyo i'm only trying to solve that technical problem, i thought it might be an interesting talk to push regarding raku regexes/grammars 22:35
so i came up with a toy syntax and wondered how i might make it possible to run: use <some-lang>; <the rest of the file is written in lisp> 22:36
my guess is it needs to go down to NQP and generate AST but wondered if there was another solution 22:37
[Coke] if you want "the rest of the file", I think the syntax for things like that is "unit"; if it's use, it's lexical, so doesn't have to be rest of file 22:40
but sounds like it'd be a new thing. 22:42
tonyo ah so possible maybe on something like `use myslang { <capture this somewhere in myslang and process it> }`
[Coke] (that is, not covered by existing C<unit>s)
Right, that could work (but then it'd be a slang probably?) 22:43
... which you implied, nevermind. :)
tonyo hmm, i'll give that a shot, it seems like kind of interesting way to expand the ecosystem 22:46
23:11 Manifest0 left 23:13 wayland left