ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<jacobdufault> andrewrk: I fixed the issue where there was no output
<jacobdufault> now everything is unresolved, not sure why
cenomla has joined #zig
isd has quit [Quit: Leaving.]
wishstudio has quit [Remote host closed the connection]
<GitHub191> [zig] andrewrk pushed 1 new commit to master: https://git.io/vxvLT
<GitHub191> zig/master 49c3922 Andrew Kelley: fix incorrect setEvalBranchQuota compile error...
cenomla has quit [Quit: cenomla]
lorde_kumamon[m] has quit [*.net *.split]
alandipert has quit [*.net *.split]
alandipert has joined #zig
lorde_kumamon[m] has joined #zig
arBmind has joined #zig
hoppetosse has joined #zig
<hoppetosse> andrewrk: is there a way for the compiler to output the code / memory dump with all the compile time evaluations applied?
<GitHub49> [zig] andrewrk pushed 1 new commit to master: https://git.io/vxv4A
<GitHub49> zig/master 1bf2810 Andrew Kelley: fix comptime slicing not preserving comptime mutability...
arBmind has quit [Quit: Leaving.]
<andrewrk> hoppetosse: can you elaborate? Are you trying to debug something?
<hoppetosse> The equivalent of outputting c source with all macros applied
<hoppetosse> Not yet, but I imagine I will
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Client Quit]
<hoppetosse> or maybe closer to outputting the template expansions in c++
davr0s has joined #zig
davr0s has quit [Client Quit]
davr0s has joined #zig
davr0s has quit [Client Quit]
<hoppetosse> I'm writing a text editor and eventually I'd like to be able to inspect comptime values while editing
<hoppetosse> I'm trying to plan how I'd do it and I thought that would be a very convenient way of having it
<hoppetosse> you could make a build, save the results as a zig file + data (or some sort of literal repr of the data in the source file)
<hoppetosse> and then it's just parsing
<andrewrk> hoppetosse, aha, ok you shall have that ability, but I think there's an even better way
<hoppetosse> There probably is =)
<andrewrk> the current plan is to have zig act as a server, providing the ability for tools such as editors to subscribe to updates
<hoppetosse> There's a bunch of other thoughts there - I eventually want to add a repl so another way would be to be able to query the comptime state
<hoppetosse> A zig server is pretty awesome XD
<hoppetosse> The thing I miss most is a little squiggle under the code when I forget a gosh darned semicolon
<andrewrk> indeed
<MajorLag> Interestingly, since I've stopped working with an IDE I find I don't really miss that at all. Guess I'm weird like that.
<andrewrk> MajorLag, I fixed comptime slice of slice and comptime slice of pointer dropping mutability. was there still another bug beyond that?
<MajorLag> Yeah, I saw. Thanks for that. Unfortunately yes, there's still something with, I think, memorizing values it shouldn't. So far my tests to reproduce it in simpler code have failed but I only put about half an hour into it. I rewrote the function to avoid calling the iterator and just do things itself and that works fine, but I kept the old code for testing. Also noticed this this morning: try is ignored at comptime
<MajorLag> wrap.
<MajorLag> `error: expected type '[]const u8', found '@typeOf(Iterator_consumeBOM).ReturnType.ErrorSet'
<MajorLag> _ = try iterSrc.consumeBOM();`
<andrewrk> what's the fn signature of consumeBOM() ?
<MajorLag> `pub fn consumeBOM(self: &Iterator) !u3`
<andrewrk> and you get that compile error when consumeBOM returns an error?
<andrewrk> the problem with inferred error sets at compile time is that the analysis doesn't find all the possible errors. it either finds the value that it returns, or it finds the one error that it returns
<MajorLag> yeah, in this case I believe it is throwing an error for the iterator position being wrong for consuming a BOM, which I'm thinking is because the pos has been memorized accross instances.
<MajorLag> ...actually that can't be true because the error is that it's expecting []const u8, so it must be being thrown farther down.
<MajorLag> ...except it is. replacing try with a catch @compileError reveals: error: UnicodeIteratorInvalidBOMPosForConsume
<andrewrk> MajorLag, 6db9be89 makes it so that if a function has any parameters whose type would allow mutating state (such as a non-const pointer), then it won't try to memoize it
<MajorLag> consumeBOM only takes a self: &Iterator, which has a member `pos`, and it only throws that error if pos > 0 when you run consumeBOM. So it's memorizing it for some reaosn.
<andrewrk> hmm I just thought of something else. let me try something.
<MajorLag> I'm really curious why it is expecting []const u8 from a !u3 if I use try though... that I don't get.
<andrewrk> that seems like a bug, at the very least for being a confusing compile error
<andrewrk> MajorLag, I think one of the problems you're hitting is this: https://clbin.com/w6Tru
<andrewrk> I'll type up an issue
<MajorLag> Maybe, though it should be using different instances of the struct. I'll be off to work in a few, I think that `try` problem at least I can write a trivial test case for.
<andrewrk> ok great. I'll get that and this fixed and then we can see where we're at
<andrewrk> hopefully I can get you through this comptime gauntlet into happy land
<GitHub105> [zig] andrewrk pushed 1 new commit to master: https://git.io/vxvyQ
<GitHub105> zig/master 5834ff0 Andrew Kelley: don't memoize comptime fn calls that access comptime mutable state...
<andrewrk> MajorLag, ^ I think this might have fixed a lot of issues for you
steveno_ has joined #zig
return0e_ has joined #zig
return0e has quit [Read error: Connection reset by peer]
return0e_ has quit [Read error: No route to host]
return0e has joined #zig
hopppetosse has joined #zig
hoppetosse has quit [Ping timeout: 260 seconds]
hoppetosse has joined #zig
hopppetosse has quit [Ping timeout: 255 seconds]
<MajorLag> Sounds right. Let me check it out
<MajorLag> Huh, no, that doesn't seem to have done it.
<andrewrk> it's still getting memoized?
<MajorLag> it looks like that's the case, I'm still getting the same error as before.
<MajorLag> I'll see if I can narrow down the conditions.
hopppetosse has joined #zig
hoppetosse has quit [Ping timeout: 255 seconds]
steveno_ has quit [Quit: Leaving]
hoppetosse has joined #zig
hopppetosse has quit [Ping timeout: 260 seconds]
steveno_ has joined #zig
davr0s has joined #zig
<MajorLag> Every time I think I know what the problem is, a test case stubbornly refuses to fail.
<andrewrk> sorry, I know it's frustrating
<andrewrk> the small test cases are really nice, but I also don't mind looking at a bigger one
<MajorLag> I've got it pretty small now. I think I'm almost there. It looks like it has to do with passing references vs values. In runtime code you can't pass structs by value, but it looks like it works differently at comptime?
<MajorLag> Oh yeah, this is definitely it. Should have a pretty minimal test in a minute.
davr0s has quit [Ping timeout: 264 seconds]
<andrewrk> exciting
<andrewrk> sounds related to #733
<andrewrk> which is blocking on the Pointer Reform issue
<andrewrk> I think Pointer Reform is going to be the first thing I do after releasing 0.2.0
<MajorLag> #828
<MajorLag> I'm excited about pointer reform.
davr0s has joined #zig
<GitHub193> [zig] andrewrk pushed 1 new commit to master: https://git.io/vxfBz
<GitHub193> zig/master bcce777 Andrew Kelley: some return types disqualify comptime fn call caching...
<andrewrk> MajorLag, ^
hoppetosse has quit [Ping timeout: 260 seconds]
hoppetosse has joined #zig
<MajorLag> Yep, that seems to have done it. Thanks.
<andrewrk> now it's just the try / error set thing, yes?
<MajorLag> oh right, I forgot to make a test case for that. It isn't stopping my current code from working, it was just making it harder to debug. I'll get on that in a bit.
<andrewrk> ok great, glad to hear you are unblocked
hopppetosse has joined #zig
hoppetosse has quit [Ping timeout: 252 seconds]
hoppetosse has joined #zig
hopppetosse has quit [Ping timeout: 240 seconds]
jjido has joined #zig
jjido has quit [Ping timeout: 256 seconds]
_whitelogger has joined #zig
Ichorio has joined #zig
steveno_ has quit [Remote host closed the connection]
_whitelogger has joined #zig
noonien has joined #zig
ltr_ has quit [Ping timeout: 260 seconds]
DuClare has quit [Ping timeout: 260 seconds]
ltr_ has joined #zig
DuClare has joined #zig
tridactyla has quit [Remote host closed the connection]
tridactyla has joined #zig
Ichorio has quit [Ping timeout: 240 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Client Quit]
davr0s has joined #zig
davr0s has quit [Client Quit]
davr0s has joined #zig
davr0s has quit [Client Quit]
Tobba has joined #zig
tautologico has joined #zig
tautologico has left #zig [#zig]