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/
diltsman has quit [Read error: Connection reset by peer]
kristoff_it has quit [Ping timeout: 258 seconds]
mikdusan1 has quit [Ping timeout: 272 seconds]
<scientes> and why don't we replace all of those with a @call(type: builtin.Call, ...
<scientes> well @newstackCall and @asyncCall have different arguments...
<scientes> so this will have to wait until after the var args stuff
<scientes> dimenus gone...
mikdusan1 has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Remote host closed the connection]
kristoff_it has joined #zig
marijnfs has quit [Ping timeout: 264 seconds]
slice has quit [Ping timeout: 245 seconds]
slice has joined #zig
darithorn has quit [Quit: Leaving]
\u is now known as meowray
marijnfs has joined #zig
marijnfs__ has quit [Ping timeout: 246 seconds]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #zig
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #zig
kristoff_it has quit [Remote host closed the connection]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 268 seconds]
mikdusan1 has quit [Ping timeout: 258 seconds]
mikdusan1 has joined #zig
mikdusan1 has quit [Ping timeout: 268 seconds]
mikdusan1 has joined #zig
mikdusan1 has quit [Ping timeout: 244 seconds]
mikdusan1 has joined #zig
mikdusan1 has quit [Ping timeout: 245 seconds]
_whitelogger has joined #zig
mikdusan1 has joined #zig
THFKA4 has quit [Ping timeout: 250 seconds]
diltsman has joined #zig
<diltsman> Does anyone have experience using Windows.h in Zig?
mikdusan1 has quit [Ping timeout: 268 seconds]
<andrewrk> diltsman, I'd generally recommend using std.os.windows instead, with additions as necessary
mikdusan1 has joined #zig
<diltsman> andrewrk, I am wanting to create a window, memory map files, etc.
<andrewrk> make your file my_windows.zig and have it do `usingnamespace std.os.windows;`. then you can augment the std lib with whatever you want
<diltsman> So, create the pub extern "kernel32" prototypes as needed?
mikdusan2 has joined #zig
mikdusan1 has quit [Ping timeout: 245 seconds]
NI33_ has quit [Ping timeout: 248 seconds]
kristoff_it has joined #zig
<diltsman> andrewrk, I see that it provides the W variants of the functions. How do I get 16-bit character sets, since string literals are UTF-8 in Zig?
kristoff_it has quit [Ping timeout: 248 seconds]
<scientes> diltsman, there are conversion in functions in unicode.zig
<diltsman> Perfect!
<scientes> however there is no support for the invalid UTF-16 that windows allows
<scientes> only valid utf-16
<andrewrk> just use the APIs, they express the correct intent. the implementations will get fixed
_whitelogger has joined #zig
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
kristoff_it has joined #zig
laaron has joined #zig
rjtobin has quit [Quit: Leaving]
kristoff_it has quit [Ping timeout: 245 seconds]
_whitelogger has joined #zig
porky11 has joined #zig
laaron has quit [Remote host closed the connection]
laaron has joined #zig
laaron has quit [Client Quit]
SimonNa has joined #zig
laaron has joined #zig
curtisf has joined #zig
_whitelogger has joined #zig
_whitelogger has joined #zig
laaron has quit [Remote host closed the connection]
laaron has joined #zig
return0e has quit [Ping timeout: 244 seconds]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
_whitelogger has joined #zig
curtisf has quit [Remote host closed the connection]
kristoff_it has joined #zig
<daurnimator> andrewrk: o.o you're up at a weird hour
<daurnimator> andrewrk: also fwiw... I'm looking into the faster strace trace issue after all
kristoff_it has quit [Ping timeout: 246 seconds]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 245 seconds]
porky11 has quit [Quit: Leaving]
kristoff_it has joined #zig
ntgg has joined #zig
kristoff_it has quit [Ping timeout: 268 seconds]
andersfr has joined #zig
andersfr has quit [Client Quit]
kristoff_it has joined #zig
NI33_ has joined #zig
kristoff_it has quit [Ping timeout: 246 seconds]
porky11 has joined #zig
kristoff_it has joined #zig
porky11 has quit [Read error: No route to host]
kristoff_it has quit [Ping timeout: 245 seconds]
MH026 has quit [Remote host closed the connection]
<daurnimator> Sahnvour: you requested a review from me. but I don't think you've modified the code since last time?
<Sahnvour> daurnimator: yes, I missclicked github's review tool
companion_cube has quit [Ping timeout: 244 seconds]
companion_cube has joined #zig
wootehfoot has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 268 seconds]
knebulae has quit [Read error: Connection reset by peer]
_whitelogger has joined #zig
_whitelogger has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 248 seconds]
akorator has joined #zig
knebulae has joined #zig
<akorator> Started with Zig in Windows 10 (64bit, latest master) and running "zig targets" gets me this: Available glibc versions: Assertion failed. This is a bug in the Zig compiler. Unable to dump stack trace: Unable to open debug info: InvalidPEMagic
<akorator> Maybe this is a known issue or something I did wrong
return0e has joined #zig
<ntgg> is there a plan to have nested inferred size for arrays ([_][_]) or is the current way final?
kristoff_it has joined #zig
<ntgg> akorator: Did you build from master or download the prebuilt?
kristoff_it has quit [Ping timeout: 244 seconds]
<Sahnvour> akorator: zig 0.4.0 is a bit date if that's what you are using, a lot happened on master since the release
<akorator> @ntgg downloaded the prebuilt: zig-windows-x86_64-0.4.0+f01cb8cc.zip
<ntgg> akorator: It's probably not you then, I don't see an issue for it on github either, so you should probably open one.
kristoff_it has joined #zig
samtebbs has joined #zig
kristoff_it has quit [Ping timeout: 258 seconds]
<samtebbs> Hi all, is anyone having issues building zig master? My issue is "error: initializing ‘llvm::ArrayRef<long unsigned int>::Data’" when building "embedded_softfloat"
<nrdmn> samtebbs: are you building with gcc >= 9?
<samtebbs> nrdmn: Yep, 9.1
<nrdmn> samtebbs: try building with gcc < 9 or with clang
kristoff_it has joined #zig
<samtebbs> nrdmn: I'll try that. Do I have to specify the compiler to use with cmake or make?
<nrdmn> you can specify it as environment variables, e.g. `CC=gcc-8.3.0 CXX=g++-8.3.0 cmake ..`
<scientes> /home/shawn/git/zig-libmvec/exp.zig:82:5: error: variable of type '(undefined)' must be const or comptime
<scientes> but undefined is comptime????
Hejsil has joined #zig
Hejsil has quit [Read error: Connection reset by peer]
<nairou> nrdmn: I was about to ask the same thing, errors building with GCC 9 :-)
<ntgg> scientes: What context is it used in?
<scientes> ntgg, call
<scientes> of an intrinsic
<scientes> i think it has something do with with ->child thingy in IrInstruction
<scientes> that I don't exactly understand
<nairou> samtebbs: Do you already have an older GCC installed? I'm trying to figure out how to do that as well.
<nairou> nrdmn: Do you know how I'd build zig using clang? How do you force cmake to use it?
<nrdmn> nairou: `CC=clang CXX=clang++ cmake ..`
<nairou> nrdmn: Thanks!
kristoff_it has quit [Remote host closed the connection]
kristoff_it has joined #zig
<nrdmn> andrewrk: do you know about this issue?
<samtebbs> nrdmn: I installed gcc-8 then backed-up my old /usr/bin/c++ binary and replaced it with /usr/bin/c++-8
<scientes> nrdmn, what is the issue?
<scientes> please paste
<samtebbs> scientes: The same issue as me above, when building embedded_softfloat
<samtebbs> Doesn't work with gcc9
<samtebbs> Hmm, now I'm getting "undefined reference to `std::_Sp_make_shared_tag::_S_eq(std::type_info const&)'" when linking zig0
<nrdmn> scientes: apparently you can't build zig with gcc 9
<scientes> just fix the bug, it shouldn't be that difficult
<nairou> I get a slightly different error than samtebbs. In my case it looks like GCC has --enable-default-pie set by default, and zig doesn't like it: relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIC
<scientes> also, that is c++, not c
<nairou> Looks like clang built it just fine, woot
<samtebbs> scientes: Well yes, but it doesn't seem like many others are experiencing the same issue so it could very well be an environment issue
ntgg has quit [Remote host closed the connection]
<samtebbs> nrdmn: How did you manage to build with clang rather than gcc?
<daurnimator> I have gcc 9.1.... haven't had issues
<nairou> daurnimator: I'm curious of your copy has --enable-default-pie built in
<samtebbs> What llvm version is zig using now? I heard talks of switching to the llvm 9 release candidate branch
<daurnimator> nairou: how would I check that?
<samtebbs> That could be something to do with it
<daurnimator> samtebbs: llvm 8 in master. there's a branch open for llvm 9
porky11 has joined #zig
<nairou> daurnimator: gcc -v shows all built-in options
<daurnimator> nairou: yes it does.
<nairou> Interesting
<scientes> uggh, lots of merge pain on my SIMD branch
<nrdmn> samtebbs: CC=clang CXX=clang++ cmake ..
nairou has quit [Remote host closed the connection]
SimonNa has quit [Remote host closed the connection]
SimonNa has joined #zig
nairou has joined #zig
<daurnimator> samtebbs: "the symbol is visible to `extern` declarations" I'm not sure what you mean?
akorator has quit [Ping timeout: 260 seconds]
<samtebbs> daurnimator: If you export a symbol, then it becomes possible to use it elsewhere by using `extern`
<daurnimator> samtebbs: oh right. I forget how overloaded extern is
<samtebbs> nrdmn: cheers
<scientes> ahhh yes a5cb0f77d11bdcc504fe broke a bunch of my SIMD stuff
darithorn has joined #zig
<scientes> and requires me to do a bunch of work
<scientes> again because of when types are resolved
<samtebbs> daurnimator: Yeah :) I always think of it from a linker point of view rather than an ABI point of view
<scientes> ugggh its totally broken by that commit
<scientes> this is really frustrating
Akuli has joined #zig
<samtebbs> Now I'm getting "CommandLine Error: Option 'dump-thin-cg-sccs' registered more than once!"... I've been building zig fine up until today
<scientes> andrewrk, do ResultLoc's get their id set before or after types?
<gonz_> How does one link `_mm_...` intrinsics into a C build?
<gonz_> `_mm_set1_epi8`, for example
<gonz_> I'm trying to build/use `libspng` with zig and having some issues
<scientes> gonz_, those are not actually C, those special headers do not work with Zig
<scientes> neon, sse, or altivec
<scientes> if its not telling you that, that is a bug
laaron has quit [Remote host closed the connection]
samtebbs has quit [Remote host closed the connection]
<gonz_> What exactly do you mean "do not work with zig"?
<scientes> those require compiler integration
<gonz_> It's the linker that needs them
<scientes> gonz_, they are not functions, they are not symbols
<scientes> they are C extensions
<scientes> gonz_, I have a portable SIMD patch set posted, but I am working on rebasing it because andrew broke it
<gonz_> So basically the zig compiler right now assumes they're normal functions and that's why `lld` ends up saying they're just undefined?
<scientes> correct
gamester has joined #zig
gamester has left #zig ["Leaving"]
ntgg has joined #zig
<daurnimator> (was marked resolved but no reply and I can't see it in the code)
xeqtr has joined #zig
FSX has joined #zig
xeqtr has quit []
akorator has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
tines9 has joined #zig
<scientes> uggh, that result loc stuff broke simd badly
<scientes> it now doesn't want to track an evolving value, but instead load it every time
<scientes> we don't need two version of every concept
<scientes> or three
<scientes> resultloc is totally incompatible with SSA
andersfr has joined #zig
andersfr has quit [Client Quit]
<scientes> LLVM just doesn't think this way
<Sahnvour> daurnimator: I wrote a comment in answer, it disappeared ?
<Sahnvour> so my point is, gimli is a cryptographic hash so I'd rather not compare it against non-crypto ones
<Sahnvour> to avoid confusing readers and making them think they can be used for the same things
tines9 has quit [Quit: leaving]
tines9 has joined #zig
gamester has joined #zig
batok has joined #zig
<gonz_> C and C++ really have the worst build eco system
<gonz_> How is it acceptable that you should have python3 installed just to install a C/C++ build tool?
<gonz_> This shit doesn't make any sense
<scientes> gonz_, or m4!
tines9 has quit [Quit: leaving]
tines9 has joined #zig
tines9 has quit [Client Quit]
tines9 has joined #zig
xeqtr has joined #zig
rjtobin has joined #zig
<emekankurumeh[m]> fips?
tines9 has quit [Quit: leaving]
tines9 has joined #zig
tines9 has quit [Client Quit]
tines9 has joined #zig
<andrewrk> scientes, vectors don't need result locations; they are treated as primitives
<ntgg> Is it possible to get the active field name of a union?
<andrewrk> ntgg, yes if the union is tagged
<andrewrk> cast it to the tag type
<andrewrk> I believe you can also use @tagName directly
<ntgg> what about an untagged union?
<ntgg> is it just not possible?
<andrewrk> yeah that's the whole point: the knowledge of which field is active is not stored in an untagged union
<ntgg> Ah, makes sense.
akorator has quit [Remote host closed the connection]
curtisf has joined #zig
<emekankurumeh[m]> so there is no safety?
<emekankurumeh[m]> I hadn't realized that till now
<andrewrk> there is safety for non-extern, non-packed unions
<andrewrk> but you can't access the safety field because it's not available in all build modes
<ntgg> is there a way to access tagged union fields as optional?
<andrewrk> switch (my_union) { .tag => |x| x, else => null}
<andrewrk> if (my_union == .tag) my_union.tag else null
<andrewrk> you could wrap that in a function
<ntgg> I'm doing currently doing the switch way, just feels a little weird coming from rust.
<ntgg> It works fine though, just wanted to make sure I wasn't missing something
Akuli has quit [Remote host closed the connection]
<andrewrk> what's the rust way?
<ntgg> if let Tag(variable_name) = my_union { ... }
<andrewrk> ah right
SimonNa has quit [Remote host closed the connection]
<andrewrk> that's equivalent to the switch, they both create a nested scope if it matches
<emekankurumeh[m]> pattern matching is one of my favorite features of rust
<ntgg> yeah, it makes a lot of stuff feel real clean
<ntgg> but without tuples it kinda reduces the usefulness
nairou has quit [Quit: Leaving]
<nrdmn> can I create a struct type with a specific alignment?
NI33_ has quit [Ping timeout: 268 seconds]
<andrewrk> nrdmn, here's the issue to track: https://github.com/ziglang/zig/issues/1512
<andrewrk> This is one that I hope to resolve in the 0.5.0 milestone rather than postpone
<nrdmn> andrewrk: I mean the alignment of the whole struct
<andrewrk> nrdmn, the alignment of a struct is equal to the alignment of its most-aligned field
<nrdmn> so I just set the alignment of the first field?
<nrdmn> will `fn foo (x: *align(N) T) { ... } const bar = T{ ... }; foo(&bar);` work?
<andrewrk> why do you need the struct to be aligned?
<andrewrk> that example will give you a compile error if the struct is under-aligned but it won't force an alignment on the type
mschwaig has joined #zig
kristoff_it has quit [Ping timeout: 244 seconds]
kristoff_it has joined #zig
huuskes has joined #zig
<ntgg> I have a test that is failing, but there are no errors or failing expects as far as I can tell
<ntgg> it says that the 'zig test <file>' command is exiting with code 255
<nrdmn> andrewrk: because the UEFI spec says so
gamester has quit [Quit: Leaving]
<nrdmn> the most aligned field of the type EFI_GUID is 4 bytes, but EFI_GUID must be 8 byte aligned
kristoff_it has quit [Ping timeout: 268 seconds]
NI33_ has joined #zig
<andrewrk> nrdmn, you're trying to make a struct match the UEFI spec? what's the target arch?
<nrdmn> UEFI is specified for i386, amd64, itanium, aach32, aarch64 and riscv
<ntgg> I fixed the test by removing a `defer File.close()` call
batok has quit []
<ntgg> why would that effect the test?
batok has joined #zig
<andrewrk> nrdmn, if you're able to put a u64 field in the struct at the end, that could be a workaround until #1512 is solved
mschwaig has quit [Remote host closed the connection]
<nrdmn> EFI_GUID is specified in https://uefi.org/sites/default/files/resources/UEFI_Spec_2_8_final.pdf on page 21 as "128-bit buffer containing a unique identifier value. Unless otherwise specified, aligned on a 64-bit boundary.", with some details in appendix A on page 2201
<andrewrk> nrdmn, oh, your other option is to choose the alignment at the memory location rather than in the type
<andrewrk> var bar: T align(8) = undefined;
<andrewrk> you can override the alignment of any type when you declare a variable
<nrdmn> that's what I'm doing right now, but I'd like to enforce it somehow
<andrewrk> yeah. that's 1512.
<nrdmn> ok
<ntgg> what reasons would I be getting integer overflow in std.buffer.Buffer.len?
<ntgg> I am creating it with Buffer.init(allocator, "")
<curtisf> Is there a simple allocator in the standard library that I can assert has freed all of its memory in a test, to make sure I'm not leaking allocations?
<andrewrk> it's not quite ready to be merged into std but it's far enough along to be useful
<curtisf> The readme says posix only, does that mean I can't use it on windows?
<andrewrk> oh yeah the windows backend isn't done yet
ntgg has quit [Ping timeout: 245 seconds]
<andrewrk> you can use `--library c` and `std.heap.c_allocator` and `valgrind --leak-check=full` when running your test
<scientes> I'm having a problem where bit shifts don't show up in the llvm-ir
<scientes> oh found it
knebulae has quit [Ping timeout: 248 seconds]
<nrdmn> Is there an allocator that I can construct from a list of slices of memory?
<nrdmn> s/construct from/pass/
<scientes> nrdmn, a single slice,yes, multiple I don't think so
marijnfs_ has joined #zig
nairou has joined #zig
nairou has quit [Client Quit]
porky11 has quit [Quit: Leaving]
nairou has joined #zig
ltriant has joined #zig
marijnfs_ has quit [Ping timeout: 250 seconds]
curtisf has quit [Ping timeout: 260 seconds]
Tetralux has quit [Ping timeout: 245 seconds]
batok has quit [Remote host closed the connection]
<scientes> I need a new intel laptop with the new debugging fetures
Tetralux has joined #zig