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]
<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
<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?