ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<alexnask>
zig build fails in spawnChildEnvMap, specifically 'const term = child.spawnAndWait() catch |err|'
kammd[m] has quit [Ping timeout: 245 seconds]
lorde_kumamon[m] has quit [Ping timeout: 256 seconds]
raytracer[m] has quit [Ping timeout: 260 seconds]
clebermatheus[m] has quit [Ping timeout: 256 seconds]
dtz has quit [Ping timeout: 255 seconds]
<alexnask>
The child processe's handle is NULL so I guess it's having some trouble spawning zig for some reason
<MajorLag>
Mine doesn't get that far. It compiles the obj, then it starts looking in the registry for the SDK path, which isn't in there, completely ignoring the commandline options I passed it, then it bails.
<alexnask>
Is that with a build file or just calling zig build-exe?
<MajorLag>
just calling the exe. I never got into the habit of using build files because there's basically no documentation for them and my early attempts just crashed.
<alexnask>
Right, this is the first time I'm testing buildfiles on windows so maybe it's not a new issue
<alexnask>
But we appear to be talking about different bugs
<MajorLag>
yeah
<MajorLag>
you're a lot farther a long in the build process. I think this used to work correctly, but looking back the only linking I did with C stuff involved SDL, which it turns out you don't need to link to C runtime to use so the compiler probably ignored those options anyway.
relatingdata has joined #zig
<MajorLag>
....there's an issue in the windows --release-safe/--release-fast code. sometimes calling warn throws an index out of bounds check (or crashes in release-fast)
relatingdata has quit [Ping timeout: 260 seconds]
return0e_ has joined #zig
<MajorLag>
it has something to do with the float value I'm trying to print... weird.
isd has quit [Quit: Leaving.]
<MajorLag>
it happens in linux too, some kind of fmt vs float issue it seems.
<MajorLag>
today has been a remarkably unproductive day
<andrewrk>
MajorLag, I don't consider the std lib float implementation done yet. printing or parsing
<andrewrk>
I have some W.I.P. code
<MajorLag>
yep, my bad not checking for the dup
<andrewrk>
sorry about the regression with lib dirs. I'm pushing a fix now
<GitHub24>
zig/master 96ebd8b Andrew Kelley: fix windows not respecting --msvc-lib-dir, --kernel32-lib-dir...
<andrewrk>
MajorLag, is it convenient for you to test this? ^
<MajorLag>
probably
relatingdata has joined #zig
<MajorLag>
hmm.. closer. "Unable to determine ucrt path"
<MajorLag>
passing that explicitly with -L doesn't seem to help
Braedon has joined #zig
<MajorLag>
interestingly, if I pass it as --libc-lib-dir it then complains about determining the kernel32 path.
<andrewrk>
kernel32 path is --kernel32-lib-dir
<MajorLag>
yeah, I know, that was in there too
<MajorLag>
seems --libc-lib-dir takes priority and confuses it. As I understand it, that's a linux/posix parameter anyway
Braedon has quit [Ping timeout: 260 seconds]
return0e_ has quit []
relatingdata has quit [Quit: Page closed]
relatingdata has joined #zig
isd has joined #zig
relatingdata has quit [Ping timeout: 260 seconds]
relatingdata has joined #zig
raytracer[m] has joined #zig
<relatingdata>
has anyone considered a lambda stype syntax for functions so that rather than `fn foo(bytes: []u8) u32 {` we wold have `const foo: u32 = (bytes: []u8) => {` I have been using this in javascript and looks more natural to me :-) ;-)
isd has quit [Ping timeout: 240 seconds]
clebermatheus[m] has joined #zig
isd has joined #zig
dtz has joined #zig
relatingdata has quit [Quit: Page closed]
lorde_kumamon[m] has joined #zig
kammd[m] has joined #zig
return0e_ has joined #zig
return0e_ has quit [Remote host closed the connection]
isd has quit [Remote host closed the connection]
davr0s has joined #zig
davr0s has quit [Client Quit]
hoppetosse has joined #zig
<GitHub66>
[zig] tiehuis opened pull request #930: Add float rounding and fix negative exponential cases (master...float-printing) https://git.io/vpUYy
hoppetosse has quit [Ping timeout: 260 seconds]
davr0s has joined #zig
hoppetosse has joined #zig
hoppetosse has quit [Remote host closed the connection]
<walac>
What's the differences between this and surrounding them with a comptime block?
<MajorLag>
walac, the first comptime ensures that the expression block to the right is evaluated at comptime. I'm not sure why the comptime in the assert exists, but if you were to wrap the whole thing in a comptime block that would mean the assert would have to happen at compile time. The construction as-is is testing at runtime that comptime expression block produces the correct value.
hoppetosse has quit [Ping timeout: 268 seconds]
<walac>
MajorLag: ah, now I got the picture. iirc, the comptime in both expressions is to make sure those expressions will be evaluated in compilation time, although in practice the compiler probably will even without them
<walac>
Another topic: I would like to inspect the assembly code for the binary generated by zig test, but I see it ignores the --emit for test command. Is there any special reason for that?
hoppetosse has joined #zig
<MajorLag>
I don't work on the compiler, so someone else will have to answer that one. I think you could commment out the `test` line and replace it with `pub fn main() void` and do a build with --emit as a workaround.
<walac>
MajorLag: thanks
l1x has quit [Ping timeout: 276 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
steveno_ has joined #zig
<andrewrk>
walac, you can use objdump on the generated binary
<andrewrk>
which will (for now) be in zig-cache/test
<walac>
andrewrk: I did it with gdb, but originally what I was looking for with --emit is assembly with source annotation. Anyway, I found out what I was looking for :)
<andrewrk>
I'd love to have that feature built into an editor
<andrewrk>
so I could see what my lines of code were producing as I typed them
<alexnask>
Like godbolt but for zig?
<andrewrk>
yes, and built into vim or an IDE or something like that
<andrewrk>
tiehuis actually got godbolt working for zig
<Hejsil>
Wait, someone got compiler explore to work with zig!
<Hejsil>
Anyways, just got my nds loading and saving working with no recursion!
<Hejsil>
It's a good day today
redj has joined #zig
davr0s has joined #zig
<andrewrk>
beautiful
jjido has joined #zig
<andrewrk>
Hejsil, I've been thinking about figuring out how to allow recursion without giving up ability to determine stack upper bound size
<andrewrk>
I was thinking that we could have something like @call(new_stack, function, args...). zig would identify loops in your call graph, and emit a compile error where you would have to use a new stack for a function call in order to address the recursion
steveno_ has quit [Remote host closed the connection]
steveno_ has joined #zig
steveno_ has quit [Quit: Leaving]
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Hejsil>
Hmmm. Interesting. Well, the refactor was needed anyways, so my work wasn't waisted :)
<andrewrk>
certainly not
<Hejsil>
How would you allocate more stack?
<Hejsil>
Some builtin?
<andrewrk>
any allocator, and you can defer a free before the call
<andrewrk>
for example, you could use std.heap.DirectAllocator
<Hejsil>
Iteresting
<andrewrk>
and you would figure out how much bytes to allocate with the builtin function that tells you stack upper bound size for a given function
steveno_ has joined #zig
<Hejsil>
And I guess this would address inferring error sets too? :)
<Hejsil>
For recursion that is
<andrewrk>
hmm I don't think it solves that\
<Hejsil>
Well, If you can detect loops, can't you then also figure out all possible errors?
<andrewrk>
I do think it's possible to make error set inference work even with recursive functions
<andrewrk>
I kinda designed myself into a corner the c++ compiler though, and it would require a lot of rework to fix it