ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
redj has joined #zig
redj_ has quit [Ping timeout: 256 seconds]
donlzx has joined #zig
quc has quit [Ping timeout: 244 seconds]
mahmudov has quit [Remote host closed the connection]
donlzx has quit [Quit: Leaving]
darithorn has quit [Quit: Leaving]
darithorn has joined #zig
v1zix has joined #zig
donlzx has joined #zig
v1zix has quit [Ping timeout: 252 seconds]
xtreak has joined #zig
dbandstra has joined #zig
very-mediocre has joined #zig
darithorn has quit [Quit: Leaving]
xtreak has quit [Remote host closed the connection]
xtreak has joined #zig
renatorabelo has quit [Read error: Connection reset by peer]
zolk3ri has joined #zig
sneow has quit [Ping timeout: 252 seconds]
xtreak_ has joined #zig
xtreak has quit [Ping timeout: 244 seconds]
bheads__ has quit [Ping timeout: 268 seconds]
xtreak_ has quit [Ping timeout: 268 seconds]
Richard10 has joined #zig
Richard10 has quit [Client Quit]
bheads has joined #zig
dbandstra has quit [Quit: Leaving]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
quc has joined #zig
unique_id has quit [Quit: Konversation terminated!]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
donlzx has quit [Remote host closed the connection]
very-mediocre has quit [Ping timeout: 252 seconds]
very-mediocre has joined #zig
<andrewrk>
this was the answer to the puzzle at the end of the stream yesterday: https://clbin.com/jrDm2
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
wilsonk_ has joined #zig
wilsonk has quit [Read error: Connection reset by peer]
davr0s has joined #zig
Bas_ has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<GitHub140>
zig/master 171f33b Andrew Kelley: ir: remove unnecessary and probably buggy code
<GitHub140>
zig/master 860d3da Andrew Kelley: ir: remove dead code
zolk3ri has quit [Ping timeout: 260 seconds]
zolk3ri has joined #zig
xtreak has quit [Ping timeout: 268 seconds]
<winksaville>
andrewrk, regarding bug 1225, I was wrong, the compiler isn't crashing its the program. The only question is should the compiler have caught my error?
<andrewrk>
winksaville, I think @errorName should not allow an error!void argument
<andrewrk>
so this would be a compile error
<winksaville>
SG, I'll update the bug.
<andrewrk>
this is probably a remnant from when we used to have `error.Ok`, which is now an anti-pattern
<GitHub197>
zig/master c87102c Andrew Kelley: ir_get_ref: delete unnecessary and probably buggy code
<winksaville>
andrewrk, I've taken a quick look and I see that @errorName is added to Codegen::builtin_fn_table in src/codegen.cpp but there is only param_count and no type information.
<andrewrk>
winksaville, here's a clue: ir.cpp:16187
<andrewrk>
woah wtf it implicit casts to its own type?
davr0s has joined #zig
<andrewrk>
that's a mistake. it should be implicit casting to ira->codegen->builtin_types.entry_global_error_set
<andrewrk>
I believe that should solve the problem. that + a new test case at the top of test/compile_errors.zig
<winksaville>
hmm, 16187 is in ir_analyze_instruction_compile_err which seems to imply its already found an error, or is my source old?
<andrewrk>
ir.cpp:16187 in c87102c304
<winksaville>
k, I need to update I'm acient from yesterday :)
<winksaville>
now 16187 is: static TypeTableEntry *ir_analyze_instruction_err_name(IrAnalyze *ira, IrInstructionErrName *instruction) {
<andrewrk>
yep that is the clue
<andrewrk>
this line is wrong: IrInstruction *casted_value = ir_implicit_cast(ira, value, value->value.type);
<winksaville>
ok, so first off type information is code not data?
<andrewrk>
I don't understand the question
<andrewrk>
the IR code deals in values, which have types
<andrewrk>
the parameter to @errorName is a value, which has a type
<Bas_>
wew
<Bas_>
ArrayList is broken.
<Bas_>
I'll... have to figure out how to do a pull request I guess.
<winksaville>
I was expecting type info "data" to be created when create_builtin_fn was called, but just my bias, np.
<winksaville>
that's adding logging to the .zig sources, correct. I want to add logging to .cpp code and print contents of structures.
<andrewrk>
I've been using gdb breakpoints for that
mahmudov has joined #zig
<andrewrk>
there's always fprintf
very-mediocre has quit [Quit: Page closed]
<winksaville>
my gdb skills are minimal so not what I turn to first, but maybe I need to up my game there. Also, I added some fprintf to ir_analyze_instruction_err_name and see that its called 5 times, so I need to educate myself on the compiler flow to get my bearings. Any docs on the internals?
<andrewrk>
nope
<winksaville>
k
<winksaville>
Is there a .cpp style guide and maybe a vi ftplugin you use?
<andrewrk>
there is no style guide, and I use the default vim cpp ft plugin
<winksaville>
sg
<Bas_>
ok, I have a question
<Bas_>
Is the realloc on an allocator supposed to keep the data intact or does it just return an undefined slice of memory?
<andrewrk>
it keeps the data intact
<andrewrk>
if you're looking at the implementation of std.mem.Allocator, it sets the new bytes to undefined
<Bas_>
ok, cause that's not what the documentation says.
<andrewrk>
this allows the compiler to set the bytes to 0xaa in debug mode
<andrewrk>
where are you looking?
<Bas_>
reallocFn
<Bas_>
line 26
<andrewrk>
I agree that is unclear. "newly allocated memory" is intended to mean the new bytes, not the old bytes that are preserved. I'll clarify
<Bas_>
Ah ok
<Bas_>
So the implementation is supposed to do the copy if nessecary?
<andrewrk>
correct
<Bas_>
Yeah I guess there's no other option. And if you don't need that behaviour you can just do free and alloc.
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<GitHub90>
[zig] BarabasGitHub opened pull request #1232: Fix array list insert (master...fix-array-list-insert) https://git.io/fNmJj
Ichorio has quit [Ping timeout: 248 seconds]
<GitHub174>
[zig] BarabasGitHub opened pull request #1233: Replace loop in ensureCapacity with a std.mem.max for the new capacity. (master...remove-weird-loop-in-array-list) https://git.io/fNmUj
iso_ has joined #zig
jitsudo has quit [Read error: Connection reset by peer]
Bas_ has quit [Ping timeout: 252 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<GitHub169>
[zig] eduardosm opened pull request #1234: codegen: Store returned value if type is 'handle_is_ptr' and function… (master...extern-return-small-struct) https://git.io/fNmYu