ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
kristate has joined #zig
darithorn has joined #zig
Marumoto has joined #zig
darithorn has quit [Remote host closed the connection]
Marumoto has quit [Ping timeout: 264 seconds]
<diltsman> How do I ignore the return value of memcpy (?[*]u8)
<daurnimator> diltsman: assign to _
kristate has quit [Remote host closed the connection]
kristate has joined #zig
kristate_ has joined #zig
kristate has quit [Ping timeout: 268 seconds]
<shachaf> Hmm, does Zig have some notion of stack frames in an arena, where you can free everything up to a point instead of the whole arena at once?
<daurnimator> shachaf: fixedbufferallocator ?
<shachaf> What's the difference between this and ArenaAllocator?
<shachaf> Neither of them seems to have this, anyway.
<diltsman> __aeabi_memcpy4 is going to be fun to implement...
<diltsman> Compiler-RT just has it call memcpy. Zig optimizes my copy of memcpy (local function named my_memcpy) to a call to __aeabi_memcpy4.
<daurnimator> diltsman: huh..... I'm interested in hearing the solution :)
<diltsman> daurnimator: My current best idea is to write it in in-line assembly. Not ideal, but the optimizer is going to cause me problems. Anything that could generate decent code will be rewritten as a call to __eabi_memcpy4.
<daurnimator> diltsman: and what stops it from optimizing your inline assembly? :)
<diltsman> I don't believe that LLVM IR moves most assembly into regular IR...
<diltsman> SSE does have equivalents in the IR that it is lowered to, but not all in-line assembly does.
<daurnimator> counting on the optimizer not being good enough always seems like a risky move
<diltsman> I know, right?
<diltsman> I will work on doing in-line assembly. If LLVM is like GCC, I believe there is a way to annotate an assembly block so that the optimizer will ignore it.
kristate has joined #zig
<daurnimator> diltsman: maybe https://github.com/ziglang/zig/issues/978 ?
<daurnimator> diltsman: even if LLVM doesn't right now.... along comes a link-time-optimizer....
kristate_ has quit [Ping timeout: 264 seconds]
jevinskie has joined #zig
_whitelogger has joined #zig
_whitelogger has joined #zig
knebulae has quit [Ping timeout: 255 seconds]
knebulae has joined #zig
kristate has quit [Remote host closed the connection]
Ichorio has joined #zig
<andrewrk> shachaf, std.heap.ArenaAllocator
<andrewrk> oh, "everything up to a point" missed that
Ichorio has quit [Ping timeout: 250 seconds]
<andrewrk> diltsman, I think an assembly implementation is perfectly fine - what are the downsides?
halosghost has joined #zig
dpk has left #zig [#zig]
jevinskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
daurnimator has quit [Ping timeout: 259 seconds]
SimonNa has quit [Remote host closed the connection]
edr has quit [Ping timeout: 250 seconds]
darithorn has joined #zig
edr has joined #zig
edr has quit [Remote host closed the connection]
edr has joined #zig
SimonNa has joined #zig
edr has quit [Client Quit]
edr has joined #zig
Zaab1t has joined #zig
Akuli has joined #zig
Zaab1t has quit [Quit: bye bye friends]
Ichorio has joined #zig
fsateler has joined #zig
fsateler_ has quit [Ping timeout: 246 seconds]
barua has joined #zig
barua has quit [Ping timeout: 245 seconds]
wootehfoot has joined #zig
Akuli has quit [Quit: Leaving]
gamester has joined #zig
<gamester> I don't understand why emekoi's code doesn't return the same result for each call. https://www.reddit.com/r/Zig/comments/ard50a/static_local_variables_in_zig/egmlnor/
<gamester> oh I just got it
<gamester> What is it that makes state a global variable?
<gamester> no it's a type, bar is the global
<gamester> idk
<andrewrk> that's right
<andrewrk> top level `var` or `const` inside a struct {} are global variables
<andrewrk> the struct {} just acts as a namespace
darithorn has quit [Remote host closed the connection]
<gamester> okay
<dec05eba> are braces supposed to be required for if/else body?
adrusi has quit [Read error: Connection reset by peer]
<dec05eba> the error being expected symbol '}' on the line with 'else'
adrusi has joined #zig
<dec05eba> i see in parser.cpp on line 1372: // Block <- LBRACE Statement* RBRACE
<dec05eba> so braces are supposed to be required, right?
<andrewrk> dec05eba, if expressions are supposed to let you have `if (c) a else b` where c, a, and b are all expressions
<andrewrk> but variable declaration is a statement not an expression
<andrewrk> dec05eba, I'm not sure right now what to do about it, let's make a github issue and then forget about it until the 1.0.0 milestone
<dec05eba> alright
<dec05eba> oh sorry, i see now that it has been asked before on github. I didn't find it before..
<dec05eba> the search menu when creating a new issue is slightly better than the one when you are not creating a new issue :p
<andrewrk> ha, good point
<andrewrk> I'm live streaming creating a general purpose allocator in 8 minutes: https://www.twitch.tv/andrewrok
wootehfoot has quit [Read error: Connection reset by peer]
return0e_ has joined #zig
return0e has quit [Ping timeout: 255 seconds]
halosghost has quit [Quit: WeeChat 2.3]
<gamester> I need to go to sleep, great stream!
gamester has left #zig ["Leaving"]
<diltsman> andrewrk: The biggest downside of an assembly implementation is that it is opaque to the optimizer. Given that it would be behind an ABI primitive, that shouldn't be too big an issue.
<diltsman> Also means that I have to look at the EABI specification to make sure that the __eabi_memcpy4 and __eabi_memcpy8 are correct, since they wouldn't be directly based on the compiler-RT implementation.