ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<martinium>
why no for in loop?
<martinium>
I like for in saves time for iterations
<martinium>
or I should say I am used to that
<martinium>
lol
<martinium>
feels more intuitive than old school C style for loop
<wink_>
For me I'd contemplate removing "for" and just have "while" loops handle ranges like "for".
<wink_>
A "do {} until" would be nice for those infrequent times you always go through once.
<martinium>
kind of reminds me of ruby's .each iteration
<martinium>
|value| piece is like ruby and is the iterator in that lang so guess that is throwing me off for zigs while loops
<martinium>
anyone do fizzbuzz in zig?
<martinium>
I need to see more sample code to wrap my head around the lang
geocar has quit [Quit: Connection closed for inactivity]
<kristate>
my battery died in the middle of andrewrk's livestream!
<kristate>
Didn't have a power supply and it was 5a in japan, so I will try to rewatch it later today.
dbandstra has joined #zig
<dbandstra>
unique_id, thanks for the feedback! however i have to redirect your praise to verminian trap, the game i cloned (even the specific enemies for each wave was copied)
<dbandstra>
i suppose a good thing to add would be basic menu and a quit confirm :p
<martinium>
error: variable of type 'comptime_int' must be const or comptime
<martinium>
var i = 0;
<dbandstra>
you have to explicitly give the number a type
<dbandstra>
like `var i: u32 = 0;`
<dbandstra>
or `var i = u32(0);`
<dbandstra>
integer literals have a special type, `comptime_int`, which lets you do some constant arithmetic and stuff without having to worry about the actual storage type until you actually put it in a variable
<martinium>
nice that solved it
<martinium>
also corrected the non interpolation
<martinium>
another thing
<martinium>
want to get my head around the zig for loop
<martinium>
for (condition) |whatisthis?| {do something}
clownpri1 has quit [Ping timeout: 252 seconds]
<dbandstra>
for doesn't take a condition, it takes an array/slice
<dbandstra>
for (some_slice) |an_item_from_the_slice| {do something}
<dbandstra>
optional second param: `for (some_slice) |item, index| {do something}`
<dbandstra>
in the pipes are basically variable declarations , but without the const/var keyword
<tiehuis>
I'll make a PR tonight or tomorrow. I have an issue on my current environment but I've tested it and it works pretty well otherwise
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
qazo has joined #zig
<kristate>
tiehuis: good to have you on IRC
<kristate>
tiehuis: n
<kristate>
normally we don't see you here?
<tiehuis>
i usually just read the logs and hop on if there is a question to answer
<kristate>
tiehuis :-)
<kristate>
tiehuis: have you ever come to Japan? I read that you live in NZ
liesegang has joined #zig
<tiehuis>
i have not, no, but i think i would like to some day
<kristate>
tiehuis: I am thinking about holding a small get together for zig members later this year -- maybe October or November
<dbandstra>
wow
davr0s has joined #zig
dbandstra has quit [Quit: Leaving]
martinium has quit [Quit: Leaving]
clownpri1 has joined #zig
clownpri1 has quit [Ping timeout: 252 seconds]
clownpri1 has joined #zig
clownpri1 has quit [Ping timeout: 252 seconds]
geocar has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
liesegang has quit [Remote host closed the connection]
clownpri1 has joined #zig
clownpri1 has quit [Ping timeout: 252 seconds]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Ping timeout: 244 seconds]
kristate has joined #zig
clownpri1 has joined #zig
clownpri1 has quit [Ping timeout: 240 seconds]
noonien has joined #zig
rain1 is now known as rain2
kristate has quit [Remote host closed the connection]
clownpri1 has joined #zig
clownpri1 has quit [Ping timeout: 252 seconds]
very-mediocre has joined #zig
very-mediocre has quit [Ping timeout: 252 seconds]
davr0s has joined #zig
clownpri1 has joined #zig
clownpri1 has quit [Ping timeout: 252 seconds]
tiehuis has quit [Quit: WeeChat 2.2]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
clownpri1 has joined #zig
clownpri1 has quit [Ping timeout: 252 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
clownpri1 has joined #zig
clownpri1 has quit [Ping timeout: 250 seconds]
<andrewrk>
tiehuis, if your godbolt change gets merged, I'll add a test for the command line parameters and panic functions and stuff that we're using, just to be sure we don't break it
qazo has quit [Ping timeout: 252 seconds]
<wilsonk>
andrewrk: nice stream last night!
<wilsonk>
really enjoyed that one :)
<andrewrk>
thanks wilsonk
<andrewrk>
I'll try to do more like that
<wilsonk>
great, I will be watching...well I watch all of them anyways, but I will continue to watch ;)
<andrewrk>
maybe next week will be on syscalls
<wilsonk>
Sounds good. Stack traces and/or the differences between the three OS's for the zig compiler (both stages) might also be a good topic
<andrewrk>
agreed
kristate has joined #zig
clownpri1 has joined #zig
<MajorLag>
Is there no issue for the compiler crashing when undeclared identifiers are used at comptime?
<andrewrk>
I was not aware of that issue
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
qazo has joined #zig
qazo has quit [Read error: Connection reset by peer]
clownpri1 has quit [Ping timeout: 240 seconds]
<MajorLag>
Really? I thought this had come up.
<MajorLag>
I'll put together an example or two and make an issue.
<MajorLag>
You usually have to abstract it a bit for the problem to surface, call it from another namespace for instance. Actually, #1483 is probably another manifestation of the same problem.
clownpri1 has joined #zig
clownpri1 has quit [Ping timeout: 252 seconds]
clownpri1 has joined #zig
<MajorLag>
..hmmm, no it's more than that.
davr0s has joined #zig
cgag has joined #zig
<cgag>
is this first argument redundant: `self.freeFn(self, <...>);` or is there a reason for that? (from std/mem.zig/destroy)
<cgag>
^ i may have sent htat before, idk, apparently i lost my connection to freenode with irccloud and didn't notice
<andrewrk>
cgag, note that freeFn is a function pointer field, not a method
<cgag>
ah, makes sense
beetcoin has joined #zig
<MajorLag>
andrewrk: I've spent about an hour trying to find or recreate a case where a compileError thrown at comptime results in a crash to no avail. Next time I run into one naturally I'll be sure to minimize it and make an issue.
<andrewrk>
MajorLag, my apologies. if your code is open source I'd be happy to look at it
clownpri1 has quit [Ping timeout: 250 seconds]
<MajorLag>
I can't even make it happen right now in source where I know I ran into it, otherwise I'd take you up on that.
<MajorLag>
It's possible one of the causes was fixed.
<andrewrk>
I did fix quite a few bugs this week
clownpri1 has joined #zig
clownpri1 has quit [Ping timeout: 252 seconds]
<MajorLag>
ok, a struct seems to be a necessary part of the equation. Specifically a generated struct;
<MajorLag>
#1438 now has a more minimized example.
<MajorLag>
I'm pretty sure this is the core issue I've been running into. I've written lots of comptime voodoo lately.
clownpri1 has joined #zig
<andrewrk>
nice
<andrewrk>
MajorLag, typo? what's the issue number?
<andrewrk>
ah, 1483
<MajorLag>
yeah, typo, my bad
clownpri1 has quit [Ping timeout: 240 seconds]
clownpri1 has joined #zig
unique_id has quit [Remote host closed the connection]
clownpri1 has quit [Ping timeout: 252 seconds]
<andrewrk>
MajorLag, fixed
<MajorLag>
thanks
clownpri1 has joined #zig
kristate has quit [Remote host closed the connection]
clownpri1 has quit [Ping timeout: 252 seconds]
tridactyla has joined #zig
kristate has joined #zig
kristate has quit [Ping timeout: 252 seconds]
clownpri1 has joined #zig
unique_id has joined #zig
wilsonk has quit [Read error: Connection reset by peer]
wilsonk has joined #zig
<wink_>
andrewrk: in #1484 I added two other working solutions and it just seems odd that the most obvious one, to me, is an error.
clownpriest has joined #zig
clownpri1 has quit [Ping timeout: 240 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hoppetosse has joined #zig
<andrewrk>
wink_, zig does not have a hidden reference type
davr0s has joined #zig
<hoppetosse>
andrewrk: pushed the commit for the offset functions PR
<andrewrk>
hoppetosse, I'll have a look!
<hoppetosse>
If the control flow seems weird, let me know. I might have sacrificed some readability for the sake of less code duplication
clownpriest has quit [Ping timeout: 245 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
clownpriest has joined #zig
hoppetosse has quit [Read error: Connection reset by peer]