ChanServ changed the topic of #zig to: zig programming language | ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
<GitHub124>
[zig] bnoordhuis opened pull request #743: Use /dev/urandom and sysctl(RANDOM_UUID) on Linux. (master...linux-random) https://git.io/vNxrf
jfo has quit [Quit: WeeChat 1.9.1]
hopppetosse has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dd3 has quit [Ping timeout: 256 seconds]
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 256 seconds]
tjpalmer has joined #zig
<tjpalmer>
hasen_judy, I'm new so I don't know, but I've found interfacing to C pretty easy with @cImport.
tjpalmer has quit [Ping timeout: 260 seconds]
hopppetosse has quit [Ping timeout: 264 seconds]
hasen_judy has joined #zig
<hasen_judy>
the problem with using cImport for freetype is that it's a bit weird and not a straight forward include
<hasen_judy>
I'm trying the approach of manually declaring the functions/types. seems to work ok
<hasen_judy>
What exactly is the deal with the `use` keyword?
<hasen_judy>
I can use it for @cImport but what about regular @import ?
redj has quit [Remote host closed the connection]
tiehuis has joined #zig
<tiehuis>
use just brings everything in that module and dumps it into the current namespace
<tiehuis>
you can use it for regular imports
<tiehuis>
use @import("std") for example makes ArrayList and debug available at the top-level
<tiehuis>
you can also do `pub use @import("..)` to expose all public members in a module, which is possibly handy if you need to re-export some members from another module
<hasen_judy>
ah, it's probably the `pub` that I was missing
<hasen_judy>
I imported a file but nothing in it seemed to have arrived in my namespace
<tiehuis>
you shouldn't need pub just to use it in that file
<tiehuis>
pub just re-exports but should do exactly the same
<hasen_judy>
pub in the file I'm `use` importing
<tiehuis>
ahh yes, you they need to be visible of course
hasen_judy has quit [Remote host closed the connection]
hasen_judy has joined #zig
davr0s has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dd3 has joined #zig
hasen_judy has quit [Remote host closed the connection]
tiehuis has quit [Quit: WeeChat 2.0.1]
davr0s has joined #zig
dd3 has quit [Ping timeout: 256 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hoppetosse has joined #zig
arBmind has joined #zig
hasen_judy has joined #zig
dd3 has joined #zig
hasen_judy has quit [Remote host closed the connection]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hasen_judy has quit [Ping timeout: 276 seconds]
<zesterer>
This probably sounds like a silly question, but I've yet to find the syntax in the docs or in the standard library. How does one iterate n times? Equivalent to for (int i = 0; i < n; i ++) in C.
dd3 has quit [Ping timeout: 256 seconds]
<ofelas>
have you looked at the while loop?
<zesterer>
ofelas: So you must first define a counter outside the loop?
<ofelas>
aye
davr0s has joined #zig
dd3 has joined #zig
<zesterer>
ofelas: Hmmm. Okay. It would be nice to have syntax like "for (0..n) |i| {}"
zesterer has quit [Quit: zesterer]
zesterer has joined #zig
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
hasen_judy has joined #zig
hasen_judy has quit [Ping timeout: 276 seconds]
<jjuran>
I used `for i in range do {}` for my language, where `range` can be e.g. `0 .. 9` or `0 -> 10` (same effect), or actually any sequence.
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
davr0s has joined #zig
<hopppetosse>
the "for (0..n) |i| {}" syntax was proposed and well received a while back, I think it just never got implemented
arBmind has quit [Quit: Leaving.]
hasen_judy has joined #zig
<zesterer>
hopppetosse: That's a shame
hasen_judy has quit [Ping timeout: 276 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<hopppetosse>
still might be though, it was never rejected
davr0s has joined #zig
dd3 has quit [Ping timeout: 256 seconds]
dd3 has joined #zig
hopppetosse has quit [Ping timeout: 240 seconds]
davr0s has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<benzrf>
andrewrk: do the assertion failures etc that happen when trying to do complicated compile time programs just incompletenesses in the interpreter or fundamental limitations that arent of interest