ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
arBmind has quit [Quit: Leaving.]
hopppetosse has quit [Ping timeout: 260 seconds]
jfo has joined #zig
<jfo>
andrewrk: is the hello world on the current docs page meant to build with master or with the tagged release
<andrewrk>
jfo, the docs has the tag/branch in the URL
<jfo>
yes, you're welcome to be the source of truth re: categorization in the grammar
<jfo>
I will be able to take a look at it this weekend some more but I thought I'd throw it out there.
<jfo>
I think it is worth thinking through it though, and being as specific as the schema of those standard classes allows
<jfo>
as the syntax of the language is still evolving a lot, this will need to be maintained alongside it, at least for major release imo
<jfo>
and I'll be looking forward to that compiler tour sometime :) we'll have to skype
<jfo>
I have gtg to bed but I will ttyl. Please lmk your thoughts on the homebrew formula, pinning llvm@5 and how to do it in the confines of the homebrew guidelines might be a question for them, but this is basically following the readme installation instructions. I was surprised it was so easy tbqh
<GitHub75>
[zig] tiehuis opened pull request #716: Add array type handling for gen_h (master...export-c-additions) https://git.io/vNwlL
arBmind has joined #zig
hoppetosse has joined #zig
hopppetosse has quit [Ping timeout: 256 seconds]
redj has quit [Ping timeout: 256 seconds]
redj has joined #zig
redj has quit [Ping timeout: 240 seconds]
hoppetosse has quit [Ping timeout: 265 seconds]
MajorLag_ has joined #zig
<MajorLag_>
I have to admit to being annoyed by tabs being invalid. It seems you've made a decision to end stupid tab vs space arguments by being needlessly draconian.
<GitHub187>
zig/master c2838f2 Andrew Kelley: fix printf format specifier
redj has joined #zig
<andrewrk>
I'm also curious about your text editor. Visual Studio?
hopppetosse has quit [Ping timeout: 264 seconds]
<MajorLag_>
andrewrk, it's a minor thing. Notepad++ doesn't have a way to specify tab->space conversion for user defined languages so I have to set it as the default. The annoyance is philosophical, really, I don't believe it is the compiler's job to enforce formatting. With tabs and newline, not a big deal, but if it were to start mandating K&R indentation or something I'd probably just give it up.
<andrewrk>
we're not going to do something like that. Although it is planned to catch accidentally mis-indented code
<andrewrk>
it doesn't enforce how much you indent, just that you do, when you nest something, and that you outdent correctly when you unnest something
jfo has joined #zig
hoppetosse has joined #zig
<MajorLag_>
I doubt that will cause me any grief, but it might for someone who has a lot of nesting and a narrow column limit. Still, seems like it would catch enough mistakes to justify it anyway.
<andrewrk>
it still allows indenting with, e.g. 1 space
<andrewrk>
as long as you are consistent for a given nesting column
arBmind has quit [Quit: Leaving.]
jfo has quit [Quit: WeeChat 1.9.1]
redj has quit [Ping timeout: 265 seconds]
cenomla has joined #zig
redj has joined #zig
<MajorLag_>
How would one go about declaring a slice and initializing it? []u8{...} throws a type mismatch error []u8 vs [100]u8.
<andrewrk>
MajorLag_, you have to consider the difference between the actual memory data, and a reference to said data
<andrewrk>
what you initialize is actual data - this would be an array. then you take a slice of that array, which is a reference
hoppetosse has quit [Ping timeout: 256 seconds]
<andrewrk>
one way to do this is to slice an array
<andrewrk>
array[0..]
<andrewrk>
with an initialization it probably has to go in parens: ([]u8{...})[0..]
<MajorLag_>
sure, but if I do that on the initializer it won't work because then I'm trying to cast const []u8 to []u8
<andrewrk>
you want mutable data
<andrewrk>
I suggest `var array = []u8{...};` and then `const slice = array[0..];`
<MajorLag_>
In this case, it probably doesn't have to be, but yeah.
<andrewrk>
if you show me the non-working code I can probably suggest a fix
hoppetosse has joined #zig
<MajorLag_>
I'm more or less just working out my understanding of Zig's syntax right now.