ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
arBmind has quit [Quit: Leaving.]
<GitHub92> [zig] ibara opened pull request #551: Add OpenBSD support (WIP) (master...master) https://git.io/vdd4X
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 255 seconds]
scurest has quit [Quit: Page closed]
tiehuis has joined #zig
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 246 seconds]
achambe has joined #zig
Andris_zbx has joined #zig
tiehuis has quit [Quit: WeeChat 1.9.1]
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 252 seconds]
arBmind has joined #zig
_whitelogger has quit [K-Lined]
_whitelogger has joined #zig
arBmind has quit [Quit: Leaving.]
achambe has quit [Ping timeout: 260 seconds]
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 252 seconds]
arBmind has joined #zig
arBmind1 has joined #zig
arBmind has quit [Ping timeout: 252 seconds]
hasen_judy has joined #zig
hasen_judy has quit [Remote host closed the connection]
hasen_judy has joined #zig
pupp has joined #zig
Dimenus has joined #zig
<Dimenus> does anyone here compile Zig in debug on a regular basis?
<pupp> well, I compile zig with debug info, I'm on windows though
<Dimenus> i am also on windows
<pupp> compiler?
<Dimenus> MSVC x64 2017
<pupp> I'm with mingw
<Dimenus> i should back up, I was originally getting linker errors in the zig debug build
<Dimenus> so I thought it was the clang install I had which was compiled in release mode
<Dimenus> i would prefer mingw to be honest......
<Dimenus> i just ran into the issue where the compiler doesn't exist cleanly and I didn't know where to add 'TerminateProcess'
<pupp> mingw is quite shit, I warn you
<Dimenus> anyway, I guess I'm just a bit stuck. Do I need to build clang & the associated tools in debug as well?
<pupp> had the same issue, with zig not exiting
<pupp> added TerminateProcess here, just below codegen_link
<pupp> not exactly below
<pupp> about "building associated tools in debug", it seems that the only thing necessary for zig is llvm.dll.
<pupp> and it doesn't matter if it's in debug mode or not
<Dimenus> interesting
<Dimenus> I was getting a lot of linker errors building in debug
<Dimenus> but this was with msvc
<pupp> lld, llvm linker, is in dependencies
<pupp> deps folder
<pupp> I don't know anything about zig though, I'm just learning it myself
<pupp> I used cmake to generate everything
<Dimenus> i'm just going to build it with mingw for now
<Dimenus> see how that goes
<pupp> use msys2 for that, 64bit version
<Dimenus> yeah I'm using msys2
<Dimenus> but the mingw64 shell
<pupp> visual studio is your best bet to be honest, author is developing it with vs at the moment
<Dimenus> yeah, but he's not distributing a debug build of llvm (nor should he have to)
<Dimenus> and I don't know my way around the llvm source
<pupp> I'll try to rebuild llvm too, maybe I'll learn how to build it statically.
Wandsd has joined #zig
<Wandsd> Second example from docs gives error: error: type 'fn() -> ArgIterator' does not support field access
<Wandsd> const nullable_value = if (os.args.count() >= 2) os.args.at(1) else null
<Wandsd> it points to os.args.
hasen_judy has quit [Remote host closed the connection]
<Wandsd> number example doesnt seem to recognise any number or maybe it just doesnt recognise newlines.
hasen_judy has joined #zig
hasen_judy has quit [Remote host closed the connection]
<tankfeeder> wait while andrewrk will wake up
Andris_zbx has left #zig ["Leaving"]
<andrewrk> tankfeeder, hi
<tankfeeder> my words was to Wandsd
<tankfeeder> read above :)
<Dimenus> andrewrk, do you happen to know offhand which clang/llvm project is needed to compile zig?
<Dimenus> or did you just do an ALL_BUILD?
<Dimenus> trying to setup an msvc debug build of zig
<Wandsd> 5.0 says the readme
<Dimenus> sorry, not the version but which projects from the source (a full build is 389 projects)
hasen_judy has joined #zig
dtzWill has quit [Ping timeout: 258 seconds]
dtzWill has joined #zig
hasen_judy has quit [Ping timeout: 252 seconds]
pupp has quit [Ping timeout: 255 seconds]
pupp has joined #zig
<andrewrk> there are instructions for the debug build
<andrewrk> Dimenus, also I do have a pre-built debug tarball which I could upload
<andrewrk> Wandsd, hm my other messages to you did not go through.
<andrewrk> this is the issue for making the docs be automatically tested: https://github.com/zig-lang/zig/issues/465
<Dimenus> andrewrk, I did notsee that post, thank you for that.
<andrewrk> and I believe this is the newline issue: https://github.com/zig-lang/zig/issues/544
<Dimenus> I'll go with that for now, many thanks!
<andrewrk> Dimenus, "-DCMAKE_BUILD_TYPE=Release" in the Debug Mode section is not a mistake
<andrewrk> that's the only way it worked for me, and it did in fact make a debug build
<Dimenus> duly noted
<dtzWill> poking at clashos: https://github.com/andrewrk/clashos while giving Nixpkgs-built Zig a try... I don't have a RPI3 on hand, so I'm using the 'zig build qemu' bit.
<dtzWill> Well lemme first say I'm still /shocked/ that it actually built a freestanding armv7 kernel out-of-the-box and did so quickly
<dtzWill> didn't need to chase down some codesourcery toolchain at a particular year-quarter version or something ;)
<andrewrk> dtzWill, finally somebody appreciates how great cross compiling works :)
<dtzWill> but anyway: Is that "supposed" to work re:running in qemu? I'm getting a blue screen and it outputs "800600" which is curious
<andrewrk> hm I think there was a regression
<andrewrk> I mean, what I had working before was a blue screen, and it printed something more coherent
<dtzWill> okay a quick look through the code suggested that
<andrewrk> haven't had time to look at that yet, but obviously if I find the regression I'll add a test for it in the compiler
<dtzWill> interestingly I see it print things like width x height, lol, but never ${width}${height} haha
<andrewrk> you can actually test it pretty easily with gdb
<andrewrk> I forget what the command is
<dtzWill> okay no worries! I am just trying out various things, and "known" regression is NBD compared to the much scarier silently miscompiling in an environment-specific manner lol
<dtzWill> yeah, I've done that before
<dtzWill> gdb http://wiki.osdev.org/Kernel_Debugging#Use_GDB_with_QEMU or so, although I haven't done it in years :D
<dtzWill> last time I did I was debugging my LLVM-JIT compiled Linux kernel :D
<dtzWill> although I "cheated" and pushed LLVM JIT into the hypervisor layer and added hypercalls for it hehe
<andrewrk> ha
<dtzWill> while I have you, when printing build errors there seems to be ... spurious newlines proportional to the number of errors? Is that a thing? xD
<dtzWill> anyway great stuff
<dtzWill> I still can't believe that this works
<dtzWill> :D
<andrewrk> dtzWill, hmm that doesn't sound familair, feel free to make an issue
<andrewrk> *familiar
<dtzWill> aye aye
<dtzWill> is there a linux platform that's "most" supported/tested with?
<dtzWill> I like to confirm when things are blatantly NixOS-specific before handing things over to upstream xD
<andrewrk> dtzWill, my main dev platform is nixos
<andrewrk> the tetris app works out of the box for me if I use zig build, which is nixos-aware
<andrewrk> let me dig up my nix-shell file
<andrewrk> dtzWill, nix-shell this file, then `zig build play` and I am playing tetris
<andrewrk> it's a bit slow, I'm going to work on that soon
<dtzWill> haha I was doing things like "nix-shell -p epoxy -p glfw -p mesa -p libpng.all"; I'll try what you gave in a sec
<dtzWill> zig build is nixos-aware?! haha :D
<andrewrk> if you use zig standalone on nixos and want to interact with c libraries, do this
<andrewrk> zig build-exe whatever.zig $NIX_CFLAGS_COMPILE $NIX_LDFLAGS
<andrewrk> zig build being nixos aware is just looking at those env vars
<andrewrk> we're not going to support all the c flags, but I don't see the harm in supporting -I -L -l
<dtzWill> hahaha I can't believe it worked
<dtzWill> okay well this is just magical
<dtzWill> well /honestly/ if I can just nix-shell (and presumably this means nix-build aka write nix expressions to build things w/zig) like this.... I'm very happy
<dtzWill> haha
<dtzWill> and yes your example nix-shell did the trick, alrighty then
<andrewrk> :)
<andrewrk> there's still a lot of work to do, but we're off to a good start!
<dtzWill> understood, and agreed!!
<Dimenus> clang in debug build takes so long to compile
<Dimenus> lol
<andrewrk> Dimenus, yeah I pretty much left it overnight
<andrewrk> I'm going to have to do it again, too, because I want to test if llvm master branch fixes debug symbols for windows
<Dimenus> i probably should have done that
<Dimenus> i grabbed release_50
<Dimenus> did they close your ticket?
<dtzWill> j/w, debug builds are significantly more... useful for your debugging experience.. than Release+Asserts?
<dtzWill> only ask because the latter is much faster O:)
<Dimenus> well, some open issues straight up crash :p
<Dimenus> rather than trigger an assert
<andrewrk> the best thing right now is release llvm (no asserts) + debug zig
<andrewrk> I wasn't able to get that working on windows
<andrewrk> it's all release or all debug
<andrewrk> Dimenus, also to reiterate: debug llvm build will not pass some of the zig tests.
xoxo has joined #zig
arBmind1 has quit [Quit: Leaving.]
<Dimenus> andrewrk, yeah I wanted to do debug zig w/ release llvm
<Dimenus> but msvc would not link properly
<Dimenus> it works in mingw
<andrewrk> we could solve this problem by self-hosting :)
<Dimenus> wait, how does self hosting help? don't you still need to call llvm on the backend?
<Dimenus> or is it just msvc + debug llvm fails
<andrewrk> yes we do, but the zig build system can handle mixing c/c++ and zig
<Dimenus> are you thinking of pulling a Jblow and having multiple backends? ;)
<andrewrk> mmm probably not before 1.0.0
<Dimenus> he probably has a larger budget
<andrewrk> we don't have the developer bandwidth to pull that off, yeah
<andrewrk> I have a day job
<Dimenus> this is pretty neat already, I want to at least investigate a few outstanding issues
<andrewrk> I look forward to your contributions
<andrewrk> Dimenus, whatever is interesting to you, go for it. There's also the c-to-zig translation effort, which could be fun to work on. Here are some of the example tests: https://github.com/zig-lang/zig/blob/master/test/parsec.zig
<andrewrk> I think we're going to be able to translate pretty much any C code into zig with correct semantics
<andrewrk> you probably wouldn't want to use it verbatim but it would be a good starting point for porting code
hasen_judy has joined #zig
<Dimenus> i'm slowly writing a video game, so I may work on glfw/opengl
<Dimenus> or just low hanging bugs
<Dimenus> for this issue that I responded to: https://github.com/zig-lang/zig/issues/546
<Dimenus> what would be the correct way to handle that? implicit casting in the compiler itself or to handle the cast in the user program?
<Dimenus> since a u3 is really just a type, there's no real bit boundary
<andrewrk> Dimenus, it's a 1 line fix, just cast the result of charToDigit to T
<andrewrk> T(%return charToDigit(c, radix))
<andrewrk> it's guaranteed to work because charToDigit returns an error if the digit didn't fit in the radix
<andrewrk> or we could make charToDigit generic and take a type parameter instead of u8
<Dimenus> it's not that line that fails though, it's that a is of type u3 above
<Dimenus> I recommended a fix (which I tested previously) was just curious if my rationale was correct
<Dimenus> /handle u2 - u7
<Dimenus> var a = if(@sizeOf(@typeOf(value)) == 1) u8(value) else value;
arBmind has joined #zig
hasen_judy has quit [Ping timeout: 252 seconds]
puppp has joined #zig
xoxo has quit [Ping timeout: 260 seconds]
pupp has quit [Ping timeout: 252 seconds]
<andrewrk> Dimenus, can you paste a diff? I'm not sure which line you're looking at
<andrewrk> Dimenus, ahh I see. I was (mistakenly) looking at the parsing code; you're looking at the formatting code
<Dimenus> you are correct that it's a one line fix though ;)
nightmared has quit [Ping timeout: 264 seconds]
Wanddsd has joined #zig
Wandsd has quit [Ping timeout: 248 seconds]
puppp has quit [Ping timeout: 248 seconds]
Dimenus has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
cenomla has joined #zig
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 258 seconds]
hasen_judy has joined #zig
hasen_judy has quit [Remote host closed the connection]