ChanServ changed the topic of #zig to: zig programming language | https://ziglang.org | be excellent to each other | channel logs: https://irclog.whitequark.org/zig/
notzmv has joined #zig
earnestly has quit [Ping timeout: 260 seconds]
a_chou has joined #zig
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! :-)
<antaoiseach> be*
<andrewrk> antaoiseach, the issue for that is https://github.com/ziglang/zig/issues/591 and there is an accepted plan to fix it
<antaoiseach> andrewrk: oh, that's nice to hear!
notzmv has joined #zig
<antaoiseach> exit
antaoiseach has quit [Quit: leaving]
<andrewrk> Type :qa and press <Enter> to exit Vim
xackus__ has quit [Ping timeout: 240 seconds]
earnestly has joined #zig
cole-h has quit [Quit: Goodbye]
semarie has quit [Ping timeout: 276 seconds]
semarie has joined #zig
vegai has left #zig [#zig]
hiljusti has joined #zig
dyeplexer has joined #zig
waleee-cl has quit [Quit: Connection closed for inactivity]
dyeplexer has quit [Client Quit]
dyeplexer has joined #zig
dyeplexer has quit [Ping timeout: 268 seconds]
dyeplexer has joined #zig
recalloc has quit [Remote host closed the connection]
notzmv has quit [Ping timeout: 260 seconds]
sord937 has joined #zig
hiljusti has quit [Ping timeout: 250 seconds]
kenran has joined #zig
notzmv has joined #zig
waleee-cl has joined #zig
<ifreund> or ZZ!
r4pr0n has joined #zig
r4pr0n has quit [Remote host closed the connection]
r4pr0n has joined #zig
wootehfoot has joined #zig
ur5us has joined #zig
kenran has quit [Remote host closed the connection]
pretty_dumm_guy has joined #zig
pretty_dumm_guy has quit [Client Quit]
pretty_dumm_guy has joined #zig
SimonNa has quit [Remote host closed the connection]
xackus__ has joined #zig
<mikdusan> if I were to code a disruptive virus here's what it would do:
<mikdusan> randomly toggle the caps-lock
<mikdusan> it would be as if millions of vi users suddenly cried out in terror
ur5us has quit [Ping timeout: 250 seconds]
<betawaffle> my keyboard doesn't even have capslock, that would be truly devastating
<ifreund> mine doesn't either :D
wootehfoot has quit [Quit: Leaving]
<mq32> i have caps-lock remapped to compose ^^
ur5us has joined #zig
pretty_dumm_guy has quit [Quit: WeeChat 3.2-dev]
zenkuro has joined #zig
r4pr0n has quit [Quit: r4pr0n]
<companion_cube> mikdusan: you monster
zenkuro has quit [Ping timeout: 265 seconds]
zenkuro has joined #zig
ur5us has quit [Ping timeout: 250 seconds]
mjsir911 has quit [Remote host closed the connection]
mjsir911 has joined #zig
tlam has quit [Ping timeout: 265 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
ssiyad has quit [Quit: Bye!]
ssiyad has joined #zig
sm2n has joined #zig
cole-h has joined #zig
zenkuro has quit [Ping timeout: 260 seconds]
wootehfoot has joined #zig
tlam has joined #zig
SimonNa has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
hiljusti has joined #zig
cole-h has quit [Ping timeout: 240 seconds]
<andrewrk> the worst is when I accidenally toggle caps lock and switch to qwerty at the same time, in vim
<kiedtl> um, how does one coerce an array to a slice again? doing `array[0..]` merely gives a `*const [size]Type'
<andrewrk> &array
<kiedtl> andrewrk: no dice
<kiedtl> Oh, wait, the array shouldn't be constant
<dutchie> constness sounds lik... yeah
<andrewrk> don't tell me it didn't work, show me the error message :)
<kiedtl> andrewrk: sorry :) With `&array` where the array is const the message is "expected type '[]usize', found '*const [2]usize'"
<kiedtl> A compiler hint stating the a slice to a const array isn't valid would be useful
<kiedtl> Assuming everyone is as dense as I am
<dutchie> should i link that zig showtime about pointers again
<dutchie> it's really helpful to understand error messages like that one
<kiedtl> Sure, that'd be neat
<kiedtl> Nice, will take a look at that :)
pretty_dumm_guy has joined #zig
<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]
motersen has joined #zig
cole-h has joined #zig
tefter_ has joined #zig
tefter has quit [Ping timeout: 252 seconds]