00:12 ds7832 left
disbot5 <simon_sibl> Any idea for this ? I am really stuck 🥲 00:32
[Coke] simon do you have a code snippet we can look at? 00:33
if you're not dealing with it as binary, it needs more bytes to make sure it can process certain encodings. 00:37
e.g "is this followed by a combiner?"
00:53 zetaaaa left 01:00 arkiuat_ joined 01:03 arkiuat left 01:11 dg joined 01:14 zetaaaa joined
disbot5 <simon_sibl> I have a link here: glot.io/snippets/hbvfzohnob 01:26
<simon_sibl> With a short code to test
<simon_sibl> And the link to the file I am trying with
<simon_sibl> Debian torrent file basically
<simon_sibl> It reads 2 bytes too much at the end, eating the “8:” that will start the url key in the dictionary 01:27
<simon_sibl> And I can’t get my head around why it does this
01:47 hulk joined, kylese left
disbot5 <jubilatious1_98524> Maybe byte-order mark? 01:59
<simon_sibl> latin-1 is 8bit so shouldnt be possible right ? 02:08
<simon_sibl> 1 byte per char so should be fine ?
02:15 hulk left, kylese joined 02:21 nativecallable6 left, coverable6 left, bloatable6 left, linkable6 left, coverable6 joined, bisectable6 left, unicodable6 left, unicodable6 joined, nativecallable6 joined, bisectable6 joined 02:24 zetaaaa left 02:36 Pixi` joined 02:37 Pixi left 02:56 Aedil joined
johnjaye am i to understand the syntax if($x<1) is explicitly not allowed in raku? That it should be if ($x<1) 03:03
03:41 arkiuat_ left 03:51 arkiuat joined 04:24 Sgeo_ left 04:31 Sgeo joined 04:43 apac joined
Voldenet in general raku likes whitespace very much and requires it in many places 05:17
but also it replaces () with spaces, so effectively there's hardly any reason why would you use () in the first place 05:18
instead of `if($x<1)` you can do `if $x < 1` 05:19
in perl it was allowed, but it was never good style anyway 05:23
because it's harder to quickly see what's going on 05:24
disbot5 <frostcod> m: my $x = 5; if ($x < 1) { say "x < 1" } else { say "x > 1" } 05:38
06:26 Sgeo left 06:28 arkiuat left 06:43 arkiuat joined 07:00 derpydoo joined
Voldenet any bool expression can be wrapped into () so it's as valid as `if ((((($x < 1)))))`, just very redundant 07:03
any expression actually 07:04
disbot5 <simon_sibl> actually it is 3 bytes too much it eats the e that ends the dictionary, the 8: that starts the next key of the parent dictionary.. 07:37
07:46 apac left, arkiuat left 08:10 arkiuat joined 08:15 arkiuat left
librasteve_ johnjaye: the best way for me to understand the need for parens () in raku is that they are purely there for disambiguation 08:26
you know if you want to say (5+3) *2 [16] instead of 5+3*2 [11] 08:27
raku is very consistent, so to make a List you can go my $l = 1,2,3; which is the same as my $l = (1,2,3); … here the “,” comma is doing duty as the list making operator 08:28
johnjaye right but i'm asking what if($x<1) parses as 08:39
i believe it gave an error since if isn't a function
and I saw someone define if as a function somewhere in the source tree 08:40
actually i re-ran it and it actually is an error. it directly says so 08:42
Voldenet simon_sibl: I'm quite sure the problem is with encoding - I've tried replacing all the 62640 bytes of "pieces" with "a" and then url-list was parsed properly
johnjaye i'm not used to error messages being useful and actually also suggesting what I can do to fix it. 08:43
08:43 arkiuat joined
disbot5 <simon_sibl> but except using latin-1 what else could I try to make it work ? I tried another torrent file and it worked, so even with raw bytes it works sometimes, there must be something weird within the bytes of the debian file that messes with the grammar somehow 08:47
08:48 arkiuat left
disbot5 <librasteve> johnjaye: oh - lol 09:07
09:10 arkiuat joined 09:14 arkiuat left
Voldenet I don't know if you can use raku grammars for binary files safely anyhow, `0d0a` is the sequence that seems to break stuff 09:23
oh wow, right, 0d0a is CRLF 09:24
what a /coincidence/ init
disbot5 <librasteve> windoze
Voldenet but actually it's all on linux
and it's a debian.torrent file
nothing windows here!
disbot5 <librasteve> yeah but maybe the protocol is windows insprired
Voldenet it's a binary blob containing hashes 09:25
I'm betting that it just happens that raku somehow interprets it in a grammar
or in encoding
and gobbles bytes
disbot5 <librasteve> wonders if vertical whitespace has a role -- iirc ^^ $$ (as opposed to ^ $) ignores it -- I have no clue how that plays with binary 09:26
09:28 apac joined
Voldenet m: grammar Bencode { token string { $<len> = \d+ {say "len: $<len>"} ':' <(. ** {$<len>})> {say "done ({$/.Str.encode('latin-1').bytes}) !"} }}; say Bencode.parse( "6:abc\r\nd…", :rule('string'), :enc('latin-1')); 09:36
camelia len: 6
Error encoding Latin-1 string: could not encode codepoint 8230
in block at <tmp> line 1
in regex string at <tmp> line 1
in block <unit> at <tmp> line 1
Voldenet m: grammar Bencode { token string { $<len> = \d+ {say "len: $<len>"} ':' <(. ** {$<len>})> {say "done ({$/.Str.encode('latin-1').bytes}) !"} }}; say Bencode.parse( "6:abc\r\nd...", :rule('string'), :enc('latin-1'));
camelia len: 6
done (7) !
Nil
Voldenet that's the problem reduced to one-liner
so no debian.torrent file is needed :D
you ask for 6 bytes, you get 7 09:37
09:42 arkiuat joined 09:47 arkiuat left
Voldenet valid question would be probably whether raku can even write kaitai-like grammars, that'd work on binary data 09:54
10:11 arkiuat joined 10:15 arkiuat left 10:22 lichtkind joined 10:24 melezhik_ joined
melezhik_ . 10:24
Sparrowdo latest release supports safe mechanism to pass secrets to remote hosts during deployment - github.com/melezhik/sparrowdo?tab=...ss-secrets , check it out 10:25
10:32 melezhik_ left 10:33 stanrifkin joined 10:35 johnjaye left 10:45 arkiuat joined
ab5tract I think it could be done, but I don’t think it’s necessarily possible right now 10:47
10:50 arkiuat left 10:52 derpydoo left 11:11 johnjaye joined 11:12 arkiuat joined 11:17 arkiuat left 11:25 abraxxa-home joined 11:26 notable6 left, coverable6 left, quotable6 left, bisectable6 left, nativecallable6 left, committable6 left, shareable6 left, sourceable6 left, greppable6 left, releasable6 left, unicodable6 left, evalable6 left, tellable6 left 11:27 abraxxa-home left 11:29 abraxxa-home joined 11:31 greppable6 joined, linkable6 joined, bloatable6 joined, notable6 joined, releasable6 joined, coverable6 joined 11:32 shareable6 joined, bisectable6 joined, tellable6 joined, unicodable6 joined, committable6 joined, committable6__ joined 11:33 nativecallable6 joined, evalable6 joined, benchable6 joined, quotable6 joined, sourceable6 joined 11:37 committable6 left 11:45 arkiuat joined 11:49 arkiuat left 12:10 melezhik_ joined 12:13 arkiuat joined 12:14 melezhik_ left
disbot5 <simon_sibl> niiice finding, thanks !!! is there a way to avoid that ? 12:15
12:18 arkiuat left 12:28 disbot6 joined, disbot5 left 12:32 melezhik_ joined 12:38 melezhik_ left, melezhik_ joined
[Coke] oh, simon is trying to use a grammar to parse binary? 12:39
12:44 melezhik_ left, arkiuat joined, melezhik_ joined
disbot6 <simon_sibl> xD torrent file but it happens to have some sha1 hashes inside 12:44
<simon_sibl> I mean, thats normal for torrent file, but anyway xD
12:47 melezhik_ left 12:53 arkiuat left 12:55 MoC joined
disbot6 <simon_sibl> so it treats \r\n as 1 . and I need it to take it as 2, but I dont see Grammar arguments for that 12:55
12:56 arkiuat joined 13:01 arkiuat left 13:04 abraxxa left 13:06 ds7832 joined 13:07 ds7832 left, ds7832 joined 13:12 LainIwakura joined 13:24 ds7832 left 13:30 arkiuat joined 13:35 arkiuat left
disbot6 <simon_sibl> even (\x[0d] || \x[0a] || .) doesnt help xD 13:39
13:53 ds7832 joined, arkiuat joined 14:28 Sgeo joined 14:40 guifa_ joined 14:42 guifa left 14:44 abraxxa-home left
disbot6 <aruniecrisps> I've been thinking about how to make Definitely more ergonomic from a Raku perspective 14:49
ds7832 aruniecrisps: you mean this module? raku.land/zef:librasteve/Definitely 14:54
or I guess rather this? raku.land/zef:masukomi/Definitely 14:55
disbot6 <librasteve> Please note that I have forked this module as at 2.1.3 in order to add a Bind operator since my PR over at masukomi was not reviewed. 14:56
<librasteve> originally The seed of this comes from This post by p6Steve (aka librasteve), masukomi built it out into a full Maybe Monad implementation as a Raku module. 14:57
14:59 abraxxa-home joined 15:22 AspiringCoder joined
AspiringCoder Okay guys, quick question: First Programming Language - Python, or Raku? Go! 15:22
stanrifkin Never programmed before? 15:26
none of those I would say 15:27
AspiringCoder Oh. 15:31
arkiuat Forth 15:32
AspiringCoder I thought the best programming language was the most popular one - more resources, more people willing to help you, more people that have encountered your issues, etc.
arkiuat No, that's the best second programming language
Raku is the best last programming language
Forth is the best first programming language 15:33
AspiringCoder Ah, sorry. I misspoke. "I thought the best programming language FOR BEGINNERS..." For beginners.
arkiuat oh, what's the difference? I mean, that's what I meant by "best first" 15:34
AspiringCoder Oh right!
arkiuat I remember back when people used to think that Logo was the best first programming language, or even (yuck) Basic
stanrifkin AspiringCoder: I depends on what you want to achieve. If you want to play around and building stuff. Or you want to learn strong fundamentals. 15:35
AspiringCoder Strong fundamentals is what I'm looking for. 15:36
stanrifkin This is an algorithm book using C, infolab.stanford.edu/~ullman/focs.html
yeah, ^ that one then
arkiuat there are other folks who think that Scheme is the best first programming language
15:37 apogee_ntv left
stanrifkin at the school here they teach Standard ML and Pascal 15:37
But for me it were algorithms which interested me the most. Programming language theory wasn't. 15:38
arkiuat I thought Pascal had died out
stanrifkin FreePascal is going strong 15:39
and looking here, www.tiobe.com/tiobe-index/
[Coke] I learned some pascal back in high school in the late 80s, iirc.
stanrifkin Delphi, Ada still very strong
arkiuat well, so is Cobol
stanrifkin I use Ada btw too
[Coke] (but basic first in the early 80s) 15:40
AspiringCoder Are you being sincere when you recommend Forth as the best first language? I know of Forth. I know it's not popular. I know it's obscure.
stanrifkin I never used Forth
arkiuat oh, it's very popular for embedded programming with limited resources, especially limited memory resources. It's still widely used in bootup ROMs
stanrifkin reminded me always of HP calculator stuff
arkiuat en.wikipedia.org/wiki/Open_Firmware 15:41
15:42 guifa_ left
AspiringCoder stanrifkin: Regarding that algorithm book, do you recommend C as a first language then? 15:43
stanrifkin yes, why not
[Coke] I would definitely not recommend c as a first language. 15:46
15:46 guifa joined
[Coke] ... maybe back in the 90s. 15:46
arkiuat but if you want to stay very far away from hardware, never get involved with the highly lucrative business of developing drivers for new devices, etc, then maybe you should steer clear of Forth. But it's far more flexible in allowing to use the available hardware resources than any other commonly used language
[Coke] How many people are writing code specifically to develop drivers? 15:47
arkiuat yeah, it's probably not the largest market anymore. Still lucrative though.
[Coke] That's more of a "here's a niche career path that you could explore" vs. "good intro", IMO
(lucrative) always a plus 15:48
arkiuat but when people ask me for a good first programming language, I'm thinking learning opportunities, and Forth has a bunch that no other widely available language offers 15:49
job market considerations might enter when selecting a second language to learn
stanrifkin AspiringCoder: Else I recommend Perl then. The "Learning Perl" book is quite nice to work through. 15:50
arkiuat What would you recommend, [Coke]? 15:53
disbot6 <antononcube> Python is good first programming language, but there is great risk to be damaged for life by it. (As a programmer.)
[Coke] I'm old enough that I wouldn't trust my opinion on current best languages to start with. I'm partial to Raku, but that's kind of self selecting 15:55
arkiuat I'm extremely partial to Raku myself, but I'm wary of recommending it as a first language. Perl too for that matter, even though that was my absolute favorite for decades.
[Coke] mmm, I loved perl back in the day, same. 15:56
arkiuat but yeah, I should disqualify myself from this question on the basis of age, as you say 15:57
[Coke] (I probably wrote my first code in the 1970s)
arkiuat my first code that shipped in a product went out in 1991 or 1992, I think. I can't remember my first MS-DOS batch file, probably the '80s sometime 15:58
AspiringCoder Alright, I'll put this topic to rest. I've decided to make C my first language, as I already have a book on it. 15:59
arkiuat oh and in 1985 I was programming whatever the PRIMOS equivalent of shell programming was. PRIMOS was a minicomputer OS that got killed off by micros
I don't even remember what they called the shell language. PRIMOS was originally implemented in Fortran, because academics, and then later they rewrote it in a dialect of PL/1. Very weird stuff. 16:00
stanrifkin AspiringCoder: good choice 16:01
ds7832 AspiringCoder: if you redecide and do want to learn Raku as the first language, there's a freely available O'Reilly book written with just that perspective in mind: greenteapress.com/wp/think-perl-6/
16:05 AspiringCoder left 16:06 arkiuat left 16:10 AspiringCoder joined
AspiringCoder I just closed my laptop and was disconnected. 16:10
Well anyway, thanks for the help everyone! 16:11
Peace.
16:11 AspiringCoder left 16:20 abraxxa-home left 16:29 LainIwakura left 16:38 ds7832 left, ds7832 joined, ds7832 left, ds7832 joined
disbot6 <aruniecrisps> @ds7832 yea i mean that module. i added some behavior last night to that module so that None plays with definiteness handling constructs lile with, without and // 16:49
<aruniecrisps> One of the things I feel like is that I kind of agree with Definitely's premise that explicitly marking a function and restricting it to return an Optional type or Result type has its uses 16:50
<aruniecrisps> But if there was a way to make it more idiomatic in Raku that would be really goo 16:51
<aruniecrisps> good 16:54
16:55 abraxxa-home joined
ds7832 aruniecrisps: So the question is figuring out what better syntax & semantics for that should look like, right? (I don't have concrete ideas myself, but since the Maybe is probably inspired by Haskell, I presume you'll want to consider that one closely 16:57
On the later question of implementation: Incidentally, I've just read this 2019 post by Damian Conway on how to extend existing language constructs. Good chance it's going to be useful at some point or another: blogs.perl.org/users/damian_conway...ratch.html 16:59
Syntax-wise, it seems that when a function's return type is specified as Maybe or Maybe[Type], one could (at least in theory) do away with any explicit something() in the block. 17:08
17:15 zetaaaa joined 17:17 librasteve_ left
ds7832 In the realm of syntactic sugar, perhaps one can do useful with ¿...? and ¡...!, e.g. as circumfix operators that one can use in place of Maybe[] and something() 17:17
although that could be hard to get right in view of inbuilt ? and ! 17:18
disbot6 <aruniecrisps> @ds7382 ive taken a couple of stabs at creating match syntax for Raku and then decided that trying to actually make a slang was too big brained for me, but I might have a second proper go at it when I get a chance 17:23
18:37 ds7832 left 18:42 zetaaaa left 18:49 apogee_ntv joined 18:50 zetaaaa joined 18:57 apac left, apac joined 19:06 ds7832 joined 19:07 apac left 19:43 MoC left 20:21 abraxxa-home left
johnjaye what are the libraries like in raku for things like web or database stuff? 21:05
i see that there are ways to link into python libraries. is that a popular thing to do?
21:07 Aedil left
ds7832 johnjaye: This stack is probably the most popular: harcstack.org/ 21:26
librasteve writes frequent blog posts about it: rakujourney.wordpress.com/2025/03/...arc-stack/ - don't know if he's online right now 21:28
I don't really know much about these tools, but it probably makes sense to start with Cro
cro.raku.org/ 21:32
For databases, as far as SQL is concerned: You can either write inline SQL queries with this module (raku.land/zef:tony-o/Slang::SQL). There are also one or two modules that provide abstraction (raku.land/?q=sql), in particular SQL::Abstract 21:38
but its functionality does't look very extensive. The one offering the most functionality is probably Red, part of the aforementioned hArc stack: github.com/FCO/Red 21:41
SmokeMachine fco.github.io/Red/ 21:45
I like Red... :)
ds7832 and back on the topic of web frameworks, there's also the more minimalist Hummingbird: github.com/rawleyfowler/Humming-Bird 21:48
21:52 Pixi__ joined 21:56 committable6 joined 21:57 benchable6__ joined, releasable6__ joined, evalable6__ joined 21:58 bisectable6__ joined 21:59 committable6__ left, benchable6 left, nativecallable6 left, evalable6 left, greppable6 left, bisectable6 left, Pixi` left, tellable6 left, linkable6 left, notable6 left, sourceable6 left, releasable6 left, bloatable6 left, nativecallable6 joined, tellable6 joined, bloatable6 joined, greppable6 joined, sourceable6 joined, notable6 joined, linkable6 joined 22:01 zetaaaa left 22:38 zetaaaa joined 22:54 ds7832 left 23:04 LainIwakura joined 23:14 linkable6 left, bisectable6__ left, benchable6__ left, releasable6__ left, notable6 left, nativecallable6 left, shareable6 left, coverable6 left, unicodable6 left, quotable6 left, evalable6__ left, tellable6 left, committable6 left, bloatable6 left, greppable6 left, sourceable6 left 23:17 evalable6 joined, greppable6 joined 23:18 benchable6 joined, bisectable6 joined, committable6 joined, coverable6 joined, unicodable6 joined, tellable6 joined, linkable6 joined, bloatable6 joined 23:19 shareable6 joined, notable6 joined, sourceable6 joined, timo left, releasable6 joined, nativecallable6 joined, quotable6 joined 23:20 timo joined
disbot6 <aruniecrisps> @ds7832 @johnjaye there is also raku.land/zef:jnthn/Badger 23:20
23:24 lichtkind left 23:30 ds7832 joined
[Coke] Any thoughts on github.com/skaji/mi6/issues/188 ? (have the thing that validates a module and deploy it be more strict about 'use' and 'depends') 23:46
Any preferences folks have for a DB that is OSS and easy to use from raku on (say) ubuntu? 23:48
Although now that I've said that, I kind of want the data to be in a git repo. 23:49
eh, we can do an export from the DB if we want to save a backup in git. nevermind 23:50
.ask tbrowder - can you followup on github.com/Raku/Blin/issues/42 ? 23:51
tellable6 [Coke], I'll pass your message to tbrowder