ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
hoppetosse has quit [Ping timeout: 264 seconds]
steveno_ has joined #zig
Tobba has quit [Ping timeout: 240 seconds]
cenomla has joined #zig
steveno_ has quit [Quit: Leaving]
davr0s has joined #zig
cenomla has quit [Remote host closed the connection]
tiehuis has joined #zig
<GitHub194> [zig] tiehuis pushed 1 new commit to master: https://git.io/vxJDP
<GitHub194> zig/master d6e84e3 Marc Tiehuis: Add WebAssembly output workaround for LLVM 6
<tiehuis> jfo: I added a workaround to master for that environment parsing issue when trying to get wasm output
<tiehuis> if you have llvm configured with the wasm backend then you shouldn't need any extra configuration
<tiehuis> i'll also enable that backend in the docker image so you won't necessarily have to do a full compile yourself
<tiehuis> will get that pushed to docker hub tomorrow when i re-compile
hoppetosse has joined #zig
jfo has joined #zig
<jfo> tiehuis: cool! I'm looking forward to working on that more in the near future
jfo has quit [Client Quit]
<tiehuis> awesome. I have to say, it's pretty great not needing emscripten/binaryen and all that to do compilation
tiehuis has quit [Quit: WeeChat 2.0.1]
jfo has joined #zig
<jfo> yeah... I'm really interested in how webassembly will develop. I have always been interested in it but every time I have given it a try I've been immediately confounded by the massive emscripten output, I just couldn't understand why I couldn't simply compile an object file and load it into js land
<jfo> of course that was always possible, but emscripten is heavy because it's polyfilling the stdlib and building all sorts of bridges back to the browser api
<jfo> I really want to write about this because I feel like wasm in its current form is very confusing to most people... it's really interesting and powerful but there are significant implications about library compatibility and the runtime etc that are really lost in the shuffle
jfo has quit [Ping timeout: 240 seconds]
jfo has joined #zig
<jfo> but of course I have to fully understand it myself first :)
jfo has quit [Ping timeout: 260 seconds]
jfo has joined #zig
<MajorLag> andrewrk: it looks like my issues with comptime error handling were either me doing something wrong when I was debugging or they were fixed with the other comptime patches. There is some strange @compileLog() behavior related to comptime loops, but I'm not entirely sure it doesn't make sense in some way I'm not clear on. I'll post an issue regardless.
jfo has quit [Ping timeout: 260 seconds]
jfo has joined #zig
hoppetosse has quit [Ping timeout: 260 seconds]
hoppetosse has joined #zig
<MajorLag> actually, I think this is expected. Does this make sense to you: when @compileLog is encountered in comptime in a function, we stop executing once we exit that function?
<andrewrk> MajorLag, I think I would need to see a code snippet to answer in a helpful way
<andrewrk> @compileLog does create a compile error, so it's quite possible that the compile error mechanism stops further analysis in some way
<andrewrk> my original intention would be that it would not modify analysis other than adding compile errors to prevent an actual build
steveno_ has joined #zig
davr0s has quit [Ping timeout: 246 seconds]
Hejsil has joined #zig
Hejsil has quit [Client Quit]
Hejsil has joined #zig
<MajorLag> based on what you're saying, this isn't the expected behavior, so I should make an issue.
<andrewrk> let me consider this example for a few minutes
<MajorLag> ok. I notice that the results in that paste are slightly older than the code. I added the @compileLog("result: ", i); line.
jfo has quit [Ping timeout: 246 seconds]
<andrewrk> MajorLag, thanks for the example. I agree this is not expected behavior, and I understand what is causing it
<andrewrk> I have a lot going on today - I would appreciate a writeup. but I think the solution will be straightforward
<andrewrk> s/writeup/a github issue with this example code/
<Hejsil> Should we have some issue to improve error messages?
<andrewrk> Hejsil, sure. something in particular?
<Hejsil> Things like "try" in functions that doesn't return errors give you something like this:
<Hejsil> test "" {
<Hejsil> fn f() void {
<Hejsil> }
<Hejsil> f();
<Hejsil> const T = @typeOf(this).ReturnType;
<Hejsil> const K = @typeOf(this).ReturnType; // error: type '(block)' does not support field access
<Hejsil> }
<Hejsil> Ops
<Hejsil> Wrong paste
<Hejsil> Lol
<Hejsil> error: expected type '[]u8', found '@typeOf(Allocator_alloc).ReturnType.ErrorSet'
<andrewrk> ah yes we need a better error message for this
<Hejsil> This "expected x, found y" are rarely the most helpful error messages either :)
<andrewrk> one thing we could add is a note for each type saying "declared here" if it is a struct or other aggregate type
<andrewrk> oh, I have a framework started for making these error messages better
<andrewrk> that's the implicit cast failure error
<andrewrk> and I added code to make implicit cast failure return detailed recursive information on why the implicit cast failed
<andrewrk> but most of that information is unused and we just print "expected x, found y"
<Hejsil> Nice
<Hejsil> Well, I can imagine the error messages will get better
<andrewrk> it's currently used only for error sets, when an error set cannot be implicitly casted to another one
<andrewrk> then it explains which error codes are missing from the destination set
<andrewrk> the philosophy of the c++ compiler is "get it to work and make sure it's tested"
<andrewrk> the philosophy of the self hosted compiler is "make sure it's perfect before moving on"
<Hejsil> Self hosted is pretty hype
<Hejsil> Zig is soo much nicer that C++
<Hejsil> Isn't the "declarations make new scopes" legacy from when goto was a thing?
<Hejsil> Ooh wait, no.
<Hejsil> I just remembered reading the "declaration makes new scopes" in the goto thread
<Hejsil> But ofc, to introduce variables mid function, a new scope is required
<MajorLag> andrewrk: #832
jjido has joined #zig
Ichorio has joined #zig
<andrewrk> Hejsil, it makes sense even from a debug info perspective. consider that until you step over a given variable declaration, that variable should not be in scope yet according to gdb
davr0s has joined #zig
jfo has joined #zig
Tobba has joined #zig
cenomla has joined #zig
jfo has quit [Ping timeout: 246 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
jfo has joined #zig
steveno_ has quit [Remote host closed the connection]
<aiwakura> build is failing for me on MacOS
<aiwakura> could just be some weird stuff in my work machine
<andrewrk> aiwakura, master branch is passing on travis MacOS. is this the libxml thing?
<andrewrk> can you give more details?
<aiwakura> lld build is failing actually. lol.
<andrewrk> can you do make VERBOSE=1 and pastebin the command used to compile COFF/Driver.cpp
<aiwakura> this is using clang 6, but fails with the same error with apple's clang
<andrewrk> you're using a different compiler to build zig as was used to build llvm/clang
<andrewrk> you have to use whatever homebrew used. which is apple's clang, which is giving the same error, correct?
<andrewrk> the error you pastebinned is looking at llvm 6.0.0 libc++. that's not the same libc++ that homebrew used for llvm/clang
<andrewrk> I think you need to delete your build folder, create a new one, and then make sure to run cmake with the same compiler that homebrew used
<aiwakura> let me try
<andrewrk> aiwakura, ^
<aiwakura> wait I know what's going on...
<aiwakura> I was cloning my fork which is not up to speed with master
<aiwakura> lame
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<andrewrk> aiwakura, is it working now?
<andrewrk> jacobdufault, I'll try to get to your PR tonight. thanks for waiting. I've been busy the past couple days
<aiwakura> yeah it's working
<aiwakura> sorry ;)
<andrewrk> np, glad it worked out
<jacobdufault> andrewrk: no worries, thanks. The bit I'm confused about is why everything is unresolved
davr0s has joined #zig
<andrewrk> jacobdufault, what's your test input? one thing to note is that zig has lazy evaluation of top level declarations
<andrewrk> so the declaration has to reachable from an exported top level decl or a test
<andrewrk> `zig json` would probably be interested in setting some flag to check all declarations regardless of whether they are referenced
jfo has quit [Ping timeout: 260 seconds]
<jacobdufault> yes, build-exe will correctly resolve the declarations though
<jacobdufault> the test input is the same as in the comment
<andrewrk> yeah and it should at least have declarations for standard panic since you didn't override it
<andrewrk> I'll have a look
Hejsil has quit [Read error: Connection reset by peer]
noonien has quit [Quit: Connection closed for inactivity]
<andrewrk> jacobdufault, I added a comment onto the PR, I hope this can unblock you
<andrewrk> let me know if you have any more questions
cenomla has quit [Quit: cenomla]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<aiwakura> andrewrk, isn't zig built with debug symbols by default anymore?
<andrewrk> aiwakura, the default mode of zig builds is Debug, which comes with debug symbols
<andrewrk> the default cmake build type of the zig c++ compiler is Debug, which comes with debug symbols
<andrewrk> what are you observing?
cenomla has joined #zig
jfo has joined #zig
<aiwakura> gdb -ex=r --args zig build-exe main.zig
<aiwakura> can't step through the compiler code though
<andrewrk> macos?
<aiwakura> this is Debian
<andrewrk> it works for me. what cmake command did you use
<andrewrk> you can also try: readelf --debug-dump=info zig
<andrewrk> you should get about 15 million lines of output
<aiwakura> hahahha
<aiwakura> I'm using the default options
<aiwakura> rebuilding just to be safe
davr0s has joined #zig
<aiwakura> it works now. oh well.
cenomla has quit [Quit: cenomla]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ichorio has quit [Read error: Connection reset by peer]
meena has quit [Ping timeout: 276 seconds]
meena has joined #zig
jfo has quit [Ping timeout: 246 seconds]
davr0s has joined #zig
jfo has joined #zig
jjido has quit [Ping timeout: 240 seconds]
steveno_ has joined #zig
<GitHub103> [zig] andrewrk pushed 1 new commit to master: https://git.io/vxTas
<GitHub103> zig/master 7f7823e Andrew Kelley: fix casting a function to a pointer causing compiler crash...
<GitHub31> [zig] AndreaOrru pushed 2 new commits to master: https://git.io/vxTa4
<GitHub31> zig/master 2a6ad23 Andrea Orru: Merge branch 'master' of https://github.com/zig-lang/zig
<GitHub31> zig/master 2cdd50c Andrea Orru: Panic instead of segfault when returning generic type from functions...
steveno_ has quit [Remote host closed the connection]