ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
JinShil has joined #zig
isd has quit [Quit: Leaving.]
<achambe>
andrewrk: is the code for your async http server online somewhere?
<andrewrk>
achambe, the tcp one is but I didn't finish the http one yet
<GitHub47>
[zig] andrewrk closed pull request #970: Fixed extern enums having the wrong size (master...extern-enum-size-fix) https://git.io/vp0ht
<MajorLag>
That's some impressive work. I really didn't expect to see that idea implemented so soon.
<GitHub7>
[zig] andrewrk closed pull request #981: ArrayList iterator, unifying API of HashMap and its derivatives (master...ArrayIteratorUnifiedSyntax) https://git.io/vp2ZW
<GitHub114>
zig/master e907c5c Braedon: Unified API
<GitHub174>
zig/master ef3111b Marc Tiehuis: Use allocator backed array for json value decoder
<GitHub174>
zig/master f174726 Marc Tiehuis: Fix review comments for json decoder
<GitHub174>
zig/master 0afc6a9 Marc Tiehuis: Add json decoder...
jjido has joined #zig
relatingdata has quit [Quit: Page closed]
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
<alexnask>
@andrewrk The only thing that kinda blocked me was nullable types, I really hate how I had to abuse @typeOf(undefined)
<alexnask>
But that will be fixed eventually
JinShil has quit [Quit: Leaving]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
<andrewrk>
yeah, and it's actually quite a nice workaround for the time being
<andrewrk>
but - agreed - I've started pointer reform branch
<alexnask>
@andrewrk Isn't not being able to reassign type variables and have pointers to types/nullable types a separate bug?
<alexnask>
I mean, with pointer reform I guess lots and lots of pointer code will change so the bugs will be corrected with it
<alexnask>
But they could be fixed in isolation, right?
<andrewrk>
the isolated fix is to introduce a separate syntax for address-of and pointer type
<andrewrk>
e.g. * for pointer type, & for address-of
<alexnask>
Why is that? I fail to see how it's related to being unable to reassign a variable of type 'type'
<alexnask>
I know a = b; -> *(&a) = b;
<andrewrk>
let me show you some Zig IR
<andrewrk>
the & operator - if a is type `type`, modifies the type to be a pointer
<alexnask>
Right, so the same IR is generated as for creating a reference type from a
<alexnask>
pointer type*
<andrewrk>
if a = i32, then @typeOf(&a) == type. if a = i32(1), then @typeOf(a) == &i32
<alexnask>
I see, gotcha
<alexnask>
I assume something similar happens with ?type behind the scenes
<andrewrk>
right. the maybe unwrap operator needs a pointer because you can assign to it, e.g. ??a = 1234;
<andrewrk>
wait a minute, I'm getting two things confused
alexnask has quit [Quit: Leaving]
alexnask has joined #zig
<andrewrk>
I forget why, but the zig IR instructions for dealing with nullable types need pointer values
<andrewrk>
alexnask, oh right. if (nullable_value) |*unwrapped_ref| { ... }
<alexnask>
@andrewrk TypeTableEntry* get_maybe_type(CodeGen*, TypeTableEntry*): Assertion `child_type->di_type' failed. is the error when trying to define a struct with a nullable type field
<alexnask>
Which probably means 'type' doesn't have a LLVM type attached to it (which makes sense)
<andrewrk>
oh maybe there's an additional problem here
<andrewrk>
I don't think I've ever tested making a struct that uses types that are not valid at runtime
<alexnask>
'type' works fine if you only use it in a comptime context
<alexnask>
seems to work in a runtime context too woops :P
<andrewrk>
hmmm. that sounds like a bug
<alexnask>
(the field becomes a 0-bit)
<alexnask>
Idk it's a pretty weird edgecase
<alexnask>
Trying to assign to the field yields 'error: cannot assign to constant' but it can be constructed properly
<alexnask>
woops my instance was const
<alexnask>
assigning seems to work, so I agree it's a bug for sure :p
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<alexnask>
andrewrk Are there any async code docs/realistic examples?
<alexnask>
I assume they work much like C++ coroutines?