ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
benjikun has joined #zig
Ichorio has quit [Ping timeout: 240 seconds]
jmiven has quit [Quit: co'o]
jmiven has joined #zig
wink_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
wink_ has joined #zig
wink_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
diltsman has quit [Ping timeout: 256 seconds]
diltsman has joined #zig
oconnor0 has quit [Ping timeout: 245 seconds]
oconnor0 has joined #zig
fsateler has quit [Read error: Connection reset by peer]
fsateler has joined #zig
<diltsman> Any idea why adding a function that has "unreachable;" in the body would cause the compiler to generate a .data.relo.ro section?
benaiah` has joined #zig
benaiah has quit [Read error: Connection reset by peer]
benaiah` is now known as benaiah
Zaab1t has joined #zig
Zaab1t has quit [Quit: bye bye friends]
Hejsil has joined #zig
<Hejsil> MajorLag, thanks for the suggestion, but I don't think a binary format is worth it for what I'm trying to do.
davr0s has joined #zig
<c15ade4> zero copy json for the win
MajorLag has quit [Ping timeout: 268 seconds]
MajorLag has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
wilsonk has quit [Read error: No route to host]
oconnor0 has quit [Ping timeout: 252 seconds]
oconnor0 has joined #zig
mht has joined #zig
Zaab1t has joined #zig
Zaab1t has quit [Quit: bye bye friends]
Zaab1t has joined #zig
<MajorLag> Hejsil: *shrug*, serializing to and from text seems like a lot more work to me than a binary representation. Maybe that's because I've already written a serializer/deserializer for working with data formats. Having a program that converts text to the format, and from the format to text solves any human readable and UNIX utility interaction needs. Of course, I'm also one of those people who think PowerShell did the
<MajorLag> r by removing the "(ASCII) text is the universal interface" part, so I guess if you're trying to be really UNIX-y then you'd want to go with text anyway.
<Hejsil> Well, if there is a better solution, I'm all in. As i see it, text seems like the best interface for most of the data I wonna send around these processes. I also don't think the binary format will win me much, as I want different games to have the ability to output different fields, if they exists in those games.
<Hejsil> So, for gen1 games, they're not gonna output sp_defense, as it doesn't exists
<Hejsil> And the text format will make the format very accessible for people who wonna write a pass in Python or something
<Hejsil> And in a way, the games themself are already binary formats and few people wonna write tools for these games because of this.
steveno has joined #zig
scriptnull has joined #zig
oconnor0 has quit [Ping timeout: 244 seconds]
<scriptnull> Hello everyone! I watched andrewrk's talk today ( https://www.youtube.com/watch?v=Z4oYSByyRak ) on zig programming language
<scriptnull> Hearing about it for the first time. It seems interesting. I am going to give it a try tonight!
<Hejsil> scriptnull, nice!
<Hejsil> Anything particular you want work on?
<scriptnull> yeah! I am very much interested in developer tools. So, I hope to do something on that area.
<scriptnull> I noticed that zig does not have syntax highlighting for atom editor
<scriptnull> May be I will look into it!
<Hejsil> Hmm, interesting. The is a Zig parser in the standard library :)
<Hejsil> Might be usefull
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<scriptnull> Thanks! I am totally excited after watching the talk and going through the doc on my uber back to home :D
<scriptnull> hahaha
<scriptnull> like right now :D
<Hejsil> scriptnull, be warned. There is no doc for the standard library
<scriptnull> hmm, ok! I hope the current docs will give me the taste of zig.
<scriptnull> What do you work on Hejsil?
<Hejsil> The language doc is pretty good
<Hejsil> I do some work on the language, some util libs and a Pokémon rom randomizer
<scriptnull> cool!
<Hejsil> There are also some pages on the wiki you might be interested in, once you get started: https://github.com/ziglang/zig/wiki
<Hejsil> The Community, External Projects, Why Zig When There is Already CPP, D, and Rust? and Zig Proposals pages are good to look at
<scriptnull> yeah, I skimmed over "Why Zig When There is Already CPP, D, and Rust?" a while back and loved it. Thanks for resources!
<Hejsil> Np
scriptnull has quit [Remote host closed the connection]
Hejsil has quit [Quit: Page closed]
davr0s has joined #zig
qazo has joined #zig
qazo has quit [Ping timeout: 252 seconds]
oconnor0 has joined #zig
d_s has joined #zig
scriptnull has joined #zig
wilsonk has joined #zig
scriptnull has quit [Remote host closed the connection]
wink_ has joined #zig
oconnor0 has quit [Ping timeout: 252 seconds]
oconnor0 has joined #zig
qazo has joined #zig
qazo has quit [Ping timeout: 240 seconds]
oconnor0 has quit [Ping timeout: 252 seconds]
oconnor0 has joined #zig
Hejsil has joined #zig
<andrewrk> I think if I was starting zig from scratch I would use this instead of GitHub: https://drewdevault.com/2018/11/15/sr.ht-general-availability.html
m4ge123 has joined #zig
scriptnull has joined #zig
<Hejsil> andrewrk, time to migrate!
<andrewrk> I'd seriously consider it if there was a way to keep the issues and comments
<andrewrk> btw Hejsil congrats on the merge
<Hejsil> Finally done with all that. Time to work on other projects for a bit!
<andrewrk> enjoy :)
bheesham has quit [Quit: WeeChat 1.4]
<Hejsil> andrewrk, Hmmm, but the stage 1 compiler doesn't understand doc comments
<andrewrk> you mean the parser?
<Hejsil> Well, yea
<Hejsil> They have to be in the tree for everyhting to work
<Hejsil> But I guess that is just part of what is needed to get this done
<andrewrk> if we switched to a token index based thing, rather than token pointer, we could just look backwards from nodes for doc comment tokens
<Hejsil> Idk. I know most of std by now, so I can wait :)
<Hejsil> But prototyping is important
<andrewrk> yeah, I just feel bad telling everyone, "sorry no docs, I have to do a ton of work before that will be available"
<Hejsil> Also, on the topic of parsing. How is "server compiler" gonna work with the current Ast points to Tokens points to Src? Wont we be waisting memory by holding onto the source code?
<Hejsil> Or maybe this question is a little premature, as Idk what will use most memory in stage 2
<andrewrk> currently stage2 does reference counting for all values
<andrewrk> and yes, hangs onto full source / tokens for any code that has not changed
<andrewrk> I think it will be ok to start this way and then change it later
<Hejsil> Seems fair
<Hejsil> How is copy-elision comming along?
<Hejsil> Still a lot of changes left=
<Hejsil> ?*
<andrewrk> yes - it seems that every semantic construct is a different puzzle to solve
<andrewrk> I have a checklist on the PR: https://github.com/ziglang/zig/pull/1682
<andrewrk> at this point I think the concept is proven, and it's just fleshing out all the details
<Hejsil> I see. Seems like you're 2/3 done
<andrewrk> I think that's about right. and then I still have to go make all the tests pass
<andrewrk> some of it is really tricky. consider this example...
scriptnull has quit [Remote host closed the connection]
<andrewrk> but now if I make those implicit casts happen to non-scalar types, e.g. a struct...
<andrewrk> crap. I have to fix a regression before I can show the other example
<andrewrk> and now what if I make it const...
<andrewrk> oops, that last one had the wrong IR pass2 pasted. https://clbin.com/UeWzn
<andrewrk> anyway, zig IR is getting more complicated. but zig language is mostly the same, with some extra, helpful guarantees about how memcpy won't happen
<andrewrk> the only unsolved problem right now is peer type resolution. unless I think of some clever thing, it's going to be a kind of "left-to-right" type resolution
<Hejsil> Hmm. I read somewhere that this would find var a: u8 = if (something) 1 else 2;
<Hejsil> find/fix*
<andrewrk> yes it would, because it essentially does u8(1) and then u8(2)
<andrewrk> it also would allow: var a = if (something) u8(1) else 2;
<andrewrk> but not: var a = if (something) 1 else u8(2);
<Hejsil> Makes sense since the code has to know about the location and its type
<Hejsil> Ooh
<Hejsil> Hmm.
scriptnull has joined #zig
<Hejsil> So a gets the type of u8(1), and then 2 is casted to the location type
<andrewrk> also: var a = if (something) u16(1) else u8(2); // ok
<andrewrk> but: var a = if (something) u8(1) else u16(2); // error: expected u8, found u16
<andrewrk> not ideal.
<andrewrk> but if you put the cast on the outside, both things get casted to the outside thing
<Hejsil> And we cant resolve the two expressions in relation to eachother before the result?
<Hejsil> If that makes sense?
<andrewrk> that's how it works in master branch. but in copy elision branch, consider the last 2 examples: https://clbin.com/B9rwA https://clbin.com/UeWzn
<andrewrk> we have to generate pass1 IR without knowing types or comptime-ness
<andrewrk> because of copy elision we have to get an inner field reference of the struct
<andrewrk> before we have seen all the types of the prongs
<Hejsil> Oooh right
<andrewrk> it might be possible to improve the behavior, but it will require a clever solution
<andrewrk> I definitely think this copy elision is worth it though
<andrewrk> it's much, much better llvm ir
<Hejsil> Debug is gonna go fast!
<andrewrk> to be clear, C already does this. the difference is that zig adds optionals and error unions, and adds implicit comptime detection
<andrewrk> whereas in C you end up with stack allocations even for number literals
<andrewrk> at least in clang, I observe this
<Hejsil> maybe var a: u8 = if (som) 1 else 2; is just the way things like this should be written
<Hejsil> After all, the type of a is none trivial once we have branching
<Hejsil> So the readability will improve a little of a's type is just specified
<Hejsil> So maybe the left-to-right is good enough
<Hejsil> Idk, we'll have to see what people get them self into
<andrewrk> agreed
<Hejsil> But if you figure out a good solution, then that's greate too :)
porky11 has joined #zig
wink_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
wink_ has joined #zig
scriptnull has quit []
<oats> andrewrk: hi there, just wanted to say that I've been playing with Zig for about a week now, and it's been a lot of fun
<andrewrk> hi oats
<oats> I really like what I see, and so far it seems like it has the potential to be the best C alternative :)
<oats> so, thanks for starting this!
<andrewrk> great :)
<oats> your kernel live-coding video kinda sucked me in, I think that's just so cool you can make an OS with zig without writing any assembly
<andrewrk> I'm hoping the OS dev community starts getting seriously into zig
<andrewrk> there's still the problem of immaturity, but I'm working hard on improving that
<oats> do you think zig's syntax is going to be getting more stable in the near future?
<oats> what with the new formal grammar
<andrewrk> yes
<andrewrk> the syntax around coroutines will be changing, but so will the semantics
<andrewrk> function calling convention syntax is planned to be changed
<andrewrk> var args syntax as well
<andrewrk> but I'm trying to prioritize the breaking changes first
<andrewrk> zig is certainly in "beta" territory right now. expect to participate in the development process if you use it
<ltr_> for the next release?
<ltr_> i mlooking for a project to rewrite it in zig, any ideas?
<ltr_> i was thinking in quake , but thats a lot of work :D
<scientes> ltr_, that is *way* too big
<andrewrk> calling convention syntax change is scheduled for 0.4.0: https://github.com/ziglang/zig/issues/661
<ltr_> just finished a project for a side job in c++ now im hooked in lowlevel coding again.
<andrewrk> var args changes, 0.4.0 as well: https://github.com/ziglang/zig/issues/208
wootehfoot has joined #zig
<ltr_> and just saw a video where someone was implementing something similar to defer in C++ but the syntaxis looks just ugly.
<andrewrk> ltr_, does this interest you? https://github.com/ziglang/zig/issues/1535
<ltr_> i can start with a regular linker
<ltr_> for elf
<andrewrk> yeah
<ltr_> looks interesting
<andrewrk> LLD is a good reference code
<andrewrk> but LLD is: * not planned to support incremental linking * not designed to be used as a library * not written in zig ;)
<ltr_> i know the linker of llvm for apple, i fixed a bug long time ago (zig 0.0.1?)
<andrewrk> yes, and sadly that was the last improvement to the apple linker code that anyone has made :(
<ltr_> hahah yeah
<andrewrk> this is a good use case for using zig's async I/O - once the coroutine rewrite is complete. but a blocking implementation should be easy to migrate over
<wootehfoot> lld doesn't support incremental linking? I thought it at least supported it with -Wl,--thinlto-cache-dir=/path/to/cache s of LLVM 5.0, or are you talking about something else?
<andrewrk> I don't think thin LTO is the same thing as incremental linking
<ltr_> ok ill research the linker thing, i have to update my zig knowledge first and setup my zig's env. anyways i think something like quake is doable
<wootehfoot> no it's not, it's a particular use case when incremental liking works
<ltr_> maybe with an semiautomated tool
<andrewrk> ltr_, quake would be an impressive demo
<andrewrk> you could work on translate-c and try to get it good enough to port quake
<ltr_> ill start with the linker
<ltr_> using go/llvm linkers for reference
<andrewrk> wootehfoot, hmm, it looks like thinlto with a cache directory does some kind of incremental linking that I was not aware of
<andrewrk> thanks - I'll investigate this
<wootehfoot> andrewrk, thank you too, your recurse presentation was really inspiring by the way :)
<andrewrk> wootehfoot, I think the main drawback of this is that it requires all objects and libraries to have been compiled with thin LTO
<andrewrk> whereas a generic linker that supports incremental linking could support, for example, .a files built with gcc
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<oats> andrewrk: will there be a coding live stream today? what time are they at?
<wootehfoot> andrewrk, gcc's LTO gimple trees aren't any more amazing either. They're versioned so re-using a lib's gimple tree from an older GCC is a nono. Then there's the -fno-fat-lto-objects which has become default, and thus requires gcc-ld, gcc-ar.. etc. for the toolchain to be fully aware of the linking phase. In GCC >=6 'ld -r' enables incremental linking with LTO.
<andrewrk> oats, yes, 17:00 EST. the topic today will be implementing a floating point number parser
<oats> awesome, I'll try to catch it
<wootehfoot> Then, for the fans of deterministic builds with LTO, it required setting the LTO seed to zero, with breaks incremental linking altogether, everything is a tradeoff :)
<wootehfoot> requires*
<andrewrk> wootehfoot, zig's stance on this tradeoff is: debug builds are not deterministic; release builds are
<andrewrk> release builds also are not incremental
<wootehfoot> nice! :)
wink_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
oconnor0 has quit [Ping timeout: 250 seconds]
wink_ has joined #zig
oconnor0 has joined #zig
davr0s has joined #zig
<ltr_> andrewrk: quake would be a great project to launch 1.0.0 with
wink_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
wink_ has joined #zig
Ichorio has joined #zig
oconnor0 has quit [Ping timeout: 244 seconds]
oconnor0 has joined #zig
darithorn has joined #zig
Ichorio_ has joined #zig
Ichorio_ has quit [Read error: Connection reset by peer]
Ichorio_ has joined #zig
Ichorio has quit [Ping timeout: 246 seconds]
Ichorio_ has quit [Client Quit]
steveno has quit [Remote host closed the connection]
oconnor0 has quit [Ping timeout: 240 seconds]
oconnor0 has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
<oats> does a "deterministic" build mean that, given the same source code and the same compiler version, the output binaries/libraries would be the exact each build?
<andrewrk> oats, correct
Zaab1t has quit [Quit: bye bye friends]
clownpriest has joined #zig
wink_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
wink_ has joined #zig
<ltr_> andrewrk: do you have useful .nix files to share?
<andrewrk> ltr_, sure, what do you want, one for zig?
<ltr_> yes zig environment
<ltr_> do you recommend to use the master branch version?
<andrewrk> https://clbin.com/y8wAm you don't need wine, kcov, or kcachegrind
<andrewrk> yes I do recommend the master branch
<andrewrk> which you can get as a static binary build from the download page btw
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ltr_> thanks
davr0s has joined #zig
Hejsil has quit [Quit: Page closed]
<benjikun> andrewrk: Are you livestreaming soon?
<ltr_> what channel are you using? i cant find llvm_7,
<andrewrk> benjikun, yes, in 22 minutes: https://www.twitch.tv/andrewrok topic: implementing a floating point parser in zig
<andrewrk> ltr_, unstable
<benjikun> yay
<andrewrk> ltr_, another option is to follow these instructions to build llvm & clang from source, and then comment out the llvm and clang items from the nix file: https://github.com/ziglang/zig/wiki/How-to-build-LLVM,-libclang,-and-liblld-from-source#posix
<ltr_> its ok i have my chroot with different versions of llvm suite, i had never used the llvm from the distro
steveno has joined #zig
wink_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
wink_ has joined #zig
wink_ has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
wink_ has joined #zig
wink_ has quit [Client Quit]
wink_ has joined #zig
<ltr_> cmake gives me an error about the libclang headers, i ended up compiling just cfe again for the headers
<ltr_> dunno which package have libclang-dev
qazo has joined #zig
qazo has quit [Ping timeout: 252 seconds]
qazo has joined #zig
qazo has quit [Ping timeout: 260 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
scriptnull has joined #zig
scriptnull has quit [Client Quit]
xentec has joined #zig
porky11 has quit [Quit: Leaving]