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/
ifreund has quit [Ping timeout: 252 seconds]
SLWW_ has quit [Read error: Connection reset by peer]
_Vi has quit [Ping timeout: 260 seconds]
eudoxus13 has joined #zig
eudoxus13 has quit [Client Quit]
dimenus has quit [Quit: WeeChat 3.1]
<nefix> is it possible to access the values of a struct from outside it? Using something like struct.value
<g-w1> yes?
<g-w1> do you mean fields, or namespace vars?
<nefix> fields I guess?
<g-w1> if namespace vars, in a different file, you must prepend `pub`
<g-w1> fields should just work??
<g-w1> im not sure what you mean?
<nefix> oh wait
<nefix> nvm, I forgot to initialize the variable
<nefix> thanks for all your time and help that you have given to me! :D
<nefix> good night everyone! :)
<g-w1> np :)
nefix has quit [Quit: WeeChat 3.1]
gracefu_1 has quit [Ping timeout: 260 seconds]
sm2n has quit [Quit: Leaving]
sm2n has joined #zig
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
earnestly has quit [Ping timeout: 252 seconds]
mokafolio has quit [Read error: Connection reset by peer]
moka has joined #zig
moka is now known as mokafolio
marijnfs2 has quit [Quit: WeeChat 3.1]
<mikdusan> that arm64 test box I guess is not same as pipeline runner. but `ps -ef | grep zig`:
<mikdusan> root 1383 32759 0 2020 ? 00:00:02 gdb --args /home/zig/build/zig build --override-lib-dir /home/zig/lib -Dlib-files-only --prefix /home/zig/build install
<mikdusan> whups. launched in '2020
<g-w1> lol, how did that happen?
<mikdusan> box uptime is 543 days
<mikdusan> so guess someone forgot about it
<g-w1> did it deadlock?
<mikdusan> no idea
M_F has quit [Ping timeout: 240 seconds]
<g-w1> idea for the deadlock: it seems like it could be a bug in std.Progress. if so, have you tried reproducing it on an arm machine while redirecting the output away from stdout? maybe cond only triggers then
<g-w1> seems quite unlikely, but anythings possible
<mikdusan> tbh I am not very uncertain about the host
<mikdusan> are you on discord?
<g-w1> yep
<mikdusan> gonna post a few screenies
<g-w1> ok
xackus_ has joined #zig
xackus has quit [Ping timeout: 240 seconds]
siraben has quit [Ping timeout: 245 seconds]
siraben has joined #zig
grive has quit [Ping timeout: 252 seconds]
grive has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
GreaseMonkey has joined #zig
gracefu_1 has joined #zig
Nazral has quit [Ping timeout: 265 seconds]
halbeno has quit [Remote host closed the connection]
halbeno has joined #zig
zie has quit [Quit: ZNC 1.8.2 - https://znc.in]
waleee-cl has joined #zig
ur5us__ has quit [Ping timeout: 250 seconds]
braket has quit [Ping timeout: 240 seconds]
sord937 has joined #zig
afk has quit [Ping timeout: 245 seconds]
tributarian has quit [Ping timeout: 245 seconds]
afk has joined #zig
tributarian has joined #zig
randomperson12 has joined #zig
<randomperson12> Hi! Can someone please explain why this snippet of code is failing to compile?: https://pastebin.com/J9zpy8QH
braket has joined #zig
<semarie> randomperson12: when you say "var a = 5;" the compiler reads it as "define a variable a with the value 5 of type comptime_int". but the compiler refuse to define a *variable* with a *comptime* value
<plumm> you can also use `comptime var a...` but im sure thats not the semantics you want
leon-p has joined #zig
<randomperson12> Thanks, semarie and plumm. How can I get around the issue though? I'm trying to declare a variable that is runtime allocated.
<plumm> `var a: usize = ...`
<randomperson12> Ok, thanks
<plumm> Honestly I was typing up an explanation but it feels weird to me that this code doesn't just work
Nazral has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
<plumm> :If you're making a zig safe wrapper around a c one, are the conventions to use the library conventions, or the zig ones?
ifreund has joined #zig
teratorn_ has joined #zig
teratorn has quit [Ping timeout: 240 seconds]
dyeplexer has joined #zig
<randomperson12> I am getting a similar comptime error. This time I think it might be a compiler bug: https://pastebin.com/qupuxWbE
<randomperson12> Is it a bug or do I have to specify variables to be runtime allocated?
randomperson1290 has joined #zig
randomperson1290 has left #zig [#zig]
<Nypsie> randomperson12: This isn't a bug. Integer literals are of the type comptime_int and have an infinite size. You'll have to specify its type in this case to make sure it doesn't over/underflow. Like this: https://zig.godbolt.org/z/76T41bqvs
Biolunar has quit [Ping timeout: 245 seconds]
<randomperson12> Thanks. I was confused because I wasn't getting an error earlier when I was compiling this code: https://pastebin.com/5zDSjyMG
Biolunar has joined #zig
randomperson12 has quit [Quit: Connection closed]
earnestly has joined #zig
<Nypsie> In this case it works because the result can be evaluated during compile time. In the previous example, it's done at runtime due to the if statement.
ur5us__ has joined #zig
xackus_ has quit [Read error: Connection reset by peer]
xackus has joined #zig
ur5us__ has quit [Ping timeout: 250 seconds]
<plumm> Does anyone know if there is a way to merge anonymous structs?
<ikskuh> what do you mean by merge?
<ikskuh> you can concatenate tuples with ++
<plumm> ikskuh thank you
marijnfs has quit [Quit: WeeChat 2.8]
ur5us__ has joined #zig
Bernstein has joined #zig
jokoon has joined #zig
cole-h has quit [Ping timeout: 252 seconds]
ur5us__ has quit [Remote host closed the connection]
ur5us__ has joined #zig
nefix has joined #zig
TheLemonMan has joined #zig
<nefix> good morning! Does Zig support WASM networking?
<TheLemonMan> andrewrk, I'm trying to download the FreeBSD llvm+clang+lld tarball but keep getting a 403
<ikskuh> nefix, WASM doesn't have a system layer
<ikskuh> so "no compiler supports WASM networking"
<ikskuh> zig supports WASI, but i'm not sure if wasi supports networking
<nefix> ikskuh: I know, but through websockets you can do io streaming. In go there are libraries that implement the default net connection interface, so you can use it as if it did support native networking
<ikskuh> that's a javascript library though ;)
<ikskuh> which exposes a interface to WASM
<TheLemonMan> and the FreeBSD server is still on llvm11.0, oh no
<ikskuh> nefix: so to get websocket support in WASM, you need to create/get glue code that provides this
<nefix> I see. Thanks! :D
knebulae has quit [Read error: Connection reset by peer]
knebulae has joined #zig
ur5us__ has quit [Ping timeout: 245 seconds]
kchambers has joined #zig
jokoon2 has joined #zig
jokoon has quit [Ping timeout: 260 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
jokoon2 has quit [Ping timeout: 260 seconds]
klltkr has joined #zig
zenkuro has joined #zig
TheLemonMan has joined #zig
teratorn has joined #zig
teratorn_ has quit [Ping timeout: 245 seconds]
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iamanoob has joined #zig
<iamanoob> const stdin = std.io.getStdIn().reader(); ... var buffer = try allocator.alloc(u8, 100); defer allocator.free(buffer); try stdin.readAll(buffer);
<iamanoob> error: expression value is ignored @: try stdin.readAll(buffer);
Nazral has quit [Ping timeout: 252 seconds]
<iamanoob> How can I solve this problem?
<TheLemonMan> readAll returns the number of bytes it successfully reads
<ifreund> you can ignore the return value with `_ = foo();` but in this case to do so would probably be a bug
<dutchie> yeah, if stdin only contains 20 bytes, then buffer[21..] is going to be undefined junk. and you only know what's defined by considering that return value
<iamanoob> so I should use: 'stdin.readByte(self) u8!' ?
iamanoob has quit [Read error: Connection reset by peer]
iamanoob has joined #zig
<TheLemonMan> what are you trying to do?
<iamanoob> get a string that somebody inputs
<TheLemonMan> mikdusan, do you happen to have a LLVM12 tarball for freebsd at hand?
<TheLemonMan> iamanoob, you want readUntilDelimiterOrEof (or its allocating counterpart)
<iamanoob> thank you very much
zenkuro has quit [Ping timeout: 240 seconds]
iamanoob has quit [Read error: Connection reset by peer]
iamanoob has joined #zig
iamanoob has quit [Read error: Connection reset by peer]
xackus_ has joined #zig
xackus has quit [Ping timeout: 240 seconds]
<mikdusan> TheLemonMan: yes but on 13.0
plakband has joined #zig
nathanael has joined #zig
<mikdusan> have 2 builds: release and release+assert . let me know if you need me to upload it somewhere
<nathanael> just installed zig on openbsd - I like the `zig zen` command :)
<ifreund> :)
dimenus has joined #zig
<mikdusan> (also have similar for openbsd 6.8, dragonfly 5.8.3, netbsd 9.1, alpinelinux, archlinux)
dimenus has quit [Client Quit]
<mikdusan> TheLemonMan: btw this URL for ci freebsd tarball works for me: https://ziglang.org/deps/zig+llvm+lld+clang-x86_64-freebsd-gnu-0.8.0-dev.1939+5a3ea9bec.tar.xz
<TheLemonMan> hey mikdusan, I've managed to reproduce the problem on an older revision that builds with llvm11, thanks anyway
<TheLemonMan> what the hell, the link's now working for me too
plakband has quit [Quit: WeeChat 2.9]
plumm has quit [Quit: Textual IRC Client: www.textualapp.com]
Nazral has joined #zig
<TheLemonMan> mikdusan, any news wrt the drone failure?
pretty_dumm_guy has joined #zig
jokoon has joined #zig
dagle has joined #zig
cole-h has joined #zig
dimenus has joined #zig
dimenus has quit [Client Quit]
dimenus has joined #zig
wilsonk_ has joined #zig
wilsonk__ has joined #zig
wilsonk has quit [Ping timeout: 240 seconds]
nefix has quit [Ping timeout: 268 seconds]
wilsonk has joined #zig
wilsonk_ has quit [Ping timeout: 252 seconds]
wilsonk__ has quit [Ping timeout: 252 seconds]
dok has quit [Ping timeout: 258 seconds]
jokoon2 has joined #zig
jokoon has quit [Ping timeout: 260 seconds]
plumm has joined #zig
wilsonk_ has joined #zig
wilsonk__ has joined #zig
wilsonk has quit [Ping timeout: 252 seconds]
wilsonk has joined #zig
wilsonk_ has quit [Ping timeout: 245 seconds]
wilsonk__ has quit [Ping timeout: 268 seconds]
Akuli has joined #zig
carldd has quit [Read error: Connection reset by peer]
carldd has joined #zig
zenkuro has joined #zig
zenkuro has quit [Ping timeout: 268 seconds]
<andrewrk> TheLemonMan, both the CI and I are able to download it: https://clbin.com/Ab2vA
<andrewrk> blame amazon. will be switching to fastly soon
<TheLemonMan> a collective middle finger to Bezos and his servers :(
xackus_ has quit [Ping timeout: 260 seconds]
<andrewrk> I'll be afk most of the day, making a 1.5 hour drive to get vaccine shot #1 today
plumm has quit [Quit: Textual IRC Client: www.textualapp.com]
<TheLemonMan> good news!
<companion_cube> drive safe
klltkr has joined #zig
dimenus has quit [Quit: WeeChat 3.1]
plumm has joined #zig
dyeplexer has quit [Remote host closed the connection]
teratorn_ has joined #zig
teratorn has quit [Disconnected by services]
teratorn_ is now known as teratorn
notzmv has quit [Ping timeout: 252 seconds]
dimenus has joined #zig
pretty_dumm_guy has quit [Quit: WeeChat 3.2-dev]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<v0idifyy> will zig run on your microchip? andrewrk
<ikskuh> v0idifyy: all vaccine microchips are pre-loaded with zig firmware
<v0idifyy> ah, good to know. we should add that to the website!
<v0idifyy> /s
zenkuro has joined #zig
notzmv has joined #zig
mmurd has quit [Ping timeout: 240 seconds]
mmurd has joined #zig
pretty_dumm_guy has joined #zig
dok has joined #zig
bitmapper has quit [Quit: Connection closed for inactivity]
nycex has quit [Ping timeout: 240 seconds]
nycex has joined #zig
kchambers has quit [Quit: WeeChat 3.1]
dimenus has quit [Read error: Connection reset by peer]
dimenus has joined #zig
pretty_dumm_guy has quit [Quit: WeeChat 3.2-dev]
bitmapper has joined #zig
sord937 has quit [Quit: sord937]
Anzh has joined #zig
jokoon2 has quit [Read error: Connection reset by peer]
leon-p has quit [Quit: leaving]
ur5us__ has joined #zig
SLWW has joined #zig
dimenus has quit [Read error: Connection reset by peer]
dimenus has joined #zig
Akuli has quit [Quit: Leaving]
Bernstein has quit [Remote host closed the connection]
teratorn_ has joined #zig
teratorn has quit [Ping timeout: 265 seconds]
dimenus has quit [Quit: WeeChat 3.1]
plumm has quit [Read error: Connection reset by peer]
<andrewrk> looks a bit like zig to me ;)
<v0idifyy> more like rust?
earnestly has quit [Ping timeout: 240 seconds]
<andrewrk> 0xaaaaaaaaaaa is what zig sets undefined bytes to
<dok> aaaaaaaaaaaa!
<v0idifyy> aaaaaaah, yeah
zenkuro has quit [Ping timeout: 240 seconds]
<noam> But that's not the microchip!