This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html Set by lizmat on 8 June 2022. |
|||
klebs | do you anticipate this improving? what would it take to improve? which parts of the compiler are the bottleneck? | 01:20 | |
thanks for this `raku --statestats` is new to me 🌿 | |||
thanks for this `raku --stagestats` is new to me 🌿 | 01:24 | ||
02:59
frost joined
04:36
Kaiepi left
07:32
Kaiepi joined
10:41
lizmat_ joined
10:43
lizmat left
10:52
Nemokosch joined
10:53
Nemokosch left,
lizmat_ is now known as lizmat
11:55
jgaz joined
|
|||
jgaz | I'm trying to read a binary file one byte at a time. I've read docs.raku.org/routine/read and friends and I'm sill confused. I can get slurp to work, but I end up with an array of one element: a buffer the length of the file. How do I read one line at a time or split a buffer? Either approach should owrk. | 13:11 | |
13:18
archenoth joined
|
|||
lizmat | jgaz: reading one byte at a time / one line at a time? feels like conflicting requirements? | 13:26 | |
jgaz | one single byte: it's a binary file. | ||
I haven't tested it yet, but I think I found some example code I can work from: github.com/Michael-S/raku_trivial_..._byte.raku | 13:28 | ||
Anton Antonov | I know a hash can be converted into an array of pairs by assignment. For example, `my $hp = %h`. Where is this described in the documentation? Maybe it under a certain "general principle" page? | 13:34 | |
lizmat | Anton Antonov: your example just puts the Hash object into a scalar | 13:40 | |
m: my %h = :42a; my $h = %h; dd $h; $h<a> = 666; dd %h | |||
camelia | Hash $h = ${:a(42)} Hash %h = {:a(666)} |
||
lizmat | m: my %h = :42a, :666b; my @a = %h; dd @a # assigning to an array will give you Pairs | ||
camelia | Array @a = [:b(666), :a(42)] | ||
Anton Antonov | @lizmat Thanks! Yes, I mistyped, I meant to write `my @hp = %h`. | 13:43 | |
lizmat | the reason for that behaviour is that you get Pairs when you iterate over an Array | 13:44 | |
s/Array/Hash | |||
afk for a few hours& | |||
Anton Antonov | Again thanks! | 13:45 | |
14:33
frost left
14:56
discord-raku-bot left,
discord-raku-bot joined
|
|||
But, still, I would like to find the actual reference in the documentation where this is discussed. | 15:12 | ||
15:14
discord-raku-bot left,
discord-raku-bot joined
|
|||
jgaz | How do I coerce a Buf[unit8] into an Int? Using the +prefix listed in raku.guide/#_common_operators isn't doing the trick. | 16:49 | |
gfldex | jgaz: sounds like a job for docs.raku.org/type/Buf#(Blob)_method_unpack | 16:53 | |
jgaz | gfldex: okay, is it still considered experemental in 2022.02? | 16:54 | |
gfldex | It is. | 16:57 | |
jgaz | k | ||
Nahita | jgaz: `$buffer[0]` works as it seems | ||
jgaz | That works! | 16:59 | |
Nahita: thank you! | |||
Nahita | you're welcome! | 17:00 | |
17:04
Kaiepi left,
Kaiepi joined
17:05
Kaiepi left,
Kaiepi joined
|
|||
Morfent | it depends | 17:51 | |
that'll work for buffers of one element, but if there are more, are you sure you want the head, or does the tail make more sense? given a big `Int`, i'd do the whole `$buffer` as a reduction, but whether or not it needs to be `reverse`d depends on where it should start | 17:53 | ||
that'll work for buffers of one element, but if there are more, are you sure you want the head, or does the tail make more sense? given a big `Int`, i'd do the whole `$buffer` as a reduction, but it may or may not need to be `reverse`d | 17:54 | ||
that'll work for buffers of one element, but if there are more, are you sure you want the head, or does the tail make more sense? given a big `Int`, i'd do the whole `$buffer` as an or/shift reduction, but it may or may not need to be `reverse`d | 17:55 | ||
Nahita | (they mentioned they were reading data one byte at a time, so that was why the suggestion) | 17:56 | |
Morfent | oh | ||
jgaz | Yeah, true. I'm trying to write a simple disassembler. All I need is one byte at a time; it's an 8-bitter. | ||
It's a LO,HI arch, so I'll have to swap the occasional word... not a big deal. | 17:57 | ||
Most ops only take an 8 bit operand, occasionally they take two for absolute addressing. | |||
swap the occasional bit pair, I mean, so I can decode the occasional 16-bit word. | 17:59 | ||
byte pair | |||
time for more coffee. | |||
stevied | anyone using command here know how to immediately run the file active in the window without adding it to the "Run configuration?" | 19:21 | |
anyone using Comma here know how to immediately run the file active in the window without adding it to the "Run configuration?" | |||
i'm on a mac | 19:22 | ||
I tried contol-option-r but that does just opens the run configuration window | |||
19:34
Kaiepi left
|
|||
lizmat | sorry, Comma supporter but not Comma user | 19:39 | |
stevied | ok, np. just a minor annoyance | 19:43 | |
gfldex | <@563790557831495691> you might find help at info@commaide.com | 19:49 | |
MasterDuke | or in #cro, a bunch of the comma devs also hang out there | 19:53 | |
stevied | ok, thanks. haven't had any luck with the info@ email in the past | ||
is that #cro in freenode? | 19:56 | ||
found a #cro room in libranet. only two people there | 19:58 | ||
MasterDuke | hm. could also try #moarvm, they're usually there also | 20:02 | |
20:02
Kaiepi joined
|
|||
stevied | ok ,thanks | 20:05 | |
Anton Antonov | <@563790557831495691> The shortcut Ctrl-Shift-R works on test files. | 20:12 | |
stevied | i got a scratch file | ||
Anton Antonov | It is a recent feature. Related, I do not have the latest Comma -- mine is at least 1.5 months old. | ||
stevied | I have the latest version. | 20:14 | |
Anton Antonov | The latest crashed on me a few times, so I reverted to the one from April. | 20:16 | |
20:23
lizmat_ joined
20:27
lizmat left
|
|||
BTW, the shortcut Ctrl-Shift-R works on all files in PyCharm. | 20:28 | ||
stevied | huh | ||
youtu.be/9cbnWIDNYas | 21:14 | ||
chris and matt should take this guy's work and generalize it for stuff beyond climate change. cook has done excellent research on identifying logical fallacies | |||
oops, wrong channel | |||
Nemokosch | who are chris and matt anyway 😄 | 21:16 | |
21:29
MasterDuke left
|
|||
Anton Antonov | Good question... | 21:34 | |
21:40
MasterDuke joined
21:51
jgaz left
22:27
Kaiepi left
22:30
paurq left
|
|||
stevied | they have a podcast, "Decoding the Gurus" | 22:34 | |
23:20
jgaz joined
23:32
jgaz left
23:56
Kaiepi joined
23:59
jgaz joined
|