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/
<ifreund> yeah, once I make the codegen not a massive footgun and add some tests it should be pretty much good to go
<ifreund> I'm off to sleep for now though
<ronsor> `return 42;` I thought I was the only one that did that
<ifreund> andrewrk: afaik all files containing wasm in binary format should use .wasm, and I don't think they are usually made executable (maybe with wasi?)
<andrewrk> good night!
<ifreund> o7
frmdstryr has quit [Ping timeout: 260 seconds]
<andrewrk> yeah wasi runs .wasm files
<andrewrk> in ELF, object and executable files are nearly identical, the main difference is the existance of an entry point
waleee-cl has quit [Quit: Connection closed for inactivity]
mkchan has joined #zig
rzezeski has joined #zig
zipp has quit [Ping timeout: 265 seconds]
_whitelogger has joined #zig
student069 has quit [Quit: ZNC 1.8.1 - https://znc.in]
stripedpajamas has joined #zig
<daurnimator> libraries and executables aren't that different either are they?
<leeward> True fact.
zippoh has joined #zig
betawaffle has quit [Ping timeout: 240 seconds]
betawaffle has joined #zig
wjlroe has quit [Ping timeout: 272 seconds]
betawaffle has quit [Max SendQ exceeded]
betawaffle has joined #zig
guan has quit [Ping timeout: 272 seconds]
wjlroe has joined #zig
betawaffle has quit [Ping timeout: 260 seconds]
wjlroe has quit [Read error: Connection reset by peer]
<mkchan> just out of interest: how come \0 is not a valid escape sequence for 0?
betawaffle has joined #zig
betawaffle has quit [Ping timeout: 240 seconds]
guan has joined #zig
betawaffle has joined #zig
wjlroe has joined #zig
zippoh has quit [Ping timeout: 256 seconds]
klltkr has quit [Ping timeout: 240 seconds]
<andrewrk> one way to do things: \x00 works just fine
_whitelogger has joined #zig
eleanor-nb has joined #zig
<eleanor-nb> Hei
<eleanor-nb> Anyone know how pfg can be reached?
eleanor-nb has quit [Remote host closed the connection]
rzezeski has quit [Quit: Connection closed for inactivity]
stripedpajamas has quit [Quit: sleeping...]
cole-h has joined #zig
cole-h has quit [Quit: Goodbye]
marnix has joined #zig
azarus has quit [Remote host closed the connection]
josias has joined #zig
<josias> How can I convert a `[]u8` slice to a sentinel-terminated slice?
marnix has quit [Read error: Connection reset by peer]
<daurnimator> josias: slice with `[from..to:sentinel]`
<josias> I keep getting the runtime errors `index out of bounds` or `sentinel mismatch`.
craigo has joined #zig
<daurnimator> sounds like your sentinel isn't correct?
marnix has joined #zig
<daurnimator> like... if you have `const a = "hello";` then `const b = a[0..3:'l']` would be valid; but `const b = a[0..3:'o']` would be sentinel mismatch
<marnix> Only by copying and adding the sentinel, I guess? But I don't know how, exactly. :-)
<josias> Oh. I guess I don't understand sentinels.
<josias> I am trying to resolve `error: expected type '[:0]const u8', found '[]u8'` when using a function in a library.
<josias> So my real question is: How can I convert `[]u8` to `[:0]u8`.
<daurnimator> josias: :0 means there is a null byte at the end => do you have a null byte at the end? can you put one at the end?
<daurnimator> if not, you'd need to make a copy of your slice, and put a null byte at the end of that
<josias> daurnimator: I can't figure out how to do that. Apparently `\0` is an invalid character.
<ifreund> \x00
marnix has quit [Ping timeout: 256 seconds]
xackus_ has joined #zig
eleanor-nb has joined #zig
eleanor-nb has quit [Remote host closed the connection]
klltkr has joined #zig
marnix has joined #zig
marnix has quit [Ping timeout: 260 seconds]
ur5us_ has joined #zig
ur5us_ has quit [Quit: Leaving]
[RMS] has quit [Read error: Connection reset by peer]
[RMS] has joined #zig
ur5us has joined #zig
ur5us has quit [Ping timeout: 244 seconds]
Snetry has quit [Ping timeout: 265 seconds]
Snetry has joined #zig
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #zig
rzezeski has joined #zig
doublex_ has joined #zig
klltkr has quit [Ping timeout: 246 seconds]
doublex has quit [Ping timeout: 260 seconds]
metheflea has joined #zig
zippoh has joined #zig
stripedpajamas has joined #zig
stripedpajamas has quit [Client Quit]
stripedpajamas has joined #zig
nycex has quit [Quit: Quit]
nycex has joined #zig
nycex has quit [Client Quit]
nycex has joined #zig
<daurnimator> josias: you don't need '\x00' when just 0 works
waleee-cl has joined #zig
<scientes> but sometimes '\x00' is more descriptive
stripedpajamas has quit [Quit: sleeping...]
dimenus has quit [Quit: WeeChat 2.9]
<andrewrk> josias, what function are you trying to call that takes a [:0]const u8 ?
<josias> So not a standard library function.
Hardy7cc has joined #zig
Akuli has joined #zig
cole-h has joined #zig
rzezeski has quit [Quit: Connection closed for inactivity]
Hardy7cc has quit [Remote host closed the connection]
<andrewrk> you can pass a string literal to that
<andrewrk> josias, otherwise if you are constructing the value at runtime, you'll want to make sure there is a 0 byte at the end. I'm not sure where you are trying to put \0 - but you almost certainly don't need to do that
<andrewrk> for example if you are using std.fmt.allocPrint to construct the value, you could simply instead call std.fmt.allocPrint0
hanetzer has joined #zig
<hanetzer> hello. giving zig cc/friends a go and it isn't what I expected from da bloggo. zig cc fails on simple hello.c for lack of stddef.h, and zig build-exe --c-source hello.c --library c seems to not recognize my glibc version.
<hanetzer> unrecognized glibc version 2.31.0 unrecoginzed C abi
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<andrewrk> hanetzer, can you provide a full output I can look at?
<hanetzer> its pretty much exactly that, capitalization aside.
<hanetzer> or do you mean the 'zig cc' output?
<andrewrk> what commands did you run, which commands produced that output, etc
<andrewrk> hmm can you verify that your zig installation is intact? the only reason I can think of this happening is that zig thinks its installation is intact but it is in fact missing the folder that has stddef.h
<andrewrk> how is your zig installed and what version is it?
<andrewrk> hanetzer, thanks for the gist. you would be surprised how many people say that one problem is happening but when they show a paste of the command they ran, it's just a completely different situation
<hanetzer> 0.5.0, installed from portage as dev-lang/zig-0.5.0
<hanetzer> I can provide a file listing in the package, if you'd like.
<andrewrk> so, 0.5.0 was released on 2019-09-30. that blog post is from 2020-03-24
<andrewrk> since then we've had a 0.6.0 release and then 4 months of work in master branch
<hanetzer> hrm. prolly need to bug the proxy maintainer then.
Flaminator has quit [Quit: Houdoe]
dongcarl has quit [Read error: Connection reset by peer]
<hanetzer> can zig currently work against llvm-10?
dongcarl has joined #zig
<Snektron> 0.6.0 uses llvm 10
decentpenguin has joined #zig
cole-h has quit [Quit: Goodbye]
<andrewrk> master branch also uses llvm 10, and the llvm11 branch is ready-to-go for 11 as soon as it is released
<hanetzer> gimme a bit then while I bump the ebuild and redo, then.
<hanetzer> oh, we don't have clang10 yet :<
<hanetzer> oh wait, we do.
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
FireFox317 has joined #zig
<FireFox317> hanetzer, note that we have master builds available on https://ziglang.org/download/
<hanetzer> if I wanted to grab binaries from the net I wouldn't be a gentooist ;)
<fengb> There’s also a source tarball
<hanetzer> yep, which I'm working against.
dongcarl has quit [Read error: Connection reset by peer]
klltkr has joined #zig
dongcarl has joined #zig
dddddd has quit [Ping timeout: 240 seconds]
klltkr has quit [Ping timeout: 256 seconds]
heidezomp has joined #zig
<andrewrk> wow, vexu is just diving straight in all the way into stage2
<andrewrk> love it
<FireFox317> andrewrk, vexu isn't working for zls?
<heidezomp> the build on Azure on my PR #6046 timed out, should I force-push my branch to retry the build, do something else, or just let it sit?
<FireFox317> zfs
<FireFox317> zsf lol
<Nypsie[m]> heidezomp: Closing and re-opening the PR also triggers the CI pipeline
dongcarl has quit [Read error: Connection reset by peer]
<heidezomp> Nypsie[m] I'll try that then, thank you!
dongcarl has joined #zig
<andrewrk> FireFox317, almost! we're just working out the details and then he's going to be able to bill hours
<FireFox317> andrewrk, damnn that is awesome!
<andrewrk> the contract doesn't require him to do any specific tasks though, I intentionally want it to be flexible so he can choose what he wants to work on
dddddd has joined #zig
<FireFox317> yeah that makes the most sense indeed. Also the best for productivity for sure
<andrewrk> heidezomp, for future reference, another good way to make the CI retrigger would be rebasing against latest master
<andrewrk> anyway sorry for the trouble, I'll take a look at the PR :)
<heidezomp> thanks andrewrk, is that preferable? I just closed/reopened it
<heidezomp> thank you! :)
<andrewrk> yeah given the (annoying) circumstance I think a rebase would be the preferred workaround, since a rebase is kinda nice anyway
<Nypsie[m]> Ah, good to know. Shouldn't have recommended open/close then
<Nypsie[m]> I shouldn't*
<andrewrk> it's all good I appreciate that you were helping people :)
<heidezomp> do you want me to rebase anyway then? or just let the build that was just triggered happen?
<andrewrk> nah don't sweat it. you can always just comment, "the ci failure seems to be a glitch and not a problem with my PR" and I'll notice that
<andrewrk> I'll admit though that I generally assume a red x without such comment means it's still WIP
<heidezomp> okay, I already did that :D thanks for the help!
<heidezomp> yeah that was what I was afraid of... hence why I decided to finally try and get over my anxiety of talking to people and join IRC ;)
<FireFox317> it's always nice to join the IRC :D
<heidezomp> nice to see all kinds of names I recognize from github for sure!
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<andrewrk> it's nice to see you heidezomp :)
<heidezomp> ty, I'm feeling very welcomed!
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
klltkr has joined #zig
bgiannan has quit [Read error: Connection reset by peer]
klltkr has quit [Ping timeout: 256 seconds]
WilhelmVonWeiner has quit [Read error: Connection reset by peer]
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
klltkr has joined #zig
heidezomp has quit [Remote host closed the connection]
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
heidezomp has joined #zig
klltkr has quit [Ping timeout: 240 seconds]
stripedpajamas has joined #zig
dongcarl has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
<ifreund> what is the dbg_stmt instruction in stage2?
dongcarl has quit [Read error: Connection reset by peer]
st4ll1 has joined #zig
dongcarl has joined #zig
<pixelherodev> ifreund: tried a git grep?
<pixelherodev> Maybe check codegen's genDbgStmt?
<pixelherodev> It's currently related to DWARF, at a glance
<pixelherodev> Generates line number info, I think.
<hanetzer> beh. the whole clang/llvm 10 situation in gentoo is all borked atm.
<ifreund> It's something to do with dwarf, but I'm not clear exactly what
<ifreund> anyhow, I'm ignoring it for wasm currently, but was curious
<ifreund> it seems strange for dwarf-related stuff to be an instruction
<andrewrk> ifreund, it marks "statements" for line number purposes. you can safely ignore it if you don't care about debug info
<andrewrk> hanetzer, yes, yes it is. I reported the issue for the llvm 10 release candidate but they released anyway
<andrewrk> anyway I believe it is fixed in 11
<ifreund> ok, so there's one dbg_stmt instruction for every line of code roughly? that makes sense
<andrewrk> ifreund, yeah, but if you did for example `foo(); bar();` on the same line there would be 2 dbg_stmts
<ifreund> cool
<hanetzer> andrewrk: seems to be largely due to uh, flipping off that shared/static switch
<andrewrk> i'm also thinking about removing the `src` field from IR instructions, or at least making it a debug-mode-only field
<andrewrk> idea being that if you want to find out the source location of an instruction, you would have to pay attention to dbg_stmt instructions. entire point would just be to save memory / faster compilation
<andrewrk> hanetzer, dunno what to tell you. it works fine if you build the dependencies from source. I don't control how gentoo builds them in its packages
<ifreund> sounds reasonable, having both in Inst does seem redundant
<hanetzer> andrewrk: reasonable. honestly the issue is basically the difference between how we're building 9:10's clang stuff, not any fault on your end.
<ifreund> dunno if it helps at all, but however void packages llvm10 it works out of the box for zig
<ifreund> arch works if you pass an extra flag to cmake
<pixelherodev> ifreund: it's easy to fix the Gentoo ebuilds
<pixelherodev> IIRC the maintainer rejected it
<hanetzer> another thing is we're apparently zapping the lld header files for 10.x
<pixelherodev> yep
<pixelherodev> If the official overlay isn't going to support us, I guess I'll run one myself soon
klltkr has joined #zig
<hanetzer> pixelherodev: reference on the rejection?
klltkr has quit [Ping timeout: 246 seconds]
ur5us has joined #zig
ronsor has quit [Read error: Connection reset by peer]
FireFox317 has quit [Ping timeout: 240 seconds]
Akuli has quit [Quit: Leaving]
dingenskirchen has quit [Quit: dingenskirchen]
heidezomp has quit [Ping timeout: 245 seconds]
stripedpajamas has quit [Quit: sleeping...]
<BaroqueLarouche> I wanted to split platform libs and include_dir so it can be checkout out seperatly, in preparation for console platforms with NDA, so I did this: https://gist.github.com/mlarouche/a3e239b8a942efa95b9297fb4bbb9fb9
<BaroqueLarouche> wish we could list directories at compile time and import zig files if the file exists or not
klltkr has joined #zig
<hanetzer> well fook it. beauty of gentoo, I disagree with upstream on something, I can override it fairly easily.
<andrewrk> ifreund, is the liveness info useful at all for the wasm codegen?
<andrewrk> example: https://clbin.com/UWYPp
<andrewrk> those flags tell whether the instruction is unreferenced, and whether each of the operands will ever be referenced again in the future
<andrewrk> for x86 add codegen it's really useful because you can use the info to re-use operand registers as the result
<ifreund> hmm, probably will be but I'm not very clear on how non-trivial wasm codegen is going to work yet
<ifreund> it's primarily stack-based but also has locals
<andrewrk> I think wasm locals essentially gives you infinite registers
<ifreund> yeah that's my understanding as well
<ifreund> reuse of these locals may not be as important then, though it would help keep the binary size reasonable
klltkr has quit [Remote host closed the connection]
klltkr has joined #zig
<andrewrk> agreed on both counts
ur5us has quit [Ping timeout: 244 seconds]
xackus_ has quit [Quit: Leaving]