ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<wink_>
I've got a routine which may return error in release builds but not in debug. I'm using a switch (builtin.mode) but when I have a debug build the compiler complains that ".. must return at least one possible error" how should I handle that?
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<andrewrk>
kristate, sorry about that
<andrewrk>
I did know that you did that. thanks for helping mtn with the PR
<kristate>
andrewrk: can you rebase so that I am included?
<andrewrk>
I don't want to force push master but how about a whitespace modification so that you're tagged on those lines?
<kristate>
andrewrk: I would like to be accredited with the work I do.
<andrewrk>
that is a very reasonable thing to want. master branch has an error in it, so let's solve it how we solve all bugs/problems in master branch, by pushing more commits
<andrewrk>
I can push a revert commit, and then merge a different way
mnoronha has quit [Ping timeout: 276 seconds]
<kristate>
andrewrk: I leave it up to you on the logistics of the master branch, but I just don't like code written by one person claimed by another
<kristate>
we're inside of git, so we have the metadata to do this -- sometimes I have brought-in code from the 90s in past projects and I make a note of it in the commit and of course in the source
<kristate>
andrewrk: as long as you make it right, it is fine by me.
<andrewrk>
I hear your preference though. I'm fine with using the --no-ff option for your PRs from now on
<kristate>
andrewrk: that's a merge commit, no? the individual commits still exist
<andrewrk>
kristate, yes, I mean the diff is simple enough to be 1 commit
<andrewrk>
but it's all good. --no-ff it is for you :)
<andrewrk>
alright back to merging scientes's PR
<andrewrk>
scientes, I took your code but I'm doing a more thorough job of eradicating allocators in std where we can rely on PATH_MAX
<kristate>
andrewrk: thanks -- I am going to push my bigint branch so that you can understand `bool allow_binop_cast` more
<scientes>
yeah mine was really just to show that it could be
<scientes>
done
<scientes>
go ahead and write your own
<andrewrk>
scientes, for windows we have to use the value 98302
<scientes>
why so much more than 64k?
<andrewrk>
because the max path on most windows file functions is 32767 "wide characters" which means UTF-16LE codepoints
<scientes>
oh wait utf-16 can have doubles
<scientes>
so why not 128K?
<andrewrk>
so it is 32767 * 3 + 1
<andrewrk>
here's the comment I wrote
<andrewrk>
// Each UTF-16LE character may be expanded to 3 UTF-8 bytes. // If it would require 4 UTF-8 bytes, then there would be a surrogate // pair in the UTF-16LE, and we (over)account 3 bytes for it that way. // +1 for the null byte at the end, which can be encoded in 1 byte.
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<kristate>
andrewrk: hey -- what is bigint like on stage2 ?
<kristate>
std.math.big.Int
<andrewrk>
kristate, yep that's it
<andrewrk>
tiehuis and I had some discussion about the data layout
<kristate>
andrewrk: Yeah -- I am not having fun with stage1 anymore. lets get to stage2 as fast as possible
<andrewrk>
there are 2 use cases - zig's use case where nearly all ints are less than 64 bits, and general math library computing where each int having an allocator kinda makes sense
<kristate>
andrewrk: I like that at comptime, ints are big and they can be anything -- I also like that we can cast down
<kristate>
but the infra for that is not really in place. it's very wishy washy
<andrewrk>
so my eventual plan is to divide std.math.big.Int up - the core will be a smaller data layout size, optimized for int sizes less than usize, and you have to pass the allocator in for all the functions
<andrewrk>
and then tiehuis's use case will wrap that one
<andrewrk>
so everybody is happy
<kristate>
andrewrk: btw, any progress on #1364?
<andrewrk>
pull requests first then I'm on it
<kristate>
andrewrk: okay -- about to push what I have for bigint