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/
layneson has joined #zig
layneson4 has joined #zig
layneson4 has quit [Remote host closed the connection]
<pixelherodev> Oh yeah - zero-sized structures == bad at the moment
<pixelherodev> Given that LLVM has a JIT thing, is it possible - or more importantly practical - to make a simple Zig JIT?
<pixelherodev> I can imagine a number of challenges (referring to previous compiled objects for a start), and I'm not sure the LLVM JIT would let you add code at runtime
<andrewrk> pixelherodev, I don't think that's entirely true - sure there may be a few bugs but we also have pretty good test coverage for a lot of zero size types
<pixelherodev> I meant that I've run into a number of crashes because of them
<andrewrk> sure
<pixelherodev> I also probably remember times they've been a nuisance more than the times they've worked :P
<andrewrk> this is one of the benefits of releases, a point in time when you can give things another chance that you had trouble doing before :)
ur5us has quit [Ping timeout: 248 seconds]
<pixelherodev> ?
<pixelherodev> Ohhh
<pixelherodev> Yeah
<pixelherodev> That makes sense
<pixelherodev> https://todo.sr.ht/~pixelherodev/LLVMParser/8 - literally added a reminder to switch to 0.6 once it's released
<pixelherodev> I figure I can leave the code in the current state for now since it's only being used by me anyways, but once 0.6 drops I'm definitely going to want to migrate everything over and take another look
<ky0ko> so, in 0.5, i had the line "client.addCSourceFile(source, [_][]const u8 {"-std=c99", "-g"});" in my build.zig. current gives me an error with this about needing an address-of operator to coerce to slice type '[]const []const u8'
<ky0ko> i can't quite parse this. what is it trying to tell me to do?
layneson has quit [Remote host closed the connection]
layneson has joined #zig
ur5us has joined #zig
<pixelherodev> Try `&` before the two strings?
<pixelherodev> Wait
<pixelherodev> That's a failure to convert to []const [] const u8
<pixelherodev> Not []const u8
<pixelherodev> Add an `&` before the `{`?
darithorn has quit [Remote host closed the connection]
<ky0ko> if i do that it seems to try to interpret the {...} as a scope block instead
<ky0ko> i.e. it wants me to put semicolons there and tries to interpret the strings as code, giving me errors about ignored values
<fengb> /plain Need to put &[_]
<fengb> One day I will master this chat client and not look like a fool
<Cadey> fengb: but this sentence makes you breathe manually
protty has quit [Remote host closed the connection]
adamkowa1ski has joined #zig
lunamn has quit [Remote host closed the connection]
<adamkowa1ski> I'm experiencing strage behavior with a test case of mine. https://github.com/adam-r-kowalski/compute_graph/blob/master/src/main.zig#L173
<adamkowa1ski> I have a arraylist that i'm appending nodes to. However, it seems like their values get corrupted. I put a debug.warn statement to print the value out before I append it to the array list. The value seems correct
<adamkowa1ski> However the act of uncommenting the append changes the value and the print now shows that the value is corrupt?
<adamkowa1ski> Any ideas
<adamkowa1ski> The test case is on line 173, and the commented line is at 167
nephele_ has joined #zig
nephele has quit [Ping timeout: 250 seconds]
adamkowa1ski has quit [Ping timeout: 268 seconds]
mikdusan has quit [Quit: WeeChat 2.5]
daurnimator has quit [Quit: WeeChat 2.6]
adamkowalski has joined #zig
adamkowalski has quit [Ping timeout: 248 seconds]
daurnimator has joined #zig
benjif has quit [Quit: Leaving]
shritesh has quit [Quit: shritesh]
layneson has quit [Quit: Leaving]
mahmudov has quit [Remote host closed the connection]
muffindrake has quit [Ping timeout: 276 seconds]
muffindrake has joined #zig
commander has quit [Remote host closed the connection]
mikdusan has joined #zig
<mikdusan> andrewrk: (just follow up). yes b242c2a did solve the problem. Thanks for closing.
adamkowalski has joined #zig
adamkowalski has quit [Client Quit]
darithorn has joined #zig
adamkowalski has joined #zig
<pixelherodev> fengb, what's the reasoning there?
<fengb> addCSourceFile takes a slice of slices. It's also in the doc: `exe.addCSourceFile("test.c", &[_][]const u8{"-std=c99"});`
nephele_ is now known as nephele
_Vi has joined #zig
adamkowalski has quit [Quit: Lost terminal]
<pixelherodev> Oh right, `[_]` is implicitly sized *array*
<pixelherodev> Not slice
<pixelherodev> So while a pointer-to-array can decay into a slice, an array cannot
ur5us has quit [Ping timeout: 265 seconds]
leeward has joined #zig
<leeward> I'm having trouble exposing a C API that wraps an array_list. https://godbolt.org/z/agqEzr Getting an error that says 'std' has no member array_list.
<leeward> Change export on line 18 to pub, and it builds fine.
leeward has quit [Quit: *Poof*]
<fengb> It probably doesn’t export array_list. Try std.ArrayList
<fengb> It builds “fine” without the export because it lazily ignores the function
_Vi has quit [Ping timeout: 276 seconds]
nephele has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
nephele has joined #zig
ur5us has joined #zig
marmotini_ has joined #zig
adamkowalski has joined #zig
dddddd has quit [Remote host closed the connection]
adamkowalski has quit [Ping timeout: 268 seconds]
riba has joined #zig
FireFox317 has quit [Ping timeout: 276 seconds]
marmotini_ has quit [Remote host closed the connection]
riba has quit [Read error: Connection reset by peer]
marmotini_ has joined #zig
marmotini_ has quit [Remote host closed the connection]
adamkowalski has joined #zig
adamkowalski has quit [Ping timeout: 265 seconds]
SimonNa has quit [Remote host closed the connection]
jjido has joined #zig
nephele has quit [Remote host closed the connection]
nephele has joined #zig
ur5us has quit [Ping timeout: 248 seconds]
darithorn has quit [Quit: Leaving]
Syrup has joined #zig
WendigoJaeger_ has joined #zig
lqd_ has joined #zig
eddyb[legacy]_ has joined #zig
guan_ has joined #zig
\u has joined #zig
rappet_ has joined #zig
wallyduchamp has joined #zig
rxF has joined #zig
M-ou-se_ has joined #zig
Syrup has quit [Quit: ZNC 1.7.4 - https://znc.in]
Syrup has joined #zig
tobbez_ has joined #zig
daurnimator has quit [*.net *.split]
WendigoJaeger has quit [*.net *.split]
programi1 has quit [*.net *.split]
frmdstryr has quit [*.net *.split]
tdeo has quit [*.net *.split]
companion_cube has quit [*.net *.split]
rappet has quit [*.net *.split]
urluck has quit [*.net *.split]
Yardanico has quit [*.net *.split]
tobbez has quit [*.net *.split]
lqd has quit [*.net *.split]
meowray has quit [*.net *.split]
M-ou-se has quit [*.net *.split]
SyrupThinker has quit [*.net *.split]
torque has quit [*.net *.split]
guan has quit [*.net *.split]
eddyb[legacy] has quit [*.net *.split]
WendigoJaeger_ is now known as WendigoJaeger
lqd_ is now known as lqd
Syrup is now known as SyrupThinker
tobbez_ is now known as tobbez
guan_ is now known as guan
eddyb[legacy]_ is now known as eddyb[legacy]
programi1 has joined #zig
daurnimator has joined #zig
companion_cube has joined #zig
ur5us has joined #zig
return0e_ has joined #zig
_Vi has joined #zig
ur5us has quit [Ping timeout: 248 seconds]
jokoon has joined #zig
adamkowalski has joined #zig
jjido has quit [Quit: Connection closed for inactivity]
adamkowalski has quit [Ping timeout: 252 seconds]
_Vi has quit [Ping timeout: 248 seconds]
adamkowalski has joined #zig
adamkowalski has quit [Ping timeout: 268 seconds]
adamkowalski has joined #zig
adamkowalski has quit [Ping timeout: 245 seconds]
adamkowalski has joined #zig
adamkowalski has quit [Ping timeout: 245 seconds]
adamkowalski has joined #zig
adamkowalski has quit [Ping timeout: 246 seconds]
adamkowalski has joined #zig
adamkowalski has quit [Ping timeout: 245 seconds]
adamkowalski has joined #zig
adamkowalski has quit [Ping timeout: 268 seconds]
adamkowalski has joined #zig
adamkowalski has quit [Ping timeout: 245 seconds]
adamkowalski has joined #zig
adamkowalski has quit [Ping timeout: 265 seconds]
adamkowalski has joined #zig
adamkowalski has quit [Ping timeout: 248 seconds]
adamkowalski has joined #zig
dimenus has joined #zig
adamkowalski has quit [Ping timeout: 248 seconds]
mahmudov has joined #zig
<Snektron> yeah i stumbled a bit about that too
<Snektron> huh
<Snektron> matrix broke again, it was in response to <pixelherodev: So while a pointer-to-array can decay into a slice, an array cannot>
<fengb> A glitch in the matrix
dddddd has joined #zig
marmotini_ has joined #zig
marmotini_ has quit [Read error: Connection reset by peer]
FireFox317 has joined #zig
<dch> just tried out building zig from source on aarch64 freebsd and it fails here https://paste.sr.ht/%7Edch/98105078348db3b6f5f8b375e1b6fd6f34a00764#zig-0.5.0%20on%20FreeBSD%20aarch64-L331
<dch> "TODO: support C ABI for more targets" shall I add this to the referred issue, or does this fall under tier-2 still for freebsd?
return0__ has joined #zig
return0e has quit [Ping timeout: 245 seconds]
frmdstryr has joined #zig
protty has joined #zig
leeward has joined #zig
FireFox317 has quit [Ping timeout: 245 seconds]
adamkowalski has joined #zig
<leeward> fengb: It lazily ignores pub functions when building libraries? That seems odd.
<fengb> It lazily ignores everything that's not referenced. Pub jsut means exposed, not compiled
<fengb> Only things that are explicitly used or exported to the linker are actually compiled
<leeward> So if I wanted to write a library in Zig and only ship the object code, I'd have to use the C ABI?
<fengb> Yes, until we define a Zig ABI
<leeward> Well that's a surprise but I guess it's not unreasonable.
waleee-cl has joined #zig
<leeward> Thanks though. It looks like you were right about array_list.
<mq32> fengb, leeward: i don't think it's possible to define an ABI for Zig
<mq32> except for ZigIR maybe
<mq32> because functions with comptime parameters cannot be compiled to machine code
marmotini_ has joined #zig
frmdstryr has quit [Remote host closed the connection]
marmotini_ has quit [Remote host closed the connection]
<leeward> mq32: that's an interesting point. A library distributed as ZigIR would be pretty cool though, since it'd be able to target more than 1 platform.
sammich has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<mq32> yeah, that was excatly my thought after i wrote that :D
sammich has joined #zig
Yardanico has joined #zig
jokoon has quit [Quit: jokoon]
<fengb> I added some "accurate" ghosting to my emulator and it's really disorienting -_-
<mq32> fengb: ghosting?
<mq32> after-image?
adamkowalski has quit [Quit: Lost terminal]
<fengb> More hardware accurate :P
<mq32> ah, motion blur
<mq32> that looks horrible on modern screens
<fengb> Yeah I had to add it in. 60 MHz doesn't actually render it too well
<fengb> It looks horrible on the old GB system too
<fengb> We just look fondly on the past
<mq32> yeah, i know
<mq32> TI83+ has horrible motion blur as well
<fengb> I should probably disable it. It's not a good default
<mq32> yeah, it isn't
<mq32> pretty much any emulator is not hw-accurate
<mq32> as the original games run on CRTs and they have special effects
<WendigoJaeger> some of them are pretty close
<WendigoJaeger> For the SNES hacks I've did, bsnes-plus was very helpful for quick iteration
<WendigoJaeger> wish that LLVM that a proper 680000 backend so that I could use Zig for Genesis/Megadrive projects and Neo-Geo
<mq32> hehe
<mq32> WendigoJaeger, have you seen "overdrive 2" by titan for megadrive?
<WendigoJaeger> yes!
<WendigoJaeger> quite impressive!
<mq32> yeah, it is
<mq32> although they cheated a lot :D
<WendigoJaeger> yeah like that SNES demo that only stream PPU commands generated from F#: https://www.youtube.com/watch?v=di_MnKNDfm0
<mq32> nah, not like that :D
jokoon has joined #zig
Akuli has joined #zig
marmotini_ has joined #zig
return0e_ has quit []
\u is now known as meowray
wootehfoot has joined #zig
riba has joined #zig
Akuli has quit [Quit: Leaving]
<riba> what is the correct way to pass a zig-string (which i got by allocPrint and manually terminated with a "\x00") to c? i tried the .ptr field of the resulting slice but that does not seem to be the right thing to do
<riba> at least when i pass the slice.ptr to the c format string as %s, it prints the address
<riba> no, that is wrong
<riba> it's allocPrint which prints the address
<riba> i have a cstring, so i give allocPrint the cstring.?
<riba> i'll have to think about that
<riba> same happens if i just give it the pointer though
<riba> so i guess the question is, how do i pass a c string to allocPrint
tdeo has joined #zig
<fengb> CString is removed from master
<riba> i guess i mean [*c]const u8
protty has quit [Ping timeout: 260 seconds]
<riba> oh well, the daily 15 minutes of coding are over
riba has quit [Read error: Connection reset by peer]
jjido has joined #zig
<fengb> https://imgur.com/a/4lzGZqy Vexu is a beast
marmotini_ has quit [Ping timeout: 252 seconds]
ofelas has joined #zig
darithorn has joined #zig
dimenus has quit [Killed (sinisalo.freenode.net (Nickname regained by services))]
dimenus has joined #zig
Guest99598 has joined #zig
ofelas has quit [Quit: shutdown -h now]
<D3zmodos> Is there a simple way in zig to recursively print a struct? (purely for debugging purposes, similarly to how golang's %+v does) JSON serialization would do but I don't see any functions in the stdlib json code for serializing structs (unless I'm missing something? >.>)
ur5us has joined #zig
<D3zmodos> oh wait...the default formatting does this already for struct members that are other structs...but seemingly not if they are arrays? (I just get `typename@address`)
lunamn has joined #zig
darithorn has quit [Quit: Leaving]
<andrewrk> D3zmodos, that can be improved
THFKA4 has joined #zig
jjido has quit [Quit: Connection closed for inactivity]
data-man has joined #zig
<data-man> andrewrk: I planned to do it after my vector's formatting PR
waleee-cl has quit [Quit: Connection closed for inactivity]
SimonNa has joined #zig
daurnimator has quit [Ping timeout: 246 seconds]
tines9 has quit [Ping timeout: 250 seconds]
layneson has joined #zig
daurnimator has joined #zig
data-man has quit [Quit: Konversation terminated!]
dimenus has quit [Ping timeout: 252 seconds]
daurnimator has quit [Ping timeout: 248 seconds]
tines9 has joined #zig
daurnimator has joined #zig
GrooveStomp has joined #zig
ltriant has joined #zig
wootehfoot has quit [Read error: Connection reset by peer]
darithorn has joined #zig
adamkowalski has joined #zig
ur5us_ has joined #zig
ur5us has quit [Read error: Connection reset by peer]
frmdstryr has joined #zig
cshenton has joined #zig
<fengb> o_O
<cshenton> Do subsequent calls to @Vector with the same args create distinct types?
lunamn has quit [Ping timeout: 248 seconds]
lunamn has joined #zig
cshenton has quit [Remote host closed the connection]
jokoon has quit [Quit: jokoon]