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/
notzmv has joined #zig
notzmv has quit [Remote host closed the connection]
notzmv has joined #zig
tdeo has quit [Ping timeout: 258 seconds]
tdeo has joined #zig
cole-h has quit [Ping timeout: 252 seconds]
notzmv has quit [Ping timeout: 240 seconds]
frmdstryr has joined #zig
meinside has joined #zig
Bernstein has quit [Remote host closed the connection]
SimonNa has quit [Ping timeout: 240 seconds]
zenkuro has quit [Ping timeout: 252 seconds]
earnestly has quit [Ping timeout: 265 seconds]
notzmv has joined #zig
dyeplexer has joined #zig
klltkr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xackus_ has joined #zig
xackus__ has joined #zig
xackus has quit [Ping timeout: 246 seconds]
xackus_ has quit [Ping timeout: 265 seconds]
SimonNa has joined #zig
frmdstryr has quit [Ping timeout: 252 seconds]
<marler8997> karchnu, yeah I created an abstraction around epoll and/or select. would be cool to see if I could modify it to use something from std lib
a_chou has joined #zig
a_chou has quit [Remote host closed the connection]
ur5us_ has joined #zig
ur5us__ has quit [Ping timeout: 245 seconds]
terinjokes has quit [Quit: ZNC 1.8.1 - https://znc.in]
terinjokes has joined #zig
skuzzymiglet has quit [Remote host closed the connection]
sord937 has joined #zig
aerona has quit [Quit: Leaving]
notzmv has quit [Ping timeout: 246 seconds]
ur5us_ has quit [Ping timeout: 268 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
cole-h has joined #zig
leon-p has quit [Quit: leaving]
[wtf] has joined #zig
cole-h has quit [Ping timeout: 260 seconds]
xackus has joined #zig
xackus has quit [Read error: Connection reset by peer]
xackus_ has joined #zig
xackus__ has quit [Ping timeout: 252 seconds]
earnestly has joined #zig
fengb has quit [Quit: Bridge terminating on SIGTERM]
Snektron has quit [Quit: Bridge terminating on SIGTERM]
siraben has quit [Quit: Bridge terminating on SIGTERM]
ugla has quit [Quit: Bridge terminating on SIGTERM]
waffle_ethics has quit [Remote host closed the connection]
waffle_ethics has joined #zig
fengb has joined #zig
ur5us_ has joined #zig
siraben has joined #zig
ugla has joined #zig
Snektron has joined #zig
detha has quit [Quit: ZNC - http://znc.in]
detha has joined #zig
motiejus has joined #zig
Cuyi has joined #zig
ur5us_ has quit [Ping timeout: 258 seconds]
zenkuro has joined #zig
knebulae has quit [Read error: Connection reset by peer]
knebulae has joined #zig
<mikdusan> >Starting on May 1st, users of sourcehut’s CI service will be required to be on a paid account, a change which will affect about half of all builds.sr.ht users.
[wtf] has quit [Ping timeout: 260 seconds]
mikdusan has quit [Quit: WeeChat 3.0.1]
<ifreund> marler8997: we don't use sr.ht's instance, rather one hosted by lavatech, so I don't think that affects us at all
<ifreund> yeah crypto sucks though
mikdusan has joined #zig
recalloc has quit [Ping timeout: 252 seconds]
[wtf] has joined #zig
recalloc has joined #zig
zenkuro has quit [Ping timeout: 252 seconds]
<karchnu> marler8997: yes. From what I saw, std.event already has an abstraction around epoll/kqueue, it would be awesome to use this and have something like libevent by default in the language.
zenkuro has joined #zig
pretty_dumm_guy has joined #zig
Cuyi has quit [Quit: Connection closed]
teratorn_ has joined #zig
teratorn has quit [Ping timeout: 265 seconds]
[wtf] has quit [Quit: [wtf]]
[wtf]1 has joined #zig
aigoo has quit [Quit: Peace!]
[wtf]1 is now known as [wtf]
pretty_dumm_guy has quit [Read error: Connection reset by peer]
aigoo has joined #zig
leon-p has joined #zig
lonjil has quit [Quit: No Ping reply in 180 seconds.]
lonjil has joined #zig
notzmv has joined #zig
waleee-cl has joined #zig
klltkr has joined #zig
teratorn_ is now known as teratorn
noam has quit [Read error: Connection reset by peer]
noam has joined #zig
<kiedtl> Interesting. Calling a struct-returning Zig function from C just returns junk; changing the Zig function to take an `out: *Struct` parameter mitigates the issue.
<ifreund> kiedtl: stage1's C ABI implementation is not complete https://github.com/ziglang/zig/issues/1481
<kiedtl> Hm. That could be the issue, then.
<kiedtl> What confuses me is the fact that this only happens with certain functions, I didn't have to add the *out parameter for all of them.
<ifreund> yeah, The calling convention depends on what's in the struct
<ifreund> (when returning by value)
<kiedtl> "depends on what's in the struct" The field's type, not the field's value, correct?
[wtf]1 has joined #zig
<kiedtl> The functions that fail all return a struct of three `uint8_t` fields; the ones which succeed return doubles; I guess it's the type then.
[wtf] has quit [Ping timeout: 240 seconds]
[wtf]1 is now known as [wtf]
<ifreund> yep, the type and order of the fields
teratorn_ has joined #zig
teratorn has quit [Ping timeout: 252 seconds]
cole-h has joined #zig
zenkuro has quit [Ping timeout: 252 seconds]
pretty_dumm_guy has joined #zig
[wtf] has quit [Quit: [wtf]]
<Piraty> eh, CXX="zig c++ --target x86_64-linux-musl" sh -c ' some meson commands' doesn't work, am i missing sth obvious ??
<Piraty> i think i hit this before but didn't take notes about it
klltkr has quit [Quit: Textual IRC Client: www.textualapp.com]
<Piraty> even without --target=
di-wu9 has joined #zig
di-wu9 is now known as di-wu
<andrewrk> mikdusan, when we were on sr.ht I was a paying customer anyway
<andrewrk> part of being responsible with the money donated to ZSF is in turn donating it to the other projects that benefit us :)
Akuli has joined #zig
teratorn_ is now known as teratorn
<v0idify> why did zig migrate away from sr.ht? not even for CI?
teratorn_ has joined #zig
<andrewrk> lavatech runs a sourcehut instance for us with more RAM
<andrewrk> drew was not interested in working with us
teratorn has quit [Ping timeout: 246 seconds]
<andrewrk> at some point we won't need the extra RAM but we're not there yet
cole-h_ has joined #zig
cole-h has quit [Quit: Goodbye]
<jeregrine> just noticed the mac/arcm builds of zig on the website <e
<jeregrine> <3
<mq32> <andrewrk> drew was not interested in working with us
<mq32> probably because of that weird rabbit :D
<mq32> also noam did a bad inside job *grin*
teratorn_ is now known as teratorn
<kiedtl> which weird rabbit?
<mq32> hare
<mq32> language designed by ddevault
<kiedtl> Uh
<kiedtl> I thought he asked people not to share it in public spaces?
<mq32> i'm not the first one to talk about it here *shrug*
<kiedtl> anyway, I thought he didn't like Zig because it uses spaces instead of tabs
<mq32> that's a pretty damn stupid reason
<kiedtl> indeed
<mq32> especially as zig allows using spaces
<mq32> (it's just stage1 that forbids that)
<kiedtl> anyway, I'm sure that's not the only reason. I was half joking
<kiedtl> I think Zig is just too complex for his tastes
<mq32> ^^
<kiedtl> Hare is to Zig as Go is to C
<andrewrk> he complains that zig has too many lines of code
<andrewrk> they're good lines, Bront
<mq32> oh yeah
cole-h_ is now known as cole-h
<mq32> kiedtl: hare feels higher level, with less bare metal
<ifreund> higher level? it doesn't have generics
<kiedtl> ^^
<kiedtl> or comptime, or anything
<mq32> ifreund: it has string types
<ifreund> it's also less bare metal though at the same time
<ifreund> yeah I see where you're coming from
<kiedtl> still just a plain []U's mq
<kiedtl> u8
<kiedtl> fucking autocorrect
<andrewrk> go style string types, just a way for people to write half-ass unicode support that gets all the edge cases wrong
<kiedtl> and apparently Hare will(?) have closures, but anonymous functions? goodness no
teratorn_ has joined #zig
<ifreund> kiedtl: nah, they have a rune type which is a u32 but a valid unicode codepoint
<mq32> kiedtl: zig will have anonymous functions as well, (but no closures)
<kiedtl> ifreund: Oh, right, I forgot
<kiedtl> I dunno, Hare is a mess but I feel like it's OK for those small projects
<kiedtl> 5~/7
<ifreund> I don't see any reason I'd use it over Zig or C once Zig an hare are both 1.0
<ifreund> I could be judging too soon though, it's also not finished yet
<ifreund> maybe generics will be added
<kiedtl> Try asking in #hare, ddevault will eat you for lunch.
<ifreund> though I doubt they can be done as seemlessly as zig without comptime
<ifreund> yeah, that's about what I'd expect
teratorn has quit [Ping timeout: 246 seconds]
<kiedtl> I guess one thing in Hare's favor is the fairly large standard library. Then again, that's probably not a benefit.
<ifreund> their standard library doesn't have a freaking hash map
<ifreund> cause no generics
<kiedtl> Well, yes, that's part of Hare's philosophy
<kiedtl> Then again, I did write a bunch of stdlib modules in Hare, so I'm probably super biased /shrug
<mq32> which is weird (the philosophy)
<mq32> especially as Go has proven that not having generics is basically a bad idea
<ifreund> ^^^^
<ifreund> if I wanted to lose type safety and go back to using void pointers, I'd use C
<kiedtl> ddevault is Not Amused that his favorite language is getting generics, no sirree
<mq32> even then, void pointers are bad for generics
<mq32> because you'd need aligned byte arrays for array lists
<mq32> which is … weird
<mq32> or you allocate each entry
<mq32> which is slo
<mq32> *slow
<jeregrine> ehh drew's grown a bunch, He is actually giving people the option/time to move off sr.ht if they need to pay with crypto
<kiedtl> ddevault's idea is that you write a hashmap for every damn type you want to use
<mq32> oh boy
<mq32> that's a lot of wasted time
<kiedtl> because hey, you get to have optimizations!!
<kiedtl> I'm going to be so bloody happy when I have to port the tenth linked list implementation in a codebase to usize, heh
<ifreund> jeregrine: I definitely appreciated his last blog post and the note at the end, that doesn't mean I need to agree with him on language design though :D
dyeplexer has quit [Remote host closed the connection]
<jeregrine> fo shpo
<jeregrine> he used to be more brash but I think running a business that needs to make money AS WELL is softening him
<kiedtl> (Probably off-topic for this channel) I could be wrong, but that paragraph seemed to be apologising for some harshly-worded posts, not his personal toxicity.
<ifreund> I'll judge him by his future actions not his words
zenkuro has joined #zig
<companion_cube> kiedtl: "puts the ball in your court" is a lovely euphemism for "force you to reinvent the wheel"
bitmapper has joined #zig
<fengb> This looks... ehhh
<kiedtl> fengb: that post is apparently a work in progress
<kiedtl> at least from what I gather from the irc chan
<ifreund> well from the current draft it basically reads as "hare doesn't make handling OOM easy enough, so you should probably just abort by default"
<kiedtl> yup
<fengb> I meant the strategy feels so... not good >_>
<ifreund> yeah, I think mq32 was right on when he said hare feels higher level than zig, but with less features
jokoon has joined #zig
<andrewrk> I really love zig's std lib hash map
<andrewrk> I think it's the shining star of the std lib
<mq32> oh yeah!
<ifreund> It's excellent yeah
<ifreund> getOrPut() is a great API
xackus has joined #zig
<mq32> i feel like most containers are actually quite cool
xackus_ has quit [Ping timeout: 240 seconds]
<ifreund> I think the linked lists need work
<fengb> I'd love to see an intrusive list
<ifreund> I want to try making them intrusive, I honestly prefer the bindings I for libwayland's intrusive linked list over the std one
<ifreund> *I wrote
<andrewrk> fengb, std lib linked list is already intrusive, just use void for the node type
<ifreund> andrewrk: ergonomics are horrible though if you do that
<andrewrk> yeah I agree with that, I think std lib linked lists need a once-over on ergo
<andrewrk> they're some of the oldest code in std
marijnfs has joined #zig
<noam> mq32: what bad inside job
<noam> :P
<noam> mq32: full disclosure: no attempt at an inside job was made
<mq32> as said: bad inside job if not attempted :D
<noam> xd
<noam> ifreund: honestly, I'm likely going to be using Hare over Zig for the most part when both are at 1.0
<noam> The fact that I'm cheating with my compiler and maybe possibly making my own person undocumented PL using my favorite parts of both Zig and Hare is irrelevant :P
<noam> personal*
<noam> Honestly, it's not a direct comparison - Zig, C, and Hare all have advantages over each other and disadvantages. I'll likely be using all three for years to come
<noam> To paraphrase an intelligent quote: > you can use multiple languages
<mq32> NO WAY
<noam> I know, right?!
skuzzymiglet has joined #zig
<andrewrk> if we can deliver on this compilation speed promise, nobody is going to want to use a different language ever again
<companion_cube> that's a tall order :)
<mq32> andrewrk: just be quicker than V
<mq32> that's all we want
<V> good luck
<mq32> Wie?
<V> normally
<andrewrk> afaik stage1 is already quicker than V
<andrewrk> it's a pretty low bar
<mq32> whoot?
<V> is vlang anything more than vaporware
<kiedtl> Really?
<V> like is it actually a thing now or
<kiedtl> It is... sort of
<kiedtl> Not good for anything much
<mq32> kinda
<V> I'm really not convinced it'll go anywhere, nothing made by amateur proglang devs ever does
* mq32 looks at andrewrk
<kiedtl> lol
<fengb> I mean, he's technically professional now that he's being paid
<fengb> Kind of a low bar 🤔
<V> I'd *like* to say that andrewrk seems to know what he's doing a bit better than the vlang people lmao
<ifreund> definitely feels far more professional, we have a foundation after all
<companion_cube> quite
<fengb> (I mean being paid, not being a real expert)
<V> like we actually have a new language here instead of "something that looks like the syntaxen of go and rust smooshed together"
<ifreund> and *still* doesn't have it's memory management strategy figured out
<fengb> But you can pass -autofree to the compiler and have it insert crashes for you :P
<kiedtl> it's a weird mashup of GC and Rust's memory management engine
<kiedtl> err, refcount
<fengb> Idea came from http://strlen.com/lobster/ which actually looks pretty interesting
<noam> andrewrk: what compilation speed promise?
<earnestly> V: > amature proglang devs
<noam> andrewrk: also, I know you were joking, but fast compilation absolutely won't get me to use stage2 :P
<earnestly> V: Python
<noam> nah, python actually works
<noam> amateurs can do a good job
<earnestly> noam: That is the counterpoint
<noam> Ah
<V> con-artists are specialists, amateurs are generalists :p
<noam> Thought you were equating V and Python
<noam> Didn't realize you were talking to V, not about V
<noam> ;p
<V> that's vlang tyvm
<earnestly> Heh
<plumm> lol
<noam> It's the lang v
<mq32> noam: why not using stage-2? it should run on plan9 with some adjustments to std :D
<earnestly> For better or worse most languages that gain wide usage tend to come from single individuals who tend to be outside of language theoretic work
<g-w1> you also need another non-elf linker
<mq32> earnestly: luckily, we have some guys with some expertise in lang theory
<g-w1> who?
<mq32> spex for sure
<g-w1> ah
<mq32> i have learned a lot by designing some hobby langs before (LoLa being the one actually usable!)
<earnestly> mq32: It's certainly useful to bolster the more pragmatic needs
<mq32> and understanding design decisons in c++
<noam> mq32: because I dislike it?
<mq32> :(
<noam> I can also port GCC, doesn't mean I want to use it
<mq32> basing languages purely on theory is stupid though, it gets you non-practical languages
<g-w1> ^'
<noam> That's like trying to get everyone to speak lojban
<mq32> but backing practical features with proper semantic definitions gets you sane languages
<noam> Does it have practical advantages? Sure
<noam> Is anyone going to give a crap? Unlikely
<noam> You can make the perfect language, but if nobody wants to use it, it doesn't matter
<noam> Language is, of course, intrinsically *social*
<earnestly> There's no need to elevate it beyond simple practical need
<mq32> earnestly: say that to the haskell guys :D
<noam> mq32: I'm working on zyg because I think it'll make for a better compiler, not just to "get it working"
<earnestly> mq32: Hobbies can be fun :p
<noam> I have no intent of using it to port stage2
<noam> Ooh, pinepower is in stock! :D
marijnfs has quit [Ping timeout: 240 seconds]
<mq32> noam: let's see if you get there :)
<earnestly> I quite like that Haskell exists as a kind of dumping ground for all sorts of interesting experiments, e.g. https://hackage.haskell.org/package/discrimination
<companion_cube> earnestly: I wouldn't that the divide is that sharp
<mq32> having a second zig impl is certainly not bad when 1.0 is there :)
<noam> mq32: it's taking a lot of work because i'm a perfectionist :P
<companion_cube> like even Java had academics contribute, and scala has certainly seen some usage
<noam> i've thrown out more code than I've kept at this point, I think
<earnestly> mq32: Here, realising that counting sort is O(n), they figured out a way to represent memory locations as sortable integers, and so gain O(n) sorting almost generally
<mq32> noam: it's a lot of work without being a perfectionist as wel
<earnestly> (roughly)
<noam> mq32: not really?
<mq32> it is ;)
<noam> I could probably implement a half-assed design for zig in a month or two
<noam> Crappy codegen, of course
<noam> and it'd probably have bugs here and there
<mq32> a "barely working" or "standard conform" one? ;)
<noam> in between
<mq32> so "barely working" :D
<noam> a "standards conforming unless you try doing something I didn't think about" one :P
marijnfs has joined #zig
<noam> mq32: Honestly, at this point I'm tempted to just go for "barely working" and then incrementally fix it :P
<earnestly> noam: Take a note from Ada though and provide the standard for free, including a companion rationale document and and a compiler conformance test suite
<noam> I mean I kinda *did*
<noam> earnestly: for what?
<earnestly> noam: zig
<g-w1> thats the part of zig, not zyg?
<noam> ^
<noam> I'm not doing that, that's not my job!
<noam> :P
<earnestly> noam: I mean a half-assed one
<noam> ... half-assed spec?
<earnestly> And rationale, etc. :p
<noam> XD
ur5us_ has joined #zig
ironhelix has joined #zig
<marijnfs> how do you deal with async functions that can suspend several times in a loop?
<mq32> marijnfs: the same as with the ones that suspend one time only:
<mq32> have a strategy on how to resume
<g-w1> you can actually use this pattern as a generator!
sord937 has quit [Quit: sord937]
aigoo has quit [Ping timeout: 276 seconds]
cole-h has quit [Quit: Goodbye]
cole-h has joined #zig
Akuli has quit [Quit: Leaving]
<g-w1> wow, error on redundant comptime was trivial in stage2!
<mq32> very cool!
<g-w1> i hope it will be that way in stage1
<g-w1> every time i fix something in stage1, i break something else
aigoo has joined #zig
jokoon has quit [Quit: Leaving]
<andrewrk> g-w1, I'm guessing you just checked if (gz.force_comptime) emit_error(); ?
<g-w1> yep, and fixed type expr not being comptime, pr is up
<andrewrk> nice, yeah that logic should be sufficient :)
<g-w1> not sure if there are any other cases, but its nice that we can just do it all in astgen :)
<andrewrk> oh sick, LemonBoy made a hex float parser
<andrewrk> I fucking love that lemon
<mq32> That dude is so on fire, i feal the heat even from over the great ocean
<mq32> i love those exercises for the reader
<g-w1> where?
v0idify has quit [Ping timeout: 240 seconds]
<mq32> Unifying this parser and the regular one (and perhaps rewrite it, #2207) is left as an exercise for the reader.
<g-w1> thanks
mschwaig has quit [Ping timeout: 240 seconds]
mschwaig has joined #zig
<fengb> Is LemonBoy open for donations?
v0idify has joined #zig
ur5us__ has joined #zig
v0idify has quit [Ping timeout: 240 seconds]
zenkuro has quit [Ping timeout: 265 seconds]
zenkuro has joined #zig
ur5us_ has quit [Remote host closed the connection]
<g-w1> andrewrk: thanks for the prompt review
v0idify has joined #zig
<marijnfs> mq32: how do you communicate when to stop resuming and await the result?
<g-w1> you can have some *bool that you pass in, and if it is false, await it, otherwise resume it
<marijnfs> g-w1: that's pretty practical
xackus has quit [Ping timeout: 240 seconds]
pretty_dumm_guy has quit [Quit: WeeChat 3.2-dev]
<g-w1> > redundant comptime keyword in implicitly comptime scope
<g-w1> andrewrk: i dont like implicitly word here as the user can make an explicit comptime scope with `comptime { }`
<andrewrk> excellent point
<g-w1> do you have any better idea of what to put (im bad with stuff like this)
<andrewrk> how about "already"
<g-w1> thanks :D
<andrewrk> redundant comptime keyword in already comptime scope
<andrewrk> it's worth thinking about because a tiny improvement in compile message wording could save hundreds of people hours of time :)
<g-w1> agreed! ive been looking at elm recently, and they have really good compile errors with examples. in the (far) future, i think it would be good to include examples in compile errors for example: `redundant comptime keyword in already comptime scope\nexample: `comptime { var i: u32 = comptime func(); }``
<plumm> rust does this to some extent too. I wonder if people (or newbies starting out) actually used rustc --explain
ifreund has quit [Ping timeout: 245 seconds]
ifreund has joined #zig
<g-w1> i did, but i would have liked it if the examples were right there in the erorrs
aerona has joined #zig
<plumm> g-w1 explain is different than an example but i see your point