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/
nerthus has joined #zig
<pixelherodev> andrewrk: is there a way to use a local zig binary to build stage2 w/o needing LLVM installed?
<pixelherodev> I want to get back to stage2 work w/o needing LLVM
st4ll1 has quit [Ping timeout: 260 seconds]
st4ll1 has joined #zig
opDispatch has joined #zig
<andrewrk> pixelherodev, https://github.com/ziglang/bootstrap
<pixelherodev> andrewrk: that just builds LLVM, no?
<pixelherodev> I have a static Zig master build, which should be enough to build stage2
<pixelherodev> But stage2 says "out-of-tree compiler not allowed"
<pixelherodev> oh wait
<pixelherodev> I can just copy it to the build folder
<pixelherodev> ... this will definitely not work but it's worth a try
<pixelherodev> ... it's actually working
<pixelherodev> huh
<pixelherodev> ... or not
<pixelherodev> drats
<pixelherodev> Unless I sync over the config.h from the buildbuddy, in which case...
<pixelherodev> Ha!
<pixelherodev> That actually worked!
<pixelherodev> All that's needed is a static up-to-date zig, and a pregenerated config.h
ur5us has quit [Ping timeout: 256 seconds]
<pixelherodev> andrewrk: 5422 will be done by this time tomorrow night.
ur5us has joined #zig
<andrewrk> pixelherodev, you might want to rebase - I already did the work for one kind of test case
st4ll1 has quit [Ping timeout: 246 seconds]
st4ll1 has joined #zig
nephele_ has joined #zig
nephele has quit [Ping timeout: 256 seconds]
nephele_ is now known as nephele
st4ll1 has quit [Ping timeout: 260 seconds]
reductum has joined #zig
alexnask has quit [Quit: Leaving]
<pixelherodev> ahok
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 246 seconds]
st4ll1 has joined #zig
doublex_ has joined #zig
doublex has quit [Ping timeout: 256 seconds]
st4ll1 has quit [Ping timeout: 265 seconds]
st4ll1 has joined #zig
st4ll1 has quit [Ping timeout: 256 seconds]
st4ll1 has joined #zig
<pixelherodev> andrewrk: thanks for the heads up :)
xackus has quit [Ping timeout: 260 seconds]
xackus has joined #zig
<andrewrk> np. don't want to step on your toes but also want to make sure I keep making progress on self hosted :)
st4ll1 has quit [Ping timeout: 260 seconds]
st4ll1 has joined #zig
<pixelherodev> No yeah that's fine
<pixelherodev> I wouldn't want it to stall because I've been busy :)
leeward has quit [Remote host closed the connection]
doublex has joined #zig
doublex_ has quit [Ping timeout: 260 seconds]
riba has joined #zig
doublex_ has joined #zig
doublex has quit [Ping timeout: 256 seconds]
_whitelogger has joined #zig
leeward has joined #zig
<pixelherodev> andrewrk: you on?
<pixelherodev> Not sure what time zone you're in :P
Snetry has quit [Ping timeout: 265 seconds]
<andrewrk> hello
<andrewrk> currently on arizona time
<pixelherodev> Okay
<pixelherodev> you modified the cases so that Transform and Error are separate
<pixelherodev> Right?
<pixelherodev> Rather, I never pushed the change removing them, and you refactored it so both have internal series of updates?
riba has quit [Ping timeout: 240 seconds]
<pixelherodev> andrewrk: is it fine if I remove those error case types and move them all to ZIRCase?
<andrewrk> remove them from #5422?
<pixelherodev> I rebased-ish onto master
<pixelherodev> not done merging yet
<pixelherodev> yes
<pixelherodev> So that #5422 only has ZIRCases
<pixelherodev> Where Error and Transform cases are just single-update ZIRCases
<andrewrk> I think ZIRTransformCase is already solved
<pixelherodev> Okay, so I should go the other route?
<pixelherodev> Remove ZIRCases?
<pixelherodev> Okay better way of asking
<pixelherodev> What is the intended pathway here?
<andrewrk> I don't see a need to put too much investment into the code structure of the test suite. As long as the test cases look friendly to contributors, and it does what you need it to do, I'm not going to scrutinize it
<pixelherodev> Okay
<pixelherodev> :)
<andrewrk> I expect the test harness to get rewritten a couple times as stage2 matures
<pixelherodev> *Casually reverts rebase and just copies new tests*
Snetry has joined #zig
<pixelherodev> aborts rebase, rather
<pixelherodev> didn't actually finish the manual cleaup
<pixelherodev> cleanup*
<pixelherodev> andrewrk: one other real quick point
<andrewrk> put another way: my goal here is just to unblock you so you can contribute to stage2 as you want to, please let me know how I can do that :)
<pixelherodev> the only remaining unresolved convo on the PR is the "find a way to mark cases as individual tests"
<pixelherodev> e.g. currently I get "1 test passed" even if there are a thousand cases
<andrewrk> ah right
<pixelherodev> What's the correct solution here?
<pixelherodev> Leave that be?
<andrewrk> well it's not really a pressing issue. but, brainstorming here, there could be something like std.testing.disableAutoProgressOutput() or something like that, as part of the test runner
<pixelherodev> Ahh, test runners are like build runners?
<pixelherodev> One other option then is a std.testing API to override test counts
<andrewrk> yeah. this is the "main" when you use `zig test`: https://github.com/ziglang/zig/blob/master/lib/std/special/test_runner.zig
<pixelherodev> e.g. `std.testing.subtest`
<pixelherodev> I'm going to be offline for most of tomorrow (hence needing a static compiler working for stage2), which is why I want to know as much as possible so I can be productive when that happens
<pixelherodev> On that note, need to charge some spare batteries :P
aerona has quit [Remote host closed the connection]
marnix has joined #zig
craigo has quit [Ping timeout: 246 seconds]
vsroy has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
ur5us has quit [Ping timeout: 256 seconds]
dddddd has quit [Ping timeout: 256 seconds]
vsroy has quit [Ping timeout: 245 seconds]
marnix has quit [Ping timeout: 264 seconds]
tdc has joined #zig
doublex_ has quit [Ping timeout: 260 seconds]
doublex has joined #zig
marnix has joined #zig
reductum has quit [Ping timeout: 240 seconds]
Snetry has quit [Ping timeout: 246 seconds]
Snetry has joined #zig
_whitelogger has joined #zig
cole-h has quit [Quit: Goodbye]
_Vi has joined #zig
Snetry has quit [Ping timeout: 246 seconds]
gazler has joined #zig
Snetry has joined #zig
_Vi has quit [Ping timeout: 272 seconds]
hermier has quit [Ping timeout: 246 seconds]
_Vi has joined #zig
_Vi has quit [Ping timeout: 260 seconds]
FireFox317 has joined #zig
ur5us has joined #zig
FireFox317 has quit [Remote host closed the connection]
FireFox317 has joined #zig
hermier has joined #zig
dermetfan has joined #zig
WilhelmVonWeiner has joined #zig
FireFox317 has quit [Quit: Leaving]
alexnask has joined #zig
_Vi has joined #zig
ur5us has quit [Ping timeout: 256 seconds]
st4ll1 has quit [Quit: WeeChat 2.8]
<ifreund> you know, it would be pretty neat if we could share custom build.zig steps as packages
<ifreund> I've now got two custom steps that would be more widely useful: one scanning wayland protocols and another generating man pages with scdoc
nycex- is now known as nycex
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen1 has joined #zig
dingenskirchen1 is now known as dingenskirchen
<daurnimator> build.zig needs to be more composable: there's no way to e.g. for a zig library to declare C libraries it depends on
<ifreund> daurnimator: how would that look? isn't that up to whatever metadata we add to make the package manager possible?
<daurnimator> yep
<daurnimator> we need to define that metadata!
<ifreund> this gets complicated by optional features which require extra dependencies
<mq32> yeah i noticed that too
<mq32> right now, i make functions that just link the stuff or not
<mq32> but it's not really scalable
dermetfan has quit [Ping timeout: 256 seconds]
dermetfan has joined #zig
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #zig
dermetfan has quit [Ping timeout: 272 seconds]
craigo has joined #zig
<daurnimator> makedepends, depends, optdepends, checkdepends
<daurnimator> ^ the 4 types of dependencies supported by archlinux PKGBUILDs. it has worked quite well
<ifreund> void has hostmakedepends, makedepends, checkdepends, and depends
<ifreund> it cares alot more about cross compliling than arch does
<ifreund> I think zig also cares about cross compiling, so we probably want hostmakedepends as well
<daurnimator> What is non-host-makedepends for in a zig world?
<ifreund> linking against a C library that's not built from source?
<daurnimator> ah right; not everything is zig yet
<ifreund> sadly :D
<scientes> I don't like that attitude
<scientes> the NIH is excessive
<scientes> C is just fine
<ifreund> sure C is fine, but I'd rather write new code in zig
<daurnimator> at the same time; I don't really want the zig package manager to do more than manage zig. i have an os package manager for that
<ifreund> right, but the zig package manager will also be mananging zig wrappers for system libraries
<ifreund> i'm not sure if we can or should included tracking of what system libraries are needed to build your zig project though
<ifreund> rust doesn't afaik
<daurnimator> What I learned with luarocks is that a package manager where another package manager can "provide" things is very useful
<ifreund> It would be totally reasonable to take the same established approach of C projects and list your system dependencies in your readme
<daurnimator> e.g. system package manager might "provide" libcurl for the native target
<ifreund> how does that work? integration with ever OS's package manager?
Snetry has quit [Ping timeout: 260 seconds]
<daurnimator> ifreund: yeah. (it doesn't exist in luarocks.... I've been meaning to add it for ages)
<ifreund> sounds hard and complex tbh
<ifreund> though also cool
<daurnimator> you'd install e.g. a "zpm-pacman" provider. if its not written yet, then you would pass it in manually: `libcurl = .{.link = "/usr/lib/libcurl.so", .include = "/usr/include/curl"}`
Snetry has joined #zig
<daurnimator> ifreund: yeah; listing in the readme works for the interim too :) though it does get messy with >2 layers of deps
<daurnimator> "the http library links again the TLS library which optionally links against the hardware token library which optionally links against libusb...."
<ifreund> agreed, it works better for C since dynamic linking and shared libs are the norm and you don't have to list the deps of your deps
<daurnimator> depends on the platform. on windows that's not really the case
<ifreund> i really don't know about windows :D
ask6155 has joined #zig
<ask6155> hello!
<alexnask> Hi
<ask6155> :)
<greenfork> =)
ask6155 has quit [Quit: Lost terminal]
waleee-cl has joined #zig
<ifreund> why isn't c_void treated like an integer instead of a pointer? I feel like that would make more sense in many cases
<leeward> void? Not void *?
<ifreund> meant *c_void yeah
<ifreund> maybe its nonsense
<ifreund> it's just that every single time i use a *c_void (ususally ?*c_void really) i need to @ptrCast(@alignCast(@alignOf( ...
<ifreund> @intToPtr(@ptrToInt( ... also works, but kinda feels like a hack
<ifreund> semantically, a void pointer in C is really just a random address that some one told you has something you want at it, might as well just be an integer
<leeward> It has different semantics from an integer. 0 means something special; negative numbers don't exist; the person who put that number in place is claiming it points to something valid.
<daurnimator> `*align(x) c_void` is also meaningful
<daurnimator> though I've been wondering for a while if `align(A)` actually could be allowed on integer types...
<ifreund> yeah I think it's a bad idea, i'll just make myself a helper function that makes the verbose casting less verbose
Snetry has quit [Ping timeout: 240 seconds]
<leeward> I wonder if translate_c should do the @alignCasting.
dermetfan has joined #zig
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
Snetry has joined #zig
<ifreund> how would it know what I want to cast my *c_void to?
<leeward> Oh, you're using the alignment of the actual type.
<leeward> I was thinking they were completely unaligned.
<leeward> Hmm, that sounds like a worth while standard library function. mem.alignTo(target: type, ptr: *c_void) *align(target) c_void
<leeward> or something like that
<daurnimator> ?
<ifreund> i don't think alignTo is the right name
<daurnimator> its called `@alignCast(@alignOf(T), myptr)`
<ifreund> it's a combination of @ptrCast, @alignCast, and @alignOf
<ifreund> what annoys me is needing to pass the target type twice and the general verobosity
<daurnimator> I think that was on purpose
<daurnimator> you can probably rationale in an old issue about why @ptrCast doesn't allow casting alignment at the same time
<ifreund> probably yeah, though I do it everywhere in my code cause callbacks in C
<ifreund> i agree, @ptrCast shouldn't cast alignment
<daurnimator> ifreund: declare your C callbacks userdata as aligned?
<daurnimator> otherwise, it really is just exposing the nastyness of C...
<ifreund> maybe my understanding of alignment is poor, wouldn't I still need to do *align(@alignOf(*MyType))c_void
<daurnimator> yep
<shakesoda> horrifying
<daurnimator> though maybe you can #define or typedef that away
<daurnimator> I'm not sure if you're writing the C code here or binding an existing library
<ifreund> the latter
<ifreund> this is for my wlroots based wayland compositor
<ifreund> and wayland is very callback based
<daurnimator> write a (private) helper function?
<shakesoda> alignments are nasty enough that i've been taking the approach of just aligncast & pray
<shakesoda> which, to be sure, i recognize as bad code
<daurnimator> shakesoda: then I pray you use --release-safe
<ifreund> fn ptrAlignCast(comptime T: type, ptr: var) *T { return @ptrCast(T, @alignCast(@alignOf(T), ptr)); }
<ifreund> this is what I want
<shakesoda> daurnimator: i don't, and it also hasn't come up as a problem anywhere, but it is a pretty bad code smell
<ifreund> and yeah --release-safe for the win
<shakesoda> daurnimator: but this is really to say that i'm interested in this discussion :)
<ifreund> though it should either return just T or the other references should also be *T
<daurnimator> ifreund: maybe instead of taking `var` take `*c_void`?
<shakesoda> i couldn't come up with any respectable solutions last this came up, so i just gave up and did what worked
<ifreund> probably better to do so yeah
marnix has quit [Ping timeout: 240 seconds]
<daurnimator> ifreund: can also turn on runtime safety in your function scope
<ifreund> I'm aware, haven't had reason to mess with it yet though
<ifreund> haven't even done any profiling yet
<ifreund> i dont think my code will be the bottleneck though, that's likely the wlroots code actually rendering stuff
<ifreund> though I do need to implement proper damage tracking at some point which will be the biggest possible performance win I can make
<daurnimator> ifreund: did you ever read through some of the arcan stuff?
<ifreund> daurnimator: I've heard of it but have not read up
dddddd has joined #zig
cole-h has joined #zig
<ifreund> this does look interesting, thanks for the links
xackus has quit [Read error: Connection reset by peer]
xackus has joined #zig
ask6155 has joined #zig
marnix has joined #zig
marijnfs has joined #zig
halbeno has quit [Remote host closed the connection]
halbeno has joined #zig
ask6155 has quit [Quit: Lost terminal]
marnix has quit [Ping timeout: 256 seconds]
riba has joined #zig
Akuli has joined #zig
marnix has joined #zig
gpanders has quit [Ping timeout: 246 seconds]
gpanders has joined #zig
Kingsquee has joined #zig
st4ll1 has joined #zig
marnix has quit [Remote host closed the connection]
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
marijnfs1 has joined #zig
marijnfs has quit [Ping timeout: 265 seconds]
marijnfs has joined #zig
nerthus has left #zig ["Leaving"]
nerthus has joined #zig
marijnfs1 has quit [Ping timeout: 260 seconds]
doublex has quit [Ping timeout: 256 seconds]
frett27 has joined #zig
gazler_ has joined #zig
gazler has quit [Ping timeout: 246 seconds]
doublex has joined #zig
doublex has quit [Ping timeout: 258 seconds]
alexnask has quit [Quit: Leaving]
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
riba has quit [Ping timeout: 258 seconds]
tdc has quit [Ping timeout: 260 seconds]
wootehfoot has joined #zig
<leeward> 5590 could use the documentation tag, if anyone with permissions to add tags to PRs is around.
Akuli has quit [Quit: Leaving]
dermetfan has quit [Ping timeout: 260 seconds]
ur5us has joined #zig
doublex has joined #zig
Kingsquee has quit [Read error: Connection reset by peer]
wootehfoot has quit [Read error: Connection reset by peer]
dongcarl has joined #zig
marijnfs has quit [Ping timeout: 246 seconds]
watzon has joined #zig
<watzon> Hello peeps
<watzon> Question for anyone familiar. Does zig have a hard time with creating large comptime arrays?
<watzon> By large I mean 4096 items or more
<xackus> watzon i think a few thousand shouldn't be a problem
<xackus> just try it
<watzon> I
<watzon> I'm trying to put together something right now
<watzon> Don't completely understand how to create a comptime array like that though. I guess I'll see if I can figure it out haha.
<xackus> you can ensure it is comptime this way: const array = comptime makeArray();
<xackus> (for example)
_Vi has quit [Ping timeout: 260 seconds]
xackus has quit [Ping timeout: 246 seconds]
<watzon> Seems to have a hard branch limit set at 1000, unless I'm doing something terribly wrong
<watzon> This one works https://godbolt.org/z/ADV67b
demizer has quit [Ping timeout: 256 seconds]
Snetry has quit [Ping timeout: 258 seconds]
Snetry has joined #zig
<fengb> It’s there to protect against infinite comptime spinning