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/
hio has quit [Quit: Connection closed for inactivity]
ltriant has quit [Quit: leaving]
marijnfs__ has quit [Ping timeout: 252 seconds]
ltriant has joined #zig
curtisf has joined #zig
jjido has quit [Quit: Connection closed for inactivity]
marijnfs_ has quit [Ping timeout: 250 seconds]
cloudhop has joined #zig
marijnfs_ has joined #zig
redj has joined #zig
squeek502 has quit [Ping timeout: 245 seconds]
marijnfs__ has joined #zig
SeedOfOnan has quit [Ping timeout: 256 seconds]
marijnfs has quit [Ping timeout: 268 seconds]
curtisf has quit [Ping timeout: 256 seconds]
kristoff_it has joined #zig
<daurnimator> uh, not really. mainly the JVM
<daurnimator> I run some of my systems with overcommit 2; only JVM programs give trouble
<tyler569> I think he meant like virtual machines and host migration
<daurnimator> > 09:44:08 <andrewrk>it will be ok if the kernel devs were smart enough to not get too clever and keep vm mappings separate if they came from separate mmap calls
<daurnimator> ^ did they not?
<daurnimator> no seems they didn't.... adjacent mmaps are merged.
<daurnimator> that's fucking annoying
<daurnimator> (I wrote a quick test program)
_whitelogger has joined #zig
hio has joined #zig
<emekankurumeh[m]> really?
<daurnimator> andrewrk: so I've ended up wanting 'do while' loops quite a lot in zig
<daurnimator> one particular use case that I think might convince you, is... counting over a whole integer range
<daurnimator> e.g. imagine I have a u8 counter and I want to enumerate over 0-255
<daurnimator> var i = u8(0); while (i < 256) : (i += 1) {} // this doesn't work, as i cannot hold 256
<daurnimator> vs a 'do while': var i = u8(0); do {} while (i != 255) : (i += 1);
fengb has quit [Ping timeout: 256 seconds]
squeek502 has joined #zig
husho has joined #zig
gonz_ has joined #zig
<gonz_> Has there been a regression in how the VS code the plug-in is able to report errors? I'm trying to use it and it's not even marking obvious things like missing semicolons.
<gonz_> It's finding the zig binary (it can format automatically) and the formatter will complain about these obvious things, but it doesn't seem to actually relay them to VS code in terms of diagnostics.
husho has quit [Read error: Connection reset by peer]
<gonz_> Also, is there a file watching mode?
ltriant has quit [Ping timeout: 272 seconds]
marijnfs has joined #zig
marijnfs has quit [Ping timeout: 248 seconds]
<gonz_> Actually, this is trivial to do with `watchexec` so I guess it doesn't really matter: `watchexec 'zig run hello.zig'`
<gonz_> `watchexec` also targets a lot of platforms so it's pretty generally useful for these things.
marmotini_ has joined #zig
husho has joined #zig
jjido has joined #zig
marijnfs has joined #zig
marmotini_ has quit [Ping timeout: 245 seconds]
marijnfs has quit [Quit: WeeChat 2.3]
cloudhop has quit [Quit: Page closed]
avoidr has quit [Quit: leaving]
jjido has quit [Quit: Connection closed for inactivity]
marmotini_ has joined #zig
kaiserA has joined #zig
marmotini_ has quit [Ping timeout: 245 seconds]
cloudhop has joined #zig
kaiserA is now known as paperbags
<cloudhop> I'm building a shared library with an exported C interface, and I can get Zig to install the DLL to `./lib/`, but even though I can find the generated `.h` file in `zig-cache`, I can't seem to convince zig build to install it anywhere. Is there some equivilent to installArtifact that outputs the header files?
cloudhop has quit [Ping timeout: 256 seconds]
paperbags has quit [Quit: Page closed]
Akuli has joined #zig
FireFox317 has joined #zig
<FireFox317> cloudhop: I think you want `setOutputDir`, it should install all the files to that folder
SamTebbs33 has joined #zig
<andrewrk> I think .h files are not handled well in the build system yet
<andrewrk> there's sort of a dependency problem in the compiler right now, because C objects are compiled before zig root source file. if the C objects depend on the generated .h file, that won't work
return0e has joined #zig
return0e_ has quit [Ping timeout: 258 seconds]
<scientes> ugggh, there is so much operator overloading the C++
<scientes> even if you can accept that you still never know what algorithm or data structure is being used
marijnfs__ has quit [Quit: WeeChat 2.4]
FireFox317 has quit [Ping timeout: 256 seconds]
gamester has joined #zig
gamester has quit [Quit: Leaving]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
husho has quit [Ping timeout: 248 seconds]
husho has joined #zig
wilsonk has quit [Ping timeout: 244 seconds]
wilsonk has joined #zig
wilsonk has quit [Ping timeout: 248 seconds]
wilsonk__ has joined #zig
<terinjokes> that's frustrating, looks like the channel logs are missing messages from this morning
avoidr has joined #zig
jjido has joined #zig
cameris has joined #zig
gamester has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 248 seconds]
wilsonk__ is now known as wilsonk
kristoff_it has joined #zig
utzig has quit [Ping timeout: 258 seconds]
husho has quit [Remote host closed the connection]
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wilsonk has quit [Ping timeout: 245 seconds]
wilsonk has joined #zig
knebulae has quit [Quit: Leaving]
Akuli has quit [Quit: Leaving]
I_Right_I has joined #zig
<gamester> Hah, I had a ton of "[]const []const u8" in my code. Arrays of slices, but with that additional const. The [_] was an excellent change, makes things much clearer.
<andrewrk> glad to hear it
cloudhop has joined #zig
<cloudhop> so, I was able to use setOutputDir to convince zig build to dump *all* the files for my library, but I think it would be more helpful if the build system placed the header files in an `/include/` directory (or even a user defined directory). Should an issue be filed on this?
<andrewrk> cloudhop, have you tried the install target?
<andrewrk> that's going to become the default target in the future
<andrewrk> err sorry, they're called "steps" not "targets" :)
<cloudhop> that's when i'm using zig build install
<andrewrk> yeah
<andrewrk> and you have to use b.installArtifact()
<cloudhop> Yes, but I already do that
<cloudhop> This does not install the headers
<cloudhop> If I comment out setOutputDir, this only installs the EXE and the DLL: https://pastebin.com/Y05V65y3
<andrewrk> this sounds like a bug in std/build.zig
<cloudhop> I've been digging around build.zig, but there doesn't seem to be *any* code that would install the header files, at least not directly. There's a lot of indirection through so it's hard for me to follow.
<andrewrk> cloudhop, hmm yes it would be in InstallArtifactStep.make and I don't see any logic for the .h file
<andrewrk> ok so it's TODO rather than a bug :)
<cloudhop> Should an issue be filed on this or do you track TODOs elsewhere?
<andrewrk> yep please file an issue if you would like to track progress on this
<cloudhop> done
<andrewrk> thanks
kristoff_it has quit [Ping timeout: 258 seconds]
<cloudhop> Is it possible to export a function pointer in a C interface? I'm trying to export a function that returns a function pointer to C and i hit `TODO implement get_c_type for more types`
<terinjokes> I asked the same question yesterday. There's an issue open on GitHub for someont to decide what the generated header should look like.
marijnfs_ has quit [Quit: WeeChat 2.4]
<cloudhop> oof
<cloudhop> if I can't export function pointers I can't... do anything
<terinjokes> do you need the generated headers?
<cloudhop> I could probably manually write the C header but I was specifically trying to avoid that
<cloudhop> The problem is that I have a seperate backend for this UI library, which is defined by a C interface that returns a struct of function pointers to all the plugin's functions
<cloudhop> so the entire C interface is all function pointers
<cloudhop> Even worse, there are going to be callbacks, which must be exported so any C compatible ABI can utilize them, which will also be problematic if zig can't export function pointers
<terinjokes> are you defining the plugin interface? or has the UI library already defined it?
<cloudhop> I'm defining it
<cloudhop> hence why i wanted to export it