ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
tiehuis has quit [Quit: Bye]
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
hasen_judy has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
hasen_judy has quit [Ping timeout: 246 seconds]
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
_whitelogger has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
hasen_judy has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Client Quit]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
pupppp has joined #zig
puppp has joined #zig
pupppp has quit [Ping timeout: 240 seconds]
hio has joined #zig
puppp has quit [Read error: Connection reset by peer]
puppp has joined #zig
hio has left #zig ["Leaving"]
hasen_judy has quit [Remote host closed the connection]
hasen_judy has joined #zig
<puppp> How do you people think, will zig compile as a 32bit app?
<tankfeeder> it will compile to any target LLVM supports
<puppp> not "compile to", but "compile as" 32bit program
<puppp> it will not run out of memory or anything?
tiehuis has joined #zig
hasen_judy has quit [Remote host closed the connection]
<puppp> src/bigfloat.hpp complained that it can't include "softfloat_types.hpp", what's up with that?
<puppp> oh, sorry, it's in deps/SoftFloat-3d
<puppp> how about moving dependencies to src/third_party?
<puppp> I'm studying mpc-hc source code in parallel, that's how they organize code
<puppp> Actually I'm only studying MediaInfo now, they seem to share some code
<puppp> ...
<puppp> my text editor, by default, searches in all subfolders. I often move things in another folder just to make search faster.
<puppp> so maybe it's better to keep deps in deps
hasen_judy has joined #zig
tiehuis has quit [Quit: Bye]
<tankfeeder> try https://beyondgrep.com
<puppp> nah, should just fix my text editor. I disabled search options myself some time ago, thinking I'll never need it. It made me press enter 2 extra times.
hasen_judy has quit [Remote host closed the connection]
hasen_judy has joined #zig
hasen_judy has quit [Remote host closed the connection]
hasen_judy has joined #zig
hasen_judy has quit [Remote host closed the connection]
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 246 seconds]
puppp has quit [Ping timeout: 248 seconds]
pupp has joined #zig
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
pupp has quit [Read error: Connection reset by peer]
pupp has joined #zig
_whitelogger has joined #zig
hasen_judy has joined #zig
ofelas has joined #zig
hasen_judy has quit [Ping timeout: 246 seconds]
<andrewrk> pupp, the zig compiler only works as 64 bit right now, but when we self host we'll support a 32 bit compiler
<andrewrk> however you can cross compile for 32 bit targets
<pupp> okay, thanks.
<pupp> Learning cmake now
<andrewrk> pupp, why do you need to learn cmake? is the build broken for you?
<pupp> haven't actually tried building with cmake, went for codeblocks build for some reason
<pupp> i'm dumb, as usual
<pupp> dependency management in golang is amasing, you just write "import github/or/something/address", and compiler does everything for you
<pupp> not sure if that's the best way to handle it, I've heard at least one story when project stopped building for him. Probably due to one dependency updating.
<pupp> but that's unrelated
<andrewrk> we'll have something similar
<andrewrk> we're going to have hash version locking though. so if you download a dependency and it doesn't match the hash you expect it's an error. you'll have to go see what's up with your dependency
<pupp> pretty cool
hasen_judy has joined #zig
<andrewrk> this is release weekend
hasen_judy has quit [Ping timeout: 246 seconds]
<andrewrk> planning on pulling the trigger for 0.1.0 first thing monday
<GitHub134> [zig] andrewrk pushed 2 new commits to master: https://git.io/vd1BJ
<GitHub134> zig/master 0bc8041 Andrew Kelley: implement os.makeDir for windows
<GitHub134> zig/master 8d3eaab Andrew Kelley: implement std.os.ChildProcess for windows
<GitHub37> [zig] andrewrk pushed 1 new commit to master: https://git.io/vd1Bt
<GitHub37> zig/master a68dc65 Andrew Kelley: fix os.makeDir for posix
pupp has quit [Ping timeout: 240 seconds]
pupp has joined #zig
<GitHub44> [zig] andrewrk pushed 1 new commit to master: https://git.io/vd1uz
<GitHub44> zig/master 0307dc0 Andrew Kelley: organize windows utility functions
<pupp> It compiled, but when I try to run "zig build helloworld.zig", it prints "Unable to find zig lib directory. Reinstall Zig or use --zig-install-prefix."
<andrewrk> pupp, what OS?
<pupp> windows
<andrewrk> wherever your zig.exe is, you need to put the standard library in the same folder
<andrewrk> in the git repo it's the std/ folder
<andrewrk> actually you should use the lib/ folder from your build directory, because it will be (intentionally) missing some rather large test files that you don't need
<andrewrk> pupp, oh yeah definitely copy from the build folder, the `lib/` folder
<andrewrk> because you need the other stuff in there too
<pupp> hm, what is the build folder? Don't see one.
<pupp> CMakeFiles?
<andrewrk> CMakeFiles is inside the build dir
<pupp> aha, the "zig" folder
<andrewrk> did you see the instructions, btw?
<pupp> By the way, this is mine issue https://github.com/zig-lang/zig/issues/528
<pupp> i'm not downloading that halfgigabyte archive to not create load on server
<andrewrk> oh you are using mingw?
<pupp> yep
<andrewrk> the build dir is the cwd when you ran cmake
<andrewrk> I think maybe you just forgot to run `make install`
<pupp> then it's "zig"
<pupp> maybe
<pupp> yes, I forgot
<andrewrk> note that I am still working out a few issues on windows: https://github.com/zig-lang/zig/issues/302
<pupp> Strange that it got installed in C:\Program Files (x86)\zig\, 64bit programs usually get installed in just "Program Files".
<pupp> and yes, it's a 64bit zig.exe, I checked.
<andrewrk> for a development version of zig, which is what you're making if you're building from source, it's recommended to use the build dir also as the install dir
<andrewrk> for mingw I believe these instructions are correct: https://github.com/zig-lang/zig#debug--development-build
<andrewrk> I'd like to remind you that I mingw zig build is not supported yet
<andrewrk> this is release weekend; after we launch we will have automatic builds provided for windows
<pupp> Should I just silently wait? I feel like I'm only distracting.
<andrewrk> it's ok, but if you run into a bug I'm not going to look at it yet
<andrewrk> I just don't want to get judged for something I haven't tried to get working yet :)
<GitHub39> [zig] andrewrk pushed 2 new commits to master: https://git.io/vd12n
<GitHub39> zig/master ad6eec9 Andrew Kelley: fix regressions from previous commit on windows
<GitHub39> zig/master 61d715d Andrew Kelley: implement std.os.symLink for windows
<pupp> got it to work, it compiled hello world.
<GitHub113> [zig] andrewrk pushed 1 new commit to master: https://git.io/vd1aZ
<GitHub113> zig/master 531f334 Andrew Kelley: implement std.os.rename for windows
<andrewrk> pupp, great. out of curiosity are you targeting 32bit or 64bit?
<pupp> I just typed "zig build-exe hello.zig", result is 64bit
<pupp> don't know how to build 32bit yet
<pupp> it's 137 kilobytes
<pupp> hello_windows.zig
<andrewrk> zig build-exe hello_windows.zig --target-os windows --target-arch i386 --target-environ gnu
<andrewrk> see also `zig targets`
<andrewrk> use whatever one says "native" for environment
<GitHub106> [zig] andrewrk pushed 1 new commit to master: https://git.io/vd1Vq
<GitHub106> zig/master 46352f6 Andrew Kelley: std.io: remove unused constants
<pupp> Well, it works, but zig process never closes for some reason.
<pupp> Also today I learned, that if you launch some program that misses dll, from command line, it wouldn't report missing dll as it usually does.
<pupp> No messagebox with error, it just quits.
<pupp> Also I wonder how to make freestanding exe with zig.
<andrewrk> pupp, when you say freestanding, what do you mean?
<andrewrk> what is different about the hello_windows.exe binary and a freestanding binary?
<pupp> no stack check, no runtime, dll only
<pupp> minimal size
<andrewrk> I haven't verified this yet, but the stack check might be necessary for ABI correctness on windows
<andrewrk> and you won't get a stack check if you keep your stack frames less than a page size
<andrewrk> what do you mean dll only?
<pupp> It's not necessary, if you don't overflow stack.
<andrewrk> and what do you mean no runtime?
<andrewrk> what runtime is in your hello_windows.exe?
<andrewrk> compiler_rt?
<pupp> I'm not sure exactly what it is, but exe is 150 kb. I guess most of it is runtime?
<andrewrk> I think this is what you want https://github.com/zig-lang/zig/issues/54
<andrewrk> depending on what code you have, llvm might generate calls to memset, memcpy, udivmoddi4, etc
<andrewrk> I just need to link with a .lib instead of a .obj and it should be able to strip unused functions
<andrewrk> oh you can also override the panic function
<andrewrk> in your root source file, `pub fn panic(msg: []const u8) -> noreturn { // your implementation here`
<andrewrk> with optimizations on, however, if you never call @panic then the code should get stripped
<andrewrk> pupp, did you use --release-fast ?
<pupp> no
<pupp> with --release-fast it's 6 kb
<andrewrk> I think that is correctly omitting symbols from compiler_rt.obj and builtin.obj
<pupp> there's still some weird code generated after the WinMain
<pupp> exception handling or something of that sort?
<andrewrk> it just calls exitprocess with success or failure
<andrewrk> what I can do is let you define WinMainCRTStartup yourself
cenomla has joined #zig
<andrewrk> do you want that? I can add that right now
<pupp> That would be useful
<andrewrk> ok then you'll have to manually specify -mconsole or -mwindows
<pupp> ok
<pupp> By the way, this is how color codes got displayed for me
<pupp> [37;1mC:\Program Files (x86)\zig\bin\_.zig:9:43: [31;1merror:[37;1m expected
<pupp> type 'noreturn', found 'void'[0m
<andrewrk> is that cmd.exe?
<pupp> it's windows 7
<pupp> yes, modified though
<pupp> I've seen git printing out proper colored output, I wonder how it did that.
<pupp> Also found some commands that change color for the whole terminal, but that's not exactly useful
<andrewrk> did microsoft really not add colors until windows 10?
<pupp> I think it works, it just needs some googling
<pupp> git is a working example
<andrewrk> good point
<andrewrk> here's the code if you want to play with it: https://github.com/zig-lang/zig/blob/master/src/os.cpp#L951
<andrewrk> I'm going to keep working on getting all the tests passing on windows
<pupp> I'm using cmd.exe + ConsoleZ/Console2 + clink, much more comfortable than just raw cmd.exe
<pupp> ok
<andrewrk> can you check if colors work in raw cmd.exe?
<pupp> sure
<pupp> ...
<andrewrk> also I added code to detect a mingw terminal and make colors work there
<pupp> raw cmd.exe works the same way
<andrewrk> ok thanks
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 246 seconds]
<pupp> SetConsoleTextAttribute
<pupp> There's probably other way too
<andrewrk> I will try it
<pupp> this also shows how to use windows unicode
<andrewrk> thanks
<andrewrk> pupp, another idea besides making you implement WinMainCRTStartup, is you could set `main` to have return type `noreturn`
<andrewrk> then we could avoid calling exit process for you
<andrewrk> i mean this will not work status quo, I'd need to add code to check for that
<pupp> on windows, returning from main has same effect as calling ExitProcess
<pupp> you probably shouldn't mark main as noreturn just due to that
<pupp> but i don't know
<andrewrk> "returning from main" is a libc concept
<andrewrk> inside libc it calls ExitProcess