ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
steveno_ has quit [Quit: Leaving]
Hejsil has quit [Ping timeout: 260 seconds]
noonien has quit [Quit: Connection closed for inactivity]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
isd has quit [Quit: Leaving.]
<GitHub199> [zig] andrewrk pushed 1 new commit to master: https://git.io/vp4b3
<GitHub199> zig/master 0bb054e Andrew Kelley: Merge pull request #930 from zig-lang/float-printing...
<GitHub160> [zig] andrewrk closed pull request #930: Finish and fix float printing (master...float-printing) https://git.io/vpUYy
<andrewrk> whew. that was tricky
davr0s has joined #zig
<andrewrk> got kernel threads working on windows, mac, and linux
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
MajorLag has quit [Ping timeout: 240 seconds]
MajorLag has joined #zig
Ichorio has joined #zig
Hejsil has joined #zig
noonien has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Dodo has joined #zig
<Dodo> alexnask: , did you have the comptime Iterators working?
<alexnask> @Dodo Nah sorry I didn't end up getting too much work done yesterday
<alexnask> I'm finishing up a couple of things for typeInfo then I'll take a look :)
<Dodo> oh okey haha, np
<alexnask> I think it will be pretty difficult to achieve but I'll see what the roadblocks are
<Dodo> why'd be difficult? if you for example know at compiletime you have a Range of 0 to 10, you should be able to do anything with it,
<alexnask> Right, any valid zig code that doesn't call syscalls _should_ be comptime evaluatable
<Dodo> because you know that the first item will be 0, then 1 etc...
<alexnask> The issue is pointer casting, because the comptime implementation does not keep stuff in memory with the same layout as runtime
<Dodo> mh, not sure how the ArrayList works with allocation, that might be the only issue
<alexnask> For example, say you have a struct with 2 fields, in comptime you will create an array of 2 ConstExprValues which are basically tagged unions with some data inside
<alexnask> You can't then just cast from a pointer to that struct to a pointer to u8
<alexnask> I mean, there are probably ways to make it work but it's more involved than it sounds :P
<Dodo> mhh haha, fair enough
<alexnask> I'll take a look for sure though
<alexnask> At worst we could probably detect comptime and change the iterface decl for comptime code or smth.
<alexnask> But I think you need a ptrCast no matter what
<alexnask> Even if the whole small buffer/heap allocation thing is patched out at comptime
<Dodo> var array = [N]Item undefined; <-- is this legal?
<Dodo> N is a comptime usize
<alexnask> var array: [N]Item = undefined
<Dodo> oh okey
<Dodo> it'd be sound to just write into it?
<Dodo> I dont want to fill it with 0's, Im just gonna loop, and set each index to what I desire
<alexnask> Yes
<alexnask> There are no issues writing and/or reading, it's just that it's filled with "random" data in the beginning.
<Dodo> oh okey :)
<Dodo> mhhhh I should probably make 'collect_array' return an ![N]Item
<alexnask> @Dodo that array would have to be heap allocated
<Dodo> why?
<alexnask> I mean, if you initialize it in collect_array it will live in its stack frame
<alexnask> Or rather if you declare/define it in collect_array
<Hejsil> You can return [N]T
<Hejsil> By value
<alexnask> Oh right sorry mb
<alexnask> ![N]Item should work too then right?
<Hejsil> Ye
<Hejsil> Though [1000]T is probably a bit to much :)
<Hejsil> Though, if the copy is elided it's fine
<Dodo> I maybe should deinit the array tho
<Dodo> if iterations != N
<Hejsil> That's fine
<Hejsil> Deinit the array?
<Dodo> destroy the items it holds
<Hejsil> Aah
<Hejsil> right
<Hejsil> Ye, probably
<alexnask> If the items need to be deinited, yes
<alexnask> You probably need some metaprogramming magic to check if they have a deinit(&Self) fn and call that
<alexnask> (If you want to do it generically)
<Hejsil> But then again. I don't see any allocation
<Dodo> or have a drop function that does that for me
<Dodo> a generic drop
<Hejsil> Soo self could still own the items
<Hejsil> on error
<Dodo> anyway, that peace of code is more pleasant to read that this: https://github.com/DutchGhost/libaoc/blob/master/src/convert.rs#L256
<Dodo> which does exactly the same, but it's just awkward there xD
<alexnask> Rust macros wird me out
<alexnask> weird*
<Dodo> once pass by value is implemented, collect_array can be much more simple: 'var written = self.collect_slice(array[0..]); if written == N {return array} if written < N {return CollectError.Underflow} else {return CollectError.Overflow}'
<alexnask> Why do you need pass by value for this?
<alexnask> You should be fine to pass the slice byref, no?
<Dodo> but collect_slice uses .map(),
<Dodo> and when using .map(), the Items are passed in by value into the function
<alexnask> Ah, right, collect_slice is the issue, gotcha
<alexnask> That's a pretty clever way to write it btw.
<Dodo> the nice parts of abstractions :)
<alexnask> I have 41 '.special = ConstValSpecialStatic;' in my PR lol
<Dodo> oh look, you can even collect into multiple arrays: https://github.com/DutchGhost/Zigerator/blob/BetterInterface/src/main.zig#L222
<Dodo> using .take() \o/
return0e_ has joined #zig
davr0s has joined #zig
redj_ is now known as redj
Hejsil has quit [Ping timeout: 260 seconds]
Dodo has quit [Quit: Page closed]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
<GitHub107> [zig] andrewrk closed pull request #963: Atomic stack and queue (master...atomic-stack-and-queue) https://git.io/vp4S3
<GitHub35> [zig] andrewrk pushed 1 new commit to master: https://git.io/vpBsg
<GitHub35> zig/master f37e79e Andrew Kelley: Merge pull request #963 from zig-lang/atomic-stack-and-queue...
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
<andrewrk> alexnask, alright! today's the day - pointer reform
ofelas has joined #zig
alexnask has quit [Read error: Connection reset by peer]
alexnask has joined #zig
ofelas has quit [Quit: shutdown -h now]
ofelas has joined #zig
helloworld1234 has joined #zig
helloworld1234 has quit [Client Quit]
Dodo has joined #zig
<Dodo> is there a function that copies one slice into another?
<Dodo> or method,
<MajorLag> std.mem.copy?
Hejsil has joined #zig
<Dodo> oh yeah
<Dodo> why isn't that memcpy? ;o
<Hejsil> Well, it's in the mem part of std
<Hejsil> That kinda implies it's memcpy
<Hejsil> You would probably always call it through the mem namespace: mem.copy
<Dodo> I mean in the implementation, it's a manual loop
<Hejsil> The loop is safer, and if done correctly, the compiler should optimize the loop into @memcpy
<Dodo> oh whoa
jfo has joined #zig
jfo has quit [Remote host closed the connection]
jfo has joined #zig
<Dodo> alexnask, there also should be a library that does parallel iteration ^-^
<Dodo> where it makes sense ofcourse, but there's a few things
<Dodo> how do I compile a lib btw? lib\zig\std\special\bootstrap_lib.zig:6:5: error: expected 3 arguments, found 2 @export("_DllMainCRTStartup", _DllMainCRTStartup);
<andrewrk> Dodo, what command are you running?
<Dodo> ..\zig-0.2.0\zig.exe build-lib .\src\main.zig
<andrewrk> oh I see the problem
<andrewrk> I'll fix it but you'll have to upgrade from 0.2.0 to master to get the fix
<Dodo> I do have a build.zig, first it did everything with a binairy, but I replaced it with staticLibrary
<Dodo> ohh, I'll git clone haha
<GitHub178> [zig] andrewrk pushed 1 new commit to master: https://git.io/vpB4T
<GitHub178> zig/master b709591 Andrew Kelley: zig fmt: respect comments before statements
<GitHub184> [zig] andrewrk pushed 1 new commit to master: https://git.io/vpB4I
<GitHub184> zig/master 5e5eceb Andrew Kelley: fix bootstrap_lib for windows
<andrewrk> argh, I need to stop pushing to master
<GitHub117> [zig] andrewrk pushed 1 new commit to master: https://git.io/vpB4L
<GitHub117> zig/master a0e9f1e Andrew Kelley: fix bootstrap_lib for windows, take 2
<Dodo> do you need to login for a download?
<Dodo> and on the one from ziglang.org I get a 403 forbidden o.O
<andrewrk> oh no I think I accidentally deleted it
<andrewrk> Dodo, wait, you're on windows right?
<Dodo> yess
<andrewrk> so what you want to do is wait for https://ci.appveyor.com/project/andrewrk/zig-d3l86/history?branch=master to finish building "fix bootstrap_lib for windows, take 2"
<andrewrk> then you can get a .zip file of the build for windows
<Dodo> you can watch it compiling live ;o!
<GitHub1> [zig] andrewrk pushed 1 new commit to master: https://git.io/vpBBB
<GitHub1> zig/master ad4ee47 Andrew Kelley: zig fmt: preserve comments before global variables
steveno_ has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
<Dodo> yay it compiles
Dodo has quit [Quit: Page closed]
jfo has quit [Quit: WeeChat 1.9.1]
<GitHub88> [zig] thejoshwolfe pushed 3 new commits to master: https://git.io/vpBRu
<GitHub88> zig/master 8c567d8 Josh Wolfe: Merge pull request #954 from BraedonWooding/patch-2...
<GitHub88> zig/master 07af655 Braedon: Changed to use shifting and masking
<GitHub88> zig/master f6cbe9a Braedon: Utf8 Encode
<GitHub136> [zig] thejoshwolfe closed pull request #954: Utf8 Encoding from Codepoint to Bytes (master...patch-2) https://git.io/vpn4L
steveno_ has quit [Ping timeout: 255 seconds]
steveno_ has joined #zig
Ichorio has quit [Ping timeout: 255 seconds]
<GitHub32> [zig] thejoshwolfe pushed 1 new commit to master: https://git.io/vpB0K
<GitHub32> zig/master 2387292 Josh Wolfe: move some checks around in utf8Encode logic to be more zig idiomatic
<GitHub27> [zig] andrewrk pushed 1 new commit to master: https://git.io/vpB0H
<GitHub27> zig/master c03b901 Andrew Kelley: zig fmt: preserve same-line comment after statement
Hejsil has quit [Quit: Page closed]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
<GitHub2> [zig] thejoshwolfe pushed 1 new commit to master: https://git.io/vpBE1
<GitHub2> zig/master 9543c0a Josh Wolfe: use explicit error sets for utf8Decode functions...
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<GitHub113> [zig] andrewrk pushed 1 new commit to master: https://git.io/vpBuI
<GitHub113> zig/master 3fa0bed Andrew Kelley: zig fmt: array literal with 1 item on 1 line
isd has joined #zig
noonien has quit [Quit: Connection closed for inactivity]
<GitHub134> [zig] andrewrk pushed 1 new commit to master: https://git.io/vpBzd
<GitHub134> zig/master 3235eb0 Andrew Kelley: zig fmt: preserve same line comment after struct field
<GitHub158> [zig] andrewrk pushed 1 new commit to master: https://git.io/vpBgS
<GitHub158> zig/master c53209a Andrew Kelley: zig fmt: comments before var decl in struct