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/
isolier3 has joined #zig
isolier has quit [Ping timeout: 240 seconds]
isolier3 is now known as isolier
_Vi has quit [Ping timeout: 246 seconds]
craigo has quit [Ping timeout: 264 seconds]
traviss has quit [Remote host closed the connection]
traviss has joined #zig
ur5us has quit [Ping timeout: 244 seconds]
st4ll1 has quit [Ping timeout: 260 seconds]
st4ll1 has joined #zig
nephele_ has joined #zig
nephele has quit [Ping timeout: 256 seconds]
nephele_ is now known as nephele
ur5us has joined #zig
xackus has quit [Ping timeout: 240 seconds]
craigo has joined #zig
gert_ has quit [Quit: WeeChat 2.8]
waleee-cl has quit [Quit: Connection closed for inactivity]
craigo has quit [Quit: Leaving]
adamkowalski has joined #zig
<adamkowalski> What happened to the LeakCheckAllocator that was in std.testing?
<adamkowalski> Looks like it got replaced by the general purpose allocator?
adamkowalski has quit [Quit: Lost terminal]
adamkowalski has joined #zig
<adamkowalski> is the new pattern for testing allocator essentially
<adamkowalski> var allocator = std.testing.allocator;
<adamkowalski> defer std.testing.expect(allocator.deinit());
adamkowalski has quit [Client Quit]
jzelinskie has joined #zig
<fengb> I thought the test runner automatically hooked up the expectation
<andrewrk> that's right, no need for that defer
<andrewrk> the pattern is the same, you shouldn't really have noticed that the underlying implementation changed unless you were inspecting the type
tsujp has quit [Ping timeout: 246 seconds]
tsujp has joined #zig
marnix has joined #zig
marnix has quit [Read error: Connection reset by peer]
marnix has joined #zig
AshOhms has joined #zig
knebulae has quit [Read error: Connection reset by peer]
knebulae has joined #zig
adamkowalski has joined #zig
<adamkowalski> GeneralPurposeAllocator is amazing
<adamkowalski> It's a great improvement over LeakCheckAllocator! I just tried it out and it even shows you which line the leak occurs on
<adamkowalski> the memory leaks just melt away, it literarly took 3 seconds to get rid of them
<andrewrk> adamkowalski, just wait until you see a double-free :)
<adamkowalski> Awesome! Yeah combined with test driven development it is almost too easy haha
ur5us has quit [Ping timeout: 244 seconds]
adamkowalski has quit [Quit: Lost terminal]
ur5us has joined #zig
_Vi has joined #zig
<bgiannan> zig is trending on github :)
<andrewrk> neat
AshOhms has quit [Quit: Leaving.]
_Vi has quit [Ping timeout: 246 seconds]
ur5us has quit [Ping timeout: 244 seconds]
juanfra__ has joined #zig
cole-h has quit [Quit: Goodbye]
<gonz_> A while ago I posted an example of writing some Zig code by voice. I've since changed how to write the Zig code a bit as well as fixed some performance issues I had (in general). Here is a more representative video: https://youtu.be/qxw2DTT5olM
<daurnimator> gonz_: cool :)
<Nypsie[m]> Really cool!
ur5us has joined #zig
_Vi has joined #zig
marnix has quit [Remote host closed the connection]
rzezeski has quit [Quit: Connection closed for inactivity]
dingenskirchen has joined #zig
ur5us has quit [Ping timeout: 260 seconds]
strmpnk has quit [Ping timeout: 272 seconds]
creationix has quit [Read error: Connection reset by peer]
dputtick has quit [Read error: Connection reset by peer]
dch has quit [Ping timeout: 244 seconds]
l1x has quit [Read error: Connection reset by peer]
dputtick has joined #zig
strmpnk has joined #zig
l1x has joined #zig
creationix has joined #zig
nikki93 has quit [Ping timeout: 260 seconds]
nikki93 has joined #zig
dch has joined #zig
<ikskuh> daurnimator, andrewrk: is there already an issue for zig not being able to use relative paths prefixed with .\ or ..\ on windows?
<daurnimator> ikskuh: yes
<daurnimator> ikskuh: it goes back to the fact that on windows, `.` is a valid filename.
<daurnimator> (as is `..`)
<ikskuh> huh okay
<ikskuh> how should i reference the upper directory then? :D
<daurnimator> that's a great question. I don't know why I don't know the ansert.
<daurnimator> *answer
<ikskuh> so i'm able to *actually* create a folder called ".."
<daurnimator> yup
<ikskuh> the heck.
<daurnimator> the only character not allowed in windows file names is \
<daurnimator> and yes.... null bytes are valid in windows file names
<daurnimator> (though null bytes are at least banned by the ntfs driver.... so they only come up in uncommon or virtual file systems)
<daurnimator> I suspect that the answer is something terrible like "get the path to the current directory; trim off the final component; open that"
utzig has quit [Ping timeout: 260 seconds]
JimRM has quit [Ping timeout: 260 seconds]
ovf has quit [Read error: Connection reset by peer]
jzelinskie has quit [Ping timeout: 244 seconds]
eddyb[legacy] has quit [Ping timeout: 260 seconds]
<daurnimator> hmmmm.. though that wouldn't work with hard links
<daurnimator> nevermind. windows is indeed that stupid.
heitzmann has quit [Ping timeout: 240 seconds]
<daurnimator> and infact that explains some things
heitzmann has joined #zig
eddyb[legacy] has joined #zig
JimRM has joined #zig
utzig has joined #zig
jzelinskie has joined #zig
ovf has joined #zig
cren has joined #zig
<cren> hey, is there something like a list of all the existing non-trivial programs that people have written with zig?
<Nypsie[m]> Not nearly complete but there's: https://github.com/nrdmn/awesome-zig
<ifreund> the #zig tag on github turns up a fair bit of stuff, most of it is on that list though
<ifreund> misses zig stuff on sr.ht and others though of course
<Nypsie[m]> ^ ooooh that's a good one, didn't even think of that
<Cadey> how do you unwrap an optional?
<Nypsie[m]> if (optional) |capture| { doSomethingWithIt(capture) }
<Nypsie[m]> Some more information available at: https://ziglearn.org/chapter-1/#optionals
<Cadey> is there a way to do it without creating a scope pyramid?
<Nypsie[m]> const x = optional orelse default_value or const x = optional orelse return error.my_error;
<Nypsie[m]> If you're sure it won't be null at that point, you can simply use const x = optional.?;
<josias> Does that invoke undefined behavior if it's actually null?
waleee-cl has joined #zig
<Nypsie[m]> I believe it's a runtime check. No idea about release-fast
<Nypsie[m]> Ah it is UB
<Nypsie[m]> Apparently .? is equivalent of `orelse unreachable`
<Nypsie[m]> On debug it's definitely safety checked, tho
redj has quit [Ping timeout: 260 seconds]
redj has joined #zig
Piraty has joined #zig
<Piraty> is it just me or does `zig | less` behave unexpected (wrong)?
<ifreund> Piraty: seems to happen for me as well, that's odd
<traviss> does `zig |& less` work?
<josias> Yes.
<ifreund> indeed
<traviss> stderr vs stdout
<Piraty> yes. why would it emit to stdout though
<Piraty> appears unintuitive
<ikskuh> i think it's reasonable
<ifreund> it only prints to stdout if you pass --help
<ikskuh> "zig targets" outputs to stdout
<ikskuh> calling "zig" without arguments is an error, the help output is thus an error message informing you about correct usage
<ikskuh> whereas "zig --help" is requesting that help message as output
<Piraty> i understand, yet i disagree :)
<Piraty> zig compiler is enforching spaces over tabs? come on
<Piraty> ./src/main.zig:6:1: error: invalid character: '\t'
<ifreund> only stage 1 does that
<ifreund> stage 2 doesn't care what you use
<Piraty> why would it ever.
<Piraty> seems i should work on Void's zig template
<ifreund> what's wrong with the template?
<Piraty> it produces the stage1 compiler i assume?
<Piraty> since i'm using that one
<ifreund> yeah, we aren't shipping stage2 yet as it's not feature complete
<Piraty> in the end it needs a process like go has, keep an old bootstrap compiler and build the actual one with that
<Piraty> great. so i'm bound to spaces here.
<ifreund> that's the plan
<ifreund> `zig fmt` will convert to spaces for you :P
<Piraty> `zig fmt && zig build run` then...
<Piraty> ok found zig vim conf https://github.com/ziglang/zig.vim
<ifreund> with regards to bootstrapping, one possible path is to use the C backend of the self hosted compiler to transpile stage2 to C and then clean that up
<ikskuh> <Piraty> zig compiler is enforching spaces over tabs? come on
<ikskuh> there's a explanation on github. a tl;dr: it's enforced policy atm to prevent bike shedding about tabs vs. spaces
<ifreund> if you're curious you can read this comment: https://github.com/ziglang/zig/issues/544#issuecomment-618072318
<ifreund> whether it's been worth it or not is debateable :P
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
<cr1901_modern> Which profile is build.zig built with by default?
<ifreund> the build.zig file itself or the project it builds?
<ifreund> the build.zig file is built in debug mode (this is hardcoded in the zig compiler)
<ifreund> your project is built in whatever mode you choose the default to be, though this is also debug if you use Builder.standardReleaseOptions()
xackus has joined #zig
<cr1901_modern> I meant the build.zig file
<cr1901_modern> Is it considered a bug if something in debug mode segfaults?
<cr1901_modern> Asking for me, who wrote a crappy build.zig a few days ago that segfaulted during a use-after-free
rzezeski has joined #zig
<Piraty> u40? lol
<ifreund> sometimes it's what makes sense semantically :P
dddddd has quit [Remote host closed the connection]
dddddd has joined #zig
st4ll1 has quit [Quit: WeeChat 2.9]
waleee-cl has quit [Quit: Connection closed for inactivity]
marler8997_ has quit [Ping timeout: 240 seconds]
xackus has quit [Ping timeout: 240 seconds]
sawzall has quit [Read error: Connection reset by peer]
gpanders has quit [Read error: Connection reset by peer]
sawzall has joined #zig
gpanders has joined #zig
cren has quit [Ping timeout: 258 seconds]
cole-h has joined #zig
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
wilsonk has quit [Ping timeout: 265 seconds]
wilsonk has joined #zig
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
xackus has joined #zig
Akuli has joined #zig
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
marnix has joined #zig
wootehfoot has joined #zig
jzelinskie has quit [Ping timeout: 240 seconds]
cren has joined #zig
jzelinskie has joined #zig
waleee-cl has joined #zig
quetzalb has quit [Remote host closed the connection]
sawzall has quit [Read error: Connection reset by peer]
marnix has quit [Read error: Connection reset by peer]
sawzall has joined #zig
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
marnix has joined #zig
rzezeski has quit [Quit: Connection closed for inactivity]
rzezeski has joined #zig
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
drewr has joined #zig
cren has quit [Quit: Swirc IRC client]
knebulae has quit [Ping timeout: 258 seconds]
CodeSpelunker has joined #zig
<Cadey> how do you make a zig build quiet?
<pixelherodev> 2>/dev/null ?
<ikskuh> zig build is quite quiet on my machine :D
<ikskuh> when nothing fails
<ikskuh> ah wait
<ikskuh> there's some build messages
<Cadey> i get stuff like this in CI
<ikskuh> oh :D
s-ol has quit [Ping timeout: 260 seconds]
<alexnask[m]> Cadey IdrA? I hope it doesnt just insult the users and ragequit : D
<andrewrk> Cadey, the CI environment is incorrectly telling zig that it is a terminal
<andrewrk> Cadey, you can override the detection by setting the environment variable TERM=dumb
<companion_cube> does CI not do that? :/
wootehfoot has quit [Read error: Connection reset by peer]
ur5us has joined #zig
marnix has quit [Ping timeout: 240 seconds]
<Biolunar> alexnask[m]: I got that reference :D
_Vi has quit [Ping timeout: 246 seconds]
xackus has quit [Ping timeout: 246 seconds]
Akuli has quit [Quit: Leaving]
CodeSpelunker has quit [Quit: CodeSpelunker]
<andrewrk> it would be nice if there was some more foolproof way to detect if the controlling terminal supports escape sequences
<andrewrk> roll call, do we have anyone here who can run a simple test on each of these macos versions? 10.14 (mojave), 11.0 (big sur)
<andrewrk> (I have catalina so I can do that one)
<leeward> upgraded the only mac in the house to catalina last week :/
<fengb> I have a Mojave box
<fengb> Woefully underpowered
<andrewrk> perfect
<andrewrk> I suspect kubkon will have a little test script for you to run within a day or two. it just needs to check the return vaule of NSGetRunTimeLibraryVersion or something like that
sawzall has quit [Read error: Connection reset by peer]
sawzall has joined #zig
<torque> technically speaking big sur is also 10.16
<torque> at least so far they're only calling it 11.0 on apple silicon
<andrewrk> oh my god they're not consistent with it? what a nightmare
<fengb> AFAIK it allows both depending on context
<shakesoda> it's 10.16 for compat on x64
<shakesoda> so that's also true in rosetta, just not when you build for arm
<shakesoda> i think it might also always report 11 when you directly target the big sur sdk