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/
<marler8997> andrewrk, looking for direction, should I pursue a change in std.json to support u64 integers?
<andrewrk> hm doesn't json only support 64 bit floats for numbers?
<marler8997> I thought it supported arbitrary precision, looking
<andrewrk> I poked around a little. I think it could make sense to support u64 as well as BigInt even
<andrewrk> for writing, this would emit as a string if necessary; for reading, it would support reading both strings and numbers and emit an error if there was a fraction component
<marler8997> when would it output a string? It's it's bigger than u64 max?
<andrewrk> if storing the value as a f64 would destroy information
<marler8997> gotcha
<andrewrk> (53 bits)
<marler8997> what do you think about making the number type configurable?
<andrewrk> what's the use case there?
<andrewrk> seems like i64, u64, BigInt covers all possible needs
<marler8997> that's true
<marler8997> yeah can't think of any use cases
<ugla> https://tools.ietf.org/html/rfc7159#section-6 JSON seems to leave it implementation-defined. Some APIs (like Twitter) use strings when f64 is not enough.
<marler8997> so, replace Float and Integer with a Number that handles everything?
<marler8997> in std.json.Value?
<andrewrk> what's the purpose there?
<marler8997> so the json parse will be able to parse any thing that's valid JSON
<andrewrk> having Float separate so that you can store a float and have the json renderer decide the best way to output it into json is part of the abstraction
<marler8997> yeah I was thinking the same, I just thought Number would handle it all for you
<marler8997> so Number would also be a union
gazler_ has joined #zig
<marler8997> Would make the Value union match the JSON grammar, kinda nifty
<andrewrk> if we wanted to do that then we would just have Number: f64 and call it a day
idxu_ has joined #zig
s-ol_ has quit [Ping timeout: 240 seconds]
idxu has quit [Ping timeout: 240 seconds]
gazler__ has quit [Ping timeout: 240 seconds]
<marler8997> but that doesn't handle large integers
Snektron has quit [Ping timeout: 265 seconds]
ugla has quit [Ping timeout: 265 seconds]
dtz has quit [Ping timeout: 246 seconds]
<andrewrk> I see, so you want number to have a sub-union
<marler8997> that's one idea
motiejus has quit [Ping timeout: 265 seconds]
BaroqueLarouche has quit [Ping timeout: 265 seconds]
jaens[m] has quit [Ping timeout: 265 seconds]
ky0ko1 has quit [Ping timeout: 265 seconds]
siraben has quit [Ping timeout: 265 seconds]
idxu_ is now known as idxu
<marler8997> I was thinking of punting the decision to the user by making it configurable
<marler8997> but the alternative is just supporting all kinds of numbers
<andrewrk> I think it's much nicer with a non-generic type
ky0ko1 has joined #zig
s-ol has joined #zig
<marler8997> if we don't make it generic, then do you think we should support all possible numbers representable by the JSON spec, or a subset?
xackus has joined #zig
<marler8997> I think all possible could be BigInt with a decimal component, BigFrac? :)
xackus_ has quit [Ping timeout: 240 seconds]
<andrewrk> we have BigRational already but I'm not sure that's warranted here
<marler8997> so you think we should support a subset?
BaroqueLarouche has joined #zig
motiejus has joined #zig
jaens[m] has joined #zig
<andrewrk> not sure
ugla has joined #zig
dtz has joined #zig
siraben has joined #zig
<marler8997> gotcha, well for me it seems like it should either be configurable, or support everything
<marler8997> is that just me?
Snektron has joined #zig
<ugla> My impression is that JS has acted as a lowest common denominator, and there numbers are f64.
<andrewrk> marler8997, that logic does make sense to me
<andrewrk> to be clear I'm down for config options passed to the parser - just not making it generic
<andrewrk> sorry I think making it generic was a straw man I constructed accidentally
rinfo has quit [Ping timeout: 258 seconds]
rinfo has joined #zig
midgard has quit [Ping timeout: 240 seconds]
xackus has quit [Ping timeout: 240 seconds]
osa1 has quit [Remote host closed the connection]
osa1 has joined #zig
<marler8997> ok well, I'd like to do what I can to at least add support for u64, so what path would you deem appropriate for me to accomplish this goal?
<marler8997> create Number union that can support i64/f64 and BigInt?
ur5us has joined #zig
ur5us_ has quit [Ping timeout: 256 seconds]
protheory8-new-m has quit [*.net *.split]
flokli has quit [*.net *.split]
protheory8-new-m has joined #zig
flokli has joined #zig
yrashk has quit [Ping timeout: 264 seconds]
dtz has quit [Ping timeout: 258 seconds]
protheory8-new-m has quit [Ping timeout: 240 seconds]
kameliya[m] has quit [Ping timeout: 244 seconds]
fengb has quit [Ping timeout: 244 seconds]
pafmaf[m] has quit [Ping timeout: 244 seconds]
Nypsie[m] has quit [Ping timeout: 240 seconds]
ifreund_ has quit [Ping timeout: 240 seconds]
BitPuffin has quit [Ping timeout: 240 seconds]
BaroqueLarouche has quit [Ping timeout: 246 seconds]
motiejus has quit [Ping timeout: 258 seconds]
siraben has quit [Ping timeout: 265 seconds]
Snektron has quit [Ping timeout: 260 seconds]
jaens[m] has quit [Ping timeout: 268 seconds]
ziguana[m] has quit [Ping timeout: 268 seconds]
dvaun has quit [Ping timeout: 268 seconds]
yrashk has joined #zig
ugla has quit [Ping timeout: 240 seconds]
<andrewrk> I would support that endeavor
<andrewrk> I would also support flattening it. I think it's implementor's choice
<marler8997> well in that case, what if just add UInteger as a case to the union for now and leave BigInt up to the next guy?
<marler8997> UInteger meaning u64
<andrewrk> I'd be happy to merge such an improvement
<johnLate> https://gist.github.com/andrewrk/34c21bdc1600b0884a3ab9fa9aa485b8#file-basic-tcp-chat-zig-L25 can we be sure here, that client.* is fully constructed before client.handle(...) runs?
cole-h has quit [Ping timeout: 256 seconds]
<andrewrk> johnLate, struct initializations expressions are evaluated in the order they appear in the source
<johnLate> so if .handle_frame and .conn were switched, it would be a problem?
<andrewrk> yes
ifreund_ has joined #zig
<johnLate> so... client.* = Client{ ...} is equivalent to client.*.conn = ...; client.*.handle_frame = ...; // ?
nkoz has joined #zig
<johnLate> what I mean: I can be sure that there will never be a temporary Client{} object that is later copied to client.*? (My assumptions were probably tainted from C++)
midgard has joined #zig
dtz has joined #zig
sebonirc has joined #zig
pafmaf[m] has joined #zig
protheory8-new-m has joined #zig
kameliya[m] has joined #zig
fengb has joined #zig
Nypsie[m] has joined #zig
ugla has joined #zig
Snektron has joined #zig
BaroqueLarouche has joined #zig
<andrewrk> johnLate, in zig, expressions pass their "result location" to sub-expressions and the language guarantees that the expr result goes directly into that location. the issue to document this better is https://github.com/ziglang/zig/issues/2809
<andrewrk> async function calls were one of the main motivations for the language working this way
<johnLate> so about async... do I understand correctly that async functions can not do arbitrary recursion and io_mode == .evented makes main and thereby the whole program async?
BitPuffin has joined #zig
<andrewrk> async is modelled as a function calling convention. when you don't explicitly provide a calling convention, zig is free to choose any calling convention that it wants, and in this way it will infer to use the async calling convention if a function calls another async function, or uses await, or suspend
<johnLate> ok maybe I need an example to understand it better: currently, can I write a something like the tcp chat server with io_mode == .evented that does e.g. jsonStringify in client.handle()? if so, how? or does this depend on https://github.com/ziglang/zig/issues/1006 ?
protheory8-new-m has quit [Ping timeout: 240 seconds]
pafmaf[m] has quit [Ping timeout: 240 seconds]
BitPuffin has quit [Ping timeout: 244 seconds]
ugla has quit [Ping timeout: 240 seconds]
ifreund_ has quit [Ping timeout: 240 seconds]
BaroqueLarouche has quit [Ping timeout: 265 seconds]
Snektron has quit [Ping timeout: 265 seconds]
Nypsie[m] has quit [Ping timeout: 265 seconds]
dtz has quit [Ping timeout: 265 seconds]
fengb has quit [Ping timeout: 260 seconds]
kameliya[m] has quit [Ping timeout: 260 seconds]
<andrewrk> jsonStringify needs to get rewritten with safe recursion in mind
<andrewrk> currently it is violating the planned rules for how recursion will work
<andrewrk> as a workaround, you could, instead of having jsonStringify write directly to your async stream, have it write to an array list buffer in memory, and then send that to your async stream
<andrewrk> this will cause the json functions to not be async, working around the issue
ziguana[m] has joined #zig
jaens[m] has joined #zig
motiejus has joined #zig
siraben has joined #zig
protheory8-new-m has joined #zig
pafmaf[m] has joined #zig
ifreund_ has joined #zig
Nypsie[m] has joined #zig
Snektron has joined #zig
BaroqueLarouche has joined #zig
kameliya[m] has joined #zig
fengb has joined #zig
ugla has joined #zig
dtz has joined #zig
BitPuffin has joined #zig
<marler8997> daurnimator does that work with recursive types?
<marler8997> and it does look like I'd also need #5326
<marler8997> the "Kind" field is like the "tag" of a union
gazler has joined #zig
gazler_ has quit [Ping timeout: 240 seconds]
jsb has quit [Quit: .]
jsb has joined #zig
wilsonk_ has quit [Ping timeout: 240 seconds]
nkoz has quit [Quit: Leaving]
DarkPlutonium has joined #zig
Stephanie has joined #zig
[Ristovski] has joined #zig
dongcarl5 has joined #zig
rinfo has quit [*.net *.split]
euantorano has quit [*.net *.split]
factormystic has quit [*.net *.split]
ave_ has quit [*.net *.split]
DarkUranium has quit [*.net *.split]
Stephie has quit [*.net *.split]
dongcarl has quit [*.net *.split]
andrewrk has quit [*.net *.split]
Ekho has quit [*.net *.split]
Ristovski has quit [*.net *.split]
shachaf has quit [*.net *.split]
dongcarl5 is now known as dongcarl
ifreund_ has quit [Ping timeout: 246 seconds]
pafmaf[m] has quit [Ping timeout: 246 seconds]
jaens[m] has quit [Ping timeout: 246 seconds]
ave_ has joined #zig
factormystic has joined #zig
BitPuffin has quit [Ping timeout: 240 seconds]
fengb has quit [Ping timeout: 240 seconds]
dtz has quit [Ping timeout: 240 seconds]
Snektron has quit [Ping timeout: 240 seconds]
Ekho- has joined #zig
shachaf has joined #zig
rinfo has joined #zig
jaens[m] has joined #zig
pafmaf[m] has joined #zig
euantorano has joined #zig
ifreund_ has joined #zig
Biolunar has quit [Ping timeout: 240 seconds]
Biolunar has joined #zig
ave_ has quit [Quit: o/ https://thelounge.lasagna.dev]
linuxgemini has quit [Quit: o/ https://thelounge.lasagna.dev]
lunamn has quit [Quit: o/ https://thelounge.lasagna.dev]
ave_ has joined #zig
lunamn has joined #zig
<johnLate> damn, wasted 1.5h to rediscover https://github.com/ziglang/zig/issues/6682 - hope that will teach me to search issues first, before trying to reduce my code to a minimal example :-/
linuxgemini has joined #zig
BitPuffin has joined #zig
dtz has joined #zig
fengb has joined #zig
Snektron has joined #zig
Ekho- is now known as Ekho
ur5us has quit [Ping timeout: 264 seconds]
wilsonk has joined #zig
ur5us has joined #zig
ur5us has quit [Ping timeout: 246 seconds]
ur5us has joined #zig
a_chou has joined #zig
ur5us has quit [Ping timeout: 246 seconds]
DarkPlutonium is now known as DarkUranium
earnestly has quit [Ping timeout: 240 seconds]
factormystic has quit [Ping timeout: 260 seconds]
sord937 has joined #zig
[Ristovski] has quit [Quit: 0]
waleee-cl has quit [Quit: Connection closed for inactivity]
[Ristovski] has joined #zig
decentpenguin has joined #zig
drvirgilio has quit [Ping timeout: 264 seconds]
a_chou has quit [Quit: a_chou]
drvirgilio has joined #zig
tnorth_ has joined #zig
decentpenguin has quit [Ping timeout: 240 seconds]
cole-h has joined #zig
g-w1 has quit [Ping timeout: 272 seconds]
g-w1 has joined #zig
_fritchie has joined #zig
fritchie has quit [Ping timeout: 260 seconds]
ur5us has joined #zig
lukego has joined #zig
ur5us has quit [Ping timeout: 256 seconds]
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
earnestly has joined #zig
gazler has quit [Ping timeout: 244 seconds]
xackus has joined #zig
gazler has joined #zig
cole-h has quit [Ping timeout: 240 seconds]
gazler has quit [Remote host closed the connection]
gazler has joined #zig
gazler_ has joined #zig
gazler has quit [Ping timeout: 260 seconds]
craigo has joined #zig
lanodan has joined #zig
mmohammadi9812 has joined #zig
meatcar has quit [Quit: bye bye.]
meatcar has joined #zig
midgard has quit [Read error: Connection reset by peer]
midgard has joined #zig
Xatenev has joined #zig
mikdusan has quit [Quit: WeeChat 2.5]
knebulae has quit [Read error: Connection reset by peer]
mmohammadi9812 has quit [Ping timeout: 240 seconds]
Xatenev has quit [Remote host closed the connection]
xentec has joined #zig
xentec_ has quit [Ping timeout: 260 seconds]
mmohammadi9812 has joined #zig
siraben has quit [*.net *.split]
Snektron has quit [*.net *.split]
pafmaf[m] has quit [*.net *.split]
BaroqueLarouche has quit [*.net *.split]
shurane has quit [*.net *.split]
halbeno has quit [*.net *.split]
yeti has quit [*.net *.split]
siraben has joined #zig
siraben has quit [Max SendQ exceeded]
Snektron has joined #zig
pafmaf[m] has joined #zig
yeti has joined #zig
BaroqueLarouche has joined #zig
halbeno has joined #zig
shurane has joined #zig
mmohammadi9812 has quit [Read error: Connection reset by peer]
BitPuffin has quit [*.net *.split]
jmiven has quit [*.net *.split]
bgiannan has quit [*.net *.split]
mmohammadi9812 has joined #zig
Nypsie[m] has quit [Ping timeout: 240 seconds]
protheory8-new-m has quit [Ping timeout: 240 seconds]
jmiven has joined #zig
BitPuffin has joined #zig
bgiannan has joined #zig
fengb has quit [Ping timeout: 240 seconds]
kameliya[m] has quit [Ping timeout: 268 seconds]
jaens[m] has quit [Ping timeout: 260 seconds]
ugla has quit [Ping timeout: 260 seconds]
Snektron has quit [Ping timeout: 265 seconds]
pafmaf[m] has quit [Ping timeout: 265 seconds]
motiejus has quit [Ping timeout: 240 seconds]
BitPuffin has quit [Ping timeout: 258 seconds]
ifreund_ has quit [Ping timeout: 268 seconds]
BaroqueLarouche has quit [Ping timeout: 265 seconds]
dtz has quit [Ping timeout: 260 seconds]
ziguana[m] has quit [Ping timeout: 260 seconds]
bitmapper has joined #zig
lanodan has quit [Ping timeout: 260 seconds]
lanodan has joined #zig
knebulae has joined #zig
kameliya[m] has joined #zig
Nypsie[m] has joined #zig
fengb has joined #zig
ugla has joined #zig
protheory8-new-m has joined #zig
[Ristovski] is now known as Ristovski
jaens[m] has joined #zig
motiejus has joined #zig
Snektron has joined #zig
pafmaf[m] has joined #zig
fengb has quit [Ping timeout: 240 seconds]
protheory8-new-m has quit [Ping timeout: 265 seconds]
Snektron has quit [Ping timeout: 240 seconds]
kameliya[m] has quit [Ping timeout: 246 seconds]
ugla has quit [Ping timeout: 258 seconds]
Nypsie[m] has quit [Ping timeout: 258 seconds]
motiejus has quit [Ping timeout: 260 seconds]
pafmaf[m] has quit [Ping timeout: 268 seconds]
jaens[m] has quit [Ping timeout: 260 seconds]
protheory8-new-m has joined #zig
ifreund_ has joined #zig
jaens[m] has joined #zig
ugla has joined #zig
motiejus has joined #zig
siraben has joined #zig
dtz has joined #zig
BitPuffin has joined #zig
BaroqueLarouche has joined #zig
ziguana[m] has joined #zig
kameliya[m] has joined #zig
pafmaf[m] has joined #zig
Nypsie[m] has joined #zig
Snektron has joined #zig
fengb has joined #zig
factormystic has joined #zig
Akuli has joined #zig
donniewest has joined #zig
drewr has quit [Ping timeout: 256 seconds]
notzmv has quit [Remote host closed the connection]
notzmv has joined #zig
jokoon has joined #zig
protheory8-new-m has quit [Quit: Idle for 30+ days]
pafmaf[m] has quit [Quit: Idle for 30+ days]
mmohammadi9812 has quit [Ping timeout: 264 seconds]
mmohammadi9812 has joined #zig
cole-h has joined #zig
nvmd has joined #zig
tnorth_ has quit [Ping timeout: 240 seconds]
jokoon has quit [Quit: Leaving]
frett27 has joined #zig
notzmv has quit [Remote host closed the connection]
notzmv has joined #zig
hnOsmium0001 has joined #zig
waleee-cl has joined #zig
nvmd has quit [Ping timeout: 246 seconds]
jzelinskie_ is now known as jzelinskie
nvmd has joined #zig
marijnfs has joined #zig
sord937 has quit [Remote host closed the connection]
sord937 has joined #zig
andrewrk has joined #zig
mmohammadi9812 has quit [Ping timeout: 240 seconds]
mmohammadi9812 has joined #zig
knebulae has quit [Read error: Connection reset by peer]
sord937 has quit [Quit: sord937]
cole-h has quit [Quit: Goodbye]
knebulae has joined #zig
decentpenguin has joined #zig
frett27 has quit [Ping timeout: 264 seconds]
frett27 has joined #zig
xackus has quit [Ping timeout: 246 seconds]
frett27 has quit [Ping timeout: 265 seconds]
ur5us has joined #zig
decentpenguin has quit [Quit: ZNC crashed or something]
midgard has quit [Read error: Connection reset by peer]
midgard has joined #zig
decentpenguin has joined #zig
dom96 has joined #zig
notzmv has quit [Remote host closed the connection]
notzmv has joined #zig
Akuli has quit [Quit: Leaving]
ur5us has quit [Quit: Leaving]
donniewest has quit [Quit: WeeChat 3.0]
dvaun has joined #zig
mmohammadi9812 has quit [Ping timeout: 240 seconds]
mmohammadi9812 has joined #zig
wootehfoot has joined #zig
squeek502 has quit [Remote host closed the connection]