ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
atk has quit [Quit: Well this is unexpected.]
atk has joined #zig
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 244 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
Thalheim has quit [Quit: leaving]
mnoronha has joined #zig
Thalheim has joined #zig
mnoronha has quit [Ping timeout: 252 seconds]
mnoronha has joined #zig
Thalheim has quit [Remote host closed the connection]
Thalheim has joined #zig
reductum has joined #zig
reductum has quit [Quit: WeeChat 2.2]
wilsonk has quit [Read error: No route to host]
wilsonk has joined #zig
mnoronha has quit [Ping timeout: 245 seconds]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 240 seconds]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 240 seconds]
very-mediocre has joined #zig
porky11 has joined #zig
return0e has joined #zig
very-mediocre has quit [Ping timeout: 256 seconds]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 252 seconds]
dec05eba has joined #zig
<dec05eba> what is the correct way to use zig libraries in another zig project? using zig build-lib and then @cInclude for the generated header file / using extern and defining external symbols?
<dec05eba> or is there a way to include another projects build.zig file or something like that
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 240 seconds]
Hejsil has joined #zig
<Hejsil> dec05eba, Currently, addPackagePath is the best way to accomplish this. Example: https://github.com/Hejsil/pokemon-randomizer/blob/c6fdc359eb43a2606e5d46a1f047ce2bf2a0b636/build.zig#L6-L10
<dec05eba> i see that one file is included from each library, for example lib/blz/ also has other files (build.zig, a c file). How does that work? does it only use the file you add and then you need to add every file from another project or does it somehow use all files in that library?
<Hejsil> The c files and build.zig are only there as reference, as blz.zig is a port
<Hejsil> If you look in Zigs std folder on git then there is an "index.zig", which just @import all other files on the folder. That way, Zig can just point to index.zig for the whole Zig std library
<dec05eba> yeah i just noticed that, thanks for the example :)
<Hejsil> Np
dec05eba has quit [Remote host closed the connection]
dec05eba has joined #zig
dec05eba has quit [Remote host closed the connection]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 252 seconds]
return0e_ has joined #zig
return0e_ has quit [Read error: Connection reset by peer]
return0xe has joined #zig
return0e_ has joined #zig
return0e has quit [Ping timeout: 252 seconds]
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 244 seconds]
noonien has joined #zig
very-mediocre has joined #zig
Jenz has joined #zig
Jenz has quit [Client Quit]
Hejsil has quit [Quit: Page closed]
<andrewrk> https://godbolt.org/ has zig now
mnoronha has joined #zig
Jenz has joined #zig
<Jenz> How come zig is on the llvm release notes?
<andrewrk> Jenz, all it takes to get on there is to support the latest llvm when they release and send a patch to the release notes
<Jenz> Oh, haha, sure *sounds* easy
<Jenz> Apart for the first part
<wink_> Jenz: What technique did you use to get zig running on Arch? I believe you mentioned a AUR package, I looked but didn't find it. Also I did create some instructions on how I created it from source, https://github.com/winksaville/zig-and-llvm-build-instructions
<andrewrk> wink_, did the instructions from the wiki not work for arch?
<wink_> I had chose to build llvm from source since its not in the Arch Distribution and I'd already created mkllvm-tool-chain. (Of course I had to tweak mkllvm-tool-chain as I was only building the static libraries and zig wants the dynamic libraries which I wasn't building)
<wink_> The posix instructions doesn't say where to ge the sources, now that I look at it again I see they are in the Windows Setup instructions (https://github.com/ziglang/zig/wiki/How-to-build-LLVM,-libclang,-and-liblld-from-source#windows) and of course I already had mkllvm-tool-chain, so I obviously didn't look hard enough :)
<Jenz> wink_: Do you *want* to build from source?
<wink_> Generally, yes when I have a choice.
<wink_> Jenz: did you use the instructions from the wiki?
<Jenz> No, I just went ahead and made a pkgbuild to install the latest master build from https://ziglang.org/download/
<wink_> Ok, I'll give the instructions a try then.
mnoronha has quit [Ping timeout: 252 seconds]
Jenz has quit [Quit: Lost terminal]
mnoronha has joined #zig
<wink_> One of the problems I had was I could only get things to work with clang with gcc zig wouldn't compile (https://github.com/winksaville/zig-and-llvm-build-instructions#explanation). But maybe my mistake or something about how my computer is setup, anyway I'll report back on my experience using the zig wiki instrucitons
<andrewrk> you have to use the same compiler to build llvm, clang, and zig
<andrewrk> this is a limitation of C++
Jenz has joined #zig
<wink_> I was trying to, he says without a lot of confidence :)
<Jenz> Im pretty sure you said almost exactly those two sentences a the other day andrewrk
<Jenz> s/a //
keveman has joined #zig
Jenz has quit [Quit: Lost terminal]
<keveman> Made it all the way to the end of documentation :) Liking what I am seeing..
<keveman> But I am quite intrigued by the grammar specification near the end.. what "language" is it specified in?
<keveman> I was able to grok things like `many`, `option`, and `list`
<andrewrk> keveman, it's pseudo code syntax that I made up just to help myself code it
<andrewrk> not intended to be consumed by machines, although I think somebody did do that
<keveman> but I couldn't understand something like 'CompTimeExpression(body) = "comptime" body'
<keveman> ah ok..
<andrewrk> oh, yeah... thejoshwolfe contributed that particular syntax and tbh I don't really understand it either
<andrewrk> bottom line is that the parser is recursive descent
<keveman> but in the above, what does `body` stand for?
<keveman> hmm ok.. just pedantic musing on my part..
<andrewrk> I think it's supposed to communicate that state about the expression body is passed to the function that parses comp time expressions? I'd have to look at the parser code to refresh my memory
<keveman> forgive me for not doing my due diligence of going over github issues, but bitfields in structures and multidimensional arrays are not in yet?
<wink_> andrewrk: I followed the instructions on the wiki on my Arch box and successfully compiled llvm and clang but failed zig exactly the same way as it did with my instructions when using gcc 8.2.1:
<andrewrk> looks like `packed struct` docs aren't done yet. packed structs provide bit fields
<andrewrk> multidimensional arrays can be made by having the type of an array be an array, just as you'd expect
<wink_> home/wink/local/include/llvm/ADT/SmallVector.h:313:11: error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct std::pair<void*, long unsigned int>’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
<andrewrk> [3][4]i32
<andrewrk> wink_, what compiler version is that?
<wink_> which compiler zig, clang, gcc?
<wink_> gcc is 8.2.1
<andrewrk> what file was it trying to build when that error happened?
<wink_> I happen to be on my remove-StrLitKind-enum which is on top of master a170a64776e703a8549e5ef16cc6009b642b617e
<wink_> and 9a123697 is there
<wink_> the file is home/wink/local/include/llvm/ADT/SmallVector.h:313:11 see above
<wink_> 0h you ment zig file one second
<wink_> from /home/wink/prgs/ziglang/zig/src/zig_llvm.cpp:18:
<andrewrk> ah, I see. We need to add gcc 8 detection in CMakeLists.txt. unfortunately c compilers don't let you disable future warnings on older versions
<wink_> LOL
<andrewrk> maybe there's a pragma that can disable warnings in the llvm includes
darithorn has joined #zig
<andrewrk> wink_, can you see if it's possible to wrap the llvm includes at the top of zig_llvm.cpp with some kind of pragma to disable warnings?
<andrewrk> we want warnings for all zig c++ code but not from LLVM C++ code
<wink_> k
<andrewrk> or maybe the next answer, with gcc 8 detection
<wink_> https://github.com/ziglang/zig/pull/1585 works for me with gcc 8.2.1 and clang 6.0.1 on Arch Linux
<wink_> Yep, that's what I did.
<andrewrk> wink_, brilliant. if this passes the MSVC build then I'll merge it pronto
<wink_> SG
<andrewrk> much appreciated
<wink_> NP
<wink_> So some suggestions on the wiki:
<wink_> Move the Setup instructions out of the Windows section
<wink_> Suggest using -jX when building
<wink_> And rename the link "Download llvm and cfe" to "Download llvm and clang"
Ichorio has joined #zig
Jenz has joined #zig
keveman has quit [Ping timeout: 256 seconds]
<Jenz> andrewrk: At the localhost presentation (which was great btw), did you use neovim-qt?
<andrewrk> Jenz, I believe that is simply `vim -g`
<Jenz> I don't get what you mean Dx, do you mean you used gvim (vim -g)? Or do you mean that neovim-qt is vim -g, which I assume you don't
<Jenz> Sorry if Im a bit of an idiot, everyone are so at times, I believe
<andrewrk> I use gvim
<Jenz> Ok, thanks :)
mnoronha has quit [Ping timeout: 245 seconds]
davr0s has quit [Read error: Connection reset by peer]
davr0s has joined #zig
mnoronha has joined #zig
mnoronha has quit [Ping timeout: 240 seconds]
Jenz has quit [Ping timeout: 252 seconds]
mnoronha has joined #zig
Jenz has joined #zig
mnoronha has quit [Ping timeout: 252 seconds]
mnoronha has joined #zig
Jenz has quit [Ping timeout: 252 seconds]
very-mediocre has quit [Ping timeout: 256 seconds]
<cgag> andrewrk: is the std.heap.directallocator not a general purpose allocator?
Ichorio has quit [Ping timeout: 260 seconds]
<andrewrk> cgag, it would be a bad fit for that for two reasons - 1. it's slow - you'll make a syscall for every allocation and every free, and 2. it's inefficient with memory - you're going to waste up to 1 page of bytes with every allocation
<MajorLag> That last part is only true of the POSIX implementation.
fsateler_ has joined #zig
benaiah` has joined #zig
<andrewrk> oh that's interesting - HeapAlloc is fit for general purpose use?
<andrewrk> that's good to know
darithorn has quit [*.net *.split]
redj has quit [*.net *.split]
fsateler has quit [*.net *.split]
benaiah has quit [*.net *.split]
benaiah` is now known as benaiah
<MajorLag> Well I'm not sure about the cost of calling it, but I can assure you it packs allocations more efficiently than one per page.
<andrewrk> if we have a GPA in std it'll probably still be worth using it on windows, because it could, at least in debug mode, do lots of memory debugging features
<andrewrk> stack traces for leaks, corruption detection, analysis of performance, all that good stuff
darithorn has joined #zig
mnoronha has quit [Ping timeout: 245 seconds]
mnoronha has joined #zig
<andrewrk> does anyone want to add their project to the "List of Active Projects Using Zig" section in the release notes? You have until thursday to submit PRs https://github.com/ziglang/www.ziglang.org/blob/b5f70b1895dda597605fd035a3b02c7071aaeb31/www/download/0.3.0/release-notes.html#L830
return0e_ has quit [Remote host closed the connection]
noonien has quit [Quit: Connection closed for inactivity]