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/
hazeycode has left #zig [#zig]
daex_ has joined #zig
daex has quit [Ping timeout: 258 seconds]
utzig has joined #zig
copy has quit [Read error: Connection reset by peer]
aerona has joined #zig
ur5us has joined #zig
jmiven has quit [Quit: bye]
jmiven has joined #zig
jmiven has quit [Client Quit]
jmiven has joined #zig
<bnbn> I recently updated from 0.5.0 to 0.6.0. I interface with a c library (stbi_image.h) to load images into memory. In 0.5.0, I could successfully pass a []const u8 via .ptr to a c function looking for a constant null-terminated string. Now in 0.6.0, it does not work. I've been trying to convert a []const u8 to the new [*:0]const u8, but I can't quite get it. Any advice/examples would be appreciated, thanks!
kristoff_it has joined #zig
<pixelherodev> bnbn, make sure the slice is marked as null-terminated?
<pixelherodev> `[:0]const u8`
<bnbn> Is there an easy way to convert a []const u8 to a [:0]const u8?
<pixelherodev> Where's the source?
<pixelherodev> Is it a string literal?
kristoff_it has quit [Ping timeout: 240 seconds]
<pixelherodev> It's *probably* already null-terminated...
<pixelherodev> `@ptrCast`?
<bnbn> Yeah that's what I thought because I remember when upgrading from 0.4.0 to 0.5.0 I could remove all the c"strings" everywhere. And it did work, so it was null terminated.
<pixelherodev> Yeah literals are null-terminated
<pixelherodev> and anything coming from a C-ish environment (including syscalls) is almost certainly null-terminated
<pixelherodev> So, it 's probably safe to @ptrCast it
<pixelherodev> `@ptrCast([:0]const u8, val)`
<bnbn> ok, I will try that, thanks!
<pixelherodev> :)
<bnbn> hmm get this error ` error: expected pointer, found '[:0]const u8'` when trying to cast with `const tpath = @ptrCast([:0]const u8, path);` path is a []const u8
<pixelherodev> Ah right hmm
<pixelherodev> I had this exact issue multiple times
<pixelherodev> and I never remember how I solved it
<pixelherodev> std.mem.toSlice might work
<pixelherodev> s/Slice/SliceConst
aerona has quit [Remote host closed the connection]
<pixelherodev> I don't *think* @as would
aerona has joined #zig
aerona has quit [Remote host closed the connection]
aerona has joined #zig
aerona has quit [Remote host closed the connection]
<bnbn> Ok I'll check those methods out, as well as @as. I see that toSlice/toSliceConst are now deprecated in 0.6.0, replaced with spanZ
aerona has joined #zig
marijnfs has joined #zig
klltkr has quit [Ping timeout: 258 seconds]
marijnfs1 has quit [Ping timeout: 260 seconds]
salotz has joined #zig
<salotz> hello, is tgschultz around? Reading your blog posts (rants). I'm also thinking about "Operating" Environments
<BaroqueLarouche> speaking of OS, I have done a list of bullet points just for fun of what I would do if I did an OS: https://gist.github.com/mlarouche/cd7c58bd90f34459ec0e2409732e55c0
<salotz> thats not a too unreasonable of a list tbh
<salotz> I think I have way more off the wall requirements :P
<BaroqueLarouche> like ?
<salotz> has anyone here ever heard of Genode OS? I'm interested in writing zig for it. Also anyone writing kernel and sandboxing should check it out
<salotz> I basically want a lisp machine and an RPG-esque tile-based terminal protocol for buffers that works remotely.
<salotz> And to have a single rendering tree for the whole thing
<salotz> and of course if 3D if I can
xackus has quit [Ping timeout: 256 seconds]
foobles has joined #zig
<foobles> hallo
<foobles> how to you check that two ZigTypes are equivalent?
<foobles> you can't just check the ids
<pixelherodev> Deep comparison you mean?
bnbn has quit [Ping timeout: 265 seconds]
zannzen has joined #zig
<salotz> is there a testing system anyone uses for zig?
<foobles> yes
<foobles> pixelherodev
<foobles> i did find `types_match_const_cast_only`
<foobles> but im not sure that's right
nephele_ has joined #zig
nephele has quit [Ping timeout: 256 seconds]
nephele_ is now known as nephele
ur5us has quit [Remote host closed the connection]
ur5us has joined #zig
xentec has quit [Quit: memento mori]
xentec has joined #zig
xentec has quit [Client Quit]
xentec has joined #zig
utzig has quit [Ping timeout: 256 seconds]
daex_ has quit [Ping timeout: 256 seconds]
daex has joined #zig
dddddd has quit [Ping timeout: 256 seconds]
_Vi has quit [Ping timeout: 272 seconds]
<foobles> anyone know?
<foobles> the comparing types thing
<foobles> i guess I don't need to compare, i could just do peer type resolution and call it a day
waleee-cl has quit [Quit: Connection closed for inactivity]
<daurnimator> salotz: zig has testing built in
zannzen has quit [Remote host closed the connection]
joey152 has quit [Ping timeout: 256 seconds]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 256 seconds]
layneson has quit [Ping timeout: 240 seconds]
aerona has quit [Remote host closed the connection]
aerona has joined #zig
<mikdusan> foobles: ZigValue can hold a ZigType and inside const_values_equal() all it does is `return a->data.x_type == b->data.x_type`; in other words compare pointers. because types or interned. but it sounds like peer-type resolution is what you need
salotz has quit [Ping timeout: 265 seconds]
StateOff has joined #zig
<foobles> mikdusan thanks!
<foobles> so just comparing the type pointers directly should work?
<foobles> because the proposal doesn't say anything about implicit conversions
<foobles> its just ?T and T
<mikdusan> tbh that proposal is pretty thin. it doesn't answer a lot of questions that arise during impl
<foobles> yeah :P
<foobles> so how does the type interning work?
<foobles> like im just wondering
<foobles> that seems pretty complicated
<mikdusan> well here's a simple example. if you want a bool type, that's builtin. the `ZigType *` for bool is just the start of all things - codegen.builtin_types
<mikdusan> now for let's any arbitrary sized ints. someone asks for u187 . they both get back the intern'd pointer because you go through make_int_type()
<mikdusan> sorry you go through get_int_type()
<mikdusan> which if it's not already there according to parameters such as is_signed and size_in_bits, it will be created and put in a table
<mikdusan> for future matches the one already in table is returned
<mikdusan> same goes for structs --> get_struct_type() and it has the criteria to judge if two structs are identical
<foobles> oh awesome
<foobles> so even arbitrarily complex generic types have that going all the way down?
<mikdusan> yes
<foobles> :O
<foobles> thats very cool
<mikdusan> so right now compiler is single-threaded; it'll get twice as cool when self-hosted comes out and multiple threads are dancing and creating types, interning will of course be sync'd
aerona has quit [Remote host closed the connection]
bnbn has joined #zig
bnbn has quit [Quit: leaving]
cole-h has quit [Quit: Goodbye]
kristoff_it has joined #zig
foobles has quit [Ping timeout: 240 seconds]
kristoff_it has quit [Ping timeout: 240 seconds]
ur5us has quit [Ping timeout: 256 seconds]
dermetfan has joined #zig
_whitelogger has joined #zig
StateOff has quit [Read error: Connection reset by peer]
StateOff has joined #zig
<pmwhite> mikdusan: I'd be somewhat surprised if multithreading gives more than a 2 times speedup due to dependencies. My hope would be that compiler performance is considered from the beginning and that Andrew is just better and making compilers.
<pmwhite> In other words, I'm looking forward to systemic improvements more than "for-free" speedups like multithreading
ur5us has joined #zig
StateOff has quit [Ping timeout: 256 seconds]
<mikdusan> I don't have andy's design in my brain, but my thought is incr builds will have to establish build segments of what today is global and those segments should be suitable for job scheduling
wootehfoot has joined #zig
qazo has joined #zig
qazo_ has joined #zig
qazo has quit [Ping timeout: 250 seconds]
<gonz_> My immediate thought is that I'd rather see a simple compiler than a complicated one reaching a local maximum with tons of threading.
<gonz_> This is a straw man or false dichotomy, of course.
Invader_Bork has joined #zig
<gonz_> Some of this is embarassingly parallel
<gonz_> But I'm convinced that what we know as slow compilers (`ghc` & co.) have massive speedups hiding in there somewhere, but no one can get at them because they're too complex.
qazo_ has quit [Ping timeout: 250 seconds]
FireFox317 has joined #zig
qazo has joined #zig
<andrewrk> mikdusan, speaking of, check the PR I just opened: https://github.com/ziglang/zig/pull/5130
qazo has quit [Ping timeout: 265 seconds]
* mikdusan reads
<mikdusan> so `hello.zir` is already targeted? ie: it's at a point where we know the machine/asm
qazo has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 256 seconds]
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #zig
<Snektron> <BaroqueLarouche "speaking of OS, I have done a li"> Good luck writing custom gpu driver that supports Vulkan
<Snektron> Do you think its possible to reuse amdgpu?
antaoiseach has joined #zig
antaoiseach has quit [Quit: Lost terminal]
FireFox317 has quit [Quit: Leaving]
daex has quit [Ping timeout: 256 seconds]
<GreaseMonkey> yeah i second that notion, don't bother with Vulkan at this point, *especially* if you've never managed to do a Hello Triangle using Vulkan
retrhelo has joined #zig
<GreaseMonkey> if anyone does want to make a GUI-first operating system i'd highly recommend working in 32-bit ARGB rectangles with only one possible component order, if you want anything higher depth allow 64-bit ARGB rectangles
<retrhelo> Hello, I met a problem while learning to use zig. The character '\t' is seen as invalid while compiling. I wonder if there is a way to solve this problem. Thanks!
<afontain_> replace the tabs
<afontain_> :-(
<retrhelo> Fine, I'll check it out, thank you. :)
ur5us has quit [Ping timeout: 240 seconds]
retrhelo has quit [Quit: leaving]
kristoff_it has joined #zig
ur5us has joined #zig
kristoff_it has quit [Ping timeout: 240 seconds]
qazo has quit [Ping timeout: 258 seconds]
ur5us has quit [Ping timeout: 252 seconds]
st4ll1 has joined #zig
_Vi has joined #zig
<pixelherodev> ZIR!!
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
Ekho has quit [Quit: An alternate universe was just created where I didn't leave. But here, I left you. I'm sorry.]
st4ll1 has quit [Ping timeout: 264 seconds]
ifreund has joined #zig
utzig has joined #zig
<Snektron> So when exactly is Allocator.realloc allowed to fail?
<Snektron> nevermind, i think it works out
Ekho has joined #zig
<nephele> what would be the equivalent to posix_spawn for zig? it does not seem to be in std/os at all (or maybe i suck at searching :g)
<pixelherodev> nephele, child_process ?
<ikskuh> std.ChildProcess
<ikskuh> according to std/build/run.zig
<nephele> thanks
<pixelherodev> Oh I was looking at file name, not type name :P
nickster has quit [Quit: Ping timeout (120 seconds)]
dddddd has joined #zig
omglasers2 has joined #zig
st4ll1 has joined #zig
r4pr0n has joined #zig
<r4pr0n> are we sure that llvm overrides the stack with garbage when inlining posixCallMainAndExit()?
<r4pr0n> i changed it to always_inline and built https://bpaste.net/IZJQ with --release-fast, it gets inlined into _start but works normally
nickster has joined #zig
<Sphax> Hello. I managed to create a repro for the error I got yesterday which I still don't understand: https://gcc.godbolt.org/z/w4_rTJ if you move the `age: u32` field in the Row struct below `set: []u8` it compiles fine, so I'm not sure why it fails here.
<Sphax> am I doing something wrong or is this a bug ?
utzig has quit [Ping timeout: 256 seconds]
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
shakesoda has quit [Quit: Connection closed for inactivity]
basedtho has quit [Ping timeout: 260 seconds]
StateOff has joined #zig
utzig has joined #zig
xackus has joined #zig
antaoiseach has joined #zig
<antaoiseach> hey folks... anybody know the status of the macOS homebrew+llvm issue? Right now I'm making do with an old commit
antaoiseach has left #zig [#zig]
layneson has joined #zig
utzig has quit [Ping timeout: 264 seconds]
TheLemonMan has joined #zig
<TheLemonMan> r4pr0n, _start is naked, you want to take the original stack pointer value and then create a frame for the other functions
<r4pr0n> why though?
<TheLemonMan> because you need the sp to find the argc/argv/auxv
<TheLemonMan> if you allocate a stack frame for _start you're thrashing the kernel-supplied stack pointer
<pixelherodev> Even if you know the size of that stack frame?
<pixelherodev> Can't you do `current_sp + @sizeOf(@StackFrame(_start))` (not real code)
<TheLemonMan> yes
<TheLemonMan> but you usually don't know the size of the stack frame
<pixelherodev> Ahh, right
<pixelherodev> Wait, isn't knowing stack frame size an accepted part of safe recursion?
<TheLemonMan> that's vapourware atm
<TheLemonMan> you really know how big the frame is after LLVM starts the codegen phase, when all the inlining and other optimizations are done
<pixelherodev> ahhhh, right
jmiven has quit [Quit: bye]
jmiven has joined #zig
Cogitri has quit [Quit: killed]
Cogitri has joined #zig
waleee-cl has joined #zig
<TheLemonMan> it seems C is getting arbitrarily-sized ints
<fengb> What about larger than 128? :P
<TheLemonMan> std.math.int to the rescue!
r4pr0n has quit [Ping timeout: 240 seconds]
nycex has quit [Ping timeout: 240 seconds]
<fengb> I'm glad the bootstrap repo exists. Gives me the perfect LLVM build :)
StateOffGames has joined #zig
nycex has joined #zig
StateOff has quit [Ping timeout: 256 seconds]
foobles has joined #zig
r4pr0n has joined #zig
<oats> I get the feeling people are having fun translating the go stdlib into zig :P
<oats> maybe I should get in on some of this action
<r4pr0n> where is that?
<oats> r4pr0n: hmm?
<r4pr0n> what about the go stdlib
<r4pr0n> where is that being transleted to zig
<oats> r4pr0n: I'm just seeing that a lot of stuff in the zig standard library has been translated from Golang's
<oats> just an example
<r4pr0n> hm oka
<r4pr0n> y
shakesoda has joined #zig
<fengb> Some people like translating code
<oats> y'know, it sounds like fun
<fengb> I don't because I always want to fix it >_>
<fengb> And then I make this ungodly hybrid of half working, half fugly crap
<tgschultz> salotz: I'm curious to hear your thoughts. Offtopic for Zig though, so please email me if you want to talk about it.
foobles has quit [Remote host closed the connection]
Akuli has joined #zig
<fengb> Is there a simple equation that maps 3x u5 back to 3x u8 ?
<fengb> I'm manually left shifting by 3 for every field
<companion_cube> casts?
<TheLemonMan> are the 3 u5 packed in a single word/vector/array?
<fengb> I mean, u5@31 => u8@255
<fengb> Yes they're packed. I feel like there's some magic that can be done
<fengb> I could load a u32 manually and shift them all by 3. That'd save 2 ops
cole-h has joined #zig
<pixelherodev> I have made the *ultimate* in hack technology
<TheLemonMan> I'd suggest to write a naïve implementation using ands/shifts and let LLVM do its job
* pixelherodev grins
<fengb> It's in Javascript
<fengb> Which also means maybe it won't ever be optimized >_>
<fengb> I guess I could try tossing it in wasm to see if the function overhead is worth it
<TheLemonMan> oh, the plot thickens
<fengb> Oh good point, maybe LLVM can give me a useful enough output that I can leverage
<TheLemonMan> you want to do this, right? `xxxxxyyyyyyzzzzz => 000xxxxx000yyyyy000zzzzzz` ?
<fengb> xxxxx000yyyyy000zzzzz000
<fengb> Er... whichever one that pads the least significant bits
<fengb> LLVM gave me an or. This is pretty interesting
<fengb> Oops, I shifted wrong. https://godbolt.org/z/Qzbw9Y
<fengb> Yeah okay, LLVM is smarter than me
<layneson> does anyone know of a way to force (all) functions to go in a certain section?
<fengb> All a bunch of magic numbers lol
<TheLemonMan> layneson, write a custom linker script
<layneson> TheLemonMan: I'll take a look at that, thanks!
<TheLemonMan> the bitcast is the lea+or
<fengb> Oh so I can do better if I used a raw u32?
<TheLemonMan> nah it should produce the same code
<oats> speaking of which, any good linker script "tutorials" out there?
dingenskirchen has quit [Remote host closed the connection]
<ikskuh> the documentation for the linker script
<ikskuh> it's the only reliable source i found
dingenskirchen has joined #zig
<oats> which linker script?
<ikskuh> afaik only GNU ld supports linker scripts
<ikskuh> and lld can parse the ld format
<oats> ah
<andrewrk> oats, I think there are some on os dev wiki
<andrewrk> it helps if you start by thinking about what a linker script should let you do in theory, and then mapping your ideas to reality
<oats> andrewrk: lol I have no idea what that sentence means
<oats> or are you saying that it helps to understand what a linker script does, first
dingenskirchen has quit [Quit: dingenskirchen]
<TheLemonMan> lots of trial&error required, that's what it means :P
<pixelherodev> Is there any reason not to use e.g. `_ = std.os.write(std.os.STDOUT_HANDLE, "") catch 0` instead of std.debug.warn?
<pixelherodev> (aside from stdout vs stderr)
<pixelherodev> (and formatting)
<pixelherodev> (and you know what that's two reasons already)
<ikskuh> i use warn only for debugging stuff
<ikskuh> and for app logic i use
<ikskuh> try std.io.getStdOut().writeAll(msg);
<fengb> `and r2, r2, r0, lsl #6` that doesn't look too reduced 🙃
watzon has joined #zig
<TheLemonMan> reduced?
<fengb> RISC. The inline `lsl` is a lie!
<TheLemonMan> that's the barrel shifter for you
<TheLemonMan> you get a shift! you get a shift! everybody gets a shift!
* yrashk finally found a toy project to do in Zig -- working on a atomic & non-atomic reference counter (Rc/Arc in Rust). Yay!
<companion_cube> too bad there's no RAII there, too
<shakesoda> raii is a plague upon software anyways
omglasers2 has quit [Quit: Leaving]
<pixelherodev> Rai is that? (I'm kidding, I agree, I just couldn't resist the pun)
utzig has joined #zig
tritao has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
wootehfoot has joined #zig
frenata has quit [Ping timeout: 250 seconds]
wootehfoot has quit [Read error: Connection reset by peer]
wootehfoot has joined #zig
Flaminator has joined #zig
dingenskirchen has joined #zig
StateOff__ has joined #zig
StateOffGames has quit [Ping timeout: 264 seconds]
dingenskirchen has quit [Quit: dingenskirchen]
<Flaminator> I have a question that is probably really easy to answer but if const TypeName = @import("typename.zig"); and I use @typeName(TypeName); why does it use the filename for the name?
marijnfs_ has joined #zig
dingenskirchen has joined #zig
<fengb> @typeName uses the original names. const Foo = Bar assigns an alias such that Foo == Bar
<fengb> When you assign "anon", like `const Foo = struct`, it'll use the target variable as the name, but it seems that @import() itself assigns a name
<Flaminator> Yeah I was using the typename.zig as a struct itself.
r4pr0n has quit [Ping timeout: 240 seconds]
marijnfs1 has joined #zig
marijnfs_ has quit [Ping timeout: 256 seconds]
marler8997 has joined #zig
<marler8997> got a quick question, is there any way to include/exclude a struct function based on a comptime condition?
<ikskuh> marler8997: don't use it?
<ikskuh> if(condition) call_it();
<marler8997> the caller needs to know whether or not the function can be called at comptime
<marler8997> so it uses @hasDecl(T, "foo")
<marler8997> it takes a different code path based on whether or not the struct implements that function
dermetfan has quit [Ping timeout: 272 seconds]
ur5us has joined #zig
<tgschultz> const BackingStruct = struct { ... }; pub const RealStruct = if(comptime_condition) struct { usingnamespace BackingStruct; fn foo() {} } else BackingStruct;
<marler8997> hmmm, I should have clarified that they were instance functions
marijnfs_ has joined #zig
<andrewrk> marler8997, `pub usingnamespace switch (foo) { a => struct {}, b => struct {} };`
marijnfs1 has quit [Ping timeout: 260 seconds]
<marler8997> I have struct Foo, and I'm creating a struct Bar that wraps Foo, and uses @hasDecl to check whether it should wrap N functions...
<marler8997> Actually I think what I'll do is have the underlying type define a boolean for each function that it implements. That way, it MUST explicitly indicate whether it supports all functions which will prevent errors from typos
<marler8997> Then a wrapper type won't have to indicate support by conditionally defining member functions, it can just use the boolean interface as well
Xavi92 has joined #zig
<marler8997> sorry for the noise, thanks for the tips
r4pr0n has joined #zig
ur5us has quit [Ping timeout: 256 seconds]
dermetfan has joined #zig
wootehfoot has quit [Ping timeout: 240 seconds]
wootehfoot has joined #zig
<mikdusan> tritao: fix for macos version detection merged in master
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
Invader_Bork has quit [Ping timeout: 264 seconds]
wootehfoot has quit [Ping timeout: 265 seconds]
<mikdusan> andrewrk: can you host new qemu 5.0.0-rc4 binary? https://drive.google.com/file/d/1TiOOg9HCd0G8g0omua2IjA3uLcmI48ZK/view?usp=sharing
ur5us has joined #zig
<tritao> @mikdusan great, thanks.
Xavi92 has quit [Remote host closed the connection]
<tritao> does zig cc work on macosx for macosx targets? from a quick test it seems to complain about stdio.h not found
<tritao> mikdusan: is your macho ld64.lld PR related to this?
<mikdusan> tritao: unrelated
<mikdusan> that PR was driven by the 3rd item ".... when running zig0" which is not interesting unless modifying the compiler on macos
<mikdusan> s/modifying/developing
<tritao> ok cool. do you know if anyone if working on zig cc for macosx?
<mikdusan> not specifically for mac. are there some things you have in mind?
<tritao> from a quick test (`./zig cc -target x86_64-macosx-gnu hello.c`) it fails on macosx
<tritao> id like to get it to work
<tritao> think maybe i just need to teach the driver how to pass the right include paths, either from xcode or `/usr/include`
<tritao> but for linking im not sure if it should use the system linker or macho lld
<mikdusan> hmmm that cmd works for me, latest master
<mikdusan> (just an empty int main() {})
<tritao> i get `hello.c:1:10: fatal error: 'stdio.h' file not found`
<tritao> i do have some custom changes related to this, dunno if they are affecting anything
<mikdusan> I think you may have some old artifacts no longer required find and nuke these 2 files, if they exist: zig-cache/native_libc.txt and ~/Library/Application\ Support/zig/native_libc.txt
klltkr has joined #zig
<tritao> removed `~/Library/Application\ Support/zig/stage1/native_libc.txt`but same issue
<mikdusan> and `clang` (or more specifically, `cc`) is in your path?
<tritao> yeah the one from Xcode (clang.1000)
<mikdusan> can you paste the output from: `cc -E -Wp,-v -xc /dev/null`
<mikdusan> does /usr/include/stdio.h exist?
<tritao> yeah
<tritao> zig is not passing the path to clang
<tritao> its only passing ` zig/lib/include`
<mikdusan> oh one sec. let me do more than an empty main
<nephele> Hey, are there some zig examples for allocating a buffer to pass to syscalls? (I am trying this with readlink, but the type system is giving me major issues (because i don't understand it yet :g))
<mikdusan> ah i see it now
<mikdusan> tritao: also tried ld64 PR; doesn't do anything to fix this issue
<tritao> ok i can take a look at this
Xavi92 has joined #zig
<mikdusan> hmm I think this has to do with the concept of "is the build for host, or for another target"
<mikdusan> so because the OS is no longer "native" it changes things. this works btw: -target x86_64-native-gnu , or native-native-gnu
<tritao> hmm right if i dont pass an explicit target it works
<tritao> good find
<marijnfs_> where can i find the c allocator?
Akuli has quit [Quit: Leaving]
<mikdusan> i must admit I'm having trouble with the issue that this breaks things: 1. `zig targets` to find my target --> `x86_64-macosx.10.15.4...10.15.4-gnu` and then using x86_64-macosx causes a compile error
<ifreund> ok, does std.mem.eql not work with sentinal terminated pointers? or am I doing something wrong?
<fengb> Most of stdlib doesn’t understand it
<ifreund> hmm, how do i best compare them then? iterate manually?
<mikdusan> ifreund: slice it? `std.mem.eql( foo[0 .. std.mem.len(foo) )`
Xavi92 has quit [Remote host closed the connection]
<ifreund> oh neat, didn't know you can do that, but it totally makes sense
Xavi92 has joined #zig
frenata has joined #zig
<fengb> std.mem.spanZ() will convert it to a slice for you
<ifreund> ah nice
<yrashk> I wish there was clamping/saturating arithmetic, also supported by AtomicRmwOp :)
ur5us has quit [Ping timeout: 256 seconds]
<yrashk> maybe I will try to make a PR for that
return0e has quit [Read error: Connection reset by peer]
return0e has joined #zig
<fengb> I think saturating arithmetic is an accepted issue
<yrashk> yes
nia has quit [Quit: ZNC 1.7.5 - https://znc.in]
gpanders has quit [Quit: ZNC - https://znc.in]
neptunepink has quit [Remote host closed the connection]
halbeno has quit [Remote host closed the connection]
neptunepink has joined #zig
halbeno has joined #zig
gpanders has joined #zig
marijnfs has quit [Ping timeout: 265 seconds]
marijnfs has joined #zig
nia has joined #zig
dermetfan has quit [Ping timeout: 265 seconds]
ifreund has quit [Quit: WeeChat 2.8]
ifreund has joined #zig
ur5us has joined #zig
Xavi92 has quit [Remote host closed the connection]
<andrewrk> mikdusan, done
mschwaig has joined #zig
r4pr0n has quit [Quit: r4pr0n]
ur5us has quit [Read error: Connection reset by peer]
fsx_ has joined #zig
ur5us has joined #zig
FSX has quit [Ping timeout: 272 seconds]
layneson has quit [Quit: WeeChat 2.8]
ifreund has quit [Ping timeout: 258 seconds]
<Snektron> error: out of bounds pointer access in mem.zeroes?
<Snektron> Thats odd
utzig has quit [Ping timeout: 240 seconds]
<Snektron> ah its one of those odd things again, maybe related to the bug i ran into earlier
<mikdusan> andrewrk: I'm seeing a few holes in target triple and how it's used; but before I write an issue up, is -target spec syntax meant to be loosely familiar? does `zig cc` or anything else tie our hands in what the syntax is?
<mikdusan> as compared to what `clang` might use for target. or llvm.
utzig has joined #zig
<Cadey> i'm trying to build a binary for ppc64 big-endian as a proof of concept and i'm getting a very odd error: `zig cc -target powerpc64-linux-musl hello.c` hello.c: https://clbin.com/wRzZr, output: https://clbin.com/xXH7u, preprocessed source: https://clbin.com/JCFVr, script: https://clbin.com/OMu9n
utzig has quit [Client Quit]
<Cadey> i'm using zig from nixos unstable, specifically `/nix/store/rgc4wscqxabb6qr15szhw6rflj2n2y8k-zig-0.6.0/bin/zig`
_Vi has quit [Ping timeout: 272 seconds]
<Cadey> am i messing something up or did i find a bug?