ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
cenomla has joined #zig
<GitHub23> [zig] andrewrk pushed 1 new commit to master: https://git.io/vbhhC
<GitHub23> zig/master 0ea50b3 Andrew Kelley: ir: new pass iteration strategy...
arBmind1 has joined #zig
arBmind has quit [Ping timeout: 272 seconds]
redj_ has joined #zig
redj has quit [Ping timeout: 252 seconds]
<GitHub157> [zig] andrewrk pushed 1 new commit to master: https://git.io/vbjmD
<GitHub157> zig/master d9d61ed Andrew Kelley: doc fixes
initram has joined #zig
initram has quit [Client Quit]
<GitHub146> [zig] andrewrk pushed 1 new commit to master: https://git.io/vbjY5
<GitHub146> zig/master c741d3f Andrew Kelley: add test for while respecting implicit comptime
cenomla has quit [Quit: cenomla]
<GitHub177> [zig] andrewrk pushed 1 new commit to master: https://git.io/vbjOo
<GitHub177> zig/master 6281a51 Andrew Kelley: add noInlineCall to docs
skyfex has joined #zig
<GitHub108> [zig] andrewrk pushed 1 new commit to master: https://git.io/vbjcO
<GitHub108> zig/master 36ff266 Andrew Kelley: fix self hosted compiler on windows
arBmind1 has quit [Quit: Leaving.]
skyfex has quit [Ping timeout: 260 seconds]
arBmind has joined #zig
arBmind has quit [Quit: Leaving.]
redj_ is now known as redj
<andrewrk> I submitted the link to /r/programming
<andrewrk> and hacker news
Mentol has joined #zig
<Mentol> does the compiler can be used into a macos?
<Mentol> do the libraries built with Zig, could be used easily from other languages/platforms? (Java/Android, Swift/iOs)
<andrewrk> Mentol, yes, the compiler works on macos
<andrewrk> you can export a C-ABI compatible library
<Mentol> Perfect! And thanks by Zig. I've used Go and Rust but I want other simpler language to replace to C (Rust is at line with C++ and Go is not expressive)
<andrewrk> Mentol, I hope you like it. It is still very young, please be patient and report issues
<Mentol> no problem
<Mentol> and what do you think about Nim? -besides of syntax like Python or C- (The competitor more similar to Zip)
<andrewrk> Mentol, I think that the garbage collector makes it unsuitable for many purposes
<Mentol> right
<andrewrk> if our goal is to write reusable software, it has to cater to the common denominator environment
<andrewrk> also, nim depends on C, whereas Zig is trying to replace C
<andrewrk> and then the things that set zig apart: nim has hidden control flow, hidden memory allocations, and crashes on out of memory conditions
<Mentol> should be used the last version (0.1.1) or trunk one?
<andrewrk> Mentol, almost certainly trunk
<andrewrk> if you want to see just some of the things that have changed since 0.1.1 you can read http://andrewkelley.me/post/zig-december-2017-in-review.html
jjido has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Mentol> In the documentation, for the installation from MacOs, it could be added the line "brew install cmake" at the beginning
Mentol has quit [Quit: Leaving]
<andrewrk> thank you
<GitHub29> [zig] andrewrk pushed 1 new commit to master: https://git.io/vNesN
<GitHub29> zig/master 5c988cc Andrew Kelley: readme: update macos installation instructions
arBmind has joined #zig
arBmind has quit [Quit: Leaving.]
Mentol has joined #zig
<Mentol> does the enum can be used to handle bitmask flags?
<Mentol> so a variable could store several values of a same enum
<andrewrk> Mentol, why not a normal const for that?
<andrewrk> const FlagA = 0b01;
<andrewrk> const FlagB = 0b10;
arBmind has joined #zig
<Mentol> const Charset = enum(u2) { Lower, Upper, Digit, Punct };
<Mentol> for then, to be able to use a variable which can be set to Charset.Upper|Charset.Digit i.e.
<Mentol> if it is possible
<andrewrk> hmm. what would be the type of the result? Charset.Upper|Charset.Digit ?
<Mentol> in Go, it's the way to define bit operators for the enum
<Mentol> a bitwise-or
<andrewrk> why not: const Lower = 0b0001; const Upper = 0b0010; const Digit = 0b0100; const Punct = 0b1000;
<andrewrk> or even: const Lower = 1 << 0; const Upper = 1 << 1; const Digit = 1 << 2; const Punct = 1 << 3;
<Mentol> ok, so it's done at Go (using << )
<Mentol> could be used from the enum?
<Mentol> I mean, assign a value like '1 << 0' to the first value in the enum
<andrewrk> you can do that, yes: const Charset = enum(u2) { Lower = 1 << 0, Upper = 1 << 1, Digit = 1 << 2, Punct = 1 << 3 };
<Mentol> perfect :)
<Mentol> Thanks!
<andrewrk> however, I believe the expression `Charset.Upper | Charset.Digit` is a compile error
<andrewrk> what type would you expect it to be?
<andrewrk> you could do: u2(Charset.Upper) | u2(Charset.Digit)
<Mentol> it was only an example since syntax at Go; the example was to show that I want a variable with several values of an enum
<Mentol> that's right for me :)
jjido has joined #zig
<Mentol> I got invalid token '<<'
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Mentol> I had to use => const Charset = enum(u2) { Lower = 0b0001, ... };
<andrewrk> Mentol, hmm looks like you need parentheses
<andrewrk> A = (1 << 0),
<andrewrk> I think I can fix that
<Mentol> yes; it works with parentheses
jjido has joined #zig
<Mentol> do both variables and constants are visible when importing?
<andrewrk> yes
<GitHub166> [zig] andrewrk pushed 1 new commit to master: https://git.io/vNezR
<GitHub166> zig/master 5b15603 Andrew Kelley: enum tag values are expressions so no parentheses needed
<andrewrk> Mentol, now you do not need parentheses ^
<Mentol> cool :)
Mentol has quit [Quit: Leaving]
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<GitHub77> [zig] andrewrk pushed 1 new commit to master: https://git.io/vNeSI
<GitHub77> zig/master a45db7e Andrew Kelley: add building the self hosted compiler to the main test suite