🦋 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,
Ekho left
00:01
reportable6 joined
00:31
eseyman left
00:33
eseyman joined
00:39
observant_meat left
00:40
Ekho joined
00:45
jpn joined
00:46
Ekho left
00:49
jpn left
00:53
MasterDuke joined
00:54
Ekho joined
01:06
Ekho left
01:24
Ekho joined
01:27
rf joined
01:32
sftp left
01:34
sftp joined
02:33
jpn joined
02:38
jpn left
02:48
hythm left
03:06
sftp left
03:41
rf left
04:03
sftp joined
04:07
jpn joined
04:12
jpn left
04:57
guifa joined
05:20
guifa left
05:42
siavash joined
05:49
abraxxa joined
05:56
jpn joined
06:00
reportable6 left
06:01
jpn left
06:02
reportable6 joined
06:07
MoC joined
|
|||
andinus | how can i get a bitstream with IO::Handle? i want to .read bits | 06:18 | |
06:18
abraxxa left
06:19
abraxxa joined
06:33
jpn joined
06:37
abraxxa left
06:38
jpn left
06:45
abraxxa joined
07:08
abraxxa left
07:15
abraxxa joined
07:20
jpn joined
07:28
ab5tract joined
07:30
jpn left
07:37
jpn joined
07:40
justache left,
justache joined
07:50
jpn left
08:10
dakkar joined
08:18
melezhik joined
|
|||
melezhik | Hi! I've created file with Raku, and then try to parse it with a program written on golnag and get this error - /tmp/config.json | 08:19 | |
load config: read and validate: unmarshal config file content: illegal base64 data at input byte 8 | |||
so looks like Raku save the file in ut8 format right? if so, how can I save it in plain/ascii mode? | |||
08:19
tea3po left
|
|||
melezhik | I user spurt function to write to file | 08:19 | |
08:20
tea3po joined,
tea3po left
08:21
tea3po joined
|
|||
melezhik | docs.raku.org/routine/spurt | 08:22 | |
looks like :enc | |||
08:23
tea3po left,
tea3po joined
08:29
tea3po left,
tea3po joined
08:30
melezhik left
08:31
tea3po left,
tea3po joined
08:43
bd3i left,
bd3i joined
09:01
xwu1 left
09:26
siavash left
09:32
Sgeo left
09:35
jpn joined
|
|||
nemokosch | Sounds about right | 09:39 | |
Andinus: I wonder what language lets you do that. Bit endianness is so low-level even C has only one feature that is affected by it (struct bit fields) | 09:42 | ||
09:43
jpn left
|
|||
Voldenet | actually, C# has BitArray that has endianness defined | 10:16 | |
10:17
jpn joined
|
|||
Voldenet | but streams (read etc.) work on bytes either way | 10:17 | |
10:23
jpn left
|
|||
nemokosch | C# is also a kind of language that tackles everything for the sake of it | 10:30 | |
Voldenet | raku has bits support too | 10:31 | |
nemokosch | oh, if I understand it well, this is rather a high-level data structure with compact storage | ||
Voldenet | Blob.new([42]).read-ubits(0, 5).say | 10:32 | |
evalable6 | 5 | ||
Voldenet | indeed, it's immensely useful if you need to implement bloom filters and such | ||
nemokosch | so like it's rather an internal "comforting" detail that it stores one bit of information on one bit | 10:33 | |
Voldenet | sort of, but it can be constructed from byte[] | ||
nemokosch | read-bits might be "the right thing" here, actually | 10:34 | |
I wonder how it works under the hood but it might just be the thing | |||
10:34
jpn joined
|
|||
but the interface doesn't seem to be handy if you actually want to use the bits one by one | 10:35 | ||
Voldenet | read-bits just does bitshifts under the hood, nothing spectacular | ||
nemokosch | retrieve one bit and literally construct an Int for it? meh | ||
if that's true, then The endianness of the bits is assumed to be BigEndian. should be false | 10:36 | ||
because bitshifts don't care about bit endianness | |||
10:37
guifa joined
|
|||
okay, maybe not outright false but like lame | 10:37 | ||
"you will get the right results for the wrong reason" | |||
Voldenet | possibly | ||
not sure what nqp::bitshiftl_I does, I'd have to dig deeper | |||
nemokosch | I rolled with the assumption that it's like C | 10:38 | |
lately it bit me for work | |||
if you do math, endianness won't matter at all - however, if you do structs, even bit endianness may matter | 10:39 | ||
10:39
jpn left,
jpn joined
|
|||
Voldenet | it's a bit of pain that this problem bubbles to the high level | 10:45 | |
10:46
guifa left
|
|||
Voldenet | either way: | 10:46 | |
> sub read-bits($h) { gather while my $b = $h.read: 1 { take ((1 +< $_) +& $b[0]) +> $_ for ^8 } }; | |||
that looks easy enough | |||
parens are probably unnecessary | 10:48 | ||
11:25
tea3po left
11:26
teatime joined
11:34
jpn left
11:36
jpn joined
|
|||
librasteve | o/ | 11:40 | |
getting an odd compile error... | 11:41 | ||
sub null-val( $dtype ) { given $dtype { when bool { False } when Bool { False } } } | |||
Function 'bool' needs parens to avoid gobbling block at /Users/stephenroe/scum.raku:3 ------> when bool { False }⏏<EOL> Missing block (apparently claimed by 'bool') at /Users/stephenroe/scum.raku:3 ------> when bool { False }⏏<EOL> | |||
11:41
jpn left
|
|||
goes away when I comment out the line with bool | 11:42 | ||
(i) where should I stick the parens to silcence the error? (ii) is this a bug? | 11:43 | ||
nemokosch | this whole "gobbling block" is so unhelpful, what does it even mean | 11:44 | |
m: 13 ==> say | |||
Raku eval | Exit code: 1 ===SORRY!=== Argument to "say" seems to be malformed at /home/glot/main.raku:1 ------> 13 ==> say⏏<EOL> Other potential difficulties: Unsupported use of bare "say". In Raku please use: .say if you meant to call it as a method on $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun. at /home/glot/main.raku:1 ------> 13 ==> say⏏<EOL> | ||
nemokosch | no, this is not it | 11:45 | |
I swear I've seen this before | |||
librasteve | i have no problem with the terminology ... usually it's pretty clear that the "bool" keyword needs to be "bool()" to disambiguate the syntax | 11:47 | |
nemokosch | now this is the difference. What you said makes perfect sense, unlike "gobbling block" | 11:48 | |
I remember now, it was a gerund or how it is called | 11:49 | ||
the action of gobbling | |||
doesn't help if it's a niche C2 word | |||
non-jargon even | |||
librasteve | ah - it seems that bool is not a native type - so it probably isn't a keyword that can be used here | ||
11:50
jjido joined
|
|||
works gine with int, num64 and so on | 11:50 | ||
nemokosch | but what is it? is there a &bool function somewhere? | ||
oh, apparently any nonsense name can claim to be a function at that point | 11:52 | ||
librasteve | nope - but that's really my point ... since it is not a nativetype you can't smartmatch on it and then it gets interpreted as an (undefined) sub call and it does know if the block is intended as an argument or not | ||
nemokosch | when gibberish { ... } | ||
librasteve | you saying my code is gibberish? | 11:53 | |
(which frankly is a compliment) | |||
nemokosch | I'm saying that you could put any gibberish name there and the outcome would be the same | ||
librasteve | true that! | ||
nemokosch | I think it makes a difference that it's not even a legitimate symbol and yet it gets to claim to be a function | ||
librasteve | thanks! | 11:54 | |
nemokosch | I think the error message is confusing but a parse error here is still better than downright refusing to parse when there are missing variables | ||
> raku --target=ast -e '$a + $b' | 11:55 | ||
librasteve | ah - actually I forgot to go use NativeCall; | ||
nemokosch | > Variable '$a' is not declared. Perhaps you forgot a 'sub' if this was > intended to be part of a signature? | ||
like, I don't care, I asked you to parse it | |||
it's not nice that semantics is so deep-rooted that you basically cannot parse expressions without context | 11:56 | ||
is it even legitimate? what are the two ways to parse $a + $b? | 11:57 | ||
$a cannot even be called without the parens, really, why not give a proper parse output? | 11:58 | ||
apparently, when gibberish { ... } works the other way around: it silently falls back to a function call without context | 11:59 | ||
12:00
reportable6 left
|
|||
when this "block gobbling" situation arises, it would be good to try to resolve the symbol that looks like the called function | 12:00 | ||
and if it isn't, give a better error message | |||
12:03
reportable6 joined
12:14
jgaz joined
|
|||
Voldenet | especially when there is no 'bool' subroutine in the first place | 12:32 | |
nemokosch | yes, this is my point | 12:40 | |
with when map { ... } it could even be legit | 12:46 | ||
13:14
linkable6 left,
evalable6 left
13:15
evalable6 joined
13:16
linkable6 joined
13:24
jpn joined
13:29
jjido left,
jpn left
13:55
gcd left,
gcd joined
13:57
jpn joined
14:13
Maylay left,
Maylay joined
14:52
gfldex left,
gfldex joined
15:04
rf joined
15:33
xwu1 joined
15:35
jpn left
15:41
xwu1 left
16:12
eseyman left
16:26
Sgeo joined
16:27
manu_ joined
16:39
dakkar left
|
|||
leont | RakuConf overlaps with PackagingConf :-/ | 16:45 | |
Oh, the overlapping day is the bonus day so I guess I could combine them | 16:46 | ||
16:51
Tirifto left,
Tirifto_ joined
16:54
abraxxa left
16:58
simcop2387 joined
17:00
perlbot joined
|
|||
tonyo | rf: is there a way to shutdown the humming bird server? | 17:09 | |
gracefully or otherwise? | 17:11 | ||
17:16
swaggboi left
|
|||
antononcube | @leont Sorry, no bonus. | 17:17 | |
17:22
ab5tract left
17:26
ab5tract joined
|
|||
Here is a clarification reference : playold.games/wp-content/uploads/2...-Sorry.jpg | 17:30 | ||
18:00
reportable6 left
18:01
reportable6 joined
18:22
jjido joined
18:32
bigdata joined
19:15
jjido left
19:29
MoC left
19:47
tjr left
20:02
jjido joined
20:04
bigdata left
20:21
teatwo joined
20:23
teatime left
20:26
jjido left
20:53
ab5tract left
21:04
swaggboi joined
21:52
tonyo left,
tonyo joined
22:03
squashable6 left
22:05
squashable6 joined
22:25
xwu1 joined
22:31
bdju left
22:32
bdju joined
22:53
tjr joined
23:14
deoac joined
23:32
cm_ joined
23:33
cm left,
cm_ is now known as cm
23:37
kaskal left
23:41
kaskal joined
23:56
swaggboi left
|