ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
defenestrator has joined #zig
<defenestrator>
Hello, I'm trying to get started with zig on OS X (from the latest on github) , and I'm having trouble compiling the "Hello world" program in the docs.
<defenestrator>
I'm getting "====parse:==== /Users/justin/src/zigstuff/hello/hello.zig:5:43: error: expected Semicolon, found LParen var stdout_file = try std.io.getStdOut(); ~ error: ParseError
<defenestrator>
Should I be expecting problems right now or did I do something wrong?
jfo has joined #zig
jfo has quit [Ping timeout: 265 seconds]
<defenestrator>
andrewrk:
<andrewrk>
hi defenestrator
<andrewrk>
are you using 0.1.1 from homebrew, or master branch compiled from source?
<andrewrk>
are you trying to use the self hosted compiler?
<andrewrk>
it's not ready yet - for now use the stage1 compiler (the one built by cmake)
<defenestrator>
I'll double check, but I'm pretty sure I'm using stage1
<defenestrator>
I think I tried stage2 and it didn't even like the build command
<andrewrk>
yeah, it's a work in progress
steveno_ has joined #zig
<defenestrator>
ohh
<defenestrator>
okay, I think I was using build/zig
<defenestrator>
but I just tried build/bin/zig and that works fine
<defenestrator>
weird, I thought I tried that before, but I must not have
<defenestrator>
sorry, user error :)
<andrewrk>
no worries. what you tried to do will work eventually
steveno_ has quit [Quit: Leaving]
<andrewrk>
I just patched llvm to give us llvm.coro.sizeof(fn_ptr) so that we can find out the number of bytes to allocate for a coroutine before calling i t
<andrewrk>
hopefully they like the idea and accept the patch
jfo has joined #zig
jfo has quit [Ping timeout: 240 seconds]
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<GitHub45>
zig/master cbbd6cf Andrew Kelley: add an assert to catch #777...
mal`` has quit [Ping timeout: 256 seconds]
cenomla has quit [Quit: cenomla]
mal`` has joined #zig
davr0s has joined #zig
jfo has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jfo has quit [Remote host closed the connection]
davr0s has joined #zig
jfo has joined #zig
jfo has quit [Remote host closed the connection]
jfo has joined #zig
jfo has quit [Remote host closed the connection]
jfo has joined #zig
jfo has quit [Remote host closed the connection]
jfo has joined #zig
jfo has quit [Ping timeout: 255 seconds]
jfo has joined #zig
jfo has quit []
arBmind has joined #zig
arBmind has quit [Quit: Leaving.]
hoppetosse has joined #zig
jfo has joined #zig
<jfo>
wait actually this makes me want to know why there are two zig executables in `build` and `build/bin`... are they not linked or the same thing?
<jfo>
I just realized I've been using `build/zig` but I haven't run into any issues like that yet...
hoppetosse has quit [Ping timeout: 252 seconds]
hoppetosse has joined #zig
hoppetosse has quit [Quit: Leaving]
jfo has quit []
Hejsil has joined #zig
<andrewrk>
jfo, it's a cmake thing
<andrewrk>
bin/zig is the real one
<andrewrk>
(and only exists after you make install)
cenomla has joined #zig
cenomla has quit [Quit: cenomla]
defenestrator has joined #zig
<defenestrator>
Is there syntax to specify a string literal that includes no newlines but can be described across multiple lines in source?
<andrewrk>
defenestrator, you can use double quotes and the ++ operator
<andrewrk>
++ is compile-time string concatenation
<defenestrator>
ah, cool, thanks.
<andrewrk>
we also have ** for compile-time array multiplication
<andrewrk>
if you want to repeat a string N times (useful for zero initialization)
defenestrator has quit [Ping timeout: 260 seconds]
<MajorLag_>
I forget, are we expecting to get traceback from runtime safety asserts on Windows when llvm6 hits?
<andrewrk>
MajorLag_, you'll be able to open it in msvc and use that as a debugger
<andrewrk>
there is still more work to do to print a stack trace directly in the terminal
<MajorLag_>
That's a shame. I don't use msvc. I've been having to add warn statements in a binary-search kind of method to locate the sources of integer overflows and oobs.
<MajorLag_>
Does the runtime safety assert call my panic handler if I provide one? And if so, is there a way to determine the source line number from that?
<andrewrk>
MajorLag_, yes it does
<andrewrk>
that's exactly what the default panic handler does on linux
<andrewrk>
we'd have to figure out how to use the COM API from zig
<andrewrk>
but we'll have to cross that bridge eventually, I think
<MajorLag_>
Well it's a place to start anyway. I could have saved myself probably 7 hours of debugging so far if I'd had line numbers this whole time, so it's worth me looking in to it.
<andrewrk>
MajorLag_, yeah I'm sorry about that. it's not really fair to have the linux debugging situation more advanced than windows. it kind of shows bias in the zig project. but I want to make it better and make windows a first class supported citizen
<MajorLag_>
It's alright, it's still experimental. One expects these kinds of things.
<MajorLag_>
And I seem to be more productive with Zig than C, and it's likely C would take me longer to debug anyway since I wouldn't even have these asserts because I'm too lazy to add them myself.
<andrewrk>
awesome. I'm really happy to hear that.
<andrewrk>
at the end of the day it's not about the bells and whistles and fancy programming language concepts, it's about being productive
<andrewrk>
I believe that's all the components you need to get stack traces working in zig (apart from figuring out how to call these functions and link against the correct libraries in the first place)
Ichorio has joined #zig
<andrewrk>
MajorLag_, I think you're going to be happy when we have windows stack traces. after error return traces landed, I've barely needed to use a debugger when working on zig code
arBmind has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]