ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
hio has quit [Quit: Connection closed for inactivity]
schme245 has quit [Remote host closed the connection]
diltsman has joined #zig
knebulae has joined #zig
phvse has quit [Remote host closed the connection]
so has quit [Ping timeout: 246 seconds]
beetcoin has quit [Ping timeout: 246 seconds]
SimonNa has quit [Ping timeout: 246 seconds]
so has joined #zig
SimonNa has joined #zig
jevinskie has joined #zig
<andrewrk> stage1 has `zig fmt` now
<emekankurumeh[m]> yes!
fsateler has joined #zig
fsateler_ has quit [Ping timeout: 245 seconds]
kristate has joined #zig
SimonNa has quit [Remote host closed the connection]
<emekankurumeh[m]> andrewrk: what are your thoughts on the builder pattern in rust?
<daurnimator> andrewrk: woo! I didn't realise that was coming
<emekankurumeh[m]> if we make pull requests for web related things do we have to update the stuff in std.event or would that wait until after the coroutine rewrite?
jevinskie has quit [Read error: Connection reset by peer]
jevinski_ has joined #zig
<emekankurumeh[m]> zig on esp32 might be a possibilty: https://esp32.com/viewtopic.php?t=9226&p=38466
barua has joined #zig
schme245 has joined #zig
_whitelogger has joined #zig
schme245 has quit [Remote host closed the connection]
urluck has quit [Ping timeout: 252 seconds]
urluck has joined #zig
schme245 has joined #zig
urluck has quit [Ping timeout: 258 seconds]
barua has quit [Ping timeout: 258 seconds]
urluck has joined #zig
urluck has quit [Ping timeout: 252 seconds]
urluck has joined #zig
urluck has quit [Ping timeout: 268 seconds]
urluck has joined #zig
urluck has quit [Ping timeout: 258 seconds]
Zaab1t has joined #zig
urluck has joined #zig
barua has joined #zig
urluck has quit [Remote host closed the connection]
urluck has joined #zig
barua has quit [Ping timeout: 246 seconds]
urluck has quit [Ping timeout: 250 seconds]
urluck has joined #zig
urluck has quit [Ping timeout: 258 seconds]
urluck has joined #zig
urluck has quit [Ping timeout: 259 seconds]
urluck has joined #zig
urluck has quit [Ping timeout: 258 seconds]
urluck has joined #zig
urluck has quit [Ping timeout: 250 seconds]
Flaminator has quit [Disconnected by services]
urluck has joined #zig
urluck has quit [Ping timeout: 252 seconds]
urluck has joined #zig
very-mediocre has joined #zig
urluck has quit [Ping timeout: 250 seconds]
urluck has joined #zig
aiwakura has joined #zig
urluck has quit [Ping timeout: 268 seconds]
kristate has quit [Remote host closed the connection]
urluck has joined #zig
Zaabtop has joined #zig
kristate has joined #zig
Zaab1t has quit [Ping timeout: 272 seconds]
Zaabtop is now known as Zaab1t
urluck has quit [Ping timeout: 264 seconds]
kristate has quit [Ping timeout: 246 seconds]
Flaminator has joined #zig
urluck has joined #zig
tschaei has joined #zig
urluck has quit [Ping timeout: 268 seconds]
urluck has joined #zig
urluck has quit [Ping timeout: 258 seconds]
urluck has joined #zig
Zaab1t has quit [Quit: bye bye friends]
urluck has quit [Ping timeout: 252 seconds]
urluck has joined #zig
very-mediocre has quit [Ping timeout: 256 seconds]
tschaei has quit [Ping timeout: 250 seconds]
Ichorio has joined #zig
urluck has quit [Ping timeout: 268 seconds]
urluck has joined #zig
Barabas has joined #zig
<Barabas> Hello, I played with Zig a few months ago. Now coming back to it some things broke (obviously).
kristate has joined #zig
<Barabas> One is I used debug.assertError(...) in my tests. Like:
<Barabas> debug.assertError(container.insert(2, 3.0), error.KeyAlreadyExists);
<Barabas> But that function is gone it seems. What's the way to check for specific errors?
urluck has quit [Ping timeout: 250 seconds]
urluck has joined #zig
urluck has quit [Ping timeout: 252 seconds]
<Flaminator> I think it's just std.debug.assert(container.inser(2,3.0) == error.KeyAlreadyExists); now.
<Barabas> Hmm... that says operator not allowed. :(
<Barabas> Oh wait... we have something called testing now
urluck has joined #zig
schme245 has quit []
urluck has quit [Ping timeout: 250 seconds]
urluck has joined #zig
urluck has quit [Ping timeout: 264 seconds]
urluck has joined #zig
urluck has quit [Ping timeout: 259 seconds]
schme245 has joined #zig
<kristate> Barabas: yes, please see testing.expect
<kristate> debug.assert can be used in runtime code
urluck has joined #zig
urluck has quit [Ping timeout: 250 seconds]
MajorLag has quit [Ping timeout: 258 seconds]
MajorLag has joined #zig
<Barabas> Yes, I fixed up my test code. There were just some issue with expectEquals and pointers. Something about Size.C not being handled in a switch.
<Barabas> So I reverted those to expect(... == ...)
<kristate> cool
urluck has joined #zig
jevinski_ has quit [Ping timeout: 255 seconds]
jevinskie has joined #zig
urluck has quit [Ping timeout: 252 seconds]
urluck has joined #zig
urluck has quit [Ping timeout: 250 seconds]
capisce has joined #zig
urluck has joined #zig
urluck has quit [Ping timeout: 258 seconds]
urluck has joined #zig
urluck has quit [Ping timeout: 264 seconds]
urluck has joined #zig
<MajorLag> @andrewrk: I've been using a self-made zig-fmt that just reads a file with std.zig.parse and dumps it back out with std.zig.render. Since zig fmt has been stage 2 only until now, I'm not sure what it brings to the table. Can you enlighten me?
urluck has quit [Ping timeout: 252 seconds]
urluck has joined #zig
schme245 has quit [Remote host closed the connection]
Barabas has quit [Ping timeout: 256 seconds]
<andrewrk> MajorLag: what zig fmt in stage1 brings to the table is for people who use the provided binaries they have the ability to format code
<andrewrk> Even for people who build from source it makes it one less step (stage2 binary isn't needed and is only a WIP compiler now)
<andrewrk> Btw in case it wasn't clear, it's still the same self hosted code. It uses zig run
walac has quit [Remote host closed the connection]
walac has joined #zig
Akuli has joined #zig
walac has quit [Ping timeout: 252 seconds]
kristate has quit [Remote host closed the connection]
gunnarahlberg has joined #zig
<gunnarahlberg> hi! Thank you for the awesomeness of Zig!
<andrewrk> welcome gunnarahlberg. what are you working on?
<gunnarahlberg> hi andrewk. I'm working on getting compilation to work on by ubuntu and then for fun implement a JSON parser, I want to for no apparent reason implement something useful in zig. Like , the webserver https://github.com/ziglang/zig/issues/910
<andrewrk> gunnarahlberg, sounds fun. we have a "contributor friendly" label if you want inspiration for what to work on
<andrewrk> yes
<gunnarahlberg> hmm, https://github.com/ziglang/zig/issues/1567 seems like a great idea too. Any general directions to start ?
<andrewrk> gunnarahlberg, I think you have found the one issue in the issue tracker that I am the least qualified to instruct on :)
<andrewrk> I would personally have to start by learning what a "koan" is
<gunnarahlberg> oh ;-)
schme245 has joined #zig
<gunnarahlberg> there is probably many definitions. I consider a koan a small unit a student can do to learn a specific topic, e.g. iterators etc.
<gunnarahlberg> is anyone else using ubunte for development and to compile zig source code? I have trouble with setting up LLVM
<gunnarahlberg> Ubuntu that is
<gunnarahlberg> The Ruby koans mentioned in 910 is a method for setting up tests. First test fails, you get to fix what is wrong and learn something. Then ruby coan will give a you another test that is failing to fix. So, it's like a method of learning.
<andrewrk> gunnarahlberg, on ubuntu you can use the llvm package from apt
<andrewrk> if you do not intend to build from source, then you can use the pre-made binaries from ziglang.org/download
gunnarahlberg has quit [Ping timeout: 256 seconds]
schme245 has quit [Remote host closed the connection]
walac has joined #zig
schme245 has joined #zig
schme245 has quit [Remote host closed the connection]
fsateler has quit [Remote host closed the connection]
kristate has joined #zig
kristate has quit [Ping timeout: 245 seconds]
schme245 has joined #zig
ross_k has joined #zig
reductum has joined #zig
schme245 has quit [Remote host closed the connection]
<ross_k> Hi, I'm trying to the zig linker (lld?) to see symbols inside MSVC static .lib files, specifically GLFW and libepoxy. It links fine with the DLL version of GLFW but can't see any symbols I try in the static .libs.
<ross_k> Is this a known issue?
<andrewrk> ross_k, what do you mean see inside? are you saying you're unable to link agains .lib files?
<ross_k> Yes, that's right
<ross_k> It can't find any symbols from those files
<ross_k> Trying a simple GLFW/epoxy app to test the water using the tetris demo as a starting point
<ross_k> build.zig: https://pastebin.com/8Sb5TiCH
<andrewrk> ross_k, ah, this is confusing API but you actually want exe.addObjectFile for static libraries such as .lib files
<andrewrk> when you run zig build what command line does that end up running, and what is the output?
<andrewrk> (after my suggested change)
<ross_k> Okay, after changing exe.linkSystemLibrary to exe.addObjectFile for both glfw3.lib and epoxy.lib, the command line is:
<ross_k> C:\Users\Ross\Downloads\zig-windows-x86_64-0.3.0+8e68d43a\zig.exe build-exe C:\Users\Ross\Desktop\zig-gl-test\src\main.zig --object C:\Users\Ross\Desktop\zig-gl-test\glfw3.lib --object C:\Users\Ross\Desktop\zig-gl-test\epoxy.lib --cache-dir C:\Users\Ross\Desktop\zig-gl-test\zig-cache --output C:\Users\Ross\Desktop\zig-gl-test\zig-cache\gl-test.exe --name gl-test --library c -isystem C:\Users\Ross\Desktop\zig-gl-test\c-compat --library-pa
<andrewrk> you might need to use a paste link
<ross_k> and it still can't link against them (no GLFW symbols)
<ross_k> Yeah, I'll pastebin the output
<andrewrk> was the glfw .lib built for msvc or mingw?
<andrewrk> you'll want to match it with `--target-environ msvc` or `--target-environ gnu`
schme245 has joined #zig
<ross_k> Right, so with exe.addObject it's actually working with GLFW but can't find win32: https://pastebin.com/Xb9gWHMt
<ross_k> Do I need to add that to the build.zig too?
<andrewrk> yeah, I believe you want linkSystemLibrary("kernel32")
<andrewrk> and some other windows DLLs
<andrewrk> also looks like you need the addObject for epoxy?
<andrewrk> btw the tip with --target-environ still stands. the .lib you downloaded/built was built in a mingw environment or a msvc environment, and you have to tell zig which one
<andrewrk> I believe zig defaults to msvc on windows
<ross_k> Right, so that's separate to the "exe.setTarget(builtin.Arch.x86_64, builtin.Os.windows, builtin.Environ.msvc);" line?
<andrewrk> ah there it is, you're passing msvc. sorry, missed that
<ross_k> Thanks a lot for the help, btw. zig is awesome.
<andrewrk> that's probably correct
<ross_k> Cool
<andrewrk> thanks :) I know it's a bit of a rough process right now getting this to work. I hope to improve tooling and error messages to make this process more straightforward
<andrewrk> ross_k, did the linkSystemLibrary work for kernel32 & friends?
<ross_k> lld: error: could not open kernel32: no such file or directory
<schme245> andrewrk: I'm writing some docs for `zig test` but I don't quite get what `--test-name-prefix` does, could you elaborate a bit perhaps?
<schme245> I mean, I see that it adds a prefix, but I don't really see what that is used for
<ross_k> Probably need to add another lib dir
<andrewrk> ross_k, hmm. I thought that lib dir would be added by the libc detection
<andrewrk> schme245, the main test suite prefixes tests with some stuff to make filter arguments work better
<andrewrk> when you run the main test suite you can see it happening
<andrewrk> ross_k, as a workaround right now, you can find where kernel32.lib is on your system and add that dir, or add the .lib files directly
<andrewrk> but this should be an open issue, zig is supposed to find this
<andrewrk> (side note - when you use kernel32 or other system DLLs from the standard library, zig automatically generates .lib files for you. but it isn't smart enough (yet!) to know what functions glfw is tryign to link against)
<andrewrk> ross_k, I'll play around with this situation you're in on windows next week and try to improve it a bit
<ross_k> Awesome, cheers. I'll dig a little just now and file an issue for the kernel32 path situation
<schme245> hmm... is the osx build broken or is my computer messed up? https://pastebin.com/E2apbjbu
<schme245> I was able to build just a couple of days ago
Dennis0 has joined #zig
<andrewrk> schme245, I just pushed that commit, must have broken it on osx. taking a look, thanks
<andrewrk> if this happens you can look at ziglang.org/download and see what the latest commit is that passed the CI tests
<schme245> great!
<schme245> so judging by the Zig test suite, `--test-name-prefix` can basically be used for printing which configuration of tests you are running etc?
<andrewrk> yes
<andrewrk> it's meant to be used in conjunction with --test-filter
<andrewrk> schme245, fixed
<schme245> yup, works!
<andrewrk> what's nice is that the CI build will fail for that commit, and 356cfa0 will never end up on ziglang.org/download. it'll skip from bd52d8 to 2dfa76a
<schme245> the beauty of CI
<schme245> there is a note in the Zig test docs that says "TODO: lazy analysis", what does that mean? is it that there will be no code produced for functions that are never called?
<andrewrk> that's right
<schme245> anything specific you want to mention about that in the context of testing?
<andrewrk> I'll be back later
kristate has joined #zig
kristate has quit [Ping timeout: 246 seconds]
Akuli has quit [Quit: Leaving]
wilsonk has quit [Read error: No route to host]
darithorn has joined #zig
wilsonk has joined #zig
darithorn has quit [Remote host closed the connection]
kristate has joined #zig
darithorn has joined #zig
Ichorio has quit [Ping timeout: 255 seconds]
SimonNa has joined #zig
<suirad> is there much I can do about the error: compiler bug: @cImport generated invalid zig code
schme245 has quit [Remote host closed the connection]
return0e_ has quit [Ping timeout: 250 seconds]
darithorn has quit [Remote host closed the connection]
return0e has joined #zig
reductum has quit [Quit: WeeChat 2.3]
<andrewrk> suirad, that means a bug in src/translate_c.cpp
<andrewrk> you could run `zig translate-c` directly on the relevant C file and look at the error
<andrewrk> suirad, or you can build with --verbose-cimport and it will spit the zig decls to stderr. you can then @import the file and get a compile error. then you can figure out what C code caused the bug. then fix translate_c.cpp
schme245 has joined #zig
<suirad> sounds good. Im trying to make a base zig project that imports raylib as a subrepo to have a small base for making games. raylib is nice since its pretty much just c headers and runs on everything
<andrewrk> neat
schme245 has quit [Remote host closed the connection]
<suirad> ahhh I see it