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 quit [Ping timeout: 256 seconds]
redj has joined #zig
scientes_ has joined #zig
scientes_ has quit [Ping timeout: 263 seconds]
wilsonk has joined #zig
<wilsonk> anyone around?
<andrewrk> wilsonk, hi
<wilsonk> zig build --build-file ../build.zig test is giving me a segfault on Ubuntu 16.04 and I am not sure why?
<wilsonk> bt: Program received signal SIGSEGV, Segmentation fault. 0x0000000000f91236 in llvm::DenseMapInfo<unsigned int>::isEqual (LHS=@0x5: <error reading variable>, RHS=@0x7fffffffcc60: 4294967295) at /usr/lib/llvm-5.0/include/llvm/ADT/DenseMapInfo.h:88 88 return LHS == RHS;
<wilsonk> I could pastebin the full output if that would help
<andrewrk> that would help
<wilsonk> ok, one second
<andrewrk> this is trying to test the zig compiler?
<wilsonk> just following the build instructions for posix
<wilsonk> so: zig build --build-file ../build.zig test
<andrewrk> hmm that's really strange. my best guess is that ubuntu has patched LLVM headers in an ABI-incompatible way
<wilsonk> hmm
<andrewrk> wilsonk, would you be willing to try these packages instead of the system ones? http://apt.llvm.org/
<wilsonk> I posted an issue ten minutes ago that might be relevant, I suppose
<andrewrk> ah I see it
arBmind has joined #zig
<wilsonk> wow, that is the first time I have screwed a linux system into the ground in a while!! :( I just accidently changed all the ownership permissions of my /bin and /etc directories to my user instead of root!! This could take a while to fix, since I can't sudo now (and can't get root)!!! FAAAKKK
<wilsonk> I will have to reboot and probably won't be back for a bit andrewrk...I will check back in as soon as I can :(
wilsonk has quit [Quit: Page closed]
<andrewrk> and that is why I recommend -DCMAKE_INSTALL_PREFIX=$HOME/local
<GitHub64> [zig] andrewrk pushed 1 new commit to master: https://git.io/vNEQz
<GitHub64> zig/master ea623f2 Andrew Kelley: all doc code examples are now tested...
_whitelogger_ has joined #zig
_whitelogger has quit [Ping timeout: 276 seconds]
wilsonk has joined #zig
<wilsonk> I am not holding my breath that everything is fixed...but at least I got the system back up ;) Cripes
<wilsonk> Thank god this isn't a production system!
<andrewrk> nice
<wilsonk> I bet I haven't done anything that stupid in 12-14 years!! I have been on Linux a LONG time but just got distracted. Blech
<GitHub0> [zig] andrewrk pushed 1 new commit to master: https://git.io/vNE5I
<GitHub0> zig/master 2c25c8a Andrew Kelley: docs: remove references to %% prefix operator...
<wilsonk> Ok, I see what I did. I typed 'sudo make install' to install zig instead of just 'make install'...that is part of what confused me. Ok, now I have installed the clang version you recommended and things built without a problem but I am getting a new error when trying to run the tests. I will post it to the github issue
<andrewrk> ok
<andrewrk> wilsonk, good night. I'll be around tomorrow
<GitHub182> [zig] andrewrk pushed 1 new commit to master: https://git.io/vNEdX
<GitHub182> zig/master 21e8ecb Andrew Kelley: readme: specify that we need exactly llvm 5.0.1...
arBmind has quit [Quit: Leaving.]
arBmind has joined #zig
arBmind has quit [Client Quit]
alexm_ has joined #zig
scientes_ has joined #zig
scientes_ has quit [Ping timeout: 260 seconds]
m6w6 has quit [Quit: ZNC - http://znc.in]
m6w6 has joined #zig
m6w6 has quit [Read error: Connection reset by peer]
m6w6 has joined #zig
m6w6 has quit [Quit: ZNC - http://znc.in]
m6w6 has joined #zig
m6w6 has quit [Client Quit]
m6w6 has joined #zig
arBmind has joined #zig
Hejsil has joined #zig
<andrewrk> hi Hejsil
<Hejsil> Yo
<andrewrk> looks like you got to an exciting checkpoint in pokemon randomizer
<andrewrk> my girlfriend is into pokemon; I'm excited to show her a demo of your project when it's ready :)
<Hejsil> Nice :)
<Hejsil> If she likes randomized Pokemon roms, the Universal Randomizer exists though
<andrewrk> ahh
<andrewrk> what does your project plan to do differently?
<Hejsil> But the project seem to be dead now, soo~
<andrewrk> I see
<Hejsil> Well, I want to implement some "game modes"
<Hejsil> I have ideas
<Hejsil> But first, I wonna get the "fundamentals" done
<Hejsil> Randomizing trainers and wild mons
<andrewrk> cool
<Hejsil> Btw, you might want to find a way to test expressions in the docs. As far as I know, the example in the operator table under catch is wrong :)
<Hejsil> const value: %u32 = null;
<andrewrk> ahh, thanks. I was thinking about that
<Hejsil> but nice work on the doc testing
<Hejsil> That'll help it stay up to date
<andrewrk> that was so much work. I am exhausted
<Hejsil> lol
<andrewrk> and now I need to implement std.os code for directory listing for MacOS and Windows
<Hejsil> So you're gonna sit with 3 computers again?
<Hejsil> Or, i guess 2
<andrewrk> yes
<Hejsil> ooh boy
<andrewrk> 3 because I have to run the tests on linux to make sure I didn't regress :)
<Hejsil> Well, have fun with that :)
aiwakura has quit [Quit: The Lounge - https://thelounge.github.io]
aiwakura has joined #zig
<alexm_> hey guys can you define a function like this in zig "fn map2 (n : usize,items : [n]u8)->[n]u8" ?
<andrewrk> alexm_, yes, where `n` is a compile-time known value
arBmind has quit [Quit: Leaving.]
<andrewrk> what is the function supposed to do?
<alexm_> im basically trying to write a function where you pass an array and a function and it applies the function to each element and returns a new array
<andrewrk> alexm_, of the same size?
<alexm_> yeah
<andrewrk> a new array, so you want the new one to be allocated on the heap?
<alexm_> yep
<alexm_> so applying fn(x:i32) -> i32{return x+1} to [1,2,3] will result in [2,3,4]
<andrewrk> just a sec
<alexm_> great and the type of the array is also polymorphic
<andrewrk> and the size can be known at runtime
<alexm_> I'll try to write some more functional style programs in zig
<andrewrk> sounds challenging
<Hejsil> Well, he could write a garbage collection allocator and just use that in all of his code :)
<andrewrk> I know you're kidding, but I wonder how that would work
<andrewrk> what do you do about dangling pointers if you have a garbage collector in userland?
<Hejsil> Idk. I've never really written a garbage collector
<Hejsil> As far as I know, there exists userland garbage collectors in C, soo
<Hejsil> And a standard Mark and Sweep collector would move the memory around, soo no dangling pointers?
<Hejsil> Im not sure lol
<Hejsil> wouldn't
<Hejsil> *
<alexm_> yeah i know of a C/C++ garbage collector
<alexm_> its made by hans boehm
<Hejsil> andrewrk, linking against c standard lib on windows. Easiest way?
<Hejsil> In Zig that is
<andrewrk> Hejsil, I believe it should work out of the box, and all you need to do is `--library c`
<Hejsil> Well, I remember that not working at some point
<andrewrk> if it does not work now, it's a new bug
<Hejsil> And now i get "error: UncleanExit"
<Hejsil> And then no stacktrace
<Hejsil> Which we know why
<andrewrk> there should be something printed above that
<Hejsil> error: link failed
<andrewrk> and linker error messages?
<Hejsil> All i get
<andrewrk> when I've run into errors like these on windows, I've had to use the llvm6 branch, because the windows debugging experience is better
<Hejsil> Hmm
<andrewrk> I think LLD is only giving us error: link failed, and in llvm 6 it gives better error messages
<Hejsil> Well, i guess it can wait
<andrewrk> what do you need --library c for ?
<Hejsil> std.heap.c_allocator
<andrewrk> can I suggest doing something like this, for now? https://github.com/zig-lang/zig/blob/master/std/special/build_runner.zig#L17
<andrewrk> I can work on a std lib heap allocator soon
<andrewrk> err, I mean a general purpose allocator
<Hejsil> Well, I guess I could allocate 500mb like that lol
<Hejsil> It's for the randomizer btw
<andrewrk> yeah
<andrewrk> it looks like llvm 6 will release on time, which is scheduled for feb 21
<Hejsil> Anyways. It was mostly to test my implementation of seekTo and getPos on windows in the std
<Hejsil> Because the randomizer uses those alot
<andrewrk> ahh
<Hejsil> Oooh, well. Did test it in some smaller code, and it seems to work. I'll probably just make a PR now
<andrewrk> :D
<Hejsil> :)
<Hejsil> Idk, if I handle all windows errors correctly. Couldn't find a source for what kind of errors you get from GetLastError after calling different functions
<Hejsil> Aka, errors from SetFilePointerEx
<andrewrk> I couldn't find that either for a lot of stuff, which is why I made that unexpectedErrorWindows function
<Hejsil> Ye, I just ended up using that too
<andrewrk> we almost can get rid of the dumpStackTrace part of it, since we have error return tracing
<andrewrk> ...if we knew how to parse debug symbols on windows
<Hejsil> The struggle
<Hejsil> PR for you
<GitHub181> [zig] Hejsil opened pull request #710: Implemented windows versions of seekTo and getPos (master...seekto-getpos-windows) https://git.io/vNzfE
<Hejsil> Ooh shoot. Didn't have to say anything
Hejsil has quit [Quit: Page closed]
Hejsil_ has joined #zig
<andrewrk> Hejsil_, I added review comments
<Hejsil_> On it!
<GitHub111> [zig] andrewrk pushed 1 new commit to master: https://git.io/vNzTk
<GitHub111> zig/master 613c4db Andrew Kelley: temporary workaround for os.deleteTree not implemented for windows/mac...
<Hejsil_> andrewrk, Next batch of commits is here
<Hejsil_> Hopefully this fixes the problems
<andrewrk> Hejsil_, looks good! I should add some std lib tests for this
<GitHub2> [zig] andrewrk closed pull request #710: Implemented windows versions of seekTo and getPos (master...seekto-getpos-windows) https://git.io/vNzfE
<GitHub126> [zig] andrewrk pushed 7 new commits to master: https://git.io/vNzLO
<GitHub126> zig/master 8be606e Jimmi Holst Christensen: Now using the right unexpectedError in seekForward
<GitHub126> zig/master a76023b Jimmi Holst Christensen: Removed PLARGE_INTEGER
<GitHub126> zig/master 90714a3 Jimmi Holst Christensen: Implemented windows versions of seekTo and getPos
<GitHub5> [zig] andrewrk pushed 1 new commit to master: https://git.io/vNztS
<GitHub5> zig/master 9f5c0b6 Andrew Kelley: windows-compatible os_rename function...
cenomla has joined #zig
<GitHub42> [zig] andrewrk pushed 1 new commit to master: https://git.io/vNzYF
<GitHub42> zig/master 890bf00 Andrew Kelley: os_rename uses MoveFileEx on windows
arBmind has joined #zig
alexm_ has quit [Ping timeout: 260 seconds]
Hejsil_ has quit [Read error: Connection reset by peer]