00:26
marijnfs_ has quit [Quit: WeeChat 2.6]
01:01
waleee-cl has quit [Quit: Connection closed for inactivity]
01:22
marijnfs_ has joined #zig
01:25
marijnfs has quit [Ping timeout: 265 seconds]
03:59
chemist69 has quit [Ping timeout: 250 seconds]
04:01
chemist69 has joined #zig
04:51
LargeEpsilon has joined #zig
05:17
_whitelogger has joined #zig
05:20
mahmudov has quit [Remote host closed the connection]
05:41
LargeEpsilon has quit [Ping timeout: 240 seconds]
05:56
_whitelogger has joined #zig
05:58
LargeEpsilon has joined #zig
05:59
LargeEpsilon_ has joined #zig
06:03
LargeEpsilon has quit [Ping timeout: 265 seconds]
07:31
ltriant has quit [Quit: leaving]
07:53
xyproto has joined #zig
08:28
avoidr has quit [Quit: leaving]
08:57
stratact has quit [Remote host closed the connection]
09:04
mahmudov has joined #zig
09:14
neceve has joined #zig
09:23
<
daurnimator >
tgschultz: you could very much implement a wayland client without glibc...
09:24
stratact has joined #zig
09:46
stratact has quit [Quit: Konversation terminated!]
09:52
stratact has joined #zig
10:09
squeek502 has quit [Ping timeout: 268 seconds]
10:22
scientes has quit [Ping timeout: 268 seconds]
10:40
samtebbs has joined #zig
10:40
<
samtebbs >
Hi all, does anyone know how to print a *u8 as a string?
10:41
<
samtebbs >
{} and {s} print it as u8@xxxxxx
10:43
<
daurnimator >
samtebbs: you'd need to dereference it.... `myu8.*`
10:43
<
samtebbs >
Null terminated string btw
10:44
<
daurnimator >
samtebbs: oh then you don't have a *u8.... you have a [*]u8
10:44
<
daurnimator >
samtebbs: I think you'd need to pass it as a slice: `myu8[0..mem.len(myu8)]`
10:46
<
samtebbs >
daurnimator: I thought I had a *u8 as I have a []*u8 and am looping over it
10:47
<
daurnimator >
thats a slice (runtime known array) of pointers to
*characters*
10:48
<
daurnimator >
samtebbs: do you have a []*u8 or a [][*]u8?
10:49
<
samtebbs >
I'm allocating with alloc(*u8, elf_headers.num) which I assume would give me elf_headers.num u8 pointers
10:49
<
samtebbs >
In whatever slice/array representation
10:49
<
daurnimator >
samtebbs: a
*u8 is a pointer to a *single* character
10:49
<
samtebbs >
daurnimator: Ah yes, I need []*u8 don't I
10:50
<
daurnimator >
samtebbs: no... you probably want a `[*]u8`
10:50
<
samtebbs >
Got ya, I struggle to remember the various array types and slices etc.
10:52
<
samtebbs >
Thanks, that works
11:16
slice has quit [Ping timeout: 240 seconds]
11:18
slice has joined #zig
12:13
samtebbs has quit [Quit: Lost terminal]
13:10
mahmudov has quit [Read error: Connection reset by peer]
13:28
mahmudov has joined #zig
13:29
BigEpsilon has joined #zig
13:33
LargeEpsilon_ has quit [Ping timeout: 276 seconds]
13:59
BigEpsilon has quit [Ping timeout: 268 seconds]
14:04
_Vi has quit [Ping timeout: 250 seconds]
14:14
BigEpsilon has joined #zig
14:15
halosghost has joined #zig
14:22
rifkik has joined #zig
14:22
<
rifkik >
Hey Everyone
14:24
Tetralux_ has joined #zig
14:27
<
rifkik >
I've started work on a SNES emulator in Zig
14:28
<
rifkik >
It really hooked me after writing some trivial programs with it
14:28
Tetralux has quit [Ping timeout: 240 seconds]
14:29
<
andrewrk >
rifkik, welcome :)
14:29
<
rifkik >
Hey Andrew!
14:29
<
andrewrk >
you joined at an interesting time; 0.5.0 release is next monday
14:29
<
rifkik >
I'm really liking your language so far
14:30
<
halosghost >
andrewrk: I'm quite excited :)
14:31
<
fengb >
ooo another emulator
14:31
<
andrewrk >
rifkik, meet fengb
14:32
<
rifkik >
Ah, a Gameboy Emulator
14:34
<
rifkik >
I'm writing a SNES emulator thanks to byuu-san's kind words, He's an awesome person
14:37
<
fengb >
It's a tad harder for sure :P
14:40
<
rifkik >
Definitely a step up from the NES
14:40
<
rifkik >
I wrote a NES emulator in go once though, so that will help
14:41
<
rifkik >
Sorry if this counts as advertising, I just want to see if people are interested in a ZigSNES emulator
14:43
<
fengb >
We're all interested in new zig projects :)
14:43
<
mq32 >
i'll get back to embedded coding with the new release
14:44
<
mq32 >
october will be much less events for me, so more free time for coding :)
14:46
waleee-cl has joined #zig
14:48
<
andrewrk >
I'm going to allocate some time in october to get my rpi bare metal arcade game up to a nice demo for handmade seattle
14:48
<
andrewrk >
that'll be a nice respite from bug fixing
14:48
<
mq32 >
you mean "it will be a good alternative to find yet undiscovered bugs"?
*grin*
14:49
<
mq32 >
but yeah, sounds like a plan
14:49
_Vi has joined #zig
15:09
mahmudov has quit [Remote host closed the connection]
15:13
avoidr has joined #zig
15:17
rifkik has quit [Remote host closed the connection]
15:21
BigEpsilon has quit [Ping timeout: 245 seconds]
15:45
batok has joined #zig
15:53
LargeEpsilon has joined #zig
16:21
lucus16 has quit [Quit: lucus16]
16:24
lucus16 has joined #zig
16:49
Akuli has joined #zig
17:07
wootehfoot has joined #zig
17:10
LargeEpsilon has quit [Ping timeout: 240 seconds]
17:13
TheLemonMan has joined #zig
17:14
<
TheLemonMan >
andrewrk, are you able to build any test against musl? for some reason the stdio.h cannot find bits/alltypes.h
17:19
wootehfoot has quit [Quit: Leaving]
17:22
wootehfoot has joined #zig
17:23
* andrewrk
checking
17:25
<
andrewrk >
TheLemonMan, it's working locally for me, also after 35c1d8cef we have CI test coverage for building musl on x86_64-linux-musl and aarch64v8_5a-linux-musl
17:25
<
andrewrk >
although the test coverage does not test `#include <stdio.h>`
17:25
<
andrewrk >
--verbose-cc will show the c flags
17:27
<
TheLemonMan >
have you tried compiling a c file too?
17:27
<
andrewrk >
yeah I just tried that locally
17:28
<
andrewrk >
in this output, `-isystem /home/andy/dev/zig/build/lib/zig/libc/include/x86_64-linux-musl` has it: ../lib/libc/include/x86_64-linux-musl/bits/alltypes.h
17:28
<
andrewrk >
I wonder what's different for you, the whole point of `zig cc` is to insulate against system differences
17:32
mahmudov has joined #zig
17:38
<
TheLemonMan >
it's armv7-linux-musleabihf that fails
17:40
<
andrewrk >
after this is fixed the test coverage can be enabled
17:40
<
TheLemonMan >
yak shaving here I come
17:40
<
andrewrk >
TheLemonMan, looks like we're not properly constructing the include path
17:41
<
andrewrk >
arm-linux-musleabihf vs arm-linux-musl
17:41
<
andrewrk >
this should be an easy fix
17:41
<
andrewrk >
codegen.cpp: detect_libc in the if (target_can_build_libc
17:42
<
andrewrk >
I'll be happy to take a look at this later today when I'm done with typing up release notes quota for the day
17:43
<
andrewrk >
TheLemonMan, out of curiosity, what's the top of your yak stack?
17:44
<
TheLemonMan >
upstreaming this MIPS port is my top priority right now
17:45
<
andrewrk >
going to try to get it in before the release on monday?
17:48
<
andrewrk >
TheLemonMan, I'll just fix this arm include thing, I got hooked once I started looking at it
17:49
neceve has quit [Ping timeout: 252 seconds]
17:50
<
TheLemonMan >
hah, neat. I'll try to upload a PR in the next few hours, gotta hook up the new arch in the testing harness and I'm done with it
17:57
<
andrewrk >
this is an issue building musl with clang 9, could probably be a nice upstream patch to send to musl
18:00
SyrupThinker has quit [Quit: WeeChat 2.5]
18:07
<
andrewrk >
or maybe it's an llvm issue. I'm not sure which yet
18:08
<
andrewrk >
anyway I pushed the include dir fix, going back to typing up release notes now
18:12
_Vi has quit [Ping timeout: 246 seconds]
18:13
TheLemonMan has quit [Read error: Connection reset by peer]
18:36
TheLemonMan has joined #zig
18:56
batok has quit [Ping timeout: 240 seconds]
18:59
SyrupThinker has joined #zig
19:01
ky0ko has quit [Remote host closed the connection]
19:02
porky11 has joined #zig
19:06
_Vi has joined #zig
19:10
ky0ko has joined #zig
19:21
redj has quit [Read error: Connection reset by peer]
19:22
redj has joined #zig
19:26
SyrupThinker has quit [Quit: WeeChat 2.6]
19:27
SimonN has joined #zig
19:28
SimonNa has quit [Ping timeout: 240 seconds]
19:34
batok has joined #zig
19:42
Akuli has quit [Quit: Leaving]
19:49
Ichorio has joined #zig
19:56
<
TheLemonMan >
andrewrk, I'm also fixing arm+libc stuff heh
19:56
<
TheLemonMan >
let's coordinate before we end up with duplicated work
19:56
<
andrewrk >
TheLemonMan, oh, let me throw up a PR so that we don't clobber
20:02
wootehfoot has quit [Read error: Connection reset by peer]
20:03
<
andrewrk >
I made it u64 instead of off_t because I think it's better unsigned, you ok with that?
20:03
<
TheLemonMan >
the fp errors are somewhat expected, we should emit the builtins with the aapcs calling convention
20:04
<
TheLemonMan >
I'd blindly follow glibc on that matter and use off_t wherever they use it
20:04
<
andrewrk >
but why would you give a negative offset to mmap or pwrite?
20:04
<
TheLemonMan >
at least at the c.zig level
20:04
<
TheLemonMan >
-1 has a special meaning for pwrite
20:05
<
andrewrk >
where do you see that?
20:05
<
TheLemonMan >
*preadv2/pwritev2 sorry
20:05
<
andrewrk >
oh I see
20:05
<
andrewrk >
ok I agree with you
20:12
uvx has joined #zig
20:12
halosghost has quit [Quit: WeeChat 2.6]
20:14
<
TheLemonMan >
you have to @intCast to u6 the << RHS
20:14
<
fengb >
(T(1) << (nth % Size_of_T_bits)) needs to be u6 or smaller
20:15
<
fengb >
I mean RHS needs to be — "(nth % Size_of_T_bits)"
20:15
<
fengb >
Anything bigger is potential overflow and undefined behavior
20:15
<
uvx >
but what if I change my base type, then it will be u7 or other
20:16
<
fengb >
Because you're doing a mod, you might be able to get away with manual casting, @intCast(u6, blah)
20:16
<
andrewrk >
but I don't think that should happen before 0.5.0
20:16
<
fengb >
(And it'd catch an actual overflow in debug / safe modes)
20:17
<
TheLemonMan >
yeah, that yak is definitely postponed to the next release
20:17
<
andrewrk >
I also have a research topic: ability to specify calling conventions with comptime code in userland
20:17
<
andrewrk >
imagine if the c calling convention or aapcs cc were fully userland concepts
20:18
<
fengb >
There's a builtin function to get the natural bitsize
20:18
<
fengb >
std function
20:18
<
fengb >
std.math.Log2Int(T)
20:18
<
andrewrk >
TheLemonMan, sorry for clobbering you, that was follow-up to nsz from #musl sending a patch
20:19
<
andrewrk >
OK I am way behind on my release notes quota for today
20:19
<
TheLemonMan >
custom CCs means you have to somehow coerce LLVM into understaning those, unless you want to do the codegen yourself but that's nuts IMO
20:21
<
TheLemonMan >
no problem, I had just started looking at the build failures
20:23
<
mq32 >
andrewrk, is there a way right now to safe-convert an integer to an enum?
20:23
<
mq32 >
@intToEnum will panic if the int is out-of-range
20:25
<
uvx >
fengb: thanks! it works!
20:25
<
Tetralux_ >
mq32: meta.intToEnum IIRC
20:26
<
mq32 >
oh right. i could just iterate over the type info
20:26
* mq32
forgets that zig is awesome :D
20:43
uvx has quit [Quit: WeeChat 1.4]
20:47
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
21:15
daurnimator has quit [Ping timeout: 246 seconds]
21:18
Syrup has joined #zig
21:23
Syrup has quit [Quit: WeeChat 2.6]
21:32
uranther has joined #zig
21:40
daurnimator has joined #zig
21:41
doesntgolf has joined #zig
21:46
waleee-cl has quit [Quit: Connection closed for inactivity]
21:51
<
_Vi >
How do I project create a template (with a public function, a test and example) for Zig library intended to be used in Zig projects?
21:53
<
_Vi >
`zig init-lib` is for libraries resulting in libmything.a. And the template does not include a Zig example that uses the library.
21:55
<
_Vi >
`zig-clap` is an example of such library. But I'm not sure the how the project was generated (and if its structure is canonical).
22:00
daurnimator has quit [Ping timeout: 245 seconds]
22:09
ltriant has joined #zig
22:09
LargeEpsilon has joined #zig
22:11
porky11 has quit [Ping timeout: 250 seconds]
22:13
LargeEpsilon has quit [Ping timeout: 240 seconds]
22:17
<
nrdmn >
what's the current state of iterators in zig? I think there's been some work on them recently?
22:26
rifkik has joined #zig
22:40
daurnimator has joined #zig
22:44
qazo has joined #zig
22:51
nifker has joined #zig
22:51
<
nifker >
Oh I am finally unbanned
22:52
Ichorio has quit [Ping timeout: 245 seconds]
22:52
nifker has quit [Quit: nifker]
22:53
ky0ko has quit [Remote host closed the connection]
23:11
daurnimator has quit [Ping timeout: 264 seconds]
23:13
<
mikdusan >
for struct-method `foo.doit()` it is roughly sugar'd to `foo.doit(foo)` . i'd like this too if it doesn't botch the world:
23:13
<
mikdusan >
`foo.abc.xyz.bar()` to sugar `foo.abc.xyz.bar(foo)`
23:14
<
mikdusan >
assuming none of intermediates `xyz` or `abc` are `@typeOf(foo)`
23:14
<
mikdusan >
this would really make for nice mixin components
23:15
rifkik has quit [Remote host closed the connection]
23:15
<
Tetralux_ >
What's an example of that?
23:16
<
mikdusan >
you mean a use-case or just a short code example to explain what i mean?
23:20
daurnimator has joined #zig
23:21
<
mikdusan >
the obvious way today is to add param `*Foo` to barPrinter but it's actually not needed
23:23
<
andrewrk >
mikdusan, I'm a bit resistant to this one because the exact reason it is useful also makes reading the code more difficult
23:25
<
andrewrk >
Maybe I'm not understanding the proposal fully
23:27
<
mikdusan >
it makes the struct-method context transitive. but that in itself, yes i understand if it's not zig zen. no problemo
23:55
<
Tetralux_ >
I can't even quite understand what that example does xD
23:55
Tetralux_ is now known as Tetralux
23:55
* mikdusan
hands out the coffee
23:56
* Tetralux
drinks it all in one go
23:56
<
andrewrk >
I have a hypothesis about these macOS ci failures. It's not easy to test though
23:57
<
andrewrk >
It's that they're giving us a nondeterministic amount of RAM and if we run out it does this "could not reach host" thing
23:58
<
mikdusan >
+1 s/hypothesis/fact/
23:59
<
mikdusan >
as more tests are added to zig...