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/
Flaminator has quit [Disconnected by services]
redj has quit [Read error: Connection reset by peer]
mikdusan has quit [Read error: Connection reset by peer]
adrusi has quit [Quit: ZNC 1.7.2 - https://znc.in]
mikdusan has joined #zig
adrusi has joined #zig
<scientes> hmmm union(enum) can't be compared
redj has joined #zig
<shritesh> hryx: I'm down!
noonien has quit [Quit: Connection closed for inactivity]
ManDeJan has joined #zig
sgo has joined #zig
sgo is now known as sgoel
sgoel is now known as siddhantg
siddhantg is now known as sgo
sgo has left #zig [#zig]
return0e_ has joined #zig
return0e has quit [Ping timeout: 246 seconds]
jjido has joined #zig
<ManDeJan> There is something strange going on with integers bigger than 64 bits at compile time
<ManDeJan> Example: https://godbolt.org/z/i2VT1m
<ManDeJan> Every time I press the clear cache en compile button it generates different, incorrect assembly
<andrewrk> ManDeJan, nice find. would you mind filing a bug report?
<andrewrk> your zig code, plus the unexpected output is enough to demonstrate the issue
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<daurnimator> andrewrk: oh you're still awake
<daurnimator> andrewrk: I forgot to ask yesterday: did you see that those 2 patches were required after all?
<andrewrk> which ones?
<daurnimator> andrewrk: the two I asked you to review just before the release
<andrewrk> marc filed an issue for the install libs, and I'll be sure to fix that before 0.6.0
<andrewrk> *before 0.5.0
<andrewrk> I don't understand why the other patch would be necessary. why do you have llvm .a files lying around if you didn't want software to use them?
tiehuis has joined #zig
<tiehuis> ManDeJan: think that shift issue will be fixed when this PR is merged: https://github.com/ziglang/zig/pull/2229
tiehuis has quit [Client Quit]
<andrewrk> merged
<ManDeJan> andrewrk, That was quick, so no need filing a bug report then? :)
<andrewrk> ManDeJan, if you build from source or wait until the new binary is available, (and tiehuis's diagnosis is correct) then the issue should be fixed
<andrewrk> tiehuis - I got the windows ABI thing resolved! It took the better part of today but finally you should be unblocked on big rationals
tiehuis has joined #zig
<tiehuis> yes, i saw that, nice work, thank you!
<ManDeJan> andrewrk, cool I was super confused when my hashing function generated different hashes at compiletime
<ManDeJan> How often does godbolt rebuild trunk?
<andrewrk> I'm not sure
<andrewrk> tiehuis, feel free to merge at will
<tiehuis> sure, i'll just wait till the test suite passes just to confirm, no hurry
<tiehuis> there was actually a TODO in that big int code related to that larger than limb shift i believe
<tiehuis> should remove that
tiehuis has quit [Quit: WeeChat 2.4]
<andrewrk> good night
very-mediocre has joined #zig
marmotini_ has joined #zig
marmotini has joined #zig
marmotini_ has quit [Ping timeout: 246 seconds]
marmotini_ has joined #zig
marmotini has quit [Ping timeout: 255 seconds]
very-mediocre has quit [Ping timeout: 256 seconds]
<gamester> What's stage 3?
jjido has joined #zig
<daurnimator> Slice stride proposal: https://github.com/ziglang/zig/issues/2255
marmotini has joined #zig
marmotini_ has quit [Ping timeout: 250 seconds]
<gamester> So barring some optimization that checks all callers of a function, all slices would have to store a stride field and @sliceToBytes would fail on those
marmotini_ has joined #zig
marmotini has quit [Ping timeout: 246 seconds]
marmotini has joined #zig
marmotini_ has quit [Ping timeout: 246 seconds]
<gamester> It's not a clean fit atm but strided memory is a cool idea.
dtz has quit [Ping timeout: 240 seconds]
emekankurumeh[m] has quit [Ping timeout: 252 seconds]
daurnimator[m] has quit [Ping timeout: 268 seconds]
slugmatt_ has quit [Ping timeout: 250 seconds]
marmotini_ has joined #zig
marmotini has quit [Ping timeout: 250 seconds]
marmotini has joined #zig
marmotini_ has quit [Ping timeout: 268 seconds]
marmotini_ has joined #zig
marmotini has quit [Ping timeout: 246 seconds]
<daurnimator> gamester: I'm not sure if entirely possible; but could it part of the type? (like align is for pointers?)
<shritesh> andrewrk: FYI, after revising my gist to "do things right", compiler_rt symbols are no longer linked in the wasm binary and get GC'd
very-mediocre has joined #zig
<tgschultz> daurnimator: I was thinking something similar, and the only problem I can see is if you intend to use a function on it that expects an unstrided slice of whatever. Even if we say 'just make it var' then that doesn't cover exported/extern use cases. Personally, I think this is something to be dealt with in userland with a simple iterator.
<very-mediocre> hm, epoch.zig has `pub const ios = 978307200; //Jan 01, 2001 AD`
<very-mediocre> although all the materials I can find indicate ios uses the unix epoch
<very-mediocre> am i missing something?
<very-mediocre> thanks for that, that's really weird
<very-mediocre> non-api-doc materials refer to the unix epoch
<shritesh> IIRC it came from the MacOS X epoch
<very-mediocre> what's worse is google failed me completely at finding this
<very-mediocre> so, terminal environment is posix compliant, higher level apis use that epoch...
<shritesh> Yeah. Learned it the hard way working on a swift app.
very-mediocre has quit [Ping timeout: 256 seconds]
marmotini_ has quit [Ping timeout: 240 seconds]
ManDeJan has quit [Ping timeout: 245 seconds]
jjido has quit [Quit: Connection closed for inactivity]
<daurnimator> tgschultz: I'm not sure; I can think of scenarios for almost any function that takes a slice to respect a stride instead
<daurnimator> I guess similarly they could take an iterator
<daurnimator> at that point.... why have slices?
<tgschultz> slices have extremely common use cases
halosghost has joined #zig
ManDeJan has joined #zig
wilsonk has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Jenz has joined #zig
<Jenz> Congratulation on the 0.4.0 release! :D
ManDeJan has quit [Ping timeout: 250 seconds]
very-mediocre has joined #zig
<andrewrk> thanks Jenz
* Jenz :)
Jenz has quit [Ping timeout: 250 seconds]
wilsonk has joined #zig
meheleventyone has joined #zig
Jenz has joined #zig
<gamester> I thought I had seen someone talking about a stage 3, what would that be?
jjido has joined #zig
* halosghost hopes it's a wide-binary that can be run as EFISTUB, run under any POSIX/Win32/Oberon/etc/iOS that self-hosts
* halosghost thinks not
<halosghost> but, a panda can dream
<Jenz> (it can?)
<halosghost> Jenz: all pandas go to heaven
<andrewrk> gamester, "stage3" is the result of building stage2 with stage2
<andrewrk> and once the self hosted compiler is done, it's what we would ship rather than stage1
<halosghost> andrewrk: because then it's effectively self-hosting?
<halosghost> so, stages 1 and 2 are the bootstrap
<halosghost> (yes?)
<halosghost> I was partially right :)
<andrewrk> stage1 is the c++ compiler code. stage2 and stage3 are the same .zig code
<halosghost> ahh
<halosghost> I see
<Jenz> How does stage2-zig executables compare to stage1-zig executables?
<andrewrk> self-hosted compiler can barely build hello world
<andrewrk> stage1 is what we ship right now
<halosghost> haha
<Jenz> Alright, I see; I'm really looking forward to see where zig's going
Jenz has quit [Ping timeout: 252 seconds]
Sahnvour has joined #zig
<Sahnvour> hi
<Sahnvour> how would I reinterpret an int as a sequence of bytes ?
<halosghost> bitcast
<halosghost> oh
<halosghost> nope
<halosghost> that was bad advice
<halosghost> well, I suppose it would work if you know the length of bytes to be, which you should
meheleventyone has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Sahnvour> @sliceToBytes doc says "Converts a slice or array to a slice of u8." however `const slice = @sliceToBytes([1]u32{x});` does not work: error: expected slice, found '[1]u32'`
<tgschultz> const byte_slice = mem.asBytes(&my_int);
<tgschultz> actually it isn't slice, the return value is a *[@sizeOf(T)]u8
<andrewrk> Sahnvour, have a look at the std.mem.readInt* functions
<bheads_____> I ran into something like that the other night, what is the zig way of read bytes from a file into a packed struct?
<andrewrk> bheads_____, I believe std.io.InStream has readStruct
<Sahnvour> tgschultz thanks
<tgschultz> there's also deserializer if endianess needs accounting for
<andrewrk> oops, std.mem.writeInt* functions, I got it backwards
meheleventyone has joined #zig
<bheads_____> ah it makes a [1]T array and slices that, I was trying to directly turn the start into a slice of bytes
<tgschultz> that's what std.mem.asBytes() does
<tgschultz> only it returns a pointer to an array since the the length is comptime known, but pointers to arrays implicitly cast to slices
<bheads_____> so I should be able to file.read(mem.asBytes(&header))
<tgschultz> there's also std.mem.toBytes() which copies to an array instead of returning a pointer.
<tgschultz> yeah, that should work.
<tgschultz> if you had the file as an InStream (which you can get with file.inStream()), you could use readStruct(), but it is functionally equivelent I think. If you need to worry about endianess you should use Deserializer.
<bheads_____> I may switch to an InStream so I can support other data stream sources (ie files packed in files)
meheleventyone has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<bheads_____> but doing compression orientated programming, so... solveing the problem at hand.. reading fastq files...
very-mediocre has quit [Ping timeout: 256 seconds]
very-mediocre has joined #zig
<shritesh> andrewrk: How would I go about solving "in function __zig_return_error void (%builtin.StackTrace*): WebAssembly hasn't implemented __builtin_return_address"?
scientes has quit [Read error: Connection reset by peer]
scientes has joined #zig
shritesh has quit [Ping timeout: 246 seconds]
shritesh has joined #zig
<andrewrk> shritesh, we'll have to disable error return traces for the web assembly target
<Sahnvour> I have some code that runs fine on debug and release-safe, but segfaults in release-fast/small
<Sahnvour> trying to reduce it, but may not be easy
<andrewrk> that's the hardest kind of bug to troubleshoot
wilsonk has quit [Read error: Connection reset by peer]
<shritesh> andrewrk: Thanks. That solved it. PR incoming.
wilsonk has joined #zig
<andrewrk> shritesh, it would be cool to look into WASI and find out if we can have some std lib tests for wasm
<shritesh> As in execute stdlib tests in an WASI env?
<andrewrk> yes
<andrewrk> I'm not trying to give you a task; I'm just musing
<shritesh> There's like 2 WASI exec envs. out there, both based on Cranelift.
<shritesh> First we need to add support for the WASI os
<shritesh> I'll see what's required to get a hello world working
<andrewrk> gonna do some more general purpose debug allocator live coding in 5 minutes https://www.twitch.tv/andrewrok/
very-mediocre has quit [Ping timeout: 256 seconds]
wootehfoot has joined #zig
ManDeJan has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jjido has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
halosghost has quit [Quit: WeeChat 2.4]
Sahnvour has quit [Read error: Connection reset by peer]
ManDeJan has quit [Ping timeout: 240 seconds]
daurnimator has quit [Ping timeout: 252 seconds]
hio has quit [Quit: Connection closed for inactivity]
companion_cube has quit [*.net *.split]
companion_cube has joined #zig