<ikskuh>
how does async and foreign callbacks work together?
<ikskuh>
i have the situation of "zig calls c calls zig" where the inner zig function does a read/write syscall
<ikskuh>
this will not work with evented i/o, correct?
<andrewrk>
you can make it work but there will be a seam at the C ABI boundary. async is a calling convention and the C ABI does not support that calling convention
grayhatter has left #zig ["reasons"]
<andrewrk>
you could, for example, put something on a queue and then tell the event loop to attend to it
<andrewrk>
you can definitely make it work but there will be glue code at the C ABI boundary
<ikskuh>
okay, good to know :)
<ikskuh>
deferring a write should be doable, but a read?
<ikskuh>
huh
<ikskuh>
i think i hit a design error
<ikskuh>
you cannot create an array of pointers to global vars atm
foobles has joined #zig
aerona has joined #zig
<ikskuh>
andrewrk, i heard you were featured on the new xkcd *trololo*
<ifreund>
i agree that east const is more consistent within C, but i still hate it
<alehander92>
the thing is it makes sense in a language where somehow `const` and `var-ity` are on the same conceptual level
<alehander92>
separated from the type somehow
satchmo has quit [Ping timeout: 260 seconds]
<ikskuh>
ifreund: you will hate my code bases then
<ikskuh>
alehander92: my proposal was to change pointer-cost and variable-const
<alehander92>
hm, not sure if i know enough zig to get that
<cren>
back to the original topic, anyway: why do I have to do two separate declarations to get an allocator? why not just `const alloc = &ar_alloc.init()` or something?
<ikskuh>
not the actual proposal, but something like
<ikskuh>
let ptr: *nonmut Data;
<ikskuh>
cren: because that would be a pointer-to-temporary
satchmo has joined #zig
<cren>
what thing is temporary there?
<ikskuh>
"ar_alloc.init()"
_Vi has joined #zig
satchmo has quit [Ping timeout: 260 seconds]
satchmo has joined #zig
<cren>
ah yeah that make sense
<cren>
Why does `pub fn ArrayList` currently return an `AlignedArrayList`, is this because `ArrayList` is just an interface
<ifreund>
i assumed it was just to avoid code duplication between the two
<ifreund>
an implementation detail really
<ikskuh>
yeah
waleee-cl has joined #zig
satchmo has quit [Ping timeout: 272 seconds]
<cren>
oh
satchmo has joined #zig
satchmo has quit [Ping timeout: 260 seconds]
satchmo has joined #zig
satchmo has quit [Ping timeout: 246 seconds]
dimenus has joined #zig
satchmo has joined #zig
satchmo has quit [Ping timeout: 246 seconds]
dimenus has quit [Quit: WeeChat 2.8]
dimenus has joined #zig
satchmo has joined #zig
[rg] has joined #zig
alexnask has joined #zig
satchmo has quit [Ping timeout: 260 seconds]
satchmo has joined #zig
satchmo has quit [Ping timeout: 260 seconds]
satchmo has joined #zig
hooo has joined #zig
satchmo has quit [Ping timeout: 260 seconds]
satchmo has joined #zig
satchmo has quit [Ping timeout: 260 seconds]
satchmo has joined #zig
satchmo has quit [Ping timeout: 260 seconds]
satchmo has joined #zig
ifreund has quit [Ping timeout: 258 seconds]
satchmo has quit [Ping timeout: 246 seconds]
satchmo has joined #zig
satchmo has quit [Ping timeout: 260 seconds]
satchmo has joined #zig
xackus_ has quit [Read error: Connection reset by peer]
kronnus has joined #zig
satchmo has quit [Ping timeout: 260 seconds]
satchmo has joined #zig
kronnus has quit [Quit: rcirc on GNU Emacs 26.3]
ifreund has joined #zig
satchmo has quit [Ping timeout: 260 seconds]
cren has quit [Ping timeout: 245 seconds]
nmeum has joined #zig
r4pr0n has joined #zig
Akuli has joined #zig
satchmo has joined #zig
slurpie has joined #zig
r4pr0n has quit [Remote host closed the connection]
st4ll1 has joined #zig
stripedpajamas has joined #zig
cole-h has joined #zig
layneson has joined #zig
stripedpajamas has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ikskuh>
huh
<ikskuh>
i think i discovered a bug in std.json.Parser…
<greenfork>
I want to wrap std.debug.warn function and insert 1 more argument to anonymous struct `fn log(comptime fmt: []const u8, args: var) void`. So I want to pass this argument `.{myarg, args.@"0", ...}` to warn, can I do that?
stripedpajamas has joined #zig
<ikskuh>
.{ myarg } ++ args
<ifreund>
++ is magic
<greenfork>
wow it works, thanks!
<fengb>
C++
<fengb>
C with magic
<ikskuh>
C++.{magic}
Akuli has quit [Ping timeout: 264 seconds]
satchmo has quit [Ping timeout: 260 seconds]
cren has joined #zig
satchmo has joined #zig
stripedpajamas has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
doublex has quit [Ping timeout: 260 seconds]
doublex has joined #zig
wozeparrot has joined #zig
<[rg]>
I noticed hello world from the docs has a bug, but I'm sure you guys know too, gonna try to set up a ppa for zig today
<[rg]>
in other words if you need help on docs...
<cren>
what's wrong with hello world on the docs?
dimenus has quit [Quit: WeeChat 2.8]
dimenus has joined #zig
doublex has quit [Ping timeout: 256 seconds]
<ifreund>
nothing unless i'm missing something
<ifreund>
[rg]: what's the bug?
<oats>
anybody here used gnu readline with zig? any code samples I could peek at?
dermetfan has joined #zig
<[rg]>
ifreund: false alarm? didn't work for me the other day
<[rg]>
on a different distro, but still linux
<ifreund>
[rg]: hmm, at a guess I'd say you were using 0.5.0 and tried the hello world from 0.6.0
<[rg]>
error was file.* on print not allowed, sorry for the ambiguity, don't remeber
<[rg]>
ifreund: that's probably it
dimenus has quit [Quit: WeeChat 2.8]
cren has quit [Remote host closed the connection]
foobles has joined #zig
Akuli has joined #zig
r4pr0n has joined #zig
layneson has quit [Ping timeout: 244 seconds]
[rg] has quit [Ping timeout: 258 seconds]
riba has joined #zig
satchmo_ has joined #zig
satchmo has quit [Ping timeout: 272 seconds]
layneson has joined #zig
doublex has joined #zig
layneson has quit [Ping timeout: 260 seconds]
layneson has joined #zig
r4pr0n has quit [Ping timeout: 240 seconds]
r4pr0n has joined #zig
dimenus has joined #zig
[rg] has joined #zig
stripedpajamas has joined #zig
stripedpajamas has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
stripedpajamas has joined #zig
salotz has quit [Read error: Connection reset by peer]
r4pr0n has quit [Remote host closed the connection]
metaleap has joined #zig
stripedpajamas has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
riba has quit [Ping timeout: 272 seconds]
r4pr0n has joined #zig
[rg] has quit [Ping timeout: 272 seconds]
<oats>
Will a defer get run if std.process.exit() is run later in the function?
<oats>
(/scope)
<ikskuh>
oats: no
<oats>
hmm, ok shoulda guessed
[rg] has joined #zig
<fengb>
process.exit is noreturn. No coming back to Zig
<alexnask>
If you love a process you will let it go
dimenus has quit [Quit: WeeChat 2.8]
[rg] has quit [Ping timeout: 256 seconds]
metaleap has quit [Quit: Leaving]
layneson has quit [Ping timeout: 272 seconds]
r4pr0n has quit [Quit: r4pr0n]
<pixelherodev>
Any numbers on how the latest commits impact the stage2-parser-rewrite perf?
stripedpajamas has joined #zig
Akuli has quit [Quit: Leaving]
slowtype1 is now known as slowtyper
spacehare has joined #zig
<spacehare>
qq: how do I cross-compile multiple zig files?
<spacehare>
the build-exe command doesn't seem to accept more than one file at a time.
<spacehare>
and the build command doesn't accept the -target flag.
<torque>
build-exe should automatically pick up the zig files @import-ed by the main file
<torque>
is your goal to output multiple executables as well?
<spacehare>
I see.
<spacehare>
I basically did `zig build-exe *.zig`, not realizing the main.zig had to be first.
<spacehare>
also: how do I cast an integer to a smaller type?
<spacehare>
in my case: u64 => usize?
<fengb>
@intCast for a runtime safety check
<fengb>
@as if you want a compile error if there's type narrowing
<spacehare>
thanks!
<fengb>
e.g. @as(usize, u64) would fail to compile on 32 bit systems
<spacehare>
yeah, I has tried that previously, but since I'm cross compiling for my (32-bit) raspberry pi it wouldn't compile.
<fengb>
Ah okay, @intCast is your friend then
<afontain_>
oh
<afontain_>
that's great
<tdeo>
note that it's undefined behaviour to @intCast a number that won't fit like that
<tdeo>
you can use @truncate if you want it to just max out
<fengb>
Runtime checked illegal behavior*
<spacehare>
I don't really care, I don't think the software I'm building would need to fit a larger number in there.
<spacehare>
it's not even my software, to make matters worse -_-
<fengb>
Gonna ship Zig for someone else?
<spacehare>
no, I'm compiling some software I found on sourcehut.
dimenus has joined #zig
<spacehare>
it's a notetaking utility.
<dimenus>
is there a quick way to do a byte for byte comparison on a struct in zig?
<spacehare>
trouble is, it's author evidently never tred compiling it on 32-bit platforms