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/
<emekankurumeh[m]> how in status quo zig you can store `promise`s from different functions in an array together
_whitelogger has joined #zig
<daurnimator> emekankurumeh[m]: given that @Frames for different functions will need to be different sizes.... I don't know how you'd have an array of them
<daurnimator> andrewrk: did the autohash PR get mixed into your coroutine branch somehow?
marijnfs_ has joined #zig
marijnfs has quit [Ping timeout: 244 seconds]
ltriant has quit [Ping timeout: 258 seconds]
lunamn has quit [Ping timeout: 272 seconds]
lunamn has joined #zig
ltriant has joined #zig
ltriant has quit [Ping timeout: 268 seconds]
mipri has left #zig [#zig]
ltriant has joined #zig
hio has quit [Quit: Connection closed for inactivity]
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 272 seconds]
<daurnimator> hrm, I can't find it now.... where is an issue about constructing a call at comptime
darithorn has quit [Remote host closed the connection]
<daurnimator> created https://github.com/ziglang/zig/issues/2930 cause I can't find the old issue that was tangentially related.
ntgg has joined #zig
tridactyla has quit [Remote host closed the connection]
ltriant has quit [Ping timeout: 272 seconds]
ltriant has joined #zig
allan0 has joined #zig
ntgg has quit [Ping timeout: 245 seconds]
laaron has quit [Remote host closed the connection]
ltriant has quit [Quit: leaving]
kristoff_it has joined #zig
laaron has joined #zig
kristoff_it has quit [Ping timeout: 248 seconds]
<daurnimator> has anyone made a terminal UI in zig yet?
kristoff_it has joined #zig
<daurnimator> how about a MIME library?
avoidr has quit [Quit: leaving]
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #zig
ki9a has quit [Quit: WeeChat 2.4]
knebulae has joined #zig
samtebbs has joined #zig
jkbbwr has joined #zig
<jkbbwr> Hey all!
tgschultz has quit [Ping timeout: 246 seconds]
<daurnimator> jkbbwr: welcome!
<jkbbwr> Anyone know where I can find a higher level breakdown of Zigs type checker
<daurnimator> jkbbwr: what do you mean?
<jkbbwr> How its implemented, is it sound, those kinda details.
<jkbbwr> Im trying to implement my own and making 0 progress understanding the problem
tgschultz has joined #zig
kristoff_it has quit [Remote host closed the connection]
hio has joined #zig
<emekankurumeh[m]> daurnimator: I have a stale branch with some terminal stuff in it
tgschultz has quit [Ping timeout: 245 seconds]
tgschultz has joined #zig
tgschultz has quit [Ping timeout: 245 seconds]
tgschultz has joined #zig
wootehfoot has joined #zig
kristoff_it has joined #zig
<samtebbs> jkbbwr: If you're looking for implementation details, then perhaps src/analyze.cpp would be of help
<jkbbwr> samtebbs:Thanks very much
tgschultz has quit [Ping timeout: 272 seconds]
tgschultz has joined #zig
fengb has joined #zig
<fengb> daurnimator, emekankurumeh[m]: I'm trying to port termbox to zig
dimenus has joined #zig
<daurnimator> fengb: did you see https://github.com/ziglang/zig/issues/2931 yet?
<fengb> "This was a weekend project. You probably shouldn't use it in any projects." :P
<daurnimator> fengb: that's for the project as a whole. the terminfo bit however is pretty solid
<fengb> Oh I see
<fengb> It's the ANSI control characters?
<daurnimator> no... terminfo is a database on your computer that tells libraries (like curses) what the sequences are for various terminals
<mq32> if i understand correctly, not only ANSI
<fengb> Oh right
<mq32> ANSI is a single termcap where you could also have ones for a TTY oder Tek terminal
<fengb> This is where I got stuck with termbox >_>
<daurnimator> it contains both simple ones like "\r" goes to start of line. but also potentially complex ones, like how to reset the terminal
laaron has quit [Remote host closed the connection]
<daurnimator> FWIW that lua-tui project also has a fun escape code parser.... I managed to find major bugs in every terminal emulator I played with.....
<daurnimator> which is another way to say: off the beaten path lay dragons
laaron has joined #zig
<fengb> If everything you touch has bugs... 🤔
MajorLag has joined #zig
tgschultz has quit [Ping timeout: 244 seconds]
MajorLag is now known as tgschultz
<fengb> Style question: `if (foo != null)` vs `if (foo) |_|`
sourgrasses has joined #zig
<Tetralux> I think `first != null` is easier to understand if you're glancing at it.
<Tetralux> .. Whereas in the second one you have to spot the underscore.
<fengb> I could do `if (foo) |_notnull|`
<fengb> But that still looks weird so okay
<Tetralux> I think I'd have to have written more Zig to be able to advise with confidence, but that's my first thought x)
<fengb> I'm happy with either. The latter is fewer characters but it's pretty minimal
<fengb> Also coming from C/Javascript/Ruby where weirdo idioms are pretty common :P
fengb has quit [Remote host closed the connection]
<diltsman> If you want weird ways to check for null, try this in SQL: a <> a
fengb has joined #zig
<daurnimator> diltsman: that would also match for NaN
<fengb> But a IS NULL is more idiomatic
<daurnimator> fengb: I prefer `if (foo != null)` to match the inverse: `if (foo == null)`
<daurnimator> there's no inverse of `if (foo) |_|`
<fengb> daurnimator: https://github.com/nsf/termbox/blob/master/src/term.inl#L135 is this basically the less functional version of your Lua code?
<fengb> Trolling response: `if (foo) |_| {} else {`
<daurnimator> fengb: yes it appears to be.
fengb has quit []
fengb has joined #zig
<daurnimator> fengb: do you need an IRC bouncer?
<fengb> Yes actually
<fengb> Not sure what's going on today
<daurnimator> fengb: https://hashbang.sh
<fengb> “That is a sign you hopefully know better than to blindly run unknown commands from the internet and/or are a curious person. We like you already.”
<fengb> There's something in the world that likes me!
halosghost has joined #zig
sourgrasses has quit [Ping timeout: 258 seconds]
FireFox317 has joined #zig
<FireFox317> The CI builds for windows are not working anymore. It is stuck on a pkg_import test, however it is not crashing or anything and just runs until the maximum time of 6h is reached.
<FireFox317> The builds for linux and mac however do succeeded
FireFox317 has quit [Remote host closed the connection]
fengb has quit [Read error: Connection reset by peer]
ltr- has joined #zig
<andrewrk> daurnimator, the inverse is orelse
<dimenus> is there any way to debug why Zig is unable to inline a function?
Akuli has joined #zig
<Tetralux> fengb, daurnimator: I suppose andrewrk is right actually - instead of `if (foo != null)`, `var value_to_proceed_with = foo orelse return false;` is generally a better pattern in Zig to go for.
<Tetralux> (.. Mainly because it avoids naming the optional.)
<mikdusan> can confirm: windows builds hang on test `cd test/standalone/use_alias; zig build test`; since commit af866140
darithorn has joined #zig
kristoff_it has quit [Ping timeout: 246 seconds]
<mq32> just want to share this hack i made: https://godbolt.org/z/VOTEbG
<mq32> someone asked if there is any language except for C++ and D that could make something like automatic function creation
<Tetralux> Automatic function creation?
<Tetralux> What does that mean?
fengb_ has joined #zig
jkbbwr has quit [Ping timeout: 248 seconds]
<mq32> this code creates 256 functions which can be used as distinct callbacks to libraries
<mq32> the orignal problem was that a library allows callback functions but without a "context" parameter
<mq32> and the solution is: create a bunch of functions which provide a callback that calls a certain function *with* context option
<fengb_> mq32: that style is used in std too — std/zig/parse.zig
<samtebbs> mq32: I can see that being useful for generating interrupt handlers in a kernel. At the moment we're doing so with assembly but would rather get rid of it.
<mq32> samtebbs, oh yeah!
<mq32> i have made that assembler stuff already
<fengb_> Oh with context... like fake closures
<mq32> fengb_: yeah
<mq32> with zig that's actually pretty reasonable and easy
<mq32> and with the "function literal" syntax (x = fn() void { }) we wouldn't even need a helper struct
<fengb_> I was planning on hand rolling something that needs "arbitrary" arguments
<mq32> got to go
<mq32> i hope i get my hands on some useful zig project soon…
<mq32> <= thinks about creating a simple paint application
<samtebbs> mq32: o/
<halosghost> mq32: sounds fun
<halosghost> mq32: do it in ncurses with sixel? :D
<fengb_> I'm still planning on porting over termbox (https://github.com/nsf/termbox/blob). Be fun to have someone else work on it too :P
<fengb_> I'm amazing with links
<halosghost> termbox should also support sixel
<halosghost> moarsixel
laaron has quit [Remote host closed the connection]
laaron has joined #zig
laaron has quit [Remote host closed the connection]
samtebbs has quit [Quit: leaving]
avoidr has joined #zig
squiddlebit has joined #zig
fsateler has quit [Ping timeout: 245 seconds]
darithorn has quit [Quit: Leaving]
fsateler has joined #zig
fengb_ has quit [Read error: Connection reset by peer]
SimonN has quit [Remote host closed the connection]
SimonNa has joined #zig
kristoff_it has joined #zig
darithorn has joined #zig
kristoff_it has quit [Ping timeout: 272 seconds]
ntgg has joined #zig
kristoff_it has joined #zig
kristoff_it has quit [Ping timeout: 246 seconds]
Akuli has quit [Remote host closed the connection]
squiddlebit has quit [Quit: WeeChat 1.9.1]
ntgg has quit [Ping timeout: 245 seconds]
dec05eba has joined #zig
<dec05eba> Something like this would be cool https://github.com/fdehau/tui-rs
dec05eba has quit [Quit: Lost terminal]
Ichorio has joined #zig
<Tetralux> dec05eba: What would you use that for? I'm curious.
<halosghost> Tetralux: too late; they left
<Tetralux> *****
<Tetralux> xD
<halosghost> I can say that I love TUIs and that I want to use a library kind of like that to make a VPS monitor at some point
<halosghost> but I don't know that that's what they had in mind
<Tetralux> Virtual Private Server?
<halosghost> yeh
<Tetralux> Huh.
<Tetralux> Interesting.
<halosghost> here
<halosghost> one sec
<halosghost> this needs some context
<Tetralux> :)
<halosghost> but is likely off-topic
<halosghost> Tetralux: pm?
<Tetralux> Sure
halosghost has quit [Quit: WeeChat 2.5]
Tetralux has quit [Quit: Leaving]
Tetralux has joined #zig
ntgg has joined #zig
<dimenus> how do i set the alignment of a struct in Zig?
<andrewrk> dimenus, wait for https://github.com/ziglang/zig/issues/1512
<dimenus> boo, vulkan project on hold
<andrewrk> that's how I feel too
<scientes> dimenus, you could hack it together with a union, and a packed struct
<dimenus> packed structs report incorrect sizes atm
<scientes> because you probably only need 16-byte alignment
<dimenus> i could start with that
<dimenus> yeah that's all I need at the moment
<dimenus> but i could just focus on bugs for now
kristoff_it has joined #zig
ntgg has quit [Ping timeout: 268 seconds]
dimenus has quit [Quit: Leaving]
ltr- has quit [Remote host closed the connection]
dimenus has joined #zig
darithorn has quit [Quit: Leaving]