ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
Tobba has quit [Ping timeout: 256 seconds]
curtisf has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Dodo>
could've also returned the union directly I notice now
Braedon has joined #zig
<Braedon>
Most iterators also have a '.next()' though so you can always do `var it_next = it.next(); while(it_next) |next| { ... // use next }`
<Braedon>
Which is quite like a for loop, though of course yeh we don't have maps/reduce and stuff :)
<Hejsil>
Dodo, Was there anything specific you needed comment on in your code? If you're just playing around unions, this seems correct
<andrewrk>
Hejsil, you've been busy while I was asleep
<Hejsil>
I've overtaken your commit count! >:)
<andrewrk>
argh!
<Hejsil>
Well, after I got While parsing, nearly all the code was already there for 'for' and 'if'
<Hejsil>
comptime, and defer where simple
<Hejsil>
So it wasn't really that much work
<Dodo>
just wondering if it was the right way indeed Hejsil
<andrewrk>
Test 37/39 zig fmt: ...
<andrewrk>
wow, so close
<Hejsil>
self hosted parser hype!
<Hejsil>
This was way more work than expected. All I wanted was to create some small program that generated an index of `std` :(
<andrewrk>
that's how it happens. you think "I understand the basics of how this works" and then you get sucked into the details
<Hejsil>
Indeed
<Hejsil>
I think I'll probably go back to doing some randomizer work when the parser is done. That indexing thing can wait
<andrewrk>
I'll get started on analysis in the self hosted compiler!
<Hejsil>
Index, as in some html page for easy browsing
<Hejsil>
Nice!
<andrewrk>
it's all coming together - I was wanting to finish this coroutine proof of concept that I just got done last night because I want to make it use a thread pool and coroutines to parallelize work
<Hejsil>
How would zig doc play work? Would it run while the analyzer is running, so it knows which files are imported, or would zig doc just naively iterate over the ast, assuming that all files imported are actually used?
<andrewrk>
docs would be a build artifact from the other build modes
<Hejsil>
s/zig doc play/zig doc/g
<andrewrk>
this is another situation where multiboot is relevant
<andrewrk>
*multibuild
<Hejsil>
Aaaah, so it'll be the same as the zig json that was worked on
<Hejsil>
I remember that now!
<andrewrk>
the first pass will be like that
<andrewrk>
ideally, a build will simultaneously process code for the multiple comptime branch configurations that can be made - release vs debug, linux vs windows, etc. docs would indicate when something is only available in one context or indicate that something could be a different type
<Hejsil>
Make sense
<Hejsil>
Anyways, I'm off for a bit
Hejsil has quit [Quit: Page closed]
<andrewrk>
take care
Braedon has quit [Ping timeout: 260 seconds]
MajorLag2 has joined #zig
MajorLag has quit [Ping timeout: 276 seconds]
MajorLag2 is now known as MajorLag
<MajorLag>
andrewrk: with tagged unions: setting it to "undefined" seems to cause a runtime saftey error if you define it later, "access of inactive union field".
<MajorLag>
how would I reset the tag?
<andrewrk>
overwrite the entire union
<andrewrk>
foo = TypeName { .Blah = whateven }
<andrewrk>
that's a great point though, if you set a union to undefined, it should set the safety tag to a special value to note that none of the tags are active
<andrewrk>
because I bet right now it would let you write/read with the 0th field
<MajorLag>
right, ok, that makes sense.
<MajorLag>
actually no, it threw the same error... but maybe the first listed field isn't necessarily the 0th.
<andrewrk>
oh right, the most aligned one is
<andrewrk>
e.g. the biggest size
<andrewrk>
anyway I think this is working as designed, with a potential impromevent to runtime safety to be made
<MajorLag>
doesn't seem to work either. probably it is whatever happens to be in the tag value location in memory at the time? but yeah, academic. being able to set to undefined and handle it later would be a minor but welcom convenience.
MajorLag2 has joined #zig
MajorLag has quit [Ping timeout: 276 seconds]
MajorLag2 is now known as MajorLag
isd has joined #zig
MajorLag2 has joined #zig
MajorLag has quit [Ping timeout: 276 seconds]
crimson_penguin has quit [Ping timeout: 265 seconds]
Dodo has quit [Quit: Page closed]
crimson_penguin has joined #zig
crimson_penguin has quit [Changing host]
crimson_penguin has joined #zig
Dodo has joined #zig
noonien has quit [Quit: Connection closed for inactivity]
MajorLag2 is now known as MajorLag
isd has quit [Ping timeout: 265 seconds]
Dodo has quit [Quit: Page closed]
isd has joined #zig
davr0s has joined #zig
isd has quit [Ping timeout: 276 seconds]
isd has joined #zig
Ichorio has joined #zig
arBmind has quit [Quit: Leaving.]
isd has quit [Read error: Connection reset by peer]
isd has joined #zig
stephaneyfx has joined #zig
brannock has joined #zig
brannock has quit [Quit: Page closed]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]