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
halosghost has joined #zig
halosghost is now known as hg
marmotini_ has joined #zig
steveno_ has joined #zig
steveno__ has joined #zig
steveno_ has quit [Ping timeout: 240 seconds]
<Akuli> dumb question: what am i doing wrong? https://termbin.com/cs3u
schme245 has quit [Remote host closed the connection]
<Akuli> nevermind figured it out, ArrayList.init doesn't want try
<hg> ahh termbin, for when you need javascript to display text
schme245 has joined #zig
tleguern has joined #zig
schme245 has quit [Remote host closed the connection]
<tleguern> Hello
<tleguern> I am Aversiste on Github, trying to port zig on OpenBSD.
Flaminator has joined #zig
steveno__ has quit [Ping timeout: 250 seconds]
<andrewrk> hi tleguern
<tleguern> Do you have any documentation specific to porting ?
Zaab1t has joined #zig
marmotini_ has quit [Ping timeout: 272 seconds]
<andrewrk> I'll move this to a wiki page and update it
<tleguern> Ok, thanks.
steveno__ has joined #zig
<andrewrk> I updated the page. Let me know if you run into something that isn't on that list
<tleguern> Oh, great :)
<andrewrk> most stuff should give you a helpful error message when you try to use your new target
<andrewrk> and I can explain any error that does not make sense
<andrewrk> you can do this process one little piece at a time
arhiv6_ has joined #zig
<arhiv6_> Hi all. I find Zig documentation. But, where I am find documentation on "Zig Standard Library"? What all methods are have std library?
<andrewrk> arhiv6_, everybody wants that, and we don't have it yet. until some improvements are made you have to read the source
<andrewrk> here's an issue you can follow: https://github.com/ziglang/zig/issues/21
<arhiv6_> Ok, thanks.
<Akuli> how do i access the type of an enum member? http://dpaste.com/3J40QZG
<Akuli> s/enum/union/
<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}, };`
<MajorLag> 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
<andrewrk> Akuli, is this what you want? https://ziglang.org/documentation/master/#errorName
<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
<hg> Akuli: sure; but I mean in C
<hg> I'd like for it to be a funcitonal means of i18n everywhere (windows, macos and linux)
<andrewrk> I think it will be a goal of zig for i18n to be a third party package, and not in the standard library
<Akuli> then write python's thing in zig and use it as a library from c :D
<andrewrk> an i18n package must be updated frequently, it depends on a lot of data, and many computing tasks do not require it
<andrewrk> so that also means that std must not step on a third party i18n's toes
<Akuli> what would i do them if i'm a library writer who wants translated strings in the library?
<Akuli> then
<Akuli> if i18n is a third-party thing, won't users have different preferences for i18n libraries that they'd like to use with my library?
<andrewrk> I'm not sure what you're asking. Translating strings is development work, in the same way that fixing a bug is
<Akuli> nevermind :D
fsateler_ has joined #zig
marmotini has quit [Ping timeout: 246 seconds]
fsateler has quit [Ping timeout: 268 seconds]
marmotini has joined #zig
<Akuli> is returning a string literal a no-no like it is in c?
schme245 has joined #zig
marmotini has quit [Ping timeout: 240 seconds]
housecarpenter has joined #zig
<Akuli> like this: fn doStuff() []const u8 { return "Hello"; }
<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]
utzig has joined #zig
allochi has joined #zig
allochi has quit [Client Quit]
rom1504 is now known as get-title[bot]
get-title[bot] is now known as rom1504
gamester has joined #zig
<gamester> Small bug report through pastebin, thanks: https://pastebin.com/raw/8atBMSgc
gamester has left #zig [#zig]
gamester has joined #zig
<gamester> oh actually the compiler still segfaults even if you make the struct extern
<gamester> (in 3rd example)
gamester has left #zig [#zig]
<andrewrk> gamester - thanks. I'll turn this into a bug report for you