ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<schme245>
can you escape "{" and "}" in format strings?
<andrewrk>
schme245, yes, double them up
<schme245>
ahh, bueno!
schme245 has quit [Remote host closed the connection]
jevinskie has joined #zig
scientes has quit [Disconnected by services]
scientes has joined #zig
jevinskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
darithorn has quit [Remote host closed the connection]
darithorn has joined #zig
scientes has quit [Ping timeout: 246 seconds]
kristate has joined #zig
scientes has joined #zig
return0e has quit [Ping timeout: 240 seconds]
steveno has quit [Quit: Leaving]
scientes has quit [Remote host closed the connection]
return0e has joined #zig
jevinskie has joined #zig
marmotini_ has joined #zig
marmotini_ has quit [Ping timeout: 250 seconds]
_whitelogger has joined #zig
darithorn has quit [Quit: Leaving]
_whitelogger has joined #zig
allochi has joined #zig
allochi has quit [Quit: Page closed]
marmotini_ has joined #zig
schme245 has joined #zig
schme245 has quit [Remote host closed the connection]
schme245 has joined #zig
reductum has joined #zig
schme245 has quit [Remote host closed the connection]
schme245 has joined #zig
kristate has quit [Ping timeout: 240 seconds]
reductum has quit [Quit: WeeChat 2.3]
Flaminator has quit [Disconnected by services]
marmotini_ has quit [Ping timeout: 240 seconds]
marmotini_ has joined #zig
schme245 has quit [Remote host closed the connection]
schme245 has joined #zig
schme245 has quit [Ping timeout: 272 seconds]
schme245 has joined #zig
schme245 has quit [Ping timeout: 240 seconds]
schme245 has joined #zig
Zaab1t has joined #zig
steveno has joined #zig
_whitelogger has joined #zig
steveno_ has joined #zig
steveno has quit [Ping timeout: 250 seconds]
wilsonk has quit [Read error: No route to host]
jevinskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Zaab1t has quit [Quit: bye bye friends]
marmotini_ has quit [Ping timeout: 240 seconds]
steveno_ has quit [Ping timeout: 272 seconds]
Akuli has joined #zig
<Akuli>
is the_file.inStream().stream the correct way to get an io.InStream for a file?
<Akuli>
hm, if i want to pass the stream to a function i need &the_file.inStream().stream
<Akuli>
well, this works: const data = Data{ .Point2D = @memberType(Data, 0){ .x = 1, .y = 2 }};
<Akuli>
maybe i'll just define the structures as consts first and then use them in the union definition
companion_cube has left #zig ["WeeChat 2.3"]
<andrewrk>
Akuli, ah, you ran into an issue I don't have the link handy for, but it's planned to be able to initialize anonymous structs
<andrewrk>
for now give your structs names
<Akuli>
neat, thanks :)
marmotini_ has joined #zig
<MajorLag>
I think I had a function for that in my PR. `std.meta.TagPayloadType. const data - Data{ .Point2D = std.meta.TagPayloadType(Data, Data.Point2D){ .x = 1, .y = 2}, };`
marmotini_ has quit [Remote host closed the connection]
<andrewrk>
oh right, you can work around that with reflection
marmotini_ has joined #zig
<andrewrk>
I will personally prefer naming structs until the anonymous literal syntax lands
marmotini_ has quit [Ping timeout: 245 seconds]
marmotini_ has joined #zig
wootehfoot has joined #zig
marmotini has joined #zig
marmotini_ has quit [Ping timeout: 246 seconds]
arhiv6_ has quit [Ping timeout: 256 seconds]
wilsonk has joined #zig
<Akuli>
is there something like strerror? i want to catch errors that may happen while opening a file and display them in a user-friendly way (that is, not a stack trace)
<Akuli>
i grepped for strerror in std/ and didn't find anything
<Akuli>
not quite, e.g. for ENOENT i would expect "No such file or directory" as returned by strerror(3) or similar
<andrewrk>
no - that does not exist in the standard library
<Akuli>
i think i'll write my own then
<andrewrk>
I think that's a good idea. If it were in the standard library it would start to cross a line into user interfaces / localization / translations etc
<Akuli>
hmm that's true :D the c function uses the current locale
<Akuli>
python uses it for its error messages, but so far i haven't heard of anyone complaining about seeing error messages in different languages depending on whether some library has called setlocale()
<hg>
I wish gettext() were more portable
<Akuli>
python has its own implementation of gettext that reads the .mo files or whatever the extension is
<andrewrk>
Akuli, that's fine because the memory for "Hello" is static, and thus valid for the entire lifetime of the application
schme245 has quit [Ping timeout: 245 seconds]
<Akuli>
nice :D
<andrewrk>
you have to always be able to answer the question "where are the bytes?"
<Akuli>
i know
<andrewrk>
for string literals, the answer is: in the read-only static data section
<andrewrk>
not only string literals, but all comptime-known arrays
<Akuli>
i like how zig doesn't force me to think in terms of something else than how zig works
Ichorio has joined #zig
hio has joined #zig
darithorn has joined #zig
<Akuli>
is there a way to attach an u8 to an error? i'd like to convert this to an error object return without losing the opbyte information: std.debug.panic("bytecode file contains invalid op byte {}", opbyte)
<Akuli>
since the byte is between 0 and 0xff, i could of course create 256 different errors, one for each byte :D
wootehfoot has quit [Quit: Leaving]
wootehfoot has joined #zig
<Akuli>
hmm i ended up actually doing that
<Akuli>
i think i'll need to create my own error handling stuff later, because the language this interpreter is supposed to run has exception objects, so this isn't "too horrible" "for now"
<Akuli>
or maybe it is :D
<andrewrk>
Akuli, creating 256 different errors, one for each byte, is an abuse of the error handling system
<Akuli>
:D well at least i had a good laugh writing this shit
<Akuli>
let me fix it
<andrewrk>
it violates a few of the zig philosophies, if you care about that
<andrewrk>
you're likely to prevent yourself from finding the best way to organize your code if you settle for a hack like that
<Akuli>
yes, i'm rewriting the shit away
<Akuli>
man that was probably the worst code i have ever written
<Akuli>
but it was funny
<Akuli>
now its gone :D
steveno__ has quit [Ping timeout: 250 seconds]
tleguern has quit [Ping timeout: 256 seconds]
wootehfoot has quit [Read error: Connection reset by peer]
Akuli has quit [Quit: Leaving]
schme245 has joined #zig
housecarpenter has quit [Read error: Connection reset by peer]
redj has quit [Read error: Connection reset by peer]
redj has joined #zig
Zaab1t has quit [Quit: bye bye friends]
hg has quit [Quit: WeeChat 2.3]
Ichorio has quit [Ping timeout: 250 seconds]
utzig has quit [Remote host closed the connection]