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/
msingle has quit [Ping timeout: 240 seconds]
Kingsquee has joined #zig
<ryuukk_> i can't find documentation about implementing custom iterator for a struct
<ryuukk_> is it possible?
<ryuukk_> so i can use for() on my struct
<ryuukk_> i'm looking for something like opApply in D https://tour.dlang.org/tour/en/gems/opdispatch-opapply
<waleee-cl> but someone collated some of the library efforts, https://github.com/ziglang/zig/issues/6185#issuecomment-683261019
<ryuukk_> so there is no way to replicate the for loop?
<waleee-cl> ryuukk_: and a proposal which mentions opApply specifically https://github.com/ziglang/zig/issues/5331#issue-616999128
<ryuukk_> so it's not possible
<tdeo> ryuukk_: if you implement `fn next(self: *Iterator) ?Element` you can use it like `for (iterator.next()) |element| { ... }`
<tdeo> not for, while*
msingle has joined #zig
<ryuukk_> i just need to add that one function?
<waleee-cl> I Ithink the crucial bit was the 2nd thing tdeo wrote
<ryuukk_> why not for?
<ryuukk_> why only slice?
<ryuukk_> what is the code slice implement to do the same?
<waleee-cl> code slice implement?
<tdeo> slice is part of the compiler
<waleee-cl> ryuukk_: regarding why only slices for 'for', I'm guessing separation of intent & explicity.
<waleee-cl> 'for' can only be used to iterate over a collection of items with a fixed length (slices have a length field)
<waleee-cl> while 'while' allows you to iterate over arbitrary structures
<waleee-cl> so that when you read code, you don't have to hunt for eg. an iterator implementation when coming across a for-loop
<ryuukk_> ah good point, thanks
<waleee-cl> but had there been a foreach, I'd have expected the same as you
omglasers2 has quit [Read error: Connection reset by peer]
a_chou has joined #zig
earnestly has quit [Ping timeout: 258 seconds]
a_chou has quit [Remote host closed the connection]
kristoff_it1 has quit [Ping timeout: 258 seconds]
msingle has quit [Read error: Connection reset by peer]
CommunistWolf has quit [Ping timeout: 260 seconds]
ryuukk_ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
CommunistWolf has joined #zig
msingle has joined #zig
ryuukk_ has joined #zig
msingle has quit [Ping timeout: 256 seconds]
stro has joined #zig
msingle has joined #zig
stro has quit [Remote host closed the connection]
marnix has joined #zig
lltt has quit [Ping timeout: 260 seconds]
cole-h has joined #zig
ask6155 has joined #zig
cole-h_ has joined #zig
cole-h has quit [Ping timeout: 264 seconds]
ifreund has quit [Ping timeout: 246 seconds]
ifreund has joined #zig
[RMS] has quit [Quit: No Ping reply in 180 seconds.]
burkac has joined #zig
_whitelogger has joined #zig
xd1le has quit [Read error: Connection reset by peer]
xd1le has joined #zig
[RMS] has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
msingle has quit [Ping timeout: 258 seconds]
lltt has joined #zig
semarie has quit [Remote host closed the connection]
marnix has quit [Ping timeout: 258 seconds]
marnix has joined #zig
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #zig
omglasers2 has joined #zig
burkac has quit [Ping timeout: 240 seconds]
ask6155 has left #zig [#zig]
frett27 has joined #zig
cole-h_ has quit [Ping timeout: 256 seconds]
supercoven has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
earnestly has joined #zig
ask6155 has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
ask6155 has left #zig [#zig]
skuzzymiglet has joined #zig
frett27_ has joined #zig
frett27 has quit [Ping timeout: 272 seconds]
<dutchie> is `catch null` the best way to go from !T to ?T?
<dutchie> (oops that ended up looking a bit confusing...)
frett27_ has quit [Ping timeout: 272 seconds]
Chris has joined #zig
Chris is now known as Guest67027
Guest67027 has quit [Remote host closed the connection]
_whitelogger has joined #zig
<ifreund> dutchie: yep
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
skuzzymiglet has quit [Ping timeout: 246 seconds]
kristoff_it1 has joined #zig
xd1le has quit [Read error: Connection reset by peer]
Kingsquee has quit []
xd1le has joined #zig
SimonNa has quit [Remote host closed the connection]
SimonNa has joined #zig
osa1 has joined #zig
frett27 has joined #zig
semarie has joined #zig
wootehfoot has joined #zig
<dutchie> woo, finished my first project in zig, rewriting a little haskell thing: https://github.com/jshholland/doomsday/tree/zig
<dutchie> any suggestions about dumb stuff i did welcome :)
marnix has quit [Ping timeout: 246 seconds]
marnix has joined #zig
radgeRayden has joined #zig
endragor has joined #zig
endragor has quit [Remote host closed the connection]
endragor has joined #zig
endragor has quit [Remote host closed the connection]
supercoven_ has joined #zig
supercoven has quit [Ping timeout: 240 seconds]
<ifreund> dutchie: Day.toString() isn't needed, we have @tagName() :P
ask6155 has joined #zig
endragor has joined #zig
<dutchie> ah yeah
<dutchie> actually i don't even call it, I just use @tagName in Date.format
<earnestly> An instant case of YAGNI that in fact wasn't needed
<earnestly> wasn't used*
xd1le has quit [Remote host closed the connection]
<dutchie> i think i did use it before i found that format existed
<earnestly> Well then, a nice negative commit is a reward
<dutchie> yep :)
ask6155 has left #zig [#zig]
<dutchie> is the compiler going to grow unused code warnings at some point?
<Nypsie[m]> Functions? No, but unused local variables will be errors at some point iirc
osa1 has quit [Quit: osa1]
<Nypsie[m]> Much thought still has to be put into that
xackus has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
xd1le has joined #zig
lltt has quit [Ping timeout: 260 seconds]
Akuli has joined #zig
msingle has joined #zig
msingle has quit [Ping timeout: 272 seconds]
marnix has quit [Ping timeout: 246 seconds]
xackus has quit [Ping timeout: 260 seconds]
marnix has joined #zig
endragor has quit [Ping timeout: 260 seconds]
xackus has joined #zig
moo has joined #zig
wootehfoot has quit [Ping timeout: 264 seconds]
layneson has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
FireFox317_ has joined #zig
layneson has quit [Ping timeout: 258 seconds]
cole-h_ has joined #zig
xackus has quit [Ping timeout: 256 seconds]
frett27 has quit [Ping timeout: 272 seconds]
frett27 has joined #zig
g-w1 has quit [Ping timeout: 256 seconds]
marnix has quit [Ping timeout: 256 seconds]
marnix has joined #zig
xackus has joined #zig
frmdstryr has quit [Ping timeout: 240 seconds]
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
g-w1 has joined #zig
frmdstryr has joined #zig
frmdstryr has quit [Ping timeout: 240 seconds]
FireFox317_ has quit [Quit: Leaving]
ask6155 has joined #zig
msingle has joined #zig
CommunistWolf has quit [Ping timeout: 240 seconds]
frmdstryr has joined #zig
CommunistWolf has joined #zig
frmdstryr has quit [Ping timeout: 256 seconds]
frmdstryr has joined #zig
oats has quit [Quit: until later, my friends]
cole-h_ is now known as cole-h
oats has joined #zig
ask6155 has left #zig [#zig]
knebulae has quit [Read error: Connection reset by peer]
knebulae has joined #zig
<kristoff_it1> Zig SHOWTIME starts in 5 mins, https://twitch.tv/kristoff_it
ryuukk__ has joined #zig
ryuukk_ has quit [Ping timeout: 272 seconds]
osa1 has joined #zig
msingle has quit [Ping timeout: 265 seconds]
xd1le has quit [Remote host closed the connection]
xd1le has joined #zig
<pixelherodev> companion_cube: I completely disagree
<pixelherodev> As a developer, I've started getting really annoyed by per-project dependencies
<pixelherodev> As a user, that's even more true
waffle_ethics has joined #zig
<pixelherodev> earnestly: ... I'm going to have to look at Gobo more, that looks really neat
<earnestly> pixelherodev: By the author of htop, heh
g-w1 has quit [Ping timeout: 265 seconds]
lltt has joined #zig
squeek502 has quit [Remote host closed the connection]
supercoven_ has quit [Read error: Connection reset by peer]
waffle_ethics has quit [Ping timeout: 258 seconds]
ryuukk_ has joined #zig
ryuukk__ has quit [Ping timeout: 256 seconds]
hnOsmium0001 has joined #zig
Kingsquee has joined #zig
<companion_cube> pixelherodev: to each their own :)
<pixelherodev> Yep :)
<pixelherodev> companion_cube: I've actually started devendoring an old project :P
<pixelherodev> It's just a hassle keeping libraries synced
<companion_cube> what's the alternative, though?
<pixelherodev> System-wide installations
<pixelherodev> It's much easier to manage that way
<companion_cube> you still need to keep track of dependencies (and their versions) quite closely
<pixelherodev> Not necessarily
<pixelherodev> At least, not with versions
<companion_cube> unless you depend only on decades-old libraries that don't move at all, of course
<pixelherodev> That's the whole point of semantic versioning
<pixelherodev> Depend on the major version only, or for new features, a minor version
skuzzymiglet has joined #zig
marnix has quit [Ping timeout: 240 seconds]
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
osa1 has quit [Remote host closed the connection]
skuzzymiglet has quit [Ping timeout: 260 seconds]
Ondingen has quit [Remote host closed the connection]
frmdstryr has quit [Ping timeout: 265 seconds]
skuzzymiglet has joined #zig
cole-h has quit [Ping timeout: 264 seconds]
marnix has quit [Ping timeout: 272 seconds]
ur5us has joined #zig
ur5us has quit [Remote host closed the connection]
ur5us has joined #zig
Ondingen has joined #zig
g-w1 has joined #zig
radgeRayden has quit [Ping timeout: 272 seconds]
Akuli has quit [Quit: Leaving]
nrdmn68 has joined #zig
nrdmn6 has quit [Read error: Connection reset by peer]
ryuukk_ has quit [Read error: Connection reset by peer]
ur5us has quit [Ping timeout: 244 seconds]
ur5us has joined #zig
radgeRayden has joined #zig
skuzzymiglet has quit [Ping timeout: 256 seconds]
earnestly has quit [Ping timeout: 260 seconds]
<Ondingen> Is it possible to get a better error message than "...exited with error code 3221225501 ..." from 'zig build run' with UBSan on windows? I tried "set UBSAN_OPTIONS=log_path=C:/ubsan_logs" but nothing appears there.
<Ondingen> (with C code)
kristoff_it1 has quit [Ping timeout: 264 seconds]
<andrewrk> Ondingen, if you have any zig code in the project, you can call std.debug.attachSegfaultHandler()
<andrewrk> and then it will print a stack trace when that happens
ur5us has quit [Ping timeout: 240 seconds]
a_chou has joined #zig
msingle has joined #zig
<Ondingen> I don't, it's a win32 C project (quake) and I couldn't get a WinMain working. But I added a separate segfault_handler.zig file and called b.addObject(...) and exe.addObject(...) and that works, but not for x86 builds, only x64.Using i386 as a target lld reports the error : "lld: error: ...\segfault_handler.obj: machine type x64 conflicts with x86".
<Ondingen> So it seems the target isn't respected? I worked around it by doing build-lib and then exe.addObjectFile(...). Now I get 2147483651 (0x80000003) as the error but nothing else. Is it because it's a win32 application? It works with a terminal app.
<Ondingen> @andrewrk
<andrewrk> Ondingen, can I see your build.zig file? note that you have to add the target for every artifact
msingle has quit [Ping timeout: 265 seconds]
<Ondingen> andrewrk https://pastebin.com/0uYCXp5u and segfault_handler.zig is compiled with "zig build-obj segfault_handler.zig -target i386-windows-msvc".
msingle has joined #zig
<Ondingen> the exe.addLinkerArg(...) was added by me to the compiler because I couldn't figure out any way to pass flags to the linker
<Ondingen> so you can't run it
<andrewrk> how is ubsan-test/src/segfault_handler.obj generated?
<Ondingen> "zig build-obj segfault_handler.zig -target i386-windows-msvc"
<andrewrk> that should be ok but simpler would be to put segfault_handler.zig in the call to addExecutable instead of null
msingle has quit [Ping timeout: 240 seconds]
<Ondingen> Oh, that works? I assumed addExecutable had to contain the entry point for some reason
<andrewrk> should work, if it doesn't I would label it a bug
<andrewrk> what is what is addLinkerArg("-nodefaultlib:libc") supposed to accomplish?
<Ondingen> MGLLT.LIB has -defaultlib:libc