ChanServ changed the topic of #zig to: zig programming language | https://ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
rzezeski has joined #zig
ur5us_ has quit [Ping timeout: 256 seconds]
ur5us_ has joined #zig
zippoh has joined #zig
CommunistWolf has quit [Ping timeout: 244 seconds]
epmills has joined #zig
<epmills> hey, all. looking for regex processing code. anything in std lib or has someone written anything in zig?
CommunistWolf has joined #zig
ur5us_ has quit [Ping timeout: 244 seconds]
CommunistWolf has quit [Ping timeout: 260 seconds]
<traviss> i haven't used it myself so i'm not really sure what to expect
ur5us_ has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
<epmills> traviss: thx! i'll check it out.
epmills has quit [Quit: Leaving...]
craigo has joined #zig
fraktor has quit [Ping timeout: 260 seconds]
_whitelogger has joined #zig
lunamn9 has joined #zig
lunamn9 is now known as lunamn
lunamn has quit [Ping timeout: 265 seconds]
ur5us_ has quit [Ping timeout: 260 seconds]
nmeum has quit [Remote host closed the connection]
cole-h has joined #zig
lunamn5 has joined #zig
lunamn5 is now known as lunamn
ur5us_ has joined #zig
Ashpool has quit [Quit: Leaving]
cole-h has quit [Quit: Goodbye]
wootehfoot has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
dtz has quit [Quit: killed]
return0e[m] has quit [Quit: killed]
protheory8-new-m has quit [Quit: killed]
alva has quit [Quit: killed]
Snektron has quit [Quit: killed]
BaroqueLarouche has quit [Quit: killed]
ifreund[m] has quit [Quit: killed]
fengb has quit [Quit: killed]
Nypsie[m] has quit [Quit: killed]
gpanders[m] has quit [Quit: killed]
Bastian[m] has quit [Quit: killed]
josias has quit [Quit: killed]
alexnask[m] has quit [Quit: killed]
return0e[m] has joined #zig
alva has joined #zig
ifreund[m] has joined #zig
dtz has joined #zig
alexnask[m] has joined #zig
Snektron has joined #zig
Nypsie[m] has joined #zig
gpanders[m] has joined #zig
fengb has joined #zig
Bastian[m] has joined #zig
BaroqueLarouche has joined #zig
protheory8-new-m has joined #zig
ur5us_ has quit [Ping timeout: 244 seconds]
ur5us_ has joined #zig
ur5us_ has quit [Ping timeout: 260 seconds]
FireFox317 has joined #zig
cren has joined #zig
cren has quit [Client Quit]
cren has joined #zig
cren has quit [Read error: Connection timed out]
CommunistWolf has joined #zig
ky0ko has quit [Quit: killed]
ky0ko has joined #zig
gazler has joined #zig
hamoko[m] has joined #zig
marnix has joined #zig
gpanders has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
dimenus has quit [Quit: WeeChat 2.9]
nvmd has joined #zig
cren has joined #zig
<cren> Hey, is it possible to initialise a slice with a fixed size?
<pixelherodev> andrewrk: should CBE compare_output tests invoke `zig cc` on stage1, use the system compiler, or...?
<pixelherodev> I think `zig cc` is probably the most consistent option there, but I could see arguments for why that makes it bad for automated testing
<andrewrk> not `zig cc` the CLI, but yes use zig's built in ability to compile C code
<andrewrk> cren, can you elaborate?
<ifreund> cren: you can set the .ptr and .len fields of slices to whatever you like
<ifreund> andrewrk: in case you were wondering, I haven't given up on wasm backend. Just got sidetracked working on river
<pixelherodev> ifreund: no one's going to get annoyed at you for taking a break from a project you're volunteering on :)
<cren> at the moment I'm doing `array: [n]T = undefined;` followed by `slice = []T = array[0..];`
<cren> I was hoping there'd be a way to do that in a single line
<cren> oops, I mean `slice: []T =`
<pixelherodev> A slice of undefined memory? Huh
<cren> it gets written by a function
<ifreund> cren: I don't think that does what you want
<pixelherodev> Write, of course (pun intended)
<ifreund> what you want is for the .ptr to be undefined but the .len to be defined
<cren> I guess
<ifreund> so var s: []T = undefined; s.len = x;
<fengb> He wants both to be defined, but the contents remain undefined
<pixelherodev> ^
<pixelherodev> You don't want the pointer undefined there
<ifreund> ah I see
<cren> I don't actually need the array
<pixelherodev> Pointer undefined would require allocation within the function
<cren> that was why I was trying to reduce it to one line
<cren> just need to get the output from this function that writes into a buffer you supply
<ifreund> what memory do you want the slice to end up pointing to?
<fengb> Zig forces you to create the array so it's explicit where the stack variable goes
<cren> a string. Here, I'll post the code someplace, that'll make it easier
sawzall has quit [Read error: Connection reset by peer]
<pixelherodev> cren: if you want it writing to a new stack buffer, you *need* the array I think
<ifreund> sounds like you need to supply a buffer then
<pixelherodev> The array *is* the buffer
<cren> ohh yeah cause slices are just pointers
<ifreund> which could be an array on the stack or something you allocate
<pixelherodev> Slices are just special pointers, yeah
<cren> I was getting confused because I was then reading the value (into debug.print) from the slice, but that's just reading it from the array...
<pixelherodev> Yep! :)
<cren> :)
<pixelherodev> You could *only* define the array
<pixelherodev> Then call the func with `func(arr[0..])` and use the array
sawzall has joined #zig
<cren> while we're on the subject, what if I don't know how much data might be read into the buffer? How can I ensure the buffer is long enough
<cren> so that the text doesn't get cu
<cren> like that
<cren> (it's a string buffer)
<ifreund> well if the api you're using tells you the length, you can allocate
<cren> yes
<fengb> Either give it a nice max or you need to allocate yeah
xackus_ has joined #zig
<cren> That's the program. Do you think you could give a quick example of how to do the allocation?
<ifreund> oh this is a socket thing
<ifreund> you can probably just call recieve again if you run out of space
marnix has quit [Ping timeout: 256 seconds]
sawzall has quit [Read error: Connection reset by peer]
<cren> how would the program know that it hadn't got the whole message, though?
sawzall has joined #zig
<ifreund> well, that's not up to the transport layer really. Usually the protocol defines a fixed size header or something that says how long the message is
<fengb> Yeah, with raw TCP sockets, you only really know of packet sizes. Messages don't really exist at that layer
<companion_cube> whereas zeromq gives you framing, woo
<cren> ah, good point. I'm aiming for this thing to become an IRC client eventually, so it will need to detect the end of IRC messages. I have yet to read the spec
<fengb> Gosh, ancient technology :P
<fengb> Back before everything decided to use HTTP
<cren> HTTP is like the de facto protocol for the internet now
<companion_cube> you can just read lines
<companion_cube> IRC is line oriented
wootehfoot has joined #zig
zippoh has quit [Remote host closed the connection]
zippoh has joined #zig
<cren> by the way, is there any difference between passing a slice to a function so it can write to an array, and passing a pointer for the same purpose?
<fengb> No, a pointer to array coerces into a slice automatically
<cren> OK, thanks
cren has quit [Ping timeout: 240 seconds]
wootehfoot has quit [Ping timeout: 246 seconds]
waleee-cl has joined #zig
rzezeski has quit [Quit: Connection closed for inactivity]
pmwhite has quit [Remote host closed the connection]
epmills has joined #zig
wootehfoot has joined #zig
epmills has quit [Remote host closed the connection]
procnto_ has joined #zig
mgxm_ has joined #zig
shakesoda_ has joined #zig
marnix has joined #zig
protheory8-new-m has quit [*.net *.split]
BaroqueLarouche has quit [*.net *.split]
alexnask[m] has quit [*.net *.split]
mgxm has quit [*.net *.split]
shakesoda has quit [*.net *.split]
procnto has quit [*.net *.split]
procnto_ is now known as procnto
shakesoda_ is now known as shakesoda
mgxm_ is now known as mgxm
fengb has quit [Remote host closed the connection]
return0e[m] has quit [Read error: Connection reset by peer]
ifreund[m] has quit [Remote host closed the connection]
dtz has quit [Write error: Connection reset by peer]
Snektron has quit [Remote host closed the connection]
Nypsie[m] has quit [Remote host closed the connection]
alva has quit [Remote host closed the connection]
gpanders[m] has quit [Remote host closed the connection]
Bastian[m] has quit [Remote host closed the connection]
hamoko[m] has quit [Remote host closed the connection]
dtz has joined #zig
ifreund[m] has joined #zig
return0e[m] has joined #zig
alva has joined #zig
hamoko[m] has joined #zig
gpanders[m] has joined #zig
alexnask[m] has joined #zig
Bastian[m] has joined #zig
protheory8-new-m has joined #zig
fengb has joined #zig
Nypsie[m] has joined #zig
Snektron has joined #zig
BaroqueLarouche has joined #zig
cren has joined #zig
epmills has joined #zig
epmills has quit [Ping timeout: 240 seconds]
<pixelherodev> "HTTP is like the de facto protocol for the internet now" Unfortunately, yeah.
<pixelherodev> It's not a particularly good protocol, but it's what we've got
<leeward> For the web, yes. For the internet? No.
<companion_cube> de facto, alas, it is
<pixelherodev> leeward: Yeah, fair
cren has quit [Ping timeout: 244 seconds]
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
craigo has quit [Ping timeout: 256 seconds]
reductum has joined #zig
nullheroes has joined #zig
CodeSpelunker has joined #zig
cole-h has joined #zig
nvmd has quit [Quit: Later nerds.]
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
ur5us_ has joined #zig
nvmd has joined #zig
marnix has quit [Ping timeout: 256 seconds]
jeko has quit [Quit: Leaving]
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
blinghound has joined #zig
nvmd has quit [Quit: Later nerds.]
reductum has quit [Quit: WeeChat 2.9]
epmills has joined #zig
xackus_ has quit [Ping timeout: 265 seconds]
tdeo has quit [Read error: Connection reset by peer]
tdeo has joined #zig
<pixelherodev> I think I figured out how to maintain interest in the CBE. I'm rewriting some of the tricarbon components; I'm going to make sure they compile to C from the beginning :D
<Snektron> I didn't even know tricarbon (the molecule) existed
<pixelherodev> lol
<pixelherodev> Snektron: do you remember my other name?
<pixelherodev> I barely do
<pixelherodev> Cyclopropatriene
<pixelherodev> It *doesn't* exist.