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