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/
<LewisGaul> I can create an issue, just thought I'd get a second opinion, having been staring at this for so long haha
<g-w1> create one, worst thing is it gets closed and you get an explination
<g-w1> i would only include 1 & 2 though
<LewisGaul> how come, don't they give distinct hints at what might be going on?
<g-w1> 3 includes more complexity, and it can be reduced with just 1 and 2
<g-w1> you can include 3 if you want ig
<LewisGaul> I'm confused, are we looking at the same thing? 3 is "no memory leak - direct arena deinit", which is the same as 1 "memory leak" but using `arena.deinit()` instead of `tree.arena.deinit()`
<g-w1> we are
<g-w1> my idea was that if it can be isolated with just 1 & 2, why include 3? but idc either way
<LewisGaul> I think I'm just failing to understand the relation between 2 and 3, you may well be right :)  I might as well include it all anyway
LewisGaul has quit [Quit: Connection closed]
<spacelove> Is there an idiomatic way of getting the len of an ArrayList?
<spacelove> To check if it's empty
<g-w1> list.items.len :)
<spacelove> How. HOW!
meinside has quit [Quit: Connection closed for inactivity]
<spacelove> g-w1 so, I'm doing a breadth first search. Basically I'm wondering if I'm making a mistake by using arraylists instead of something more complex, like my own custom type. Basically I have an ArrayList of Nodes which makes a graph. Each Node has as a property a list of its neighbors. What I want to do is start with a node and find the shortest
<spacelove> possible path to another one. So to do this I make a queue, which I will add arrays to (and pop off) as needed. To do all this popping and appending... maybe I'm wondering if ArrayList is the wrong thing, if maybe I have to implement my own datastructure. Thoughts?
<spacelove> That probably made zero sense.
<g-w1> a queue or a stack?
<g-w1> stdlib also has a queue datastructure iirc
<spacelove> queue... exists. wtf. amazing
<g-w1> not like c lol
<spacelove> I was so happy when I discovered string comparison
<g-w1> spacelove: out of curiosity, how did you find out about zig?
<spacelove> HackerNews, seemed hip
<g-w1> nice :)
<spacelove> Also, friends who do SWE
<g-w1> SWE?
<spacelove> Software Engineering
<g-w1> ah
<spacelove> in Sweden
<spacelove> joking about that last part
<spacelove> error: variable of type 'type' must be const or comptime
<spacelove>     var queue = std.TailQueue(StringArray); <-- there's no documentation on how to use this guy, have you seen him before?
<spacelove> My friends are skeptical of me using Zig though. I'm trying to prove them wrong
<g-w1> PROVE THEM WRONG!!!
<spacelove> That's my biggest motivator
<spacelove> Honestly it's like 10% curiosity 90% spite
<g-w1> the documentation is kinda borked rn, the best way to learn is to read the tests: https://github.com/ziglang/zig/blob/master/lib/std/linked_list.zig#L326-L438
<spacelove> ty
<g-w1> basically TailQueue is a function that takes a type and returns a struct
<g-w1> you have to initialize it
<spacelove> Ahhhhh
<spacelove> I see. If it's a struct... that reminds me of a zigling I did
<spacelove> I'm so close, I can taste it
<spacelove> Or maybe that's my filling that came out. One or the other
<spacelove> This is amazing!!!
selby has joined #zig
bsrd has quit [Read error: Connection reset by peer]
nycex has quit [Ping timeout: 268 seconds]
v0idifyy has joined #zig
v0idify has quit [Remote host closed the connection]
bsrd has joined #zig
nycex has joined #zig
Piraty has quit [Quit: No Ping reply in 180 seconds.]
Piraty has joined #zig
<spacelove> g-w1 https://zigbin.io/5424e7
<spacelove> Please tell me when to stop btw, I will respect your autonomy or whatever.
<spacelove> Please tell me when to stop btw, I will respect your autonomy or whatever.
<spacelove> Oh shoot I did it again
linuxgemini has quit [Read error: Connection reset by peer]
lunamn has quit [Read error: Connection reset by peer]
ave_ has quit [Remote host closed the connection]
<spacelove> Let me know if I can pm you, I will respect your time, but I feel like you have taken me under your wing and I don't want to necessarily spam the channel if my questions aren't super helpful for other people
<g-w1> is this a question?
<spacelove> Yea sorry.
<spacelove> I am trying to understand why this doesn't compile. https://zigbin.io/c63dc9 Has the error message
<g-w1> what is StringArray?
<spacelove> I put it in the code. At the top
<spacelove> I made it up because I needed arrays of strings a lot
<spacelove> Maybe it's a doozy... idk.
<g-w1> var array = StringArray.init(allocator); try array.append(start)
<g-w1> (beware, dont know very much about algorithms)
<spacelove> That's alright, I've got the algorithms under control
<g-w1> nice
<spacelove> I see what you did, so, the lesson is that you have to initialize arraylists before you can use them. Makes sense
<g-w1> you probably also want to deinit them when you are done with them
<spacelove> One step at a time baby
<spacelove> I feel like Rocky at the end of every movie
selby has quit [Ping timeout: 256 seconds]
brzg has joined #zig
<spacelove> g-w1 why did you learn Zig?
<g-w1> I wanted to learn about compilers, and the compiler source code was soooooo good (much cleaner than any other compiler i saw) that I ended up writing a minimal standard library for my toy language in zig
<g-w1> then i started working on the compiler lol
<spacelove> I want to be like you
brzg has quit [Quit: leaving]
brzg has joined #zig
<g-w1> spacelove: i only knew python and js a year ago. you can do it!
<spacelove> That's me!
<spacelove> Except minus the JS
<spacelove> and minus the year
<spacelove> And largely, minus the python
<g-w1> oh, it must have been someone else who said they knew python :P
<spacelove> My friend wants me to know if you use VSCode
<spacelove> He's helping me over the phone right now
<g-w1> i use emacs/neovim
<g-w1> i used to use vscode ~1 yr ago tho :P
<spacelove> Does your IDE tell you if your .zig will compile before you try to compile it
<spacelove> (Sam is asking)
<g-w1> no, zig language servers are not this advanced yet
<g-w1> hopefully they will be soon
<g-w1> for now, you have to compile it the old fashoned way
<spacelove> Cool
<brzg> nvim, on saving zig with zig.vim, will do a basic syntax check and run zig fmt
<sjd> I know this is totally off topic for this channel, but would anyone be interested in a "usesthis" for developers? Seems like usesthis.com has lost its way in recent years, focusing 0 on devs and more on other random genres
sepples has left #zig [#zig]
<spacelove> So, I'm initializing a struct with:
<spacelove> neighbors: std.ArrayList(*const Node),
<spacelove> then creating an instance with
<spacelove> .neighbors = std.ArrayList(*const Node).init(allocator),
<spacelove> then trying
<spacelove> node.neighbors.append(&next_node);
<spacelove> This seems like it should work.The data types match for .neighbors, initialize the array with init(allocator), but can't append the pointer to the other node. Getting this error:
<spacelove> expected type '*std.array_list.ArrayListAligned(*const Node,null)', found '*const std.array_list.ArrayListAligned(*const Node,null)'
<spacelove> on that last line.
<brzg> i think you declared something as const instead of var
<brzg> look at any relevant variable declarations, check if you made them immutable
<spacelove> The struct has to be const. The node "node" is var
<spacelove> Those are the only two relevant values afaict
<g-w1> neighbord: *std.ArrayList(*const Node)
<brzg> if the struct containing the ArrayList is const i don't think you can append
<g-w1> if the struct is const, then it has to be a pointer
<brzg> unless you use a pointer, as g-w1 is saying
<spacelove> Working, but -- why can't I just keep the struct's .neighbors as a simple array? Why does it need to be a pointer?
<spacelove> When some of the values can be regular ints/strings/whatev
<g-w1> if the instance of the struct it const, then it is not modifiable if it is just an arraylist
<g-w1> it can be an arraylist, but then you can't modify it (eg add to it)
<brzg> it needs to be a pointer if you want to mutate (append to) the contained arraylist
<spacelove> The instance is var though
<g-w1> of what?
<spacelove> There's a struct Node which has attributes "value, neighbors..."
<spacelove> var node = Node { ... neighbors = ... }
<g-w1> hmm
<spacelove> That was the original error. But your modification made it work, so...
<spacelove> I'm not really sure what I fixed, since it should have been working in the first place.
<g-w1> same
<spacelove> Shortened version with just the relevant code
<brzg> does it work without pointering the ArrayList if you initalise the ArrayList separately from the struct construction
<brzg> i.e. var neighbours = std.ArrayList(...).init(...);
<spacelove> I see...
<spacelove> ./word_chains.zig:88:28: error: cannot assign to constant
<spacelove>             node.visited = true;
<brzg> var node = Node { ... .neighbors = neighbours ... };
<spacelove> It's treating the type as a constant
<spacelove> even if the instance is var
<spacelove> This is the idiomatic way?
<spacelove> Have the instance keep pointers to the values and just modify the value by reference?
gpanders has quit [Ping timeout: 268 seconds]
<spacelove> https://zigbin.io/23a133 This is a minimal example that works.
<spacelove> https://zigbin.io/9327b5 This returns an error... almost exactly the same.
<spacelove> Says I'm trying to modify a constant value. But var Node is var...
<brzg> this is a variable scope mistake
<brzg> the node variable decalred in while (it.next()) is not the same as the node variable in for (grpah.items) |node|
jsb has quit [Quit: .]
<brzg> try changing for (graph.items) |node| to end with |*node|
<g-w1> yeah
<g-w1> it needs a pointer anyways
<brzg> the iteration sets node in a const way; changing to *node makes it a mutable pointer
<spacelove> That makes each node into a type **const Node
<spacelove> * is a pointer, what ** is I have never seen
<spacelove> You can't access the attributes on a ** struct
<noam> Stupid question: what's volatile do to asm?
<brzg> ** is a double pointer, don't know why that's showing up
<noam> ... I might break the asm syntax. This is ugly.
<noam> (which makes sense, since it's descended from *GCC*'s asm(
<noam> andrewrk: what's the identifier used for in the inline asm blocks? > [ret] "={rax}" (-> usize)
<noam> the example in the docs references a nonexistent identifier.
<andrewrk> noam, are you asking about the `usize` or the `ret`?
<noam> The ret
<noam> AFAICT it does literally nothing
<andrewrk> in the assembly source, it can be used like this: `%[ret]`
<noam> ... huh. Neat.
<noam> Why are they mandatory though?
<andrewrk> it shouldn't be. if you use the `-> T` form there is no reason to use it
<noam> Gotcha. Thanks for confirming :)
<noam> One more tweak being made to the grammar here then :)
<andrewrk> assembly syntax is one of the oldest parts of zig language, which has not yet received a design iteration
<noam> Makes sense
<noam> Ah yeah, didja see the progress in zyg? In the last day: test suite, scope rules, semantic analysis, arm64 and amd64 code generation, function calls, call and type graph generation, deferred execution, loops... :D
<noam> Currently working on locals, slices / strings, and inline asm, should be done with those and more tonight :D
<g-w1> ^ noam went crazy
<noam> AsmOutputItem <- (LBRACKET IDENTIFIER RBRACKET)? STRINGLITERAL LPAREN (MINUSRARROW TypeExpr / IDENTIFIER) RPAREN
<noam> I think that makes sense, right?
<noam> Honestly, I don't even see the point in the parens
<noam> "foo" -> usize
<noam> that makes perfect sense to me, don't see why "foo" (->usize) is better...
craigo has quit [Read error: Connection reset by peer]
<noam> Given that asm is due for a rework in zig [the language] anyways, I'm just going to do whatever for now until it's settled
<spacelove> @gw-1 this is the solution: https://zigbin.io/e356cf
<spacelove> pretty simple, not much pointer shit involved
<g-w1> ah i see
<g-w1> nice
<spacelove> Ty
<andrewrk> noam, can you link to some passing test cases?
<noam> I don't have 'zyg test' written just yet, so my "test cases" consist of running an input through the pipeline and checking for errors, currently :P A few days should be enough to get actual execution and such, though that depends on how much effort I put into revamping the assembler
<g-w1> spacelove: i have noted down some improvements to compile errors that would have helped you
<g-w1> ./zyg --target amd64 test/rk9/4.zig # then see the assembler output
<g-w1> you must be on tmp branch though
<noam> Yeah, because I need to do some squashing and cleanup before pushing to master :P
<noam> but then i just kept doing more work!
<noam> Might just move it for now and focus on better commit hygiene in the future instead
<noam> ... huh. I can't do the hacky asm injection I was going for ("msr " ++ reg ++ ", [out]") because it needs to be a string literal. Guess that means I'm working on enums / containerfields first
<noam> Having an actual *goal* makes this all so much easier
<noam> "I'm getting this done so I can use it to work on my bootloader" is a lot more motivating than "I'm getting this done because I enjoy it", weirdly, even though I *do* enjoy working on it
<noam> Hmm, is there a good way to insert a comptime *string* into an inline asm bit? I want to read from special named registers, so in asm I'd write e.g. `msr CPUACTLR_EL1, <target_register>`. In Zig, CPUACTLR_EL1 does not bind to ANY zig variable (and can't! there's no direct access mechanism and the register allocator is obviously unaware of it), so it can't be fed in as an input.
<noam> I *could* mod the assembler so I can feed in the bitstring that corresponds to CPUACTLR_EL1, but that just makes it harder to debug
jsb has joined #zig
earnestly has quit [Ping timeout: 256 seconds]
<spacelove> Why would this return the same pointer appended 10 times?
<noam> Hmm, maybe I should just stop using a stringliteral in favor of a comptime string, so that ++ is an option
<spacelove> erm, that one had a typo, this one is clearer: https://zigbin.io/4026fb
brzg has quit [Quit: leaving]
terinjokes has quit [Quit: ZNC 1.8.1 - https://znc.in]
terinjokes has joined #zig
<spacelove> It's like I'm creating a node at the same memory address every time...
<spacelove> Oh shit -- is that how while loops work? Any tmp vars are created at the same address?
<noam> Yes
<spacelove> !!!! incredible!!!!
<spacelove> Blowing my mind
<noam> Never rely on temporary variables
<noam> That's what "temporary" means ;)
zie has quit [Quit: ZNC 1.8.2 - https://znc.in]
<spacelove> Is there a "new" operator in zig to tell it I want to keep that variable around? Or do I make a new array and store it in that?
<spacelove> What if I, going against my buddhist nature, wanted to hold on to what's temporary? So that I could make a pointer to it
<spacelove> https://zigbin.io/c33d43 something like this, but without the compiler errors
<noam> You have to allocate memory
<spacelove> I did, with var arr = std.ArrayList(Node).init(allocator);
<noam> Stack memory is intrinsically temporary, though if it's at the top of e.g. main it might as well be forever
<noam> if you append nodes from the stack, they'll stay
<noam> but they can't themselves point to temporary memory or they'll misbehave
<spacelove> Can I become someone's apprentice. I think I need a mentor
<spacelove> I don't want to spam the channel
<spacelove> I can even pay money. I just want to learn.
<spacelove> Just to like... get my own wings so I can fly.
<spacelove> Well, goodnight, thanks for all the help guys
spacelove has quit [Quit: Connection closed]
<andrewrk> zir-memory-layout branch is passing "hello world" now
<noam> neat!
<noam> Guessing there's similar but smaller improvements compared to the AST rework?
<andrewrk> after a couple perf optimizations, I'll do everyone's favorite silly benchmark again :)
<andrewrk> yes that's the idea
<noam> which bm is that?
<andrewrk> whether it's smaller or larger is not known, I could see it going either way
<noam> true
<andrewrk> printf 1 million times
<noam> XD
<noam> That's better than mine at least
<noam> Mine is ~150K lines of while(true){} which will break as soon as I add detection of unreachable code :P
remby has joined #zig
<noam> Found a bug in the grammar! Le gasp! It calls square brackets... brackets! And it calls curly brackets "braces"! Such horror!
<andrewrk> oh wow, the branch is way way faster...
<andrewrk> this is another 30% speedup and 36% reduction in peak memory usage
<noam> 90%?
<noam> Ah :P
<noam> Still very good!
<noam> What's the time for the 1M printfs?
<noam> :P
<andrewrk> I'm up to 1.6 million lines per second on my laptop
<andrewrk> down to 372 MiB peak rss for print1mil.zig, from 577 MiB
<andrewrk> I haven't done the 2 tricks I wanted to do yet either
<noam> That's... still a lot, I think
<noam> I need to get mine working well enough to compare it [and decide once and for all whether i or y is better /s]
cole-h has quit [Ping timeout: 246 seconds]
osa1 has joined #zig
jsb has quit [Quit: .]
jsb has joined #zig
bitmapper has quit [Quit: Connection closed for inactivity]
yyp has joined #zig
earnestly has joined #zig
remby has quit [Quit: remby]
haliucinas has quit [Quit: Lost terminal]
wootehfoot has joined #zig
haliucinas has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
kenran has joined #zig
yyp has quit [Quit: will go play minecraft or something]
bbuccianti has quit [Quit: ZNC 1.8.2 - https://znc.in]
bbuccianti has joined #zig
kenran has quit [Ping timeout: 245 seconds]
kenran has joined #zig
craigo has joined #zig
kenran has quit [Quit: leaving]
<g-w1> thats reeally good
<g-w1> i suspect it will go down further with the tzir-memory-layout too!
yyp has joined #zig
meinside has joined #zig
ave_ has joined #zig
lunamn has joined #zig
linuxgemini has joined #zig
linuxgemini has quit [Read error: Connection reset by peer]
ave_ has quit [Remote host closed the connection]
lunamn has quit [Remote host closed the connection]
wootehfoot has joined #zig
lunamn has joined #zig
ave_ has joined #zig
linuxgemini has joined #zig
<v0idifyy> hey, i can't call a function from itself if i `try` it, that's a bug right? cannot resolve inferred error set '@typeInfo(@typeInfo(@TypeOf(func)).Fn.return_type.?).ErrorUnion.error_set': function 'func' not fully analyzed yet
fireglow has quit [Quit: Gnothi seauton; Veritas vos liberabit]
LewisGaul has joined #zig
<ugla> v0idifyy: Are you using inferred error sets? Seems to work for me if I do Error!void but not just !void: https://zig.godbolt.org/z/8roPrq
fireglow has joined #zig
zie has joined #zig
<v0idifyy> ugla, yes, i'm using inferred
<v0idifyy> but it should work right?
<ifreund> v0idifyy: stage1 isn't smart enough to handle inferred error sets on recursive functions
<ifreund> stage2 should be
<v0idifyy> compiler bugs are fun
<v0idifyy> because i get to be like "it's _actually_ not my fault!
<v0idifyy> stack traces get confused on recursive functions, i guess that's normal
<v0idifyy> openFile is failing on a relative path, is that normal?
<ifreund> what error do you get?
<v0idifyy> FileNotFound but i'm pretty sure it exists
<v0idifyy> ./dir/file is the path format
<ifreund> if you're getting that error, then the operating system disagrees with you about whethere or not the file exists at that path relative to the directory you used
<ifreund> you can use strace to see the exact syscall made if you want to double-check what the zig standard library is doing
<v0idifyy> using absolute paths to /bin/sh works so it's weird, i
<v0idifyy> i'll try that
<v0idifyy> yeah it's my fault
<v0idifyy> i called a openFile on a dir with a path from outside the dir
sord937 has joined #zig
LewisGaul has quit [Ping timeout: 240 seconds]
<v0idifyy> is there a recursive makeDir?
<ifreund> v0idifyy: makePath
<v0idifyy> oh
wootehfoot has quit [Read error: Connection reset by peer]
remby has joined #zig
<v0idifyy> i'm getting FileNotFound with createFile, what does it mean?
ave_ has quit [Read error: Connection reset by peer]
lunamn has quit [Remote host closed the connection]
linuxgemini has quit [Read error: Connection reset by peer]
<ifreund> v0idifyy: probably you're trying to create a file in a dir that doesn't exist
<v0idifyy> ifreund, totally didn't commit the exact same mistake
<v0idifyy> is there other data formats apart from json in std?
<ifreund> nope
bitmapper has joined #zig
<v0idifyy> is there a thing that copies from reader to writer easily
<ifreund> a fifo maybe?
<ifreund> v0idifyy: yeah see LinearFifo.pump()
<v0idifyy> ifreund, is there something that doesn't require an allocator? with a static buffer
<ifreund> v0idifyy: a fifo can have a static buffer
<v0idifyy> ugh i'll check the src. the docs are very useless :|
<ifreund> yes, please ignore them and read the source :)
<v0idifyy> how would it be possible to generate good docs of zig? or we will have to find a different approach to documentation(?)
<ifreund> there's an open issue about it, it's definitely a solveable probalem, just not something that makes sense to solve in stage1
sord937 has quit [Ping timeout: 268 seconds]
<v0idifyy> `anytype` generates different assembly for each version of the function right?
sord937 has joined #zig
CommunistWolf has quit [Ping timeout: 244 seconds]
<ifreund> afaik yes
CommunistWolf has joined #zig
lunamn has joined #zig
ave_ has joined #zig
linuxgemini has joined #zig
<v0idifyy> would it be a good idea to have typed anytypes (interfaces)? i'm sure you already thought about it
<ifreund> v0idifyy: here's some discussion: https://github.com/ziglang/zig/issues/6615
<ifreund> if you want runtime interfaces on the other hand, there are plenty of patterns for that
remby has quit [Quit: remby]
m4r35n357 has quit [Quit: Ex-Chat]
cole-h has joined #zig
remby has joined #zig
mikdusan has quit [Quit: WeeChat 3.0.1]
<ifreund> andrewrk: opened a PR for my first zir-memory-layout patch, if you think what I've done there makes sense I'll start pushing to the branch directly
dreda_ is now known as dreda
<v0idifyy> hmm, am i supposed to be able to have a function pointer with a first parameter as a self?
<v0idifyy> like: const A = struct { thing: fn (self: A) void }; fn func (self: A) { }; var a = A{.thing=func}; a.thing(); // (instead of a.thing(a);)
<v0idifyy> i'm pretty sure this is a compiler bug (it errors to compile something like this) because allocator.<func>(unrelated params) always works fine
<v0idifyy> oh nevermind, Allocator uses self.func(self) inside it's functions
<s-ol> anyone know a zig-friendly (or zig native) math library with vec4, mat4, and perspective projection?
<ifreund> s-ol: I've seen but not used https://github.com/ziglibs/zlm
<s-ol> just found this too: https://github.com/ziglang-contrib/glm
<s-ol> its a bit odd that zlm implements each Vec* and Mat* separately
riba has joined #zig
lunamn has quit [Read error: Connection reset by peer]
linuxgemini has quit [Write error: Connection reset by peer]
ave_ has quit [Remote host closed the connection]
lunamn has joined #zig
ave_ has joined #zig
linuxgemini has joined #zig
ave_ has quit [Remote host closed the connection]
linuxgemini has quit [Remote host closed the connection]
lunamn has quit [Read error: Connection reset by peer]
lunamn has joined #zig
ave_ has joined #zig
linuxgemini has joined #zig
marler8997 has joined #zig
Akuli has joined #zig
xentec_ has quit [Quit: memento mori]
xentec has joined #zig
xentec has quit [Quit: memento mori]
xentec has joined #zig
<v0idifyy> passing a variable doesn't actually copy it on memory right?
<v0idifyy> s/passing/taking a parameter
<ifreund> depends on what the compiler decides to do
lanodan has quit [Ping timeout: 240 seconds]
lanodan has joined #zig
sord937 has quit [Quit: sord937]
ergz has joined #zig
ergz has quit [Quit: Konversation terminated!]
<g-w1> andrewrk: i am actually not going to do condbr, so anyone else feel free to take it on
ur5us has joined #zig
<ifreund> g-w1: sema or astgen? I just started poking at astgen for bool_and/bool_or which requires condbr
riba has quit [Ping timeout: 246 seconds]
<g-w1> astgen
<g-w1> a hint would be implement gz.addCondBr like addFnType (andrewrk told me this)
<ifreund> cool, thanks
yyp has quit [Quit: slep]
jah has quit [Ping timeout: 256 seconds]
mikdusan has joined #zig
ur5us has quit [Quit: Leaving]
ur5us has joined #zig
SimonNa has quit [Ping timeout: 245 seconds]
SimonNa has joined #zig
<noam> Huh, stage2 distinguishes between sema and astgen?
<g-w1> astgen produces the untyped ir, sema types it and does comptime on it; then it gets fed to codegen
<noam> ahhh
<noam> It's really interesting how that differs :)
<noam> We didn't converge on *everything* :P
<g-w1> it basically turns the ast into a less repetitive form eg -> loops are all same, it deals with short circuting and and if, stuff like that
<noam> short circuiting?
<ifreund> and/or short circuit
<ifreund> we make them into a condbr in a block
<noam> ... ahhhh
<g-w1> hmm in the new ast branch, how can I get a Tag from a zir.Inst.Ref?
Akuli has quit [Quit: Leaving]
<g-w1> ahh got it: if (init_scope.zir_code.instructions.get(.tag)[src_inst] == .store_to_block_ptr) |store| {
meinside has quit [Quit: Connection closed for inactivity]
remby has left #zig ["Good Bye"]
craigo has quit [Quit: Leaving]
<g-w1> andrewrk: what is the new inst: zir.Inst.Index, field on LocalVal?
<g-w1> what do I put there?
<g-w1> importantly the `inst` is a value type, not a pointer <- not sure what that means
<ifreund> g-w1: pushed astgen for and/or using condbr if you're curious
<g-w1> just saw nice :)
<ifreund> hopefully I'm not writing bugs, the parser/renderer was a lot easier to hack on with the extensive test suite
<g-w1> i can do a quick look over
<g-w1> dependent types would make this a whole lot easier
<g-w1> at a quick glance, lgtm
<ifreund> you mean distinct types?
<ifreund> and yeah 100% agree
<companion_cube> from a C-lile language to dependent types in just a few years :p
<g-w1> yeah distinct types
<ifreund> companion_cube: zig has comptime dependant types :P
<companion_cube> yep