🦋 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:03 reportable6 joined 01:03 committable6 left, bloatable6 left, bisectable6 left, tellable6 left, releasable6 left, benchable6 left, quotable6 left, evalable6 left, statisfiable6 left, reportable6 left, shareable6 left, nativecallable6 left, sourceable6 left, linkable6 left, coverable6 left, unicodable6 left, squashable6 left, greppable6 left, notable6 left, bisectable6 joined, evalable6 joined, statisfiable6 joined, squashable6 joined, notable6 joined 01:04 nativecallable6 joined, tellable6 joined, quotable6 joined, shareable6 joined, benchable6 joined 01:05 releasable6 joined, coverable6 joined, unicodable6 joined, sourceable6 joined, linkable6 joined, committable6 joined, bloatable6 joined, reportable6 joined 01:06 greppable6 joined 01:16 Tirifto left 01:31 razetime joined 01:44 Tirifto joined 02:02 Sgeo joined 02:07 razetime left 02:13 razetime joined 02:30 hexology left 02:47 razetime left 02:52 Xliff left 03:09 razetime joined 03:36 razetime left
SmokeMachine RakuCron now uses Lumberjack as logging framework, internally but you can also use it for your jobs (ex: github.com/FCO/RakuCron/blob/main/...kuconfig). Now I'm thinking in a way to reuse the rules when the configuration file changes (currently it drops all the rules and created new ones). Is there a way to se if 2 Callables are equivalent? Because that's the thing avoiding it to know if a rule has changed or not 03:38
m: my &a := { 42 }; my &b := { 42 }; say &a env &b 03:39
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> my &a := { 42 }; my &b := { 42 }; say &a⏏ env &b
expecting any of:
infix
infix stopper
postfix
statement …
SmokeMachine m: my &a := { 42 }; my &b := { 42 }; say &a eqv &b
camelia False
SmokeMachine maybe I should store the AST of the current version and compare if that's the same as the new one... 03:40
04:36 evalable6 left, linkable6 left 04:37 evalable6 joined 04:39 linkable6 joined 05:29 silug left 05:32 silug joined 06:00 reportable6 left 06:02 reportable6 joined 06:39 siavash joined 07:02 codesections left 07:26 jpn joined 07:42 siavash left 07:43 siavash joined, sena_kun joined 08:10 teatwo left 08:12 teatime joined 08:16 teatwo joined 08:17 teatwo left, teatwo joined 08:19 teatime left 08:38 Sgeo left 08:41 jpn left 09:14 razetime joined 09:17 razetime left 09:59 jpn joined 10:18 jpn left 10:22 jpn joined 10:59 jpn left 11:02 jpn joined 11:33 jpn left 12:00 reportable6 left, reportable6 joined
leont Just noticed fez seems to support reset-password but not change-password, that seems wrong 12:38
12:49 siavash left 12:56 jpn joined 13:00 jpn left
vrurg .tell SmokeMachine Saw your question about callables. I don't know what and how RakuCron does, but if your callables were generated from a source then why wouldn't you preserve it (or it's hashsum) and compare the source? 13:29
tellable6 vrurg, I'll pass your message to SmokeMachine
14:00 evalable6 left, linkable6 left 14:01 linkable6 joined 14:02 evalable6 joined 14:08 jpn joined 14:19 jpn left
SmokeMachine . 14:21
tellable6 2023-08-13T13:29:17Z #raku <vrurg> SmokeMachine Saw your question about callables. I don't know what and how RakuCron does, but if your callables were generated from a source then why wouldn't you preserve it (or it's hashsum) and compare the source?
SmokeMachine vrurg: because I don’t want to say it’s different if the only thing that has changed is a comment, for example. 14:22
vrurg AST may not be capable of parsing the code yet because RakuAST is not complete. But otherwise it's an option. 14:26
SmokeMachine vrurg: currently, what I do is: I have a supply from notification on the file changes, then for each change I EVAL its content and emit the generated object, and just use .squish to avoid repeating objects one after the other. That’s made by my Configuration module, but RakuCron have Callables inside those objects… then it thinks all objects are different… 14:30
My idea with the ast would be compare it before running the code, as a new step… but yes, if it may not run every code, that’s not a solution yet… 14:33
vrurg SmokeMachine: There is more reliable but implementation-dependent solution. You can produce textual dump of AST using the compiler and get a digest from it. Slower path is to use `rakudo --target='ast' -e <your code>`. Faster path is to get the compiler object and do like EVAL does. 14:34
Except that EVAL is using :from<stage>, you'd need :target<ast> and then .dump the resulting QAST tree. 14:37
SmokeMachine vrurg: interesting… I’ll try that… 14:41
antononcube @SmokeMachine This partial statement by vrurg: “I don't know what and how RakuCron does […]” can be used as a motivator to write a mission statement for “RakuCron”. 14:44
14:57 vrurg_ joined, vrurg left
SmokeMachine antononcube: English is not my primary language and I’m quite bad on it. That’s the reason most of my projects have bad documentation (if any) and I usually left to write it when I’m sure of the API, to not have to write that again… but I do agree that’s needed. I’ll try to spend some time doing that. Thanks 14:57
antononcube Good luck! Also, excuses, excuses… use use OpenAI/ChatGPT or Bard/PaLM to jump-start documentation and/or correct grammar. 15:05
15:32 Xliff joined
Xliff \o 15:32
SmokeMachine: Consider taking the string representation of your code, running it through .AST and then walking the tree and dropping all of the comment nodes. 15:35
Then you can use the result for your comparisons.
m: q|my $a = 1; #`( why would I ever write an inline comment here? ); my $b = 2|.AST.gist.say 15:36
camelia RakuAST::StatementList.new(
RakuAST::Statement::Expression.new(
expression => RakuAST::VarDeclaration::Simple.new(
sigil => "\$",
desigilname => RakuAST::Name.from-identifier("a"),
initializer => RakuAST::Initia…
Xliff Hmm...
That comment turned into a RakuAST::Statement::Empty, which you can strip from any StatementList. 15:37
SmokeMachine: You might even be able to use your ASTGrepper for that, yes? 15:38
SmokeMachine Xliff: yes, in theory you could… maybe I need to complete that module… :( 15:47
Xliff :) 15:49
SmokeMachine If a callable stored its own asteroid it would be easier to write a eqv to it… :( 15:54
(And it would also make my life much easier with Red…) 15:58
Xliff I've actually been asking for that. 15:59
SmokeMachine What would be the problem of that? Besides the size of blocks? 16:10
Xliff Don't underestimate the amount of bloat that would cause.
You'd basically be asking for everyone to at least double the size of every Raku program in memory. 16:11
At least.
SmokeMachine Yes… maybe that’s not feasible…
Xliff I think a better way might be to identify such callables by trait.
And only use it on those callables that would benefit from or require that their ASTs are available at run-time. 16:12
s/it/said trait/
SmokeMachine For Red I’m thinking on trying to write a slang that would make all `.map({…})` into `.map({…}, :red-ast($red-ast-version-of-block))` map methods that are not from Red::ResultSeq will just ignore it and the Red::ResultSeq ones will use it to create the sql… (same for grep and first) 16:17
16:32 linkable6 left, evalable6 left 16:34 linkable6 joined 16:35 evalable6 joined 17:16 bigdata joined
Xliff SmokeMachine: Good luck! 17:39
SmokeMachine But not sure if it would work… 17:44
18:00 reportable6 left 18:02 reportable6 joined 18:46 bigdata left 19:34 guifa_ left 20:15 tea3po joined 20:18 teatwo left 21:04 Altai-man joined 21:05 sena_kun left 21:35 Altai-man left 21:37 sena_kun joined 21:51 jpn joined 22:24 jpn left 22:28 sena_kun left 22:39 Xliff left 23:19 jfrent joined, jfrent left 23:20 jfrent joined