00:21
oodani left
00:25
oodani joined
00:54
marcprux joined,
marcprux left
03:11
derpydoo joined
03:33
apogee_ntv left
03:34
apogee_ntv joined
04:13
Aedil joined
05:32
Sgeo_ left
06:04
disbot3 joined
06:08
disbot2 left
06:12
apac joined
06:36
apac left
06:49
abraxxa joined
07:31
abraxxa1 joined
07:34
abraxxa left
08:06
lichtkind joined
08:12
lichtkind_ joined
08:15
lichtkind left
08:23
dakkar joined
|
|||
disbot3 | <simon_sibl> I am not a very web oriented dev, would hArc stack be a good tool to use to make a website that allow to download and upload files ? (for the download I would simply list the files, clicking on them would trigger the download) and upload via a button I guess | 08:26 | |
<simon_sibl> but every action would require a user interaction right ? even refreshing the files list ? | 08:27 | ||
08:56
librasteve_ left
|
|||
disbot3 | <jubilatious1_98524> I see [dead] also. Sounds like a line from a movie. | 08:58 | |
09:05
abraxxa1 left
09:24
abraxxa joined
09:28
abraxxa1 joined
09:32
abraxxa left
09:34
abraxxa2 joined
|
|||
disbot3 | <holmdunc> They can be saved from [death] by sufficiently karma'd users - just did it | 09:36 | |
<holmdunc> cdn.discordapp.com/attachments/633...8f9c4& | |||
09:37
abraxxa1 left
09:52
Aedil left
10:00
apac joined
|
|||
disbot3 | <melezhik.> On my experience HN moderators sometimes are way to strict on multiple posts from the same source , author - they might see thus as self promotion. It’s sad though | 10:04 | |
<melezhik.> Oh . I will keep your contact in my bookmarks 😀 | 10:06 | ||
10:36
apac left
|
|||
disbot3 | <antononcube> Self promotion with Raku is somewhat of an oxymoron. HN moderators might be “just” Perl fans. | 11:30 | |
<antononcube> I want to make two packages that connect Raku to locally run services. One is Ollama, the H2O. | 11:32 | ||
<antononcube> What are good names for those? I do not think “WWW::Ollama” is a good one. Here are some variants: 1. Ollama 2. Ollama::Client 3. H2O 4. H2O::Client 5. H2O::AI::Client | 11:33 | ||
<simon_sibl> How can I make a variable from my main file available on a rakumod file ? I tried $*var but it still doesn’t find it | 11:37 | ||
<antononcube> Using our might do what you want. I am not sure what “main file” is. | 11:38 | ||
11:39
abraxxa joined,
abraxxa1 joined
|
|||
disbot3 | <simon_sibl> I tried our as well | 11:41 | |
11:41
abraxxa2 left
|
|||
disbot3 | <simon_sibl> Main file is basically the file that “use” all the modules and do stuff | 11:41 | |
<simon_sibl> But one of the model needs to access a variable created in the main file | |||
11:43
abraxxa left
|
|||
disbot3 | <antononcube> Then make a sub that accesses it. | 11:43 | |
11:48
Aedil joined
|
|||
Geth | raku-mode: 5e36e7f76c | quanrong++ | raku-indent.el Indent method calls when they happen on a new line |
11:51 | |
raku-mode: d06baaa2e8 | Altai-man++ (committed using GitHub Web editor) | raku-indent.el Merge pull request #62 from ttn-ttn/master Indent method calls when they happen on a new line |
|||
disbot3 | <simon_sibl> doesnt work as well, the sub is invisible to the module somehow | 12:03 | |
<simon_sibl> the module I "use" cannot access the main file | |||
<simon_sibl> alright, for some reason when in my main file its $node and the module $*node it works | 12:09 | ||
<simon_sibl> makes no sense to me xD | |||
<antononcube> 🤷♂️ | |||
[Coke] | $* is a dynamic var. | 12:12 | |
docs.raku.org/type/Variable#trait_is_dynamic | 12:13 | ||
disbot3 | <simon_sibl> yes but why must the name be different between my main file and my module for it to work ? | 12:24 | |
[Coke] | you're using the dynamic nature in the module. You could use $*a in both | 12:29 | |
(and probably should to avoid confusion) | |||
I'm actually surprised it works with $a in main - you can't do it all in one file: | 12:40 | ||
m: my $a = 3; sub b { say $*a}; b | |||
camelia | Dynamic variable $*a not found in sub b at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
[Coke] | m: my $*a = 3; sub b { say $*a}; b | ||
camelia | 3 | ||
[Coke] | m: my $a = 3; sub b { say $a}; b | 12:41 | |
camelia | 3 | ||
[Coke] | (just has to match, there..) | ||
Voldenet | if you want to access variable (a global one) inside a module, export getter and setter to it | 12:43 | |
12:49
derpydoo left
|
|||
Voldenet | avoid dynamic variables for as long as possible - they can be useful exactly in cases where you can't avoid it | 12:50 | |
sub query ($q) { try &*logger($q); }; my &*logger = -> $q { say "running query $q" }; query("select"); # example, you need contextual logger, but the framework only supports constant logger, so you have to manually set request context | 12:51 | ||
evalable6 | running query select | ||
Voldenet | but otherwise it's a mess to maintain :\ | 12:52 | |
disbot3 | <simon_sibl> it does not work when I name it $*a in both | 13:06 | |
Voldenet | may I ask how do you define your dynamic variable in a module? | 13:23 | |
if you do `my $*a` in a module, I'm not sure if that can work | 13:24 | ||
example glot.io/snippets/hblj3xbt2f | 13:25 | ||
when you do `my $*a` in a module, you define dynamic variable for <load> subroutine, which is not very useful | 13:28 | ||
though the syntax may hint something else… :) | 13:29 | ||
m: sub load-foo { my $*x = 1; bar => -> { $*x } }; my $foo = load-foo(); $foo<bar>() # shorter example | 13:33 | ||
camelia | Dynamic variable $*x not found in block <unit> at <tmp> line 1 |
||
disbot3 | <simon_sibl> let me create a git repo for this project, will be easier xD 🙏 | 13:34 | |
Voldenet | you can reduce it to glot example probably, it's a lot easier to tinker with that way | 13:35 | |
but i'm not a big fan of dynvars either way, they're extremely confusing | 13:36 | ||
disbot3 | <simon_sibl> its very small for now anyway xD github.com/4zv4l/dfs the main file is dfs.raku and the module I use the $*node is Web.rakumod | 13:39 | |
<simon_sibl> I can try to create a smaller example | |||
<simon_sibl> well for some reason in the small example it works xD | 13:41 | ||
Voldenet | for some reason my head really hurts when trying to figure out what is $*node :P | 13:45 | |
13:48
arkiuat joined
|
|||
Voldenet | it may work in current version, but it assumes a lot of things about how things execute | 13:49 | |
arkiuat | simon_sibl, when you used our, did you try just declaring the our-var in a module and setting it in the mainline? when you say the variable needs to be "created" in the mainline do you mean declared, or initialized, or something else? | 13:51 | |
of course you'd need to either export the our-var from the module or else fully qualify the package name of the var when referring to it in the mainline | |||
disbot3 | <simon_sibl> so the main file does the link between the 2 modules, but 1 of them need that variable since it contains information | 13:53 | |
<simon_sibl> the main create a "Node" (server) and I made another module for the web server, but the web server needs info from the Node, so I need to be able to access that variable | |||
arkiuat | and you can't pass it as an argument? | 13:55 | |
disbot3 | <simon_sibl> from the main I directly call the SITE.serve (hArc stack), and even with a function, that variable is required in multiple Class and sub within that Web module, wouldnt be practical | 13:57 | |
arkiuat | I haven't really started learning Air yet. Maybe librasteve can help. | 14:00 | |
Voldenet | so, I have tried and I can use dynamic variables in this example just fine glot.io/snippets/hblk2nojo0 | ||
disbot3 | <simon_sibl> I am a very beginner as well xD just trying to have a base working for now, then I can improve it | ||
<jubilatious1_98524> It lives! | 14:02 | ||
Voldenet | erm, I had to add -I. to run command, because fork eats it glot.io/snippets/hblk4twrxq | ||
disbot3 | <simon_sibl> thats even better, because I moved the use Web and use Node because I thought the error was because Web was used before I create $*node | 14:03 | |
Voldenet | $*node is being dynamically created by main.raku, then when you call anything from it, it has $*node | ||
disbot3 | <antononcube> @jubilatious1_98524 Thanks! | 14:04 | |
Voldenet | I still would say to not use dynvars and pass things explicitly: glot.io/snippets/hblk8cdh72 | 14:06 | |
disbot3 | <simon_sibl> but in my code it still doesnt work, the website starts, but when it tries to load and do the for loop on $*node it dies | 14:07 | |
Voldenet | you can avoid dynvars, so avoid it, it will save you from headaches later | 14:08 | |
disbot3 | <simon_sibl> yep, just did like your last example | 14:10 | |
<simon_sibl> thank you ! 🙏 | |||
14:14
melezhik_ joined
|
|||
arkiuat | sub sleep, sleep-timer, and sleep-until are all three documented (and presumably implemented) in class Date. The first two take a Real $seconds argument, and the last takes an Instant. | 14:15 | |
Does anyone know why these are in Date? DateTime, Instant, or even role Dateish all seem more appropriate. | |||
melezhik_ | . | 14:16 | |
14:19
melezhik_ left
|
|||
Voldenet | I'm betting that probably Date was made earlier and it made sense at the time | 14:20 | |
14:21
melezhik_ joined
|
|||
melezhik_ | please vote for yet another Raku post if you like it - news.ycombinator.com/item?id=45425774 - thanks | 14:21 | |
Voldenet | sleep has 0 sense in the context and sleep-until coerces to Instant | 14:22 | |
but hey, note that they are subs inside Date.rakumod, they're not part of Date | 14:23 | ||
lizmat | right... so they could very well live somewhere else | 14:24 | |
I guess the doc just followed the file structure | |||
14:25
abraxxa1 left
14:31
melezhik_ left,
melezhik_ joined
14:33
apac joined
14:37
melezhik_ left
|
|||
arkiuat | yeah, I suspected it was some sort of historical reasons | 14:38 | |
but it might be helpful to document sleep-until under Instant instead of Date, and if we do that, then might as well move sleep & sleep-timer into DateTime, unless it's felt better to keep all three under a single rubric | 14:39 | ||
I guess I should have brought this up on #raku-doc instead :D | 14:40 | ||
14:51
apac left
|
|||
[Coke] | (why is sleep-until not also a method on Instant, I wonder) | 15:09 | |
disbot3 | <librasteve> @holmdunc thanks for the tip on karma ... ChatGPT tells me you need karma ~30 to have powers of resurrection | 15:22 | |
15:24
melezhik_ joined
15:26
melezhik_ left
15:28
apac joined
15:30
Aedil left
15:33
Aedil joined
|
|||
disbot3 | <antononcube> @librasteve My H2O is going to beat your Polaris. | 15:38 | |
tbrowder | while on docs, is there an ascii version of the unicode negated set operators? if so, i can't find them in docs. for instance, there is '(elem) for is an element of, but i see a unicode for not an element of, but no ascii equivalent. how about '(not elem)' or '(!elem)'? | 15:48 | |
hm, i guess because the parsing is very different from the others... | 15:55 | ||
hm, '(noelem)' | 15:56 | ||
ugh | |||
arkiuat | [Coke] yes, I was wondering that too | 15:57 | |
15:57
arkiuat left
|
|||
Voldenet | sleep-until coerces, so its usable with DateTime | 16:04 | |
which is a lot more useful in the context | |||
# so this is possible sleep-until DateTime.now.later(second => 5) | 16:05 | ||
16:23
arkiuat joined
|
|||
arkiuat | Voldenet, so it seems the reasonable thing to do is move (at least the doc for) all three from Date into DateTime | 16:24 | |
tbrowder, the docs suggest what you're looking for is !(elem). The operator with a ! prepended is mentioned as "equivalent to" for each of the negated set operators with no ascii version | 16:28 | ||
16:38
dakkar left
16:43
arkiuat left,
arkiuat joined
|
|||
tbrowder | thanks, i missed that. it needs to be added in a few missing places. sounds like another docs pr. | 16:44 | |
…in the making | |||
16:48
apac left
16:57
human-blip left
16:59
human-blip joined
17:08
apac joined
17:13
leah2 left
17:18
nine left,
nine joined
17:19
dg left
17:26
merp joined
17:29
dg joined
17:34
leah2 joined
17:35
melezhik_ joined
17:37
melezhik_ left
18:02
melezhik_ joined
18:04
leah2 left
18:11
melezhik_ left
18:12
melezhik_ joined
18:13
melezhik_ left,
melezhik_ joined
18:15
melezhik_ left,
melezhik_ joined
|
|||
disbot3 | <librasteve> o/ | 18:19 | |
18:19
leah2 joined
18:21
melezhik_ left,
melezhik_ joined
18:26
melezhik_ left
18:27
melezhik_ joined
18:32
melezhik_ left
18:33
melezhik_ joined
18:34
coleman left
18:36
melezhik joined,
coleman joined
18:38
melezhik_ left
|
|||
disbot3 | <librasteve> @simon_sibl -- I took a look at your code (the Voldenet variant) - I see a few things that are reminiscent of Air and have a couple of tips at this point ... generally in Raku methods with names in CAPS do something special / system level ... so for example if you make a custom Air::Component, then you need to give it a method HTML ... and then that is magically called by the Air module to render it. Same with sub SITE ... you | 18:39 | |
need to export that sub so that the Air library can launch your site when you go raku -I. service.raku | |||
<librasteve> So - yes please do write these methods / subs - but leave it to the Air library to call them | 18:40 | ||
<librasteve> My advice is to start with a simple example (eg github.com/librasteve/Air-Examples...nimal.raku from github.com/librasteve/Air-Examples) and then try adding your Node / Web classes to that | 18:41 | ||
<librasteve> please do ask here if you have any questions and I will try my best to help | 18:42 | ||
arkiuat | librasteve++ | ||
disbot3 | <librasteve> @simon_sibl - I just saw you have done that on the cro-irc ... checking now... | 18:44 | |
19:06
Aedil left
19:10
tonyo joined
|
|||
tonyo | . | 19:10 | |
19:26
itaipu left
19:42
itaipu joined
19:50
arkiuat left
20:02
arkiuat joined
20:07
arkiuat left
20:27
arkiuat joined
20:32
arkiuat left
20:44
arkiuat joined
|
|||
Voldenet | That makes sense, but then how do you pass variables to that SITE? I think it'd make sense to pass *%_ | 20:46 | |
m: sub SITE(:$x) { say $x }; sub air-serve(*%_) { SITE(|%_) }; air-serve(:x(5)) | |||
camelia | 5 | ||
Voldenet | it vastly simplifies the whole thing | ||
20:49
arkiuat left
20:56
melezhik left
21:03
arkiuat joined
21:07
arkiuat left
21:14
apac left
21:21
arkiuat joined,
lichtkind_ left
21:25
arkiuat left
21:37
melezhik_ joined
21:40
melezhik_ left
21:46
arkiuat joined
|
|||
tbrowder | m: use Test; my $s1 = set(1..3); my $s2 = set(1..6); my $res = $s1 (<=) $s2 | 21:56 | |
camelia | ( no output ) | ||
tbrowder | m: use Test; my ($s1,$s2) = set(1..3), set(1..6); my $res = $s1 (<=) $s2; is $res, True | 22:05 | |
camelia | ok 1 - | ||
22:28
Sgeo joined
22:41
summerisle left
22:43
summerisle joined
22:44
perryprog_ joined
22:46
perryprog left,
perryprog_ is now known as perryprog
23:37
melezhik_ joined
23:41
melezhik_ left
|