🦋 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.
bscan @ugexe I just added a new version of the Raku Navigator. Now you can disable syntax checking by setting "raku.syntaxCheckEnabled" to false. 01:21
ugexe <bscan> ideally i wouldn't have to use separate workspaces + options so that I can switch between developing various raku modules (where i wantn syntax checking) and core code (which doesn't work with syntax checking) 01:24
im not sure there is a good way to detect when someone is working on core rakudo code though
bscan I think different workspaces is probably the best possible unless we have a reliable way of detecting core rakudo code. The syntax checker is written in Raku, so the tests could be added there if we come up with any. 01:31
SmokeMachine I've been playing with `HTML::Component` and databases... it seems to be very easy to use `HTML::Component` + `Cro` + `Red`. Does anyone want to give a try? github.com/FCO/HTML-Component/tree...s/todo-red 01:46
SmokeMachine Voldenet: Here's a todo example using database (Red): github.com/FCO/HTML-Component/tree...s/todo-red 03:07
Voldenet SmokeMachine: that's actually quite nice, the only thing I think this example is missing is autogenerating forms from the endpoint 04:01
m: sub new-todo (Str :$description) { }; sub endpoint-form($s) { $s.signature.params.map({ $_.type ~~ Str ?? "input $_.name" !! "" }).say }; endpoint-form(&new-todo) 04:03
camelia (input Parameter<5797307079808>.name)
Voldenet something like this perhaps
SmokeMachine Voldenet: thanks! I like your idea! I think I’ll make it possible to `.form` receive an Endpoint… read the params from it and generate the form… so, in that case one could just do: ```.form: self.new-todo``` 09:23
librasteve good problem solver on LSP etc … fwiw I have used both the comma plugin and the comma standalone … comma plugin struggles since it cannot be used with latest intellij release and also comma standalone is a much nicer experience (for raku) 09:27
any real workflow would likely need the plugin since raku is likely to be an add on tool (for grammar, cli, unicode) before it is the one and only 09:29
so imo we are talking (LSP) plugin (which intellij / jetbrains can consume) vs comma plugin 09:30
i would vote to put all the wood behind the LSP arrow … 09:32
antononcube At first I used Comma’s plugin, but since it did not work with the latеst IntelliJ releases, I started using the Comma app. I use VS Code only for/with Jupyter notebooks. 12:51
(I do not like Jupyter that much. I started to use it much more often because of the chat-enabled notebooks. I prefer VS Code’s Jupyter extensions to the Web browser Jupyter, and the Jupyter plugin of IntelliJ.) 12:54
SmokeMachine I think after making form be auto generated with Endpoint, I'll try to find a good way to add components that are not root and then add stuff like sessions to it... any idea/suggestion? 13:47
antononcube @SmokeMachine Sorry for the following ignorant question about "Red" -- you might have answered it already. 13:57
SmokeMachine What question? 13:58
antononcube Patience, please! 🙂 I am typing it in.
SmokeMachine Oh, sorry 13:59
antononcube Manually, by myslelf, whithout LLM support...
Do you have any benchmarks for "Red" ? (E.g. speed vs database sizes vs type of queries.) Do you do certain internal indexing or other optimizations for faster query execution? (Maybe, that is "standard" for ORM systems.) 14:01
@SmokeMachine So, I put two questions in, since you are impatient!! 14:02
SmokeMachine > Do you have any benchmarks for "Red" ? 14:11
No, I don't. I make the queries be the simplest possible ones and hope for the better... :)
> Do you do certain internal indexing or other optimizations for faster query execution?
What I try to do is some query optimization, mostly because of the why I "interpret" code blocks... then I try to merge most branches possible... most of my "optimizations" are [here](github.com/FCO/Red/tree/master/lib...Optimizer) and when calling a query, I have a [optimization step](github.com/FCO/Red/blob/master/lib...kumod#L82) to optimize qhe query AST per driver (but isn't doing anything
currently).
I've been waiting until my "block iterpretation" be done using RakuAST to start really doing some optimizations and benchmarks, but until there that's not something I'm doing...
antononcube: ☝️ 14:12
SmokeMachine currently the code blocks are "read" and the query generated at run time... it will NOT perform very well... but the intention is, with RakuAST, make it run at compile time and, with that, make it perform as fast any sql query... 14:24
antononcube Great, thank you for the detailed explanations!
SmokeMachine *for the best 14:26
this (github.com/FCO/Red/blob/master/lib...d#L56-L96) is how we "convert" a block of code into Red::AST... and we do that ar runtime... it CANNOT be fast... 14:29
(and please, if someone have any idea/suggestion on how to make that faster... please let me know!)
I mean, that and all these operators: github.com/FCO/Red/blob/master/lib...rs.rakumod 14:33
but my intention is when I start using RakuAST (if possible) to convert all blocks I'll use on my queries into Red::AST on compile time and cache the query generated by it when running the query... 14:40
SmokeMachine so, when I do `Model.^all.grep: *.column > 1` it become something like this at compile-time `do given Model.^all { .grep: *.column > 1, :red-ast($ = Red::AST::Gt.new(:left(.of.column), :right(Red::AST::Value.new(:type(Int), :1value))) }`... but I don't even know if something like that is/will be possible... 14:56
That was the reason I started playing with github.com/FCO/RakuAST-Matcher a few time ago... 14:59
antononcube Hmm... raku-ast reminds me the Raobin Williams impersonation of raccoons that swear with the phrase "green asshole!" 15:41
www.youtube.com/watch?v=nNBxi8_ySbU 15:42