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/
Ashpool has quit [Remote host closed the connection]
jonase has quit [Ping timeout: 264 seconds]
jonase has joined #zig
jonase has quit [Ping timeout: 264 seconds]
Patrice_ has quit [Ping timeout: 272 seconds]
wootehfoot has quit [Read error: Connection reset by peer]
factormystic has quit [Read error: Connection reset by peer]
factormystic has joined #zig
semarie has quit [Ping timeout: 260 seconds]
linuxgemini has quit [Quit: Ping timeout (120 seconds)]
linuxgemini has joined #zig
semarie has joined #zig
jonase has joined #zig
jonase has quit [Ping timeout: 264 seconds]
olabaz has left #zig ["WeeChat 2.3"]
jonase has joined #zig
jonase has quit [Ping timeout: 246 seconds]
proteusguy has quit [Remote host closed the connection]
proteusguy has joined #zig
sord937 has joined #zig
leon-p has quit [Quit: leaving]
Patrice_ has joined #zig
jonase has joined #zig
bitmapper has quit [Quit: Connection closed for inactivity]
philtor has joined #zig
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
craigo has joined #zig
plakband has joined #zig
jonase has quit [Ping timeout: 256 seconds]
<mikdusan> a new tag showed up: llvmorg-11.0.1
<andrewrk> yep
<andrewrk> no source changes needed on our end. need to update CI tarballs tho
<andrewrk> just did it for linux
cole-h has quit [Ping timeout: 260 seconds]
tnorth_ has joined #zig
tnorth_ is now known as tnorth
jonase has joined #zig
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
jonase has quit [Ping timeout: 246 seconds]
_whitelogger has joined #zig
plakband has quit [Quit: WeeChat 2.9]
jonase has joined #zig
jonase has quit [Ping timeout: 256 seconds]
jonase has joined #zig
marler8997 has quit [Read error: Connection reset by peer]
nycex has quit [Ping timeout: 240 seconds]
jicksaw has quit [Ping timeout: 265 seconds]
jicksaw has joined #zig
nycex has joined #zig
wootehfoot has joined #zig
xackus has joined #zig
<xackus> daurnimator I can't use the std.meta.fieldInfo because I wasn't using a fixed string literal
<xackus> was that a use case considered?
jonase has quit [Ping timeout: 246 seconds]
<koakuma> Is there any way to completely disable optimizations in a build?
<koakuma> I found out that even with -O Debug it still seems to perform some optimizations (like inlining and some precomputations)
<pixelherodev> I don't think so - the optimizations it's performing are probably related to comptime evaluation
<pixelherodev> e.g. a function explicitly marked inline will always be inlined, no matter what
bitmapper has joined #zig
donniewest has joined #zig
waleee-cl has joined #zig
tomku has quit [Ping timeout: 264 seconds]
tomku has joined #zig
jonase has joined #zig
jonase has quit [Ping timeout: 256 seconds]
Akuli has joined #zig
keyehzy has joined #zig
hnOsmium0001 has joined #zig
olabaz has joined #zig
<olabaz> Hi, is it possible to modify a function parameter? For example f(x: i32) { x += 1}?
<ifreund> olabaz: no, function parameters are always const
<ifreund> you can do fn foo(x: i32) { var x2 = x; x2 +=1; }
<olabaz> if I pass in a pointer, can I change it contents?
<dutchie> yes
<dutchie> it'll be as if it was defined with `const ptr: *Foo = ...`
<olabaz> ok thanks
Patrice_ has quit [Ping timeout: 272 seconds]
tnorth has quit [Ping timeout: 260 seconds]
olabaz has quit [Ping timeout: 265 seconds]
nvmd has quit [Quit: Later nerds.]
nvmd has joined #zig
marler8997 has joined #zig
<marler8997> hmmm, so yesterday zig build starting putting binaries in debug/bin, but now they are back in zig-cache/bin?
<g-w1> yes
<g-w1> it got reverted, there was a regression
<mikdusan> reverted fc38b42521027b2ddcba688ba07bd2f6eb2737bc
<marler8997> I've been updating all my scripts and documentation
<marler8997> so is the plan to unrevert it as some point?
<g-w1> it will be discussed in the compiler meeting today.
notzmv has quit [Ping timeout: 256 seconds]
olabaz has joined #zig
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
wootehfoot has quit [Quit: Leaving]
<olabaz> In the zig docs they have std.io.getStdOut().writer() but in the std doc they don't have getStdOut() function?
<olabaz> I'm confused where I can get the info
<marler8997> right now the most reliable docs is the source code
<fengb> Don’t trust the std docs
nyaa8 has quit [Quit: Ping timeout (120 seconds)]
<olabaz> I'm not even sure where to find it in the source
nyaa8 has joined #zig
<olabaz> I'm looking through lib/std/io
<mikdusan> many times there is file and dir, so `io.zig` and `io/*.zig`
<olabaz> ah io.zig
cole-h has joined #zig
leon-p has joined #zig
g_w12 has joined #zig
notzmv has joined #zig
g-w1 has quit [Ping timeout: 260 seconds]
g_w1 has quit [Ping timeout: 256 seconds]
g_w12 is now known as g_w1
FireFox317 has joined #zig
g-w1 has joined #zig
g-w1 has quit [Ping timeout: 246 seconds]
g_w1 has quit [Ping timeout: 264 seconds]
<pixelherodev> Is "true=1, false=0" a defined part of the language, or an implementation detail?
<pixelherodev> @boolToInt gives those results, so I think it makes sense that they'd be in the eventual spec?
<justin_smith> pixelherodev: I didn't even expect that to be true?
<pixelherodev> Why not?
<justin_smith> I'd expect true == 1 to be a compiler error
<ifreund> it is
<pixelherodev> ... I meant in terms of codegen lol
<pixelherodev> Not "Is this a valid comparison?"
<ifreund> I don't think that needs to be defined
<pixelherodev> True
<pixelherodev> For Zyg, I'll probably have them be templates which lower implicitly to integers...
<ifreund> or maybe it does, I think I actually rely on that behavior
<ifreund> (true being 1/false being 0)
<FireFox317> internally it doesnt matter, as long as @boolToInt returns 1 for true and 0 for false
<FireFox317> i think
<ifreund> it makes using a packed struct of bools as a bitfield possible
<FireFox317> ah true
<pixelherodev> but that's not a supported use case, is it?
<pixelherodev> Hmm, it should be IMO
* pixelherodev shrugs
<ifreund> I don't see why it shouldn't be
* pixelherodev agrees
<pixelherodev> I think you're right
<pixelherodev> Fortunately, templating means I can change the generated lowered form later anyways :D
wootehfoot has joined #zig
wilsonk has quit [Ping timeout: 272 seconds]
slevin11 has joined #zig
<fengb> @boolToInt(false) == 1
<fengb> ...
<fengb> @boolToInt(true) == 1
<fengb> Hmm... I suppose @bitCast(u1, true) == 1 as well?
<pixelherodev> That's my question.
<pixelherodev> fengb: that's exactly the question.
<pixelherodev> If so, then IMO @boolToInt should be removed in favor of bitcasting.
<pixelherodev> (Since @boolToInt would just be a specialized bitcast)
<pixelherodev> This is *if* that bitcast is defined.
<ifreund> even now it could just be `if (foo) 1 else 0`
<ifreund> I was very surprised to discover its existence
ky0ko has joined #zig
<pixelherodev> Yeah, I think boolToInt and intToBool should be removed...
<pixelherodev> > Only one way
<pixelherodev> I do think bool as a separate type from u1 is good, because there's a semantic difference
<pixelherodev> But the casting is weird rn
slevin11 has quit [Remote host closed the connection]
quint has quit [Disconnected by services]
sord937 has quit [Quit: sord937]
cCCCCcccccCCc has quit [Ping timeout: 260 seconds]
slevin11 has joined #zig
Akuli has quit [Quit: Leaving]
slevin11 has quit [Remote host closed the connection]
hspak2 has joined #zig
hspak has quit [Ping timeout: 272 seconds]
hspak2 is now known as hspak
jonase has joined #zig
olabaz has left #zig ["WeeChat 2.3"]
g-w1 has joined #zig
<justin_smith> is it not an enum / @enumToInt() situation?
jonase has quit [Ping timeout: 246 seconds]
<pixelherodev> Not really, IMO
<ifreund> no? enum values can be manually specified
<justin_smith> I hadn't found the implementation and wouldn't have been surprised if it were an enum
<pixelherodev> It's a primitive
xackus has quit [Ping timeout: 256 seconds]
<andrewrk> marler8997, have a look at https://github.com/ziglang/zig/issues/7296#issuecomment-756432370 - now's the time to get your opinion in there
<ifreund> daurnimator probably has an opinion as well
<daurnimator> andrewrk: I don't think `prefix` should mean what you think it means
<daurnimator> andrewrk: in build systems --prefix is used to tell the toolchain where the final binaries will be installed on a system.
<daurnimator> common choices being /usr, /usr/local, /opt/myprogram
<daurnimator> but also e.g. /home/user/.local/
<daurnimator> the prefix gets used when hardcoding paths into the binary for e.g. DT_RUNPATH, but also where to find config files by default, etc
<ifreund> yes all of that is true, and installing to the prefix being the only way to get a binary out of the zig build system means that you will always be testing your program "for real"
xackus has joined #zig
<daurnimator> ifreund: only if you care about those hard-coded paths. for a huge swathe of programs.... they don't end up needing any of those
<ifreund> is there a downside to always installing to the prefix?
<daurnimator> yes
<daurnimator> we need to separate the "build" step from the "install" step
<ifreund> why exactly?
<ifreund> I know this is what package managers tend to expect but I don't see why it must be a hard requirement
<daurnimator> because I want to be able to generate binaries that contain "/usr/local/lib/libfoo.so.1" without actually having to install it on *this* system
<daurnimator> --> e.g. I want to build on my desktop, and install on my laptop
<daurnimator> or build for an embedded device (my router) from my desktop; and then copy the binaries across
<ifreund> can't you use DESTDIR to do that?
<pixelherodev> No
<pixelherodev> It'd have the wrong rpath
SebastianKeller has joined #zig
<daurnimator> ifreund: yes.... but that's not how DESTDIR traditionally works....
<daurnimator> pixelherodev: no it wouldn't?
<pixelherodev> DESTDIR doesn't affect rpath, generally?
<daurnimator> ifreund: however that would be a good hack for now :)
<daurnimator> pixelherodev: correct. which is the point of it
<daurnimator> (in this situation)
donniewest has quit [Quit: WeeChat 3.0]
<marler8997> what's the rationale behind using CWD as default prefix?
<marler8997> instead of the build.zig directory?
<daurnimator> that actually makes sense: think about "prefix" as "the path that gets hard-coded into the binary": hardcoding a relative path of... `.` makes sense
<daurnimator> (as a default)
<marler8997> > hardcoding a relative path of... `.` makes sense (as a default)?... but why though?
<daurnimator> marler8997: what other default would make more sense?
<marler8997> > instead of the build.zig directory?
<daurnimator> marler8997: why would I want the build.zig directory hard-coded into my binary?
<daurnimator> that might make sense as the default install *location*
<daurnimator> but we need to separate that from the "prefix"
<marler8997> I dunno, I'm not saying one is better, I'm asking why CWD is being chosen over build.zig directory
<marler8997> why does it make more sense to you?
FireFox317 has quit [Ping timeout: 256 seconds]
FireFox317 has joined #zig
<daurnimator> marler8997: I don't particularly have an opinion on that.
FireFox317 has quit [Ping timeout: 256 seconds]
<g-w1> cwd is default rn