ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
commander has quit [Remote host closed the connection]
daftpunk has joined #zig
<andrewrk> copy-elision-2 is coming along
<andrewrk> it's a big core implementation change, probably the biggest since changing from AST codegen to the IR system
pqflx3[m] has quit [Ping timeout: 250 seconds]
commander has joined #zig
jreut has quit [Read error: Connection reset by peer]
fsateler has quit [Quit: ZNC 1.7.1+deb2 - https://znc.in]
fsateler has joined #zig
odc has quit [Ping timeout: 264 seconds]
odc has joined #zig
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
<bheads> That is such a big change! Have you done any performance comparisions yet?
jreut has joined #zig
Hejsil has joined #zig
<Hejsil> bheads I don't think it
<Hejsil> 's gonna make a big difference in perf in release-fast
wink_ has joined #zig
Hejsil has quit [Quit: Page closed]
<andrewrk> agreed. and I haven't benched anything, since most tests are failing. Also the change is semantically needed; performance improvement is not required for this to be valuable
<andrewrk> it will be interesting to see the difference in compilation speed and debug mode
<andrewrk> hmm. I either need to change implicit cast syntax to make it different than function call syntax, or add some complexity to the IR system to deal with the fact that we don't know whether something is an implicit cast or function call until pass 2 (when we have types)
m4ge123 has quit [Read error: Connection reset by peer]
Rohlem has joined #zig
<Rohlem> andrewrk: I guess I'm late, but is that distinction really necessary? I was under the impression that explicit casts (@intCast etc.) are just calls to builtin functions. So why couldn't "default" casts also be function calls? (with a special rule that calling a type like that is a cast)
<Rohlem> andrewrk: So I guess I'd be worried that casts-through function calls (like explicit casts) would have different guarantees/behaviour from non-function-casts, if that distinction is necessary.
<andrewrk> Rohlem, that is indeed one of the two potential solutions I'm considering: 1. make implicit casts a builtin, or 2. make status quo syntax continue to work (in progress)
<andrewrk> "implicit casts" are generally preferred to explicit ones, as they are always safe
<andrewrk> explicit casts are a surface area for bugs
<andrewrk> implicit casts will never go away - there are many places they happen - for example when you call a function, the arguments are implicitly casted to the parameter types. this makes, for example, string literals able to be passed to functions accepting slices
jfo has joined #zig
DutchGh0st has joined #zig
<DutchGh0st> `const` means just: This variable is immutable ?
<DutchGh0st> I dont know why, but I always though it was const as in...a constant const
jfo has quit [Remote host closed the connection]
<andrewrk> DutchGh0st, yes that's what it means
<andrewrk> you can think of it this way: "the bytes that make up this variable are constant"
<DutchGh0st> hehe
<DutchGh0st> Also I did not know you could use godbolt with zig now!
<andrewrk> in that case you probably have a lot more exciting things to read about in the 0.3.0 release notes: https://ziglang.org/download/0.3.0/release-notes.html
<DutchGh0st> `now`, maybe Im just late with updates or whatever, but I was excited when I read it while sitting in the train
<DutchGh0st> also I wondered, is there like some simd section in stdlib?
<andrewrk> simd is one of the high priority 0.4.0 issues https://github.com/ziglang/zig/issues/903
<DutchGh0st> \o/
<DutchGh0st> wasn't there a playground to online compile some code?
<andrewrk> I stopped linking to it because it doesn't update frequently enough, and doesn't have color support in the stderr output for errors
<DutchGh0st> ah yes,
<DutchGh0st> I tried to switch against a slice and an array, but that didn't work ^^
Hejsil has joined #zig
kaiyin has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<andrewrk> Hejsil, one more thing that just occurred to me - we could have a coroutine frame, pre-suspended, be a comptime const value that you can initialize coroutine frames to
<andrewrk> you would use this for generators, for example. but it's neat that the pre-suspended value could be a comptime constant.
<andrewrk> hmm that doesn't take into account parameters. never mind.
<wink_> @andrewrk, is there a way to use the "test" directive to validate @compileError paths in generic code?
<andrewrk> no. there's an open issue for that
<wink_> k
<Hejsil> Puuh, this grammar work is killing me. I'll need to finish this up fast, as I've gotten the urge to work on the randomizer again, but work towards this https://github.com/Hejsil/pokemon-randomizer/issues/41
<Hejsil> andrewrk, seems that your copy elide work is comming along nicely btw.
<andrewrk> thanks. have you been looking at the examples in the commit messages?
<andrewrk> yeah, you've taken on a big project
<Hejsil> A little, but I'm not super fluent in LLVM, so a quick glance didn't say much :)
DutchGh0st has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<andrewrk> the key parts are the lack of alloca instructions and memcpy instructions
<Hejsil> It's probably pretty simple, when you know the instruction set
<Hejsil> I'm looking forward to seeing if debug builds are build faster
<Hejsil> And I know of a few places where I could use the copy being elided
<andrewrk> yeah. I imagine it won't be by much. but theoretically it's less LLVM code, which is the slowest part of compilation
<Hejsil> It also seems that the tuple proposal has gone stale again. I'm still not sure what the solution is myself
<Hejsil> Adding tuples for multi return and varargs seems overkill, but my other proposals kinda feels like hacks
<andrewrk> let's start with anon enum initializers, anon struct initializers, and then maybe anon list initializers, and see where that takes us
<Hejsil> Agreed
<andrewrk> Hejsil, I'm interested in reverting the `struct.{` syntax changes, are you on board with this, and is the `anyerror` change sufficient to solve the problem?
<Hejsil> The PR does revert this, and I'm pretty sure anyerror is enough
Hejsil has quit [Quit: Page closed]
<andrewrk> oh I see, you made the parser code according to the grammar you worked on
<andrewrk> wow, this is really high quality work
<andrewrk> if you run out of steam, I think this is still worth merging even if we leave the async hack in for now
nbjoerg has joined #zig
<nbjoerg> andrewrk: seeing the compile-time perfect hashing post -- you are aware of the expected O(n) algorithms for creating phash functions?
<nbjoerg> just in case it is more than a pure fun example :)
davr0s has joined #zig
<andrewrk> nbjoerg, neat- I figured there was probably plenty of academia around the concept. I just wanted to show a comparison of how it looks to implement compile-time stuff in c++ vs zig
<nbjoerg> I should find some time to look at zig more seriously. but just for #853 I can take it a lot more serious than many other languages...
<nbjoerg> heh and since you advertised the godbolt support: the first example link is currently broken as the compiler core dumps ;)
<andrewrk> I'll have a look at that. In the meantime, choosing 0.3.0 should be a stable workaround
<andrewrk> nbjoerg, hm so here's what happened. godbolt used to have zig 0.3.0 and master branch. the link in the release notes was pointing to master branch, which worked at the time. it seems that godbolt removed master and added 0.2.0 and now that link, which used to point to master, now chooses 0.2.0
<nbjoerg> heh
ManDeJan has joined #zig
ManDeJan has quit [Ping timeout: 240 seconds]
Rohlem has quit []
kaiyin has left #zig [#zig]