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> scientes: not that i know of, i actually bought some cheap avr chips a few months ago to test but just have never got around to it
<tiehuis> also in regards to arguments, do you mean command-line arguments?
<tiehuis> in that case you can use argsAlloc, argsFree: https://github.com/ziglang/zig/blob/master/std/os/index.zig#L1925
<scientes> tiehuis, yeah i gounf os.ArgIteratorPosix
<scientes> but i just ended up using os.ArgIteratorPosix.raw
<tiehuis> that works too if you only need posix support
qazo has joined #zig
qazo has quit [Ping timeout: 244 seconds]
mnoronha has quit [Ping timeout: 252 seconds]
kristate has joined #zig
<kristate> andrewrk: it merged??
<kristate> andrewrk: when I saw in 598e809 that you changed from initMultiThreaded to initSingleThreaded, I figured that you had found #1363 -- bummer
tiehuis has quit [Quit: WeeChat 2.2]
\u is now known as meowray
<scientes> chaCha20(input[0..], key, nonce, &result);
<scientes> home/shawn/git/zig/std/crypto/chacha20.zig:138:19: error: expected type '[]u8', found '[]const u8'
<scientes> why is this a problem?
zolk3ri has quit [Quit: leaving]
mnoronha has joined #zig
<scientes> how do i get my function to write to a slice buffer provided by the caller?
<scientes> pub fn chaCha20(in: []const u8, key: [8]u32, nonce: [8]u8, out: *[]u8) void {
<scientes> home/shawn/git/zig/std/crypto/chacha20.zig:102:16: error: index of single-item pointer
<scientes> otherwise I got my chaCha20 working
<scientes> bingo
_whitelogger has joined #zig
qazo has joined #zig
qazo has quit [Ping timeout: 244 seconds]
qazo has joined #zig
qazo has quit [Ping timeout: 244 seconds]
mnoronha has quit [Ping timeout: 252 seconds]
kristate has quit [Ping timeout: 240 seconds]
mahmudov has joined #zig
<MajorLag> ..wait, what? Since when can return type be var? This changes everything.
<MajorLag> Oh, no wait. It still doesn't. I'm just too tired to compile the right file.
mahmudov has quit [Remote host closed the connection]
davr0s has joined #zig
zolk3ri has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
qazo has joined #zig
qazo has quit [Ping timeout: 244 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Barabas has joined #zig
<Barabas> Howdy
<Barabas> I made a simplex noise implementation, and I get the values I expect (compared to the C++ implementation) in debug mode, but when I compile it with release-fast I don't. Any idea why this might be?
davr0s has joined #zig
bodie_ has quit [Quit: ZNC 1.6.6+deb1 - http://znc.in]
bodie_ has joined #zig
ft3 has joined #zig
<Barabas> I hacked the compiler source code to always turn off fast math and now it's fine.
<Barabas> ... now I reverted it and it's still fine. wtf.
<Barabas> Oh wait... not building with release-fast ><
<Barabas> Ok, so it's really 'optimized' floating point mode which screws up my numbers. Most of the time it's fine, sometimes it's 2% off, depending on whether I do the calculations with 1 and 2 or 4 and more elements at the same time.
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
hooo has joined #zig
<hooo> weird ERROR: https://tio.run/##ZYzBCoJAFEX3fsVlNs1ASLUpEqNlfYO1GHXSAZ2JcSxL/XbTJFC6iwePc899y6TrIq0Ki8LG8HGU@V0bS0n/EuY5I3tyo/6gG4uwTNyBec69DHFTyLlUlOGhZYzawZAHN6heewTXcavc9UvkdCbeyG/agFavYOW6mytDI5uf@c0wT0ndXhRZQjJvgoqntFEKKtnM2K7hH@YeSbRFJqwVBot0Qdhy0hdZIQajVEbwKOVhJqa4dcbbdt0H
<MajorLag> what's weird about it?
<MajorLag> 'H' == 72
<hooo> it doesnt tell me whats wrong
<MajorLag> you reached unreachable code
<MajorLag> which is explicitly what you told it to do if you didn't match in the switch
<hooo> yeah but so what, this is an error?
<MajorLag> it's an assert
<MajorLag> you've told the compiler "this should never happen", but because you're compiling in debug, it catches the fact that it did happen, and panics with a line number of where it happened.
<hooo> well how do I do nothing in the else case?
<MajorLag> else => {}
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
qazo has joined #zig
qazo has quit [Ping timeout: 240 seconds]
qazo has joined #zig
qazo has quit [Ping timeout: 244 seconds]
davr0s has joined #zig
<Dirkson> andrewrk: Did you ever consider that "cast(FromType, ToType, Castable)" suggestion of mine? I'm curious what you think of it, since it appears to sidestep the problems of typecasting via "SomeType(Castable)", while simplifying syntax.
ft3 has quit [Read error: Connection reset by peer]
<scientes> he's on vacation for a week
<scientes> Dirkson, <andrewrk> also, I'm going on vacation tonight. spending 1 week with my family. I might have time to merge PRs and respond to issues, but not much else.
Barabas has quit [Ping timeout: 252 seconds]
<Dirkson> Ok, so zig errors when I attempt to not use an expression value. I assume this is to force people to deal with return values, for things like errors. But if I stuff the result into a value, then never use the value, the error vanishes. It seems like this could be fairly easily detected using static analysis. Is this "TODO" behavior, or am I misunderstanding something?
<Dirkson> It appears that local values are implicitly typed. Are there other things that are implicitly typed? (function return types, argument types, etc.)
<MajorLag> Dirkson, zig forces you to acknoledge an expression value, not necessarly do anything with it. We use `_` to explicitly ignore the value. `_ = func();`. Type is inferred under most circumstances, not not function returns (yet). For arguments we have `var`, but that's used for comptime duck-typing and generics.
qazo has joined #zig
<Dirkson> Oh. Is type inference planned for function returns?
qazo has quit [Ping timeout: 244 seconds]
<Dirkson> MajorLag: It seems to me that creating a value without using it should also be an error. (Or at least a warning, as it is in C)
<MajorLag> Zig doesn't have warnings. Either something is an error or it isn't. It's part of the "being explicit about intent" philosophy.
<Dirkson> Sure. Not really my point.
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…]
hooo has quit [Quit: Page closed]