ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
aiwakura has joined #zig
hasen_judy has quit [Remote host closed the connection]
steveno has joined #zig
steveno has quit [Quit: Leaving]
hopppetosse has quit [Ping timeout: 260 seconds]
hopppetosse has joined #zig
hopppetosse has quit [Ping timeout: 248 seconds]
hopppetosse has joined #zig
hopppetosse has quit [Read error: Connection reset by peer]
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 276 seconds]
<MajorLag_>
I think I accidentally created closures in Zig. It only works at comptime though, because if the variable you're trying to capture isn't declared comptime the compiler crashes.
<MajorLag_>
actually it might be a runtime failure, I can't tell because Windows+llvm.
<GitHub130>
zig/master e8d81c5 Andrew Kelley: fix build broken by previous commit
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 265 seconds]
arBmind has quit [Quit: Leaving.]
jfo has quit [Remote host closed the connection]
<sient>
it seems like a lot of the self-hosted compiler is going in std, is one of the goals to allow end-users to write user-land apps which can traverse fully typed ASTs?
dd3 has joined #zig
<andrewrk>
sient, at least the tokenizer and parser can be part of the std lib. the parts that depend on LLVM won't go in there
<andrewrk>
there are a few things in the analysis phase that depend on LLVM, for example @offsetOf and @sizeOf
<andrewrk>
and you could, for example, create a type like this: var a: [@sizeOf(u32)]u8 = undefined
<andrewrk>
so that would mean that no, we don't get fully typed ASTs in the std lib
<sient>
ah :(, I was hoping that'd be the case as it would enable writing an indexer, ie, goto definition, find references, etc
<andrewrk>
I'll think about it
<sient>
otherwise the indexer would probably have to live in the compiler, or at least have the compiler emit something that can be easily consumed by an indexer
<andrewrk>
it is planned to have the compiler act as a server and provide information about a build in real time
<andrewrk>
e.g. you'd press save in your editor, the compiler would pick up changes, minimally recompile, and push out deltas of what changed to listeners
jfo has joined #zig
<andrewrk>
also, once we have proper package management, we will have ability to get a fully typed AST as a package. it's just that the package will depend on llvm and clang
<sient>
that's a neat approach. atm cquery does delta updating (ie, load the previous index from cache and compare it to the current index and apply the changes to the database)... not as efficient as your approach but it ends up working well enough in practice
<sient>
ah, that would be fine, just so long as I could write a (user-land) app that can traverse fully typed AST
jfo has quit [Remote host closed the connection]
jfo has joined #zig
jfo has quit [Remote host closed the connection]
Hejsil has quit [Read error: Connection reset by peer]
jfo has joined #zig
jfo has quit [Remote host closed the connection]
return0e has quit [Remote host closed the connection]
<GitHub105>
zig/master 629f134 Andrew Kelley: std.zig.parser understands inferred return type and error inference
jfo has quit [Remote host closed the connection]
Hejsil has joined #zig
jfo has joined #zig
jfo has quit [Remote host closed the connection]
<sient>
Maybe I should post an issue, but why do if/while/for require parens? Seems like quite a few newer languages drop them (less boilerplate)
<andrewrk>
it's required for parsing reasons
jfo has joined #zig
<andrewrk>
because `foo { }` is struct instantiation syntax
<andrewrk>
if a > foo { }
<sient>
have you considered being more aggressive about whitespace? ie, foo{ -> object construction, foo { -> new block - but maybe those are too visually similar
<andrewrk>
I think that visually similar things should not be semantically distinct