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/
dimenus has joined #zig
dimenus has quit [Remote host closed the connection]
ltriant_ has quit [Ping timeout: 240 seconds]
ltriant has joined #zig
<ky0ko> is there a way to disable .h file generation in build.zig
<ky0ko> i'm running into #2173 and don't actually need the .h file at all
blueberrypie5 has joined #zig
davidkrauser_ has joined #zig
benaiah` has joined #zig
m6w6_ has joined #zig
<ky0ko> i tried doing exe.setDisableGenH(true); but it still runs into it
via_ has joined #zig
blueberrypie has quit [Quit: Ping timeout (120 seconds)]
davidkrauser has quit [Ping timeout: 272 seconds]
benaiah has quit [Remote host closed the connection]
m6w6 has quit [Remote host closed the connection]
via has quit [Ping timeout: 272 seconds]
rom1504 has quit [Ping timeout: 272 seconds]
gruebite has quit [Ping timeout: 272 seconds]
davidkrauser_ is now known as davidkrauser
benaiah` is now known as benaiah
blueberrypie5 is now known as blueberrypie
m6w6_ is now known as m6w6
mq32 has quit [Ping timeout: 268 seconds]
BaroqueLarouche has quit [Read error: Connection reset by peer]
lukeholder has quit [Read error: Connection reset by peer]
BaroqueLarouche has joined #zig
mgxm has quit [Quit: ....]
ur5us has quit [Ping timeout: 260 seconds]
mgxm has joined #zig
rappet has quit [Remote host closed the connection]
Yardanico has quit [Quit: No Ping reply in 180 seconds.]
lukeholder has joined #zig
mq32 has joined #zig
<ky0ko> ah wait i see, it needs to be set on the individual objects, not the exe
<ky0ko> got it
rappet has joined #zig
torque has quit [Remote host closed the connection]
occivink has quit [Ping timeout: 272 seconds]
novaskell has quit [Ping timeout: 272 seconds]
Yardanico has joined #zig
torque has joined #zig
occivink has joined #zig
ur5us has joined #zig
rom1504 has joined #zig
marijnfs has quit [Remote host closed the connection]
seoushi has quit [Ping timeout: 240 seconds]
<daurnimator> andrewrk: is `myslice[start..][0..len]` well-optimised?
<daurnimator> as in: I'm hoping it won't bother to calculate an intermediate length.
cmrs has quit [Quit: ZNC 1.7.1 - https://znc.in]
cmrs has joined #zig
adamkowalski has left #zig ["ERC (IRC client for Emacs 28.0.50)"]
adamkowalski has joined #zig
decentpenguin has joined #zig
decentpenguin has quit [Client Quit]
lunamn_ has quit [Ping timeout: 240 seconds]
lunamn has joined #zig
seoushi has joined #zig
ky0ko has quit [Ping timeout: 268 seconds]
lunamn has quit [Ping timeout: 272 seconds]
adamkowalski has quit [Remote host closed the connection]
<shakesoda> shouldn't `for (thing) |i| { ... }` be equivalent to `var i: usize = 0; while (i < thing.len) : (i += 1) { ... }` ?
<shakesoda> i've got a case here where the former is giving me index out of bounds errors but the latter isn't and i'm really confused
<fengb> It’s `for (thing) |element, i|`
<shakesoda> oh!
<shakesoda> fengb: thanks
lunamn has joined #zig
seoushi has quit [Ping timeout: 265 seconds]
seoushi has joined #zig
<pixelherodev> LSP?
<pixelherodev> Ah, okay
<pixelherodev> `going slow because aiming for protocol-completeness-from-the-outset` Yeah, that's always smart
<pmwhite> <pixelherodev "Ah, okay"> Linux Systems Programming
<pixelherodev> Threw away LLVM parser v1 because I *didn't* do that and so it was a mess to maintain
<pixelherodev> New version can almost lex itself, hopefully by the end of tomorrow :)
<pmwhite> Oops, I didn't mean to do a reply to that. I'm on the matrix bridge to the IRC channel
<pixelherodev> No worries. I mean, aside from the fact that you're using Matrix instead of using IRC as nature intended.
cmrs has quit [Quit: ZNC 1.7.1 - https://znc.in]
seoushi has quit [Ping timeout: 265 seconds]
<pmwhite> Haha, well fengb is also using matrix.
* shakesoda is very much looking forward to zig having a language server at some point
<fengb> IRC doesn't work with mobile. Need some intermediary
<fengb> work well*
<pmwhite> that's one thing for me. I also like being able to keep with a conversation without having to have a client always running.
<shakesoda> same reason i use irccloud
seoushi has joined #zig
<pixelherodev> I have a bouncer :)
<fengb> https://www.gitmemory.com/fengb this is neat
<shakesoda> pixelherodev: i got tired of running mine at some point
<SyrupThinker> What did you use? My ZNC has been running for a year without touching it
mahmudov has quit [Ping timeout: 260 seconds]
adamkowalski has joined #zig
<seoushi> fengb: I wish I could still contribute to open source and put stuff on github. My gitmemory page in comparison is bare because I haven't posted anything new in years
<shakesoda> SyrupThinker: znc, it wasn't much burden but i just wanted to not think about it at all and have something that played nice on mobile without fuss too
<adamkowalski> is the format api documented somewhere? I want to provide custom format printing for my type
<shakesoda> i was running it for a very long time
<SyrupThinker> Alright, thanks :)
<adamkowalski> awesome thanks!
seoushi has quit [Ping timeout: 272 seconds]
<adamkowalski> yeah I found that uefi example before and I was confused what the context is exactly.
<fengb> Ah yeah it's a little confusing. It's just annoying boilerplate :P
<adamkowalski> okay, i'm also confused by the output function pointer. what happens if you call it haha
<adamkowalski> it seems like both of them are just forwarded to fmt.format and you just act as a middleman
<adamkowalski> I got something working for now though, i'll do a deep dive on what all the API offers later to fully utilize it
_Vi has joined #zig
<fengb> You can call output directly if you want. It consumes any []const u8
<adamkowalski> okay will this also work with allocPrint if I want to output to a string instead of stdout?
<fengb> Yeah, context/output/error are fed through to make all of that work
<fengb> Context should contain the string buffer that's accruing the value.
<adamkowalski> ah okay perfect, thanks!
dddddd has quit [Ping timeout: 260 seconds]
<ky0ko_> i have an error building some zig code that i'm not sure what to do about. it's while trying to reference a struct imported from c code, and involves... allowzero?
<ky0ko_> there's a global struct, svs, in c, that contains an array of struct client_s, which i am trying to iterate through
ur5us has quit [Ping timeout: 260 seconds]
<mikdusan> ky0ko_: sounds like https://github.com/ziglang/zig/issues/4361
BaroqueLarouche has quit [Quit: Connection closed for inactivity]
ltriant has quit [Quit: leaving]
_Vi has quit [Ping timeout: 248 seconds]
<ky0ko_> hah, i just keep hitting all sorts of bugs with this project
<ky0ko_> hm, looking at that i'm not sure
<ky0ko_> the thing here is, i'm not writing freestanding code and i am not using allowzero
<ky0ko_> the allowzero is coming from an imported c header, which seems... weird, to me
<ky0ko_> it *is* giving a very similar error though
<ky0ko_> hmm, maybe it is that
qazo has joined #zig
<daurnimator> ky0ko_: the allowzero isn't coming from your code?
<daurnimator> I didn't think translate-c/c-import could ever generate allowzero....
<ky0ko_> it is most assuredly not
<daurnimator> ky0ko_: could you share the C header/snippet?
<daurnimator> I don't see `allowzero` (or similar tokens) in translate-c.zig at all.
<mikdusan> or --verbose-cimport
<daurnimator> mikdusan: btw, any chance you can look at https://github.com/ziglang/zig/issues/4328 ?
adamkowalski has quit [Remote host closed the connection]
<ky0ko_> unfortunately the project is *much* larger than a snippet but i can try and pare it down to a minimal repor
<ky0ko_> s/repor/repro
<ky0ko_> i just did a grep -r of my entire src/ and there is definitely not allowzero anywhere in there
<ky0ko_> daurnimator: here's a minimal repro https://github.com/goshhhy/zig-allowzero-test
plumm has joined #zig
<plumm> andrewrk: currently using -fdump-analysis is there any way to get the type of a declaration from the package?
<plumm> right now im trying to do basic file completion, so getting the declarations from the root package, but going from pkg->decls only gives me the position in src where they are defined and their name
<fengb> Slicing `[*c]` returns allowzero pointers...
<daurnimator> fengb: that sounds wrong. time to file a bug methinks
<fengb> I can't even get it to compileLog :(
<mikdusan> and if you make `|c|` mutable `|*c|` seems to not error
<fengb> `| *allowzero u32` it's still wrong, but it's not complaining :P
<mikdusan> and there's no error if the `|c|` var is not used
<daurnimator> looks like it was introduced at the same time as `allowzero` itself
<fengb> So it's been around? >_>
<ky0ko_> maybe so, and we're only seeing it because of the issue linked above?
<ky0ko_> this same code compiled in 0.5
<fengb> I'll create an issue
<fengb> Markdown doesn't work in the title whoops
<daurnimator> fengb: we all understand it anyway :P
<fengb> I'd go remove it but then it'll show my edit forever
<daurnimator> also editing the title splits the thread in my inbox
<fengb> I'll keep that in mind 🙃
<mikdusan> for now coerce before slice should work: `var clientList = @as([*], c.svs.clients)[0..16];`
<ky0ko_> thanks mikdusan and everyone else
<mikdusan> typo fixed: `var clientList = @as([*]client_t, c.svs.clients)[0..16];`
<ky0ko_> oh fun, now i'm reaching unreachable code
<ky0ko_> porting a game engine seems to be a *really* good way to find problems
<fengb> Ah, I think this is exacerbated by the dereference bug that LemonBoy opened
<mikdusan> I blame young John Carmack
<fengb> It seems to have always convert to allowzero pointers, but now it can't dereference and generating compiler errors
<ky0ko_> young john carmack wrote some terrible code. i learned c by studying that code and it took me years to recover
<mikdusan> I seem to recall something in ir-clean-up branch and saw that error -- (erroneously) concluded that error existed pre PR and we moved on
<ky0ko_> hm. so if i have .h file generation enabled i hit the "TODO implement get_c_type for more types" issue
<ky0ko_> and if i disable it i get an unreachable from an assert that wants h file generation enabled
<mikdusan> confirmed: regression caused by #4152 and here's the comment I marked as offtopic:
<fengb> I seriously hosed my compiler. Nothing is working now -_-
<ky0ko_> any ideas here?
<mikdusan> somewhere generation of .h files is disabled, and it's expecting it to NOT be disabled
<ky0ko_> i have generation of .h files disabled in my build.zig, because otherwise i hit the TODO. my understanding was that if *I* didn't need those, i could disable them safely
<ky0ko_> but clearly some code path is being hit that expects those
<mikdusan> are you using setOutputDir ?
<ky0ko_> yyyyyes
<ky0ko_> however disabling it made no difference
<mikdusan> just today andrew mentioned it was deprecated. ok, was wondering if it caused issue
<mikdusan> s/mentioned/not_reallly... I read it somewhere _today_/
return0e has quit [Remote host closed the connection]
ur5us has joined #zig
ur5us has quit [Client Quit]
marmotini_ has joined #zig
<mq32> oh, wonderful
<mq32> "void" isn't a keyword anymore, so i can name my struct fields void!
return0e has joined #zig
ur5us has joined #zig
jzck has joined #zig
<jzck> Hi guys! we're doing a day of open-source at work. I'm working on issue #1519 (build system documentation)
<mq32> jzck, neat!
_Vi has joined #zig
<jzck> actually it seems that the main documentation has this already solved but it hasn't been pushed to master
ur5us has quit [Ping timeout: 260 seconds]
<jzck> Ah, I was looking at the homepage. The docs are in sync with master
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #zig
marmotini_ has quit [Ping timeout: 272 seconds]
marmotini_ has joined #zig
marmotin_ has joined #zig
marmotini_ has quit [Ping timeout: 260 seconds]
marmotin_ has quit [Read error: Connection reset by peer]
marmotini_ has joined #zig
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #zig
shakesoda has quit [Ping timeout: 260 seconds]
gonz_ has quit [Ping timeout: 252 seconds]
backwhack has quit [Ping timeout: 265 seconds]
marmotini_ has quit [Remote host closed the connection]
dddddd has joined #zig
backwhack has joined #zig
shakesoda has joined #zig
gonz_ has joined #zig
forgot-password has joined #zig
<forgot-password> The compiler always starts crashing when I use a function from a MacOS Framework. Is this related to linking?
<mq32> i don't think the compiler should crash in any way
<mq32> but i'm no MacOS user, i cannot reproduce this
<betawaffle> well... the compiler crashes for all kinds of things
<betawaffle> forgot-password: what's the error?
<forgot-password> I know, I'm sorry for the broad description, but the compiler is not exactly accurate with its message ^^
<forgot-password> Well, it just says "The following command terminated unexpectedly" when I execute "zig build run"
<forgot-password> And it fails at the build step I think
<mq32> ah
<betawaffle> so it's probably a seg fault or something. try running the command directly
<mq32> you can just call the command that failed by hand
<mq32> this will yield a more descriptive output
<forgot-password> Yes, I will try that
<andrewrk> happy to report all tests passing in llvm10 branch, with llvm assertions enabled
<betawaffle> what's new in llvm10?
<andrewrk> as far as zig project is concerned, mostly bug fixes
<mq32> \o/
<forgot-password> Now I removed the call that causes the issue with "zig build run", so it works fine. But when I execute the command by hand it reports that there are undefined symbols
<betawaffle> when's the next stream gonna be?
<andrewrk> it's a nontrivial amount of work to keep up with new llvm versions. some projects are several major versions behind
<andrewrk> betawaffle, today
<betawaffle> forgot-password: linking macos frameworks isn't trivial, last i tried. you had to specify the right framework dir
<forgot-password> Okay, but why does it work fine when I use "zig build run", but not when I execute the command directly?
<betawaffle> cool, and what's the topic?
waleee-cl has joined #zig
<betawaffle> forgot-password: i can only imagine you're running a different command than zig build is when it works
<forgot-password> I think it's related to the directory... When I moved into zig-cache/bin it works fine as well
<mq32> andrewrk: random thought that crossed my mind: Are you aware that the current way of doing varargs probably hit a local maximum? it creates code bloat per call, which is probably not the thing you want to have on a embedded target. C-style varargs have a single function, but can accept different argument types.
<forgot-password> Okay, nevermind, I failed to copy a few parameters from the 'zig build' command... Now it actually fails with a segmentation fault. Is there any way to get more information from that?
<shakesoda> i'm trying to pass a page_allocator around but unlike arena allocator it wants to be const, which breaks everything else
<shakesoda> this leads me to believe i'm doing it wrong, so what should i be doing instead?
<mq32> shakesoda: for page allocator, are you using std.heap.page_allocator?
<betawaffle> forgot-password: run it under gdb or lldb
<betawaffle> i think that's generally as easy as lldb -- <the command and args>
<forgot-password> Yes, I just did that, but the information is not really helpful to me, hehe
<shakesoda> mq32: yes, i'm trying to
<shakesoda> mq32: but actually, i just passed it wrong - disregard
<betawaffle> forgot-password: bt?
marmotini_ has joined #zig
<forgot-password> betawaffle: bt?
<betawaffle> type bt<enter> and put the output in a gist?
<shakesoda> mq32: i switched it from the arena i had first and forgot to fix the indirection of it, and the error i got led me to believe i'd done something very different
<betawaffle> (bt is a shortcut for backtrace)
<forgot-password> Sure, give me a second
<shakesoda> naturally, i figure this out after i mention it on irc instead of 20 minutes ago :P
<fengb> Rubber ducking is great
<betawaffle> in a switch with a non-exhaustive enum, when doing `_ => |val|`, what is the type of val? the enum, or the tag type?
<shakesoda> i'm working on my basic zig-fu, which today means "write a tga file" -> https://hastebin.com/hepoyepeyo.cs (seems to be working!)
waleee-cl has quit [Ping timeout: 272 seconds]
<andrewrk> mq32, I'm aware of this problem. I have a plan to address this. The fact that we have a release-small build mode helps, since the compiler can choose to deal with generic functions differently (although it currently is not capable of doing so)
<mq32> okay, good :)
BaroqueLarouche has joined #zig
<shakesoda> is @as the only way to specify the size of an int/float in an anonymous struct or is there some syntax for it
metaleap has joined #zig
<shakesoda> ` .{ .foo = @as(u8, 5) }` works, just don't know if there's another form to know about
<wilsonk> betawaffle: clang-10 is faster than 9 by about 9% when building itself...just so you know. So there might not be large differences for zig with llvm10 but there may be for building large code bases with clang. Strangely I can build llvm/clang/lld 10 in 8:10 with gcc-7.4, whereas clang-9 takes 8:35? I thought clang-9 would be, and was faster, the last time I checked (but I may have to rebuild clang-9 with itself to get the best performance
<wilsonk> that is for release builds, btw
<betawaffle> k
forgot-password has quit [Quit: leaving]
forgot-password has joined #zig
<forgot-password> Seems like I resolved my problem. I just forgot to link against CoreFoundation...
Snetry has quit [Ping timeout: 268 seconds]
Snetry has joined #zig
forgot-password has quit [Quit: leaving]
marmotini_ has quit [Remote host closed the connection]
<metaleap> say you have this: fn foo() !MyStruct { return .{ fld = 123 }; }
<metaleap> "type 'MyErrorSet!MyStruct' does not support struct initialization syntax"
<fengb> you have this: fn foo() !MyStruct { return .{ fld = 123 }; }
<metaleap> heh
<metaleap> in the long run i think it "should" -- as error enumerants cannot be constructed via struct-initialization-syntax
<metaleap> objections? agreements?
dddddd has quit [Remote host closed the connection]
<metaleap> (at least in a self-hosted future)
<fengb> I think the goal is to actually allow inferred construction
<metaleap> meaning? (note same msg on anyerror!MyStruct return, not sure if this also involves inference)
via_ is now known as via
<fengb> It'll understand error unions and create a struct for you rather than bombing
sammich has quit [Ping timeout: 260 seconds]
<fengb> Don't quote me though. I'm trying to find the issue
<metaleap> also when you know you wont ever error and thus annotate with `error{}!MyStruct` (lets say the signature with ret `anyerror!T` was prescribed by some lib)
<metaleap> so no error ever, the struct-initializer *must* be for the rhs of the union-ish ret type
<fengb> Same issue with optionals: https://github.com/ziglang/zig/issues/3663
<fengb> I guess it doesn't have a resolution or tag so I'm not sure which direction it'll go
<metaleap> well, i'll keep these things in my head's backburner area until the self-hosted zigcompiler comes up. rather than flooding with mostly-mere-convenience requests right now
wilsonk has quit [Ping timeout: 268 seconds]
zfoo_ has joined #zig
AndroidKitKat has quit [Quit: バイバイ〜!]
wilsonk has joined #zig
sammich has joined #zig
AndroidKitKat has joined #zig
<fengb> I didn't realize the usefulness of `for |*foo|`
Akuli has joined #zig
<pixelherodev> Wait, what? You mean e.g. `for (a) |*b|`?
_Vi has quit [Ping timeout: 272 seconds]
mahmudov has joined #zig
<frmdstryr> Does enumToInt have any runtime cost?
<andrewrk> no
<fengb> pixelherodev yeah, I just used `for (alloc()) |*item|` to simplify so much
<pixelherodev> Huh, that's an interesting pattern
omglasers2 has joined #zig
omglasers2 has left #zig [#zig]
seoushi has joined #zig
JoshAshby has joined #zig
<betawaffle> what types are allowed in the "iterator value" of a for loop? anything besides slices/arrays?
return0e has quit [Remote host closed the connection]
jmiven has quit [Quit: brb]
jmiven has joined #zig
adamkowalski has joined #zig
<fengb> Only arrays and lices
frmdstryr has quit [Remote host closed the connection]
<mikdusan> maybe we should genericize it to accept anything with .ptr and .len
<betawaffle> heh, that'd be neat, though not sure how useful it would be
<fengb> I'd love to do for (range)
_Vi has joined #zig
<betawaffle> you can easily make a slice out of a ptr and a len value
<mikdusan> yeah we'd need a fn call to make it useful
<betawaffle> but we already have while for that use-case, so...
<betawaffle> i'd like to see `until` and `unless` added, though
<betawaffle> for situations where you only want the `else` block
<fengb> Disagree
<andrewrk> var it = range(10); while (it.next()) |i| {}
<andrewrk> if anything `for` should be removed
<betawaffle> i guess we already have things that cover the use-case, fengb
<betawaffle> like orelse and catch
<betawaffle> andrewrk: what time is the stream and what will the topic be?
<andrewrk> 17:00 EST, topic not determined yet
waleee-cl has joined #zig
adamkowalski has left #zig ["ERC (IRC client for Emacs 28.0.50)"]
marmotini_ has joined #zig
<seoushi> My pine phone arives today. Will be fun to see if zig cross compiling will run on ubports.
<andrewrk> seoushi, I bet the aarch64 download tarball will work correctly
<seoushi> I will give it a shot for sure
<seoushi> speaking of cross compiling tho. Are there any plans for cross os compiling? like compiling on linux and build a windows build?
<andrewrk> seoushi, you are about to be pleasantly surprised
<andrewrk> zig is completely unmatched when it comes to cross compiling
<seoushi> oh, hey that is awesome.
<seoushi> How does this work with dynamic libraries. Like say I depend on SDL, I'm guessing it's just a matter of including the dlls?
<seoushi> mac is also a bit odd because it has .app folders for executables and not just a binary.
<andrewrk> seoushi, here's an example of cross compiling targeting windows, including SDL: https://github.com/thejoshwolfe/legend-of-swarkland
<andrewrk> `zig build -Dtarget=x86_64-windows-gnu` and you have yourself a .exe file. you can even test it with wine
<seoushi> very nice
<andrewrk> zig's power isn't even tapped into yet, until we have the package manager
<seoushi> yeah code organization is something I'm still kinda learning in zig. I converted my code base to use files as structs and it feels a lot cleaner. I do have an enum in a single file tho and would like to treat it kinda the same, like the whole files is that enum
<andrewrk> not gonna happen, just do const your_thing = @import("foo").bar;
<fengb> Oh I’m thinking of getting a Pnephone. You have to tell me how it goes :P
<seoushi> yeah. that is what I currently do. I assume that comptime structs are in the same boat of not going to happen?
<seoushi> fengb: will do.
<andrewrk> I received my pinephone last night. Put postmarketOS on it. The phone doesn't support 5Ghz wifi, or my sim card, so it's basically a brick
<andrewrk> the OS software was barely usable as well
<companion_cube> wait, you don't have "normal" wifi?
<seoushi> I thought i does support 5ghz. Or do you mean the os doesnt'?
<andrewrk> the hardware only supports 2.5GHz
<seoushi> yeah I wanted to try ubports because it's suppose to be more of an out of the box experiance
<andrewrk> in summary: it won't work as a real phone any time soon. but it's exciting if you want to be an early part of the development process
* shakesoda mostly just wants a phone that acts like the computer it is, to do computer things with
<Snektron> if its a brick you could always try to make it run the zig arm ci
<seoushi> I also have the librem 5 coming but I have no idea when that will be at this point.
<Snektron> theres linux for smart phones, as in, desktop-derived versions
<Snektron> not sure if theyre any good
<andrewrk> Snektron, we have drone ci ready to run arm32 CI, the ball is actually in zig's court to get those tests passing
marmotini_ has quit [Read error: Connection reset by peer]
marmotini_ has joined #zig
ky0ko has joined #zig
<Snektron> oh thats cool
<Snektron> i heard there are these cool arm server cpus now
<shakesoda> huh, pinephone wifi really is only single band. haven't seen one of those in a while
<ky0ko> andrewrk, so: i have some code that triggers ""TODO implement get_c_type for more types" doing .h file generation. i don't need the .h file, so i disabled that. but then i get this. https://gist.github.com/goshhhy/98439394e905e62e0084925d2d635a85
<andrewrk> ky0ko, can I send you a patch to try?
<ky0ko> yes
marmotin_ has joined #zig
marmotini_ has quit [Read error: Connection reset by peer]
marmotini_ has joined #zig
marmotin_ has quit [Read error: Connection reset by peer]
marmotini_ has quit [Read error: Connection reset by peer]
<Snektron> andrewrk, do you think its viable to extend whatever is now calculating comptime code to also calculate non-comptime code for quick interpretation?
<ky0ko> andrewrk, that appears to have fixed the issue
<andrewrk> ky0ko, ok thanks, pushing to master
<andrewrk> Snektron, I think you're imagining that it works a lot differently than it does
<Snektron> (not like now, but more in general)
<Snektron> might be, i didn't look up yet how it works
<Snektron> In my uni compiler i just implemented simple constant propagation on the AST, but i could imagine a solution working on IR
<Snektron> both of which could be extended to non-comptime code
<Snektron> Native code might be harder, but its probably possible to fashion something jit-like
marmotini_ has joined #zig
marmotini_ has quit [Remote host closed the connection]
Joefish has joined #zig
return0e has joined #zig
marmotini_ has joined #zig
return0e has quit [Ping timeout: 260 seconds]
<fengb> Oh you don’t even have a 2.4 band? I needed to set one up for my printer and thermostat
<andrewrk> I have it disabled
<andrewrk> could turn it on. but this is a mobile phone. the point is that you go into a wifi you've never been to before and use it
<Joefish> hi. Is there a tutorial or something like the rustbook to learn zig or are the docs the only way right now? tbh the docs seem fine to learn the language because of all the example code in it. just curious and I am wondering if it is kept up to date with changing syntax.
marmotini_ has quit [Remote host closed the connection]
<andrewrk> hi Joefish. the docs are the best we have currently. that, and a bunch of example projects
<Joefish> example projects that are in the commnuity tab?
<Joefish> no wait.. they were somewhere.. like tetris and a few others
<Joefish> ah ´zig in the wild´. found it
<Joefish> alright. thanks andrewrk :)
<Joefish> btw is the (unofficial) discord server still active? theres a link on https://github.com/ziglang/zig/wiki/Community but the invite is invalid
<andrewrk> it's active. I forwarded your report to the discord channel
<Joefish> thanks
<lunamn> Joefish: I manage the server. the invite is valid, weird
<Joefish> yea I tried disabling my adblock but same. helped in the past where is showed an invite as invalid but it was because of blocked cookies/js
<wilsonk> metaleap: have you seen https://github.com/gernest/hoodie to compare to your LSP impl? There might be some overlap there
<metaleap> havent
ur5us has joined #zig
<metaleap> freakish, he seems intent on porting much of go's stdlib to zig in this project: https://github.com/gernest/hoodie/tree/master/src
<wilsonk> yeah, it is a little different but it was somewhat useful for me in vscode so I figured I would mention it
<metaleap> at least numerous files like this in there :P https://github.com/gernest/hoodie/blob/master/src/time/time.zig
dddddd has joined #zig
<shakesoda> `while (i<n) : (i += 1)` pattern is bizarre
<metaleap> truth be told i'm too absorbed too deeply into it now to even remotely consider any other's half-a-year-ago-attempts at the subject matter. who knows at what point they stopped? would i spend my time bringing that stuff up to nightly? fuggeddaboutit :D
<shakesoda> does anything else use : that way in zig?
<metaleap> occasionally do. its part of the while construct. but only in the beginning as most uses turned out to be `for`able upon revisiting
<andrewrk> I've found zig code to be surprisingly resilient to language changes
<Joefish> lunamn, could you add a PR for the link with a non-expiring invite? would be great :)
<wilsonk> oh, yeah that had bitrotted a while ago...I had to build an old zig to actually get hoodie to build, but it did work once I got it built
<andrewrk> but to be fair that may have something to do with writing most of the compiler code and language design
<andrewrk> metaleap, labels
<lunamn> Joefish: the invite is set to never expire
<Joefish> huh..
<metaleap> andrewrk thought shakesoda meant the `:` in while
<andrewrk> metaleap, oops yes I meant to tag shakesoda
<companion_cube> soon zig will have more language servers than rust
<wilsonk> metaleap: not sure if you also saw this https://github.com/ziglang/zig/pull/4262 ... I only mention these things because I would love to see an lsp server up and running for zig and the smaller the amount of duplicated effort the better ;)
<metaleap> to the *user* maybe not to this writer :D
Joefish_ has joined #zig
lunamn has quit [Ping timeout: 265 seconds]
<shakesoda> andrewrk: i see
Joefish has quit [Ping timeout: 252 seconds]
<metaleap> wilsonk i wrote my own go "lsp-like" for vscode (before LSP was really devised/published much) because their go-ext sucked so bad back then. once i'm infatuated with "my next decade's fav non-work / hobby lang", i always ensure top tooling tweakable / extendable / fixable at a thought's notice. if i had to dig into some 3rd party code the momentum would already be lost and the usecase dismissed by the inner sluggish-animal lizard brain
adamkowalski has joined #zig
<metaleap> but thx for the links nonetheless because for the part of actually analyzing those fat -fdump-analysis jsons soon, i'll have to look around if and how others have done it
ur5us has quit [Ping timeout: 252 seconds]
<wilsonk> ah, ok no problems...just mentioning things. I understand your preferences with regards to this, as well
<metaleap> (will see how smart it can get while staying at ast level, not much i'm afraid unless type-inferencing)
<metaleap> yeah as i said might come in handy soon for sure so thx
ur5us has joined #zig
lunamn has joined #zig
<jaredmm> Do you need to build LLVM in debug mode to build the Zig compiler in debug mode?
return0e has joined #zig
<andrewrk> jaredmm, on posix: no, in fact the recommended debug build of zig is with release mode llvm
<andrewrk> on windows: unfortunately yes
akavel has joined #zig
<akavel> Hi! I need to watch stderr & stdout of a child process separately, immediately reacting to any output, differently for each descriptor
<akavel> Can I do that in Zig? If yes, how?
<akavel> Should I use event.Loop for this somehow? If yes, how? I couldn't find any guide :/
<akavel> (I'm a complete noob)
<andrewrk> akavel, the API does not handle this case gracefully yet. i'm working on async i/o which helps a lot
FireFox317 has joined #zig
<andrewrk> with status quo you'll have to use the "pipe" option for each stream, and poll() to find out which one to read from
Joefish has joined #zig
<akavel> will this poll work on Windows?
<andrewrk> in summary, if you find a tutorial for how to do it in C, it will be the same in Zig right now, until the API is improved
<jaredmm> andrewrk, thanks, that's what I thought. I was having problems building llvm on Windows and the errors told me release mode wouldn't work, but I wanted to double check before I tried to figure the LLVM build out.
<andrewrk> akavel, no; there is no graceful cross platform API to handle this yet
<akavel> is there an issue I can subscribe to track progress on this front?
pmwhite has quit [*.net *.split]
tridactyla has quit [*.net *.split]
Joefish_ has quit [Ping timeout: 260 seconds]
Joefish_ has joined #zig
<akavel> also, IIUC some work on IOCP seems already started? at what state it is? would it be much work if I wanted to try extending child process to support it?
<andrewrk> I have a branch I will be pushing later today that takes a big step in this direction
recombinant has joined #zig
Joefish has quit [Ping timeout: 245 seconds]
<akavel> @andrewrk Thanks for the link! Subscribed. Will you mention some details in a comment in #938 after doing this push?
<andrewrk> yes
<akavel> Ok, cool, I'll read through. Still, is there any guide or example of event.Loop usage somewhere? in zig repo or third-party?
<akavel> some test?
adamkowalski has quit [Remote host closed the connection]
Joefish has joined #zig
<andrewrk> event.Loop is an implementation detail; no need to use it directly
<akavel> oh; hm, so I must be missing/misunderstanding something :/
<akavel> I'm coming from Go, with C/C++/Asm background
Joefish_ has quit [Ping timeout: 245 seconds]
<andrewrk> what you're missing is documentation, and a working implementation
<andrewrk> what I'm describing is currently vaporware
<akavel> oh
zfoo_ has quit [Read error: Connection reset by peer]
<akavel> In Go, I can do "select{}" on channels; is async/await and event.Loop somehow going to provide a similar mechanism? or is it something completely different?
<mq32> akavel, it's completly different
<mq32> async/await is not for channels, but you describe "inherent" concurrency as in "i don't care in what order the stuff is executed, but please be done 'here'"
<andrewrk> zig has channels in userland: std.event.Channel
<andrewrk> select() isn't implemented yet but it will be
<andrewrk> go's runtime has zig's beat, but not for long ;)
<andrewrk> `async foo();` in zig using evented I/O mode can be thought of as equivalent to `go foo();` in Go. But instead of being forced to use a channel, you can get the return value with `await`
<andrewrk> also when I say "zig's runtime" I mean the event loop written into the standard library, which is optional, and can be swapped for your own, and can be implemented on freestanding targets
<akavel> Will there be something like `select { await foo, await bar }` available ?
<andrewrk> it will be a userland function that operates on std.event.Channel
<pixelherodev> There a good tutorialy article on Zig async?
<pixelherodev> Suddenly discovered a use for it
<akavel> @andrewrk Ok, thanks, so I assume I'll wait on #938 until I see mention of this stuff (incl. `select`) being done (?)
<andrewrk> that sounds reasonable. async std will be a big focus for me for the rest of the release cycle
<seoushi> is this compiler bug known or should I submit an issue? https://gist.github.com/seoushi/d987f187677ebea90fa8c63515f77ed8 I looked through the issues and it seems it might be related to https://github.com/ziglang/zig/issues/4008
<mq32> i'm still not safe on the semantics of async (in terms of how the compiler is actually doing the async)
<akavel> One more, completely unrelated question: on Windows, in C, I can link to a DLL library if I only have a .def file describing it; can I do it in Zig somehow?
<mq32> so: where is a suspension point (which is clear from the docs) but more important: where does it suspend to?
Akuli has quit [Quit: Leaving]
<mq32> akavel, you can create def files from DLL files via implib
<akavel> mq32 uh, I see my question is unclear:
<akavel> I want to write a Zig app that links to a libfoobar.def
<akavel> can I do this? if yes, how?
FireFox317 has quit [Ping timeout: 240 seconds]
<andrewrk> akavel, --object libfoobar.def
<fengb> @suspend dumps the raw frame somewhere that needs to be @resume. await will suspend and assume the suspend will resume somewhere else in the code (like await file io)
<akavel> cool, thanks! is there some similar mechanism that will work on Linux too? can .def files be made for .so libraries?
<fengb> I’m not sure why I wrote @suspend and @resume
<andrewrk> akavel, on linux you @cImport a .h file or have pre-made .zig file with extern fn definitions
<akavel> andrewrk: on Windows, can I pass the `--object libfoobar.def` somehow as part of build.zig?
marjohkan has joined #zig
<andrewrk> addObjectFile
<akavel> andrewrk: cool, thanks!
akavel has quit [Remote host closed the connection]
<seoushi> found this https://github.com/ziglang/zig/issues/3269 .. Guess the bug is known :)
Joefish_ has joined #zig
omglasers has joined #zig
Joefish has quit [Ping timeout: 260 seconds]
ur5us has quit [Remote host closed the connection]
<companion_cube> andrewrk: have you looked at mopidy?
ur5us has joined #zig
<andrewrk> yes
<andrewrk> mpd protocol is hopeless
<companion_cube> mopidy seems to use something different, and it has tons of plugins
<companion_cube> (like, at last, I can listen to spotify without the electron monstruosity)
Joefish has joined #zig
Joefish_ has quit [Ping timeout: 256 seconds]
omglasers has left #zig [#zig]
<andrewrk> I'm postponing the stream today. I'm late getting to the gym
omglasers has joined #zig
<betawaffle> until when?
<andrewrk> same time, tomorrow
<betawaffle> ah, ok
<andrewrk> if you miss it you can catch the upload later
omglasers has left #zig [#zig]
omglasers has joined #zig
omglasers has left #zig [#zig]
omglasers has joined #zig
omglasers has left #zig [#zig]
omglasers has joined #zig
wilsonk has quit [Ping timeout: 265 seconds]
<andrewrk> mikdusan, ^
<andrewrk> (not related to what you're working on, just thought you might find this interesting)
<andrewrk> hint: zig's * vs [*] would have caught this
<andrewrk> it's a wonder any async functions work at all
omglasers has left #zig [#zig]
<mikdusan> looping for the fun of it :)
<BaroqueLarouche> whoups
<fengb> Hmm would that fix one of my bug reports? :P
<andrewrk> possibly more than one
<jaredmm> Anyone have a Windows debug build of llvm sitting around? Apparently this machine's 12GB are not enough to link it.
benjif_ has joined #zig
omglasers has joined #zig
backwhack has quit [Quit: Connection closed for inactivity]
benjif has quit [Ping timeout: 265 seconds]
wilsonk has joined #zig
frmdstryr has joined #zig
wilsonk has quit [Ping timeout: 240 seconds]
Joefish_ has joined #zig
Joefish has quit [Ping timeout: 256 seconds]
TheLemonMan has joined #zig
<TheLemonMan> andrewrk, ping
wilsonk has joined #zig
omglasers has quit [Read error: Connection reset by peer]
<andrewrk> sorry I'm about to head out
forgot-password has joined #zig
<forgot-password> Has the c-string syntax, like `c"foo"`, been removed?
<TheLemonMan> np, I think we have the first miscompilation of the llvm-10 branch heh
<metaleap> forgot-password: yes
geemili36 has joined #zig
<geemili36> Hello
<geemili36> I'm thinking of trying to take on issue 4311 (https://github.com/ziglang/zig/issues/4311)
Joefish has joined #zig
frmdstryr has quit [Ping timeout: 260 seconds]
Joefish_ has quit [Ping timeout: 256 seconds]
<andrewrk> TheLemonMan, I did successfully run the full test suite with a debug build of llvm10. release/10.x which was at 2d9954dd8244c7a9d6a1e160fcbb22fe2b9b514f
<andrewrk> bye! afk
recombinant has quit [Quit: Leaving]
* mikdusan expects the treadmills at andrew's gym to soon boot with a zig logo
<fengb> They’ll run Electron before they run Zig 🙃
<companion_cube> mikdusan: boot would be too short to notice the logo
_Vi has quit [Ping timeout: 246 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
mahmudov has quit [Remote host closed the connection]
metaleap has quit [Quit: Leaving]