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/
<nycex> hm, apparently it's not a good idea to parse a 33797 line file at comptime
ur5us has quit [Ping timeout: 260 seconds]
ur5us has joined #zig
<daurnimator> nycex: why not
<pixelherodev> daurnimator: performance, probably
<pixelherodev> Stage1 comptime is sloooow
<nycex> uh yes
<nycex> I don't think that compilation would have completed in the next few hours
zannzen[m] has joined #zig
doublex has quit [Read error: Connection reset by peer]
doublex has joined #zig
doublex has quit [Read error: Connection reset by peer]
nephele_ has joined #zig
satchmo has joined #zig
nephele has quit [Ping timeout: 260 seconds]
nephele_ is now known as nephele
doublex has joined #zig
aerona has joined #zig
<nycex> is there a toUpper that works also on unicode characters?
doublex has quit [Read error: Connection reset by peer]
doublex_ has joined #zig
<andrewrk> not in std lib. you'll need to link in a unicode library
<nycex> huh okay
<andrewrk> could you possibly get by without needing to deal with unicode?
<andrewrk> what's the use case for toUpper?
<andrewrk> BaroqueLarouche, I really enjoyed your talk!
<andrewrk> I missed the show today - catching up now
* daurnimator too
<nycex> andrewrk: well it's about a tool that handles unicode specifically
<nycex> so it needs to support such things
<nycex> but I guess linking such a lib is fine
<nycex> but is it possible to get a function pointer to a function that takes a comptime known type for it's arguments
<daurnimator> nycex: unistring is best; otherwise icu
<nycex> like std.mem.eql?
<nycex> daurnimator: oh, haven't heard of unistring, guess I'll try that before icu
<daurnimator> nycex: note that in unicode you need to toUpper a whole string; not just a single codepoint
<daurnimator> s/need to/should/
<andrewrk> these Q&A's of zig showtime are really helpful to me from a language design perspective
<nycex> yeah I wanted to do that anyway
<nycex> just gonna post this is a second time since I think this may not have been read due to the other conversation:
<nycex> is it possible to get a function pointer to a function that takes a comptime known type for it's arguments
layneson has joined #zig
r4pr0n has quit [Quit: r4pr0n]
<andrewrk> nycex, if you only need the function pointer to be comptime-known, then you can just use the generic function as the function pointer, no problem
<andrewrk> if you need it to be runtime known, then you would have to declare a function without any generic args that calls the generic one, and then take a pointer to that
<nycex> hm yeah I figured that might be needed, thanks
frmdstryr has quit [Ping timeout: 264 seconds]
<daurnimator> andrewrk: idea: @as to do that
<daurnimator> `@as(fn (i32) void, somegenericfn)`
knebulae has quit [Read error: Connection reset by peer]
knebulae has joined #zig
<leeward> Ok, somewhere between 0.6 and now, translate-c has broken for SDL. Time to bisect.
<leeward> Oof, long stretch where mainline wasn't building is making this less fun than it ought t obe.
<leeward> ought to be, even.
layneson has quit [Ping timeout: 272 seconds]
<leeward> Well, it's not terribly useful, but #5560 at least points to the range of changesets where it could have been broken. Given the last one in the range's comment, I'm guessing it's either that one or the first one. Might dig into it when the sun is up.
benjif has quit [Ping timeout: 240 seconds]
<andrewrk> leeward, you should be able to bisect with only direct children of master branch
<daurnimator> btw, please excuse my terseness for a while: I only have one working hand
<andrewrk> you ok there?
<daurnimator> had hand surgery
frett27 has joined #zig
satchmo has quit [Ping timeout: 256 seconds]
B4s1l3 has joined #zig
B4s1l3 is now known as opDispatch
aerona has quit [Quit: Leaving]
opDispatch has quit [Quit: Konversation terminated!]
ur5us has quit [Ping timeout: 256 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
ur5us has joined #zig
drp has joined #zig
craigo has quit [Ping timeout: 246 seconds]
ur5us has quit [Ping timeout: 256 seconds]
dddddd has quit [Ping timeout: 260 seconds]
cole-h has quit [Quit: Goodbye]
B4s1l3 has joined #zig
B4s1l3 is now known as opDispatch
alexnask_ has joined #zig
alexnask has quit [Ping timeout: 272 seconds]
hermier has quit [Remote host closed the connection]
s-ol has joined #zig
<s-ol> whats the quickest way I can turn a pointer to a value into a size-1-slice?
dermetfan has joined #zig
<s-ol> i guess i have to go from single-item to multi-item pointer somehow, but im not sur ehow
<alexnask_> @as([*]T, ptr)[0..1] I think
<alexnask_> Nvm this @as doesnt work, I though any pointer could coerce to [*]T
<alexnask_> I guess you need to ptrCast
<s-ol> yeah, that does it, ptrCast then slice
wootehfoot has joined #zig
<andrewrk> you can do a double coercion: @as([]T, @as(*[1]T, ptr))
<s-ol> o/ daurnimator
<daurnimator> s-ol: hey :)
<s-ol> daurnimator: how are you? (lets take this part to DM ;)
<daurnimator> 14:30:20 <daurnimator>had hand surgery
<daurnimator> :P
<s-ol> next question: zig-fmt always un-wraps function signatures, there's no way around that? I've got some real long signatures for C library callbacks
<daurnimator> "un-wrap"?
<s-ol> daurnimator: oof, strain related?
<s-ol> daurnimator: eh, un-line-wraps, i mean puts the whole signature onto one line
<daurnimator> cut tendon(s) doing housework
<daurnimator> s-ol: add a trailing comma
<s-ol> ahah! thats better ;)
<s-ol> sounds sucky :/ they got it all back together?
<daurnimator> supposedly; 6 weeks one handed now...
<s-ol> guess you're going half speed for a while
<daurnimator> certain keyboard shortcuts are.... difficult
ur5us has joined #zig
<s-ol> well now's the time to learn to type with your toes
<s-ol> @ptrCast(*ControlServer, @alignCast(@alignOf(ControlServer), userdata.?));
<daurnimator> will probably take 4 weeks for a footboard to arrive :P
<s-ol> is there any way to shorten this? ?*c_void -> *ControlServer
<daurnimator> no that looks about right
<daurnimator> each piece of that statement is making a separate promise
<s-ol> yeah, i see
<s-ol> guess 80w is not a very attainable goal in zig sometimes
<daurnimator> made for reading/debugging not writing/codegolf :P
<s-ol> yeah, working on a 1366x760 laptop though I am starting to appreciate horizontal-brevity ;)
<s-ol> maybe i should turn line wrapping on in my editor
<s-ol> thats so ugly though >.<
<daurnimator> 120 cols should be fine though...
<s-ol> yeah, might just need to lower my font size a bit
alexnask_ is now known as alexnask
ur5us has quit [Ping timeout: 256 seconds]
DrDeano has joined #zig
<DrDeano> I am having some problems with ChildProcess where after I call `wait()`, I get a `OutOfMemory` but the error return trace says `PathAlreadyExists`. I am calling this with the build file.
<ifreund> hmm, does Builder.exec() not work for your use case?
<ifreund> would probably help to see code
<DrDeano> I need access to the stdout of the process, here is the code: https://github.com/SamTebbs33/pluto/blob/feature/runtime-test-success-or-failure/rt.zig
<ifreund> DrDeano: Builder.exec() returns the stdout as a []u8, if that's what you need
neceve_ has joined #zig
ask6155 has joined #zig
<DrDeano> The process i am running doesn't return
<ask6155> Hey I'm back (If anyone remebers). I decided to try out zls so I built zig master and then zls master and configured it to work with Coc (Vim) and then copied all the keybinds. gd is supposed to jump to definition but it says "Definition provider not found for current document"
<alexnask> ask6155, Hmm, this is weird. Let me download vim and give it a shot, I know a few people are using zls with coc and no one has reported this
<alexnask> (are you using vim or neovim btw? Should matter just want to make sure I get as close an environment as possible)
<ask6155> neovim
<ask6155> I installed Coc via vim-plug
<DrDeano> ifreund, but why should I be getting a OOM though as I do the same as the Builder.exec()
<ifreund> DrDeano: hmm, I don't know.
<euantor> Is there an easy way using `build.zig` to set a compile-time option that can be checked in code? Something like D's `-version=XYZ` or Nim's `-d:abc=xyz`? I want to implement a compile time feature flag to enable/disable specific functionality.
<ifreund> euantor: yes, you can use addBuildOption() and then @import("build_options")
<euantor> Awesome, thanks ifreund!
<ifreund> no problem
<euantor> I thought I'd seen something like it, but the stdlib documentation is a little lacking for the build system right now
<daurnimator> euantor: indeed; please do help out where you can!
<euantor> Yeah, I'll try get time to submit a PR to document this at least tonight
<ask6155> Yeah I tried my zls with emacs (Found a PR on github with instructions) and it works but neovim doesn't
<gonz_> CoC AFAIK is about as faithful an implementation of LSP as you get outside of VSCode
<gonz_> It's unlikely that CoC is the issue and by extension neovim
frmdstryr has joined #zig
ask6155 has left #zig ["byeeee"]
andrii has joined #zig
andrii has quit [Client Quit]
andrii has joined #zig
andrii has quit [Client Quit]
andrii has joined #zig
andrii has quit [Client Quit]
andrii has joined #zig
<alexnask> I just installed coc through plug.vim, added zls to the config (also needed zig.vim) and added the 'gd' nmap and it just works
<alexnask> (completions seem to work as well). Are you sure all goto definitions were broken? Perhaps it was a specific symbol (like something imported by usingnamespace perhaps?)
craigo has joined #zig
andrii has quit [Quit: Leaving]
andrii has joined #zig
andrii has quit [Client Quit]
andrii has joined #zig
babina has joined #zig
babina has left #zig [#zig]
andrii has quit [Client Quit]
andrii has joined #zig
Snetry has quit [Quit: left Freenode]
Snetry has joined #zig
dddddd has joined #zig
layneson has joined #zig
<s-ol> in std.fs.File, is there a way to check how much data an fd has buffered? I'm trying to manually line-buffer input pipes
drewr has quit [Quit: brb]
<s-ol> if i could get the number of bytes in the fd, then I can pull them out and do my splitting. I need to line-buffer multiple streams at the same time, so I can't just read(1)
drewr has joined #zig
dermetfan has quit [Ping timeout: 256 seconds]
alexnask has quit [Quit: Leaving]
Aransentin has joined #zig
tgschultz has joined #zig
<Aransentin> I thought a little on how dates in the standard library might work: https://gist.github.com/Aransentin/594473b5e73f78e41703ef990ae4fee3
<Aransentin> If anyone has an opinion on the "open questions" i pointed out I'd be happy to hear it
xackus has joined #zig
<fengb> I'd probably favor A for monotonic clocks, and B for human clocks
babina has joined #zig
<fengb> But also... we should probably store TZ instead of offset because it's more "correct", but also a lot more work
<fengb> And other people in this room have opinions about non-Gregorian calendars
<Aransentin> Storing just TZ means you need to store the offset as well (or the timestamp itself) or you get ambiguous values when DST changes
andrii has quit [Ping timeout: 258 seconds]
<ikskuh> Aransentin: my experience tells me that you need different types for Dates
<ikskuh> usually you want to have time stamps to work with for calculations (how many seconds between A and B)
alexnask has joined #zig
<ikskuh> and calculator operators
<ikskuh> so something like
tgschultz has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<fengb> TZ requires TZinfo yes
<fengb> But that's the whole point
<ikskuh> GregorianDate(2020, 06, 08) which yields "today"
<fengb> It's the only thing that humans have an intuition about
<ikskuh> you can trivially implement "+1 month" on a GregorianDate
<fengb> Although you can argue that historical dates could be offset based, future times are almost always TZ based
<ikskuh> but as you said, it's not trivial on a strictly monotonic timelime
<fengb> We actually had this happen in recent memory. US changed offsets for DST and broke a bunch of stuff
<fengb> Because most devs don't bother storing the TZ
<Aransentin> ikskuh: Yeah, I had different types for GregorianDate / JulianDate / etc in mind as well, anything else would he horrific
<fengb> Jewish, Islam, Lunar
<ikskuh> i also like splitting date and time
<fengb> I actually have no clue how to handle non-solar calendars... but they sound painful
<ikskuh> and only have a "backend time value" which is unix timestamp in signed nanoseconds for example
andrii has joined #zig
babina has quit [Ping timeout: 256 seconds]
<BaroqueLarouche> andrewrk:
<BaroqueLarouche> andrewrk: Thanks for your comment on my talk :D
layneson has quit [Quit: WeeChat 2.8]
andrii has quit [Quit: Leaving]
xackus has quit [Quit: Leaving]
antaoiseach has joined #zig
antaoiseach has left #zig [#zig]
waleee-cl has joined #zig
nmeum has quit [Remote host closed the connection]
nmeum has joined #zig
dermetfan has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
<pixelherodev> Oh hey, my register patch got merged :)
Akuli has joined #zig
gpanders has quit [Read error: Connection reset by peer]
DrDeano has quit [Ping timeout: 245 seconds]
gpanders has joined #zig
<pmwhite> Best way to readStdinAlloc?
cole-h has joined #zig
xackus has joined #zig
nycex has quit [Remote host closed the connection]
nycex has joined #zig
doublex_ has quit [Ping timeout: 246 seconds]
<xackus> andrewrk do you have any specific optimizations in mind that are allowed by not having a guaranteed slice layout?
<andrewrk> xackus, yes, how they are passed as parameters and return values
<andrewrk> also potentially being able to have safety for pointer casts to them
<xackus> thanks
<xackus> JesseRMeyer asked for rationale behind the layout thing and i got curious myself
<xackus> i suspected parameter optimization
<pixelherodev> pmwhite: std.io.getStdIn().inStream().readAllAlloc or soemthing like that?
tgschultz has joined #zig
benjif has joined #zig
alexnask_ has joined #zig
alexnask has quit [Ping timeout: 272 seconds]
alexnask_ is now known as alexnask
<pmwhite> Yeah, I found that a little later. Can't ask for much better than that.
<pmwhite> Wait, how do you return a non-zero result from main?
<pmwhite> Oh, it can be a u8
doublex has joined #zig
doublex has quit [Read error: Connection reset by peer]
doublex_ has joined #zig
metaleap has joined #zig
FireFox317 has joined #zig
wootehfoot has joined #zig
<FireFox317> andrewrk, you might like these slides on MLIR by Chris Lattner https://docs.google.com/presentation/d/11-VjSNNNJoRhPlLxFgvtb909it1WNdxTnQFipryfAPU/edit#slide=id.g7d334b12e5_0_4
wootehfoot has quit [Read error: Connection reset by peer]
doublex_ has quit [Read error: Connection reset by peer]
doublex has joined #zig
<andrewrk> FireFox317, that certainly looks relevant
<scientes> andrewrk, FireFox317 I was just looking into that
tdc has joined #zig
<FireFox317> scientes, yeah i found it in the link you posted on the C ABI issue. If scientes == shawnl :D
<scientes> FireFox317, use /whois
doublex has quit [Read error: Connection reset by peer]
<FireFox317> I see :D
doublex has joined #zig
metaleap has quit [Quit: Leaving]
benjif has quit [Quit: Leaving]
frett27_ has joined #zig
frett27 has quit [Ping timeout: 260 seconds]
tdc has quit [Ping timeout: 256 seconds]
drp has quit [Ping timeout: 240 seconds]
neceve_ has quit [Ping timeout: 265 seconds]
satchmo has joined #zig
drp has joined #zig
alexnask_ has joined #zig
alexnask has quit [Ping timeout: 272 seconds]
alexnask_ is now known as alexnask
satchmo has quit [Ping timeout: 256 seconds]
ur5us has joined #zig
mikdusan1 has quit [Quit: WeeChat 2.6]
mikdusan has joined #zig
andrii has joined #zig
craigo has quit [Ping timeout: 260 seconds]
Akuli has quit [Quit: Leaving]
arend has joined #zig
nycex has quit [Remote host closed the connection]
nycex has joined #zig
arend has quit [Remote host closed the connection]
* ikskuh just created a zeemap for the zig community
<ikskuh> enter where you are located! let's see where all those ziguanas live
<fengb> The last time a German started collecting location info
<pixelherodev> I mean
st4ll1 has joined #zig
<pixelherodev> fengb: Technically it was Americans who did that
<pixelherodev> IBM did that on behalf of the Germans
<pixelherodev> So...
<pixelherodev> Yeahhhhhh
<fengb> Murica 🇱🇷
<leeward> Flag of Liberia?
<andrewrk> on topic please
<pixelherodev> Sorry
<andrewrk> zee map is cool, let's just stay away from topics that might make people sad or angry
<leeward> I was going to make a joke about Zig being unpopular in certain parts of the world, but...11 pins means it's just unpopular.
<leeward> A thing to change.
xackus has quit [Ping timeout: 265 seconds]
<ifreund> or a small sample size
<pixelherodev> andrewrk: good call, sorry
<leeward> ifreund: Ridiculous.
<pixelherodev> imp'd, yeah
<companion_cube> wow, 2 people in texas
<andrewrk> ikskuh, feel free to put this link in the Community wiki page
<ikskuh> i did already *grin*
<andrewrk> :)
<ikskuh> we had this at gamestudio community
<ikskuh> and it's really cool to see how people are distributed
<ikskuh> and the community still works together and just ignores the physical borders of the world ♥
<nephele> except for timezones
<ikskuh> haha
<ikskuh> the one who does not sleep does not need to consider time zones
<ikskuh> right, pixelherodev? *laughs*
<leeward> Wait, we're supposed to put what time zone we're in? I'm like 8 zones too far East.
<pixelherodev> *sobs*
<pixelherodev> yes.
<pixelherodev> technically.
nycex has quit [Quit: Quit]
nycex has joined #zig
frmdstryr has quit [Ping timeout: 264 seconds]
SyrupThinker has quit [Ping timeout: 260 seconds]
SyrupThinker has joined #zig
dingenskirchen has quit [Ping timeout: 272 seconds]
dingenskirchen has joined #zig
andrii has quit [Quit: Leaving]
slowtyper has quit [Ping timeout: 264 seconds]
dongcarl has joined #zig
FireFox317 has quit [Ping timeout: 264 seconds]
<gonz_> Do you have to sign in to add to the zeemap?
<ikskuh> no, it's not necessary
<gonz_> I guess I should've asked if there was an upside.
<gonz_> I accidentally added an anonymous one, feel free to remove it
<gonz_> Sofia, Bulgaria
<tgschultz> andrewrk: OutStream.write seems underspecified regarding the return value. My instinct is that it should return '0' if there is a temporary situation (buffer full, requires flushing) that causes there to be no bytes written.
<tgschultz> However, if one calls writeAll in this situation, its a softlock.
<tgschultz> On the other hand, returning an error complicates calling code.
alexnask has quit [Quit: Leaving]
satchmo has joined #zig
satchmo has quit [Client Quit]
satchmo has joined #zig
satchmo has quit [Client Quit]
dermetfan has quit [Ping timeout: 272 seconds]
frett27_ has quit [Ping timeout: 265 seconds]
ifreund has quit [Ping timeout: 265 seconds]