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/
stripedpajamas has quit [Quit: sleeping...]
frmdstryr has joined #zig
<frmdstryr> Is there any way to check if an async fn frame is returned (with/without an error) without using await?
pangey has quit [Ping timeout: 244 seconds]
Ekho has quit [Ping timeout: 256 seconds]
<ronsor> I'm wondering if it's possible to *not include* the file extension when building an executable
<ronsor> e.g. hello.wasm -> hello
pangey has joined #zig
<andrewrk> stage2 has -femit-bin=hello but it's not backported to stage1 yet
<ronsor> ah well then, I'll just rename it after compilation then
Snektron has quit [*.net *.split]
matti has quit [*.net *.split]
ovf has quit [*.net *.split]
r0bby has quit [*.net *.split]
nmeum has quit [*.net *.split]
Stephie has quit [*.net *.split]
dtz has quit [*.net *.split]
Cynthia has quit [*.net *.split]
cow-orker has quit [*.net *.split]
torque has quit [*.net *.split]
student069 has quit [*.net *.split]
jicksaw has quit [Ping timeout: 244 seconds]
frett27_ has joined #zig
jicksaw has joined #zig
frett27 has quit [Ping timeout: 256 seconds]
ur5us has quit [Ping timeout: 260 seconds]
nmeum has joined #zig
cow-orker has joined #zig
matti has joined #zig
dtz has joined #zig
ovf has joined #zig
Snektron has joined #zig
r0bby has joined #zig
Stephie has joined #zig
student069 has joined #zig
Cynthia has joined #zig
torque has joined #zig
Ekho has joined #zig
alva has quit [Remote host closed the connection]
return0e[m] has quit [Remote host closed the connection]
Bastian[m] has quit [Read error: Connection reset by peer]
dtz has quit [Write error: Connection reset by peer]
Snektron has quit [Read error: Connection reset by peer]
hamoko[m] has quit [Read error: Connection reset by peer]
protheory8-new-m has quit [Remote host closed the connection]
gpanders[m] has quit [Read error: Connection reset by peer]
BaroqueLarouche has quit [Remote host closed the connection]
fengb has quit [Remote host closed the connection]
frmdstryr has quit [Quit: Konversation terminated!]
nmeum has quit [Remote host closed the connection]
<ronsor> matrix gateway crasheed
letoram has quit [Ping timeout: 264 seconds]
r0bby has quit [Ping timeout: 270 seconds]
matti has quit [Ping timeout: 270 seconds]
ur5us has joined #zig
letoram has joined #zig
r0bby has joined #zig
matti has joined #zig
hamoko[m] has joined #zig
<pixelherodev> Ugh, stupid matricies
<pixelherodev> matrices*
<leeward> Replace them with tensors?
return0e[m] has joined #zig
alva has joined #zig
dtz has joined #zig
protheory8-new-m has joined #zig
BaroqueLarouche has joined #zig
Snektron has joined #zig
gpanders[m] has joined #zig
Bastian[m] has joined #zig
fengb has joined #zig
<pixelherodev> andrewrk: I assume that branch will be pushed to master soonish?
stripedpajamas has joined #zig
stripedpajamas has quit [Quit: sleeping...]
craigo has quit [Ping timeout: 264 seconds]
marnix has joined #zig
marnix has quit [Ping timeout: 264 seconds]
frett27_ has quit [Ping timeout: 240 seconds]
marnix has joined #zig
ur5us has quit [Ping timeout: 256 seconds]
<pixelherodev> What's a quick single-sentence explanation of the semantic analyzer?
<pixelherodev> Ah, good old commit logs
marnix has quit [Read error: Connection reset by peer]
ur5us has joined #zig
marnix has joined #zig
<andrewrk> so far all my work on stage2 has caused no regressions (after compile errors fixed)
<andrewrk> zig code is quite resilient
<andrewrk> I mean all my work, in total. I have never had to debug a regression so far
marnix has quit [Read error: Connection reset by peer]
Nypsie has joined #zig
marnix has joined #zig
stalli has joined #zig
dermetfan has joined #zig
<andrewrk> it takes a minimum of 7 bytes of x86_64 just to pass the result of an integer comparison to a function parameter
<andrewrk> 10 if you count the cmp
<gruebite> that's awesome
<andrewrk> I wonder why it doesn't use rex.W sete dil, it would be 3 fewer bytes
<shachaf> Godbolt "compile to binary" doesn't work for Zig?
<andrewrk> woohoo my test case passes
<andrewrk> look at this beautiful codegen
gpanders has quit [Ping timeout: 256 seconds]
<andrewrk> in particular the add function
<shachaf> Hmm, does rex.W even do anything to setcc? I'm confused.
r4pr0n has joined #zig
<andrewrk> yeah, it writes 0s to the upper bits
<andrewrk> well and without it, it would be dh and not dil
daurnimator has quit [Quit: WeeChat 2.8]
<shachaf> I don't think it clears the upper bits.
<andrewrk> maybe I'm missing something
<shachaf> A plain REX makes it write to dil instead bh, but I'm not seeing the W doing anything.
<andrewrk> oh, I see. pixelherodev made it omit the REX if you don't set W so I guess I was accidentally setting something unrelated and getting second-order effects
<shachaf> Ah, that makes sense.
<shachaf> Plain REX is pretty unusual and the W doesn't do anything here, I think.
<shachaf> But I don't think there's a way to clear the rest of the register with setcc.
<andrewrk> I see, so that's why the other strategy is always used
Ashpool_ has quit [Remote host closed the connection]
Ashpool_ has joined #zig
gpanders has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
<shachaf> (Normally a disassembler doesn't even print the REX prefix instruction, so if it shows rex.W that means something weird is going on.)
<andrewrk> yeah I have a TODO comment here to audit that particular codegen
<andrewrk> have a look at that add() codegen though, I think it's quite reasonable for a debug build
Ashpool__ has joined #zig
<andrewrk> it's missing integer overflow safety checks
<shachaf> Oh, I didn't see that.
<shachaf> Is 0xaaaaaaaa the undefined value?
<andrewrk> that's what I've been working towards the last few days
<andrewrk> yes
<andrewrk> oh the stack variable is at slightly the wrong offset; about to fix that
Ashpool_ has quit [Ping timeout: 264 seconds]
<shachaf> Looks like it does what it says on the tin (other than the stack thing).
<shachaf> Is it 0x10 to keep the stack pointer aligned or something? I never remember what the requirements are exactly.
marnix has quit [Ping timeout: 260 seconds]
<andrewrk> yeah so that every function can assume at least a minimum aligned amount (depending on calling convention). that way functions which don't need > 16 byte align (which is most) can omit instructions to align the stack
<andrewrk> alright, pushed to master. and I'm taking a day off tomorrow. good night all
gpanders has quit [Ping timeout: 240 seconds]
gpanders has joined #zig
Ashpool__ is now known as Ashpool
r4pr0n has quit [Quit: r4pr0n]
nycex has quit [Remote host closed the connection]
nycex has joined #zig
ask6155 has joined #zig
<ask6155> hello!
<ask6155> I'm not able to compile the master branch of zig. Is it because I don't have clang 11?
<ikskuh> i think there was a change to 10.0.1 yesterday?
<ask6155> I do have clang 10.0.0.1 but when I run cmake .. It says not found CLANG_LIBRARIES
gpanders has quit [Ping timeout: 240 seconds]
<ifreund> ask6155: what OS/distro? have you ever successfully built master before?
<ask6155> yes
<ask6155> arch linux
<ifreund> ask6155: did you passt -DZIG_PREFER_CLANG_CPP_DYLIB=ON ?
<ifreund> you need that on arch
<ask6155> oh yeah I forgot to do that
gpanders has joined #zig
waleee-cl has joined #zig
heitzmann has quit [Quit: WeeChat 2.9]
heitzmann has joined #zig
FireFox317 has quit [Remote host closed the connection]
FireFox317 has joined #zig
marnix has joined #zig
craigo has joined #zig
<pixelherodev> andrewrk: REX should be emitted as long as *any* parameter to self.REX is true, not justw
<pixelherodev> just w *
<ifreund> pixelherodev: are you itching to write a wasm backend? if not I might give it a shot (though may need some guidance)
<pixelherodev> ifreund: go for it :)
<pixelherodev> I'm finishing up my How To Backend thingy right now
<pixelherodev> feel free to ping me here
<ifreund> I was reading the wasm spec yesterday and it seems quite nice
<ifreund> oh definetly ping me when you get that writeup finished :)
<ask6155> Hey, can anyone give me some insight on raylib? will it work well with zig?
<ikskuh> ifreund: yeah, wasm spec is really well-made
<ifreund> ikskuh: I have a dream that someday javascript will be forgotten :D
<ikskuh> ifreund: we need some API for the DOM first
<ifreund> indeed
ask6155 has left #zig ["later"]
redj_ is now known as redj
marnix has quit [Ping timeout: 240 seconds]
marnix has joined #zig
hamoko[m] has left #zig ["Kicked by @appservice-irc:matrix.org : Idle for 30+ days"]
dimenus has joined #zig
<dimenus> did clang change it's triple/target format in 10.0.1?
<dimenus> even a simple hello world with zig cc fails to build
<pixelherodev> Zig master?
<dimenus> yessir
<dimenus> it'
<pixelherodev> I can't test, sorry :(
<pixelherodev> Clang 10's build is still broken
<pixelherodev> ugh
<dimenus> it's cc1as failing actually
<dimenus> the code itself generates o files np
<pixelherodev> Static build works fine for me
<dimenus> i'm on arch :(
<dimenus> i'll do a bootstrap build and then swap 0.6 with master and re-test
<dimenus> probably a clang issue
<pixelherodev> I'm on Gentoo
<pixelherodev> I just manually extracted the tarball
* pixelherodev shrugs
<pixelherodev> LLVM is broken, and IIRC the distro refused to fix it
<pixelherodev> the distro's maintainer*
nvmd has joined #zig
marnix has quit [Read error: Connection reset by peer]
<dimenus> i don't blame them
<pixelherodev> I do.
<pixelherodev> It's like a two line ebuild patch.
<dimenus> ah
<pixelherodev> Hmm, I'm going to try proposing it as a USE flag this time
<dimenus> do you have a link to the issue?
<pixelherodev> Not offhand
<pixelherodev> I could probably find it
dimenus has quit [Read error: Connection reset by peer]
dimenus has joined #zig
pmwhite has quit [Remote host closed the connection]
pmwhite has joined #zig
marnix has joined #zig
xackus_ has joined #zig
tsujp1 has joined #zig
frett27_ has joined #zig
tsujp has quit [Ping timeout: 240 seconds]
frett27_ has quit [Ping timeout: 256 seconds]
<dimenus> pixelherodev: i just downgraded clang. Working as expected now
<pixelherodev> :P
<dimenus> :)
dermetfan has quit [Ping timeout: 246 seconds]
blinghound has joined #zig
<blinghound> is there a way I can convert a multidimensional array to a flat slice?
<fengb> If you know the size, you can manually convert the root pointer and slice it
<fengb> But that might be harder and more brittle than starting with a flat array and manually slicing multi-dimensions
<blinghound> I do know the size, I'm generating vertices for terrain in varying LODs in chunks using a 5 dimensional array to make the calculations easier
<blinghound> so can I just cast the first element and then slice?
<fengb> Yep
<fengb> `@ptrCast([*]T, array)[0..len]`
<fengb> Oops, that's supposed to be `&array`
Nypsie has quit [Ping timeout: 256 seconds]
<blinghound> ah brilliant, thanks fengb
<blinghound> I'm still getting to grips with slices/arrays/ptrs
<leeward> Array: chunk of memory. Slice: Pointer with length. Pointer: address of a single thing
<blinghound> got all the terrain rendering in a single draw call
<leeward> (pointer in a slice is in the C sense, not the "single thing" sense)
<leeward> blinghound: Ooh, nifty
<blinghound> cheers leeward! Jumping between c++ and zig confuses me sometimes
stripedpajamas has joined #zig
<leeward> Yeah, subtle differences can be hard to keep straight.
<ifreund> so, llvm 10.0.1 totally breaks the 0.6.0 arch package
<ifreund> I guess we probably need to fix that
<leeward> Ooh, an 0.6.1?
<fengb> 0.6.0-2
<ifreund> though, shouldn't the zig package have been rebuilt? Or is 10.0.1 ABI compatible?
<pixelherodev> I highly doubt it
<ifreund> same
sm2n has joined #zig
<dimenus> ifreund: I just downgraded clang to 10.0 and that works
<dimenus> llvm is still 10.0.1
<dimenus> (on arch)
Nypsie has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
<ifreund> Oh im not on arch myself (void now), but someone mentioned it in my #river channel
<ifreund> interesting that downgrading only clang fixed it though
<pixelherodev> clang bug
* pixelherodev shrugs
<pixelherodev> At this point, I'm more surprised when LLVM + Clang works than when it fails
marnix has quit [Ping timeout: 264 seconds]
frmdstryr has joined #zig
<ifreund> well I pulled out my old arch laptop to try simply revbumping the zig package
<ifreund> looks like that fixed it
<ifreund> guess I'll send daurnimator a mail
cole-h has joined #zig
blinghound has quit [Remote host closed the connection]
marnix has joined #zig
cole-h has quit [Quit: Goodbye]
frett27_ has joined #zig
wootehfoot has joined #zig
tsujp1 has quit [Ping timeout: 256 seconds]
nikita` has joined #zig
Akuli has joined #zig
marnix has quit [Read error: Connection reset by peer]
dimenus has quit [Read error: Connection reset by peer]
dimenus has joined #zig
ofelas has quit [Remote host closed the connection]
dermetfan has joined #zig
ofelas has joined #zig
DarkUranium has joined #zig
<DarkUranium> I was told to talk to aurame & Alex Nask in this channel. My question is unrelated to Zig specifically, but apparently, I could get some advice about something from 'em.
<DarkUranium> Are they around?
<DarkUranium> (my question is about language server stuff)
<ifreund> DarkUranium: don't either here currently, they're more active on the discord
<ifreund> *don't see
<DarkUranium> I'll just idle a bit then.
ofelas has quit [Quit: shutdown -h now]
<ronsor> >discord
<ronsor> ah proprietary chat
<ifreund> yep :/
<pixelherodev> :( yeah
<pixelherodev> I'm deleting my Google account shortly, maybe Discord should follow
<pixelherodev> Also, heads up that all my old commits are now marked as unverified :P
<pixelherodev> I changed my GitHub / GPG email
<ifreund> oof, you been using a gmail?
<pixelherodev> I was, yes.
<pixelherodev> Now I've got something much much nicer: noam@pixelhero.dev
<pixelherodev> :D
<ifreund> man, pixelhero.dev is great
<ifreund> only downside is that google owns the tld no?
<pixelherodev> Yep
<DarkUranium> pixelherodev, I do have a Matrix->Discord bridge, FWIW.
<pixelherodev> But I figure that I'm getting rid of my google account anyways, so using something on their TLD is a sorta parting middle finger
<pixelherodev> DarkUranium: want me to DM you the server ID?
<DarkUranium> But I can't guarantee anything. Also, the bot would have to be invited to the server.
<pixelherodev> Ah
<DarkUranium> The only reason that bridge exists is because of a D&D player.
<pixelherodev> lol
<pixelherodev> I can ask them if they want to invite it?
<DarkUranium> If I remembered how!
<pixelherodev> hahaha
<pixelherodev> Zig -> GLSL when?
<pixelherodev> Wait
<pixelherodev> I could actually do that
<pixelherodev> Wait dammit
<pixelherodev> Oops
<gruebite> :D
<pixelherodev> Switched chats halfway through typing
* pixelherodev facepalms
<gruebite> that would be cool. haxe/heaps has something similar where you write shader code in haxe
<DarkUranium> It's something I'd like to do for my own Coyote language at some point.
<DarkUranium> But one problem at a time.
waleee-cl has joined #zig
Ashpool_ has joined #zig
Ashpool has quit [Ping timeout: 246 seconds]
Nypsie has quit [Quit: WeeChat 2.8]
dimenus has quit [Quit: WeeChat 2.9]
wootehfoot has quit [Read error: Connection reset by peer]
xackus_ has quit [Ping timeout: 264 seconds]
ur5us has joined #zig
<pixelherodev> Going to do a stage2 stream soon :)
nikita` has quit [Quit: leaving]
Akuli has quit [Quit: Leaving]
Stephie has quit [Quit: Fuck this shit, I'm out!]
<pixelherodev> Alrighty, starting
Stephie has joined #zig
gert_ has joined #zig
_whitelogger has joined #zig
<gruebite> pixelherodev: where are you streaming?
<pixelherodev> IIRC*
<pixelherodev> Typed from memory so YMMV :P
<pixelherodev> andrewrk: is there a reason that createElfFile is public?
<pixelherodev> Also, why use an enum for pointer width within the linker, but integer in std.Target?
<pixelherodev> I guess hypothetically it could be useful for supporting e.g. 15-bit architetures, but realistically I think that would scale to u16 for all intents and purposes
<pixelherodev> Well, not for ELF - hm, I guess it does make sense
dermetfan has quit [Ping timeout: 272 seconds]
nvmd has quit [Ping timeout: 244 seconds]
tdeo has quit [Read error: Connection reset by peer]
tdeo has joined #zig
<gruebite> is it weird for a library to ask the user to add `exe.addCSourceFile`?
<pixelherodev> Kinda
<pixelherodev> We need to figure out a good API for that
<gruebite> that's what my gut says. `translate-c` isn't good for 100% of C right now, yeah?