ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
tiehuis has joined #zig
<tiehuis>
Dirkson: I wouldn't rule that out being an error in the future
<scientes>
how do i reslice a slice?
<scientes>
(without modifying slice.ptr)
<scientes>
nvm
<MajorLag>
I think not allowing creating variables without using them would make it annoying to test WIP code. That was an issue I had with Go.
<scientes>
thats why you make a bunch of small functions
davr0s has joined #zig
qazo has joined #zig
qazo has quit [Ping timeout: 240 seconds]
<scientes>
the problem is turning slices into pointers
<scientes>
slices into arrays ***
qazo has joined #zig
<scientes>
PITA
qazo has quit [Ping timeout: 244 seconds]
<scientes>
a do {} while() loop would be nice
<scientes>
i guess it doesn't get much use though
<scientes>
why is it so hard to zero initilize a struct?
<scientes>
arm64 has a didicated 0 register to make it fast
<tiehuis>
i think the idea is that if you want to zero initialize a struct you should have to explicitly zero all fields
<tiehuis>
this way at least when the definitions changes you need to re-evaluate this behavior
<tiehuis>
you can create a function to return a zero initialized value as an option of course
tiehuis has quit [Quit: WeeChat 2.2]
zolk3ri has quit [Remote host closed the connection]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
qazo has joined #zig
qazo has quit [Ping timeout: 244 seconds]
<scientes>
are inlined whiles still inlined when --release-small ?
<scientes>
i assume so
<scientes>
there has got to be an easier way to turn a slice into a array
<scientes>
yeah doing x25519 in zig is too difficult without being able to turn slice to array without an explicit cast
<scientes>
poly1305 also runs into this problem
_whitelogger has joined #zig
mnoronha has joined #zig
<mnoronha>
I haven't used cmake too much before. After I make changes, will I run into problems if I just rebuild with `make install`?
<mnoronha>
i.e. not `rm -rf build`, etc.
<mnoronha>
Well, it works with just `make install`, and the output suggests the generated makefile checks, and it's late everywhere but the west coast, so I think this is resolved :)
<scientes>
mnoronha, if you are doing alot of building i suggest using -G "Ninja", and then running "ninja" instead of "make"
<mnoronha>
scientes: Will do. Is that just to speed up compiles?
<scientes>
yeah
<scientes>
mainly speed up later compiler, not the first one
<scientes>
but it also use -j by default, unlike make
<mnoronha>
Ah gotcha. To be honest, I've also been poking at the rust compiler and not taking 40+ minutes to build is refreshing even doing nothing fancy
<mnoronha>
Ah yea, make not using -j by default was confusing to me when I first learned about it. Are there any disadvantages?
<scientes>
not really
wink_ has quit [Remote host closed the connection]
_whitelogger has joined #zig
mnoronha has quit [Ping timeout: 252 seconds]
qazo has joined #zig
qazo has quit [Ping timeout: 244 seconds]
qazo has joined #zig
qazo has quit [Ping timeout: 260 seconds]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
Barabas has joined #zig
noonien has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
qazo has joined #zig
davr0s has joined #zig
qazo has quit [Ping timeout: 244 seconds]
wink_ has joined #zig
scientes has quit [Disconnected by services]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
scientes has joined #zig
scientes has left #zig ["Leaving"]
scientes has joined #zig
mnoronha has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ft3 has joined #zig
davr0s has joined #zig
<ft3>
Hi everyone
<ft3>
I was wondering if it's possible to return an anonymous function from a function
<ft3>
Sort of like in Go
<ft3>
I read the docs, but didn't find anything about it.
Barabas has quit [Ping timeout: 252 seconds]
<ft3>
Also I tried writing some code to test it but got only compile errors
<scientes>
its just when you remove pointer arithmetic you have to address its use cases
mnoronha has joined #zig
<MajorLag>
why aren't you just using Many Item pointers ([*]) instead of arrays? You can use do pointer arithmetic on those, and since the lengths you're using ar comptime known you don't really need to pass them as an argument.
<scientes>
yeah i'll do that
<scientes>
but it would be nice to have proper type checking
<scientes>
you still have to cast to those
<scientes>
i'm tempted to use slices and see if it compiles them out
<scientes>
ahh you just do &
<shodan45>
small bit of hopefully constructive criticism - I'm reading https://ziglang.org/documentation/0.2.0/ and "break :something" has been used a few times, but I don't think it was explained
* shodan45
just notices he's not reading the /master branch docs....
<scientes>
how do i do pointer arithmatic on [*] types?
<scientes>
zig/std/crypto/x25519.zig:289:16: error: expected type '[*]u32', found '*u32'
<scientes>
recip(&work[32],&work[32]);
<scientes>
work[32..].ptr is kinda ugly (but not as bad as @ptrCast
<scientes>
why can't slices with comptime parameters just implicitely cast to array?
qazo has joined #zig
qazo has quit [Ping timeout: 260 seconds]
qazo has joined #zig
qazo has quit [Ping timeout: 260 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
noonien has quit [Quit: Connection closed for inactivity]