eyepatchOwl has quit [Quit: Connection closed for inactivity]
sm2n has quit [Ping timeout: 252 seconds]
a_chou has quit [Remote host closed the connection]
a_chou has joined #zig
zenkuro has quit [Ping timeout: 246 seconds]
a_chou has quit [Quit: a_chou]
<recalloc>
I know in C I'm able to assign values to arbitrary indices in an array literal via `[420] = value`. It doesn't look like I see that in Zig -- should I use `comptime` to compensate or something else?
hiljusti has joined #zig
<andrewrk>
that's one option or you can look into using one of the std.enums functions
hiljusti has quit [Ping timeout: 250 seconds]
antaoiseach has joined #zig
notzmv has quit [Ping timeout: 260 seconds]
<antaoiseach>
hello folks, can I not wrap a FixedBufferAllocator inside an ArenaAllocator? I tried this code, but it segfaults - https://zigbin.io/922d49.
<antaoiseach>
Oh, never mind, found the issue - `var allocator = arena.allocator` must be `var allocator = &arena.allocator`.
<antaoiseach>
A warning (if possible) would ben nice here though! :-)
<ifreund>
kiedtl: error messages can definitely be improved, this is not a big priority with stage1 though
<kiedtl>
Fair enough, makes sense
<kiedtl>
btw, the compiler should at least warn when you try to return a slice to an array allocated in the stack frame of the current function
<kiedtl>
just realized that the array would be overwritten later
<andrewrk>
that's a big topic. there are several ideas to explore to address this problem
<kiedtl>
Oh, /11
<kiedtl>
oops
<andrewrk>
one of the ideas is to try to define the language such that returning a stack pointer from a function is a compile error. but it's actually non-trivial to do that
<dutchie>
i guess you can't really do that without ending up being Rust
<kiedtl>
Is there any way to keep zig fmt from formatting a section? I can't stand it when it turns something like '{ foo(); true; }' to a multi-line statement
<kiedtl>
especially when you have a bunch of those blocks, in, say, a switch statement
<xackus__>
/ zig fmt: off
<g-w1>
s/\/\/\/
<g-w1>
that ended up looking cooler than i expected lol
<kiedtl>
I think you meant s/\//\/\//?
<g-w1>
yes
<kiedtl>
strange.. it still formats
<kiedtl>
does it need a matching // zig fmt: on or something?
<g-w1>
yep
<g-w1>
not like rustfmt that operates on the ast
tefter has joined #zig
tefter has quit [Quit: WeeChat 3.1]
tefter has joined #zig
dyeplexer has quit [Read error: Connection reset by peer]
<mikdusan>
are there any linux distros that don't use elf?
hiljusti has quit [Ping timeout: 250 seconds]
<mikdusan>
maybe we should dump the notion of `-lc` on the zig `build-{obj,lib,exe}` command line and infer from target triple
<mikdusan>
and dump -gnu while we're at it
<mikdusan>
we can have `-target x86_64-linux` be the same as `-target x86_64-linux-none` which means static and ELF
<mikdusan>
and if someone sends any -dynamic related arguments they should error because static only
<mikdusan>
specifically this `target x86_64-linux` means use syscall interface
<mikdusan>
then as a step-up we can have `-glibc` and `-musl` abi which selects a zig-bundled-libc to use
<mikdusan>
so naturally when -glibc or -musl is used, we infer -lc and search paths and crt0 stuff
<mikdusan>
and these 2 default to dynamic with (currently) -musl supporting opt-in -static
<mikdusan>
and for the hat trick we then introduce a `-system` abi which means build things compatible for that particular host;
<mikdusan>
this would require some interesting probes to glean lib/include search paths, -fpic disposition, crt0 stuff under different compiler options, dynamic-libary path, etc.
<mikdusan>
but hell we could CACHE that
<mikdusan>
to clarify the above `-glibc` and `-musl` are part of the triplet, not stand-alone args
<mikdusan>
with -gnu disappearing, on x86_64-windows-mingw takes it's place
<mikdusan>
and on macos it is meaningless; but we introduce `-system` abi as well and `x86_64-macos-system` would mean use host stuff
<mikdusan>
if the work on macos bundled includes pans out potentially we can have default `x86_64-macos-libc` or somesuch as the default
[wtf] has joined #zig
[wtf] has quit [Client Quit]
waleee-cl has joined #zig
Akuli has joined #zig
sord937 has quit [Quit: sord937]
Biolunar has joined #zig
tefter has quit [Quit: WeeChat 3.1]
zenkuro has joined #zig
tefter has joined #zig
klltkr has joined #zig
xackus__ has quit [Ping timeout: 246 seconds]
Akuli has quit [Quit: Leaving]
squeek502 has joined #zig
motersen has quit [Remote host closed the connection]