<Snektron>
Either that or have a "native word' size type
<Snektron>
Either way i don't really think its useful
<daurnimator>
FWIW, this came up when I was trying to automatically generate lua bindings for zig libraries. lua only supports 64 bit *signed* integers; so things like an .indexOf() were failing (cause they return a u64)
<daurnimator>
s/u64/usize/
metaleap has joined #zig
<daurnimator>
and I realised that the 64th bit was always going to be unused
<daurnimator>
so it would be stupid to campaign for it to be suppored by lua
_whitelogger has joined #zig
_whitelogger has joined #zig
ur5us has joined #zig
dddddd has quit [Ping timeout: 268 seconds]
jjido has joined #zig
knebulae has joined #zig
ur5us has quit [Ping timeout: 248 seconds]
mikdusan has quit [Quit: WeeChat 2.6]
waleee-cl has joined #zig
<daurnimator>
andrewrk: yeah.... so then it would take a u64, not a usize...
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #zig
mahmudov has quit [Ping timeout: 260 seconds]
mikdusan has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mahmudov has joined #zig
jjido has joined #zig
marijnfs has joined #zig
<daurnimator>
hmmmm.... @export isn't working for me
<marijnfs>
what's the normal way to build and install zig with zig
<marijnfs>
zig install just silently does nothing it seems
<marijnfs>
i see, so it compiles some stuff but no binary yet
<daurnimator>
marijnfs: stage2 (the zig compiler written in zig) is far from ready.
<daurnimator>
marijnfs: however parts of stage2 are used by the current compiler; e.g. translate-c is written in zig; and linked into "stage0" to make stage1
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<daurnimator>
essentially: it parts of zig (the executable) that aren't needed by the zig compiler itself are eligible to be written in *only* zig.
<daurnimator>
`zig zen` may be the simplest example of that
dingenskirchen has quit [Quit: dingenskirchen]
dingenskirchen has joined #zig
daurnimator has quit [Ping timeout: 260 seconds]
jjido has joined #zig
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
dingenskirchen has quit [Client Quit]
dingenskirchen has joined #zig
marmotini_ has quit [Ping timeout: 268 seconds]
daurnimator has joined #zig
<mq32>
on the topic earlier: what size does usize have on AVR?
<mq32>
AVR has a lot of different pointer sizes
<mq32>
16 bit for data pointers, or (depending on the device) 15,16 or 17 bit for code pointers
<mq32>
so you have different pointer size for data- and code segments
dingenskirchen has quit [Remote host closed the connection]
mahmudov has quit [Ping timeout: 272 seconds]
dingenskirchen has joined #zig
dingenskirchen has quit [Remote host closed the connection]
dingenskirchen has joined #zig
dddddd has joined #zig
_Vi has joined #zig
LER0ever has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Xatenev has joined #zig
<Xatenev>
hello, why does fmt.bufPrint takes a slice as first param and not an array?
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
riba has joined #zig
jjido has joined #zig
<metaleap>
Xatenev: would have to be a pointer to an array to not write into a temp copy of your passed array (the arg could be stack-allocated-then-discarded-on-return)
<metaleap>
and a pointer to an array? that's called a slice =)
<Xatenev>
metaleap: understood
<Xatenev>
makes sense :)
<Xatenev>
metaleap: is it correct that zig does not have post/prefix operators?
<Xatenev>
if yes, I cant find them in the docs :P
<Xatenev>
post prefix increment operators*
<metaleap>
++ and -- are not included, only += and -=
<Xatenev>
I see, thanks !
<Xatenev>
sorry, one more question. what is the best practice for constness? I have many structs that e.g. take a *obj type (pointer to obj), i would like it to accept const obj pointers and obj pointers, can i do that?
riba has quit [Ping timeout: 272 seconds]
<Xatenev>
I'd have guessed that const pointers would cast down to non const obj pointers just fine but thats not the case :)
<shakesoda>
Xatenev: prefer const wherever possible, but note things can cast up to const but not down unless you forcefully cast it away (bad!!!) or copy the object
<Xatenev>
shakesoda: understood, thank you
<Xatenev>
I am rewriting my raytracer from c to zig, its a pleasurable experience :)
<shakesoda>
nice, i've been doing some texture generation and raytracer is on the todo list :)
<shakesoda>
porting some of my gamedev libraries has been (slowly, as i learn) in progress, it has been pleasant
<Xatenev>
cool
<Xatenev>
yea I thought about porting to c++ or rust, but I can't take a lot of pleasure in both languages :( they are just.. to big, you have to waste a lot of time by digging through language features to find out whats the correct way to do something
<Xatenev>
when you really just want to focus on your program, zig seems to be a good fit for me here :)
<shakesoda>
i found rust incredibly frustrating, but not zig
<shakesoda>
zig has everything i like about c, and also improves on most everything i wish were better in c... without bringing in the complicated junk in c++ and rust
<Xatenev>
yeah, exactly.
<shakesoda>
i've been thinking of zig being to c as rust is to c++
* mq32
just backports a C++ program to Zig and i'm really happy about it
_Vi has quit [Ping timeout: 272 seconds]
<mq32>
i can remove intricacy without removing complexity
<shakesoda>
mq32: on my list for when zig matures slightly more is doing the same for many of my programs
<shakesoda>
hopefully not in too many releases :)
<mq32>
yeah, i love zig too much now that i want to continue hacking around in C++
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
forgot-password has joined #zig
return0e has joined #zig
return0e_ has quit [Ping timeout: 240 seconds]
<forgot-password>
Is it still possible to format floats in non-scientific notation? I recall being able to use "{.3}" to do that, but now "{:.3}" prints the scientific notation
alexnask has joined #zig
marijnfs has quit [Ping timeout: 268 seconds]
marmotini_ has joined #zig
<metaleap>
{d:3.3} gives 123.456
<metaleap>
with a float
<metaleap>
so yeah just d prefix even for floats
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #zig
<forgot-password>
Oh cool, thanks, I couldn't make that part out in the fmt source :)
<Xatenev>
what is the zig way of ignoring a param?
<betawaffle>
but SDL just has garbage string errors
<andrewrk>
oh. R.I.P.
<betawaffle>
i suppose if that's the case... they don't expect me to handle any of them without crashing. so maybe panic is a reasonable idea?
<andrewrk>
I think panic on initialization is very reasonable
<shakesoda>
betawaffle: i've always handled sdl errors by bailing if it's anything i can't fix by changing gl context version or so
<shakesoda>
i think almost all of them are worth a panic
<shakesoda>
certainly every one related to init
Akuli has joined #zig
Snetry has quit [Ping timeout: 272 seconds]
<andrewrk>
heh, found this in ziglang.org referrer logs: https://compti.me/
<metaleap>
a fellow voidlinuxer and zigger. the dude's got taste
<betawaffle>
i don't like zigger
decentpenguin has joined #zig
<metaleap>
zigster then
<betawaffle>
much better
<metaleap>
my zigga =)
<andrewrk>
+1, let's avoid a lot of unnecessary problems by avoiding that other word
<metaleap>
lol duly noted
<andrewrk>
I have a branch with an abstraction to do multiple operations in parallel, with no heap allocation, a nice & clean API, and it is a "zero cost abstraction" for both evented I/O and blocking I/O
<fengb>
There’s a lot of buzzwords in that sentence :p
<andrewrk>
betawaffle, batch.add(&async self.findNativeIncludeDirPosix(allocator)); is equivalent to batch.add(&(async self.findNativeIncludeDirPosix(allocator)));
<andrewrk>
it's taking the address of a temporary
<betawaffle>
ah, ok
<andrewrk>
this function expresses concurrency and will take advantage of it in evented I/O mode, yet also can be compiled with blocking I/O and it would be as if you didn't put the Batch thing in there
<Xatenev>
metaleap: thanks :) yes I've realized then that that is the way
Aruseus has quit [Quit: Leaving]
Snetry has quit [Ping timeout: 260 seconds]
Snetry has joined #zig
jjido has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
benjif has joined #zig
marmotini_ has quit [Remote host closed the connection]
jjido has joined #zig
_Vi has joined #zig
<pixelherodev>
"zero cost abstraction" in the C++ way, or for real?
<pixelherodev>
That is, is there a comptime cost?
<companion_cube>
looks like fork/join
FireFox317 has joined #zig
<FireFox317>
that looks so cool andrewrk!
<FireFox317>
how is the self-hosted libc detection coming along?
<metaleap>
pretty hyped about this async-await story evolving in zig. in c#/ts it blows because infectious/function-colors, and go channels are a right pita to pamper+caress
forgot-password has joined #zig
forgot-password has quit [Client Quit]
decentpenguin has quit [Ping timeout: 240 seconds]
rjtobin has joined #zig
<fengb>
I like go channels
mzigora has joined #zig
<jaredmm>
cImport creates an assignment to an undefined variable (__builtin_va_list). Is that #515 or me doing something wrong?
moka has joined #zig
moka is now known as Guest59258
Akuli has quit [Quit: Leaving]
mokafolio has quit [Ping timeout: 272 seconds]
Guest59258 is now known as mokafolio
FireFox317 has quit [Ping timeout: 265 seconds]
mzigora has quit [Quit: mzigora]
discip has joined #zig
discip has quit [Remote host closed the connection]