triallax changed the topic of #numbat to: The Official Numbat channel https://numbat.dev | This channel is publicly logged at https://libera.irclog.whitequark.org/numbat | Please read https://workaround.org/getting-help-on-irc/ if you're new to IRC!
sharkdp has joined #numbat
sharkdp has quit [Remote host closed the connection]
sharkdp has joined #numbat
sharkdp has quit [Remote host closed the connection]
sharkdp has joined #numbat
sharkdp has quit [Remote host closed the connection]
sharkdp has joined #numbat
benjaminl has quit [Ping timeout: 264 seconds]
benjaminl has joined #numbat
sharkdp has quit [Remote host closed the connection]
sharkdp has joined #numbat
benjaminl has quit [Remote host closed the connection]
<triallax> sharkdp: we agreed to do static type checking for string specifiers, right?
<triallax> did we also agree to leave it out of the initial PR? because that's what I'm tempted to do
<sharkdp> I'm not sure we agreed on that :-). I think it is completely fine to leave it out for now.
<triallax> maybe i'm misremembering, it's been what, 3 weeks? :D
<triallax> i've got a bit of time today so i think i'll finally get around to doing the "boring" stuff (tests and docs)
<sharkdp> What exactly do you mean by "static *type* checking"? Parse the format specifier and make sure it has the right structure? Or checking the type of the expressions against the format specifiers in some way?
<triallax> it's the latter
<triallax> but the former would also be nice to have actually
<triallax> and i imagine they'd be done together in the same pr
<sharkdp> I think it's fine to defer both things to runtime. This leaves the possibility to generate the format specifier itself at runtime.
<triallax> that's fine by me
<triallax> though i don't remember if runtime specifiers currently work actually
<triallax> they don't
<triallax> what would the syntax for runtime-generated format specifiers look like?
<sharkdp> Python (and a few other languages) allow something like this: f"{math.pi:.{width}}"
<sharkdp> so you only "parametrize" the format specifier
<triallax> right, then i guess i need to change the parser to accomodate that
<triallax> but also how can we only allow "parametrization" while forbidding other kinds of interpolation in the format specifiers?
<triallax> after all, we don't know anything about them because we leave it to strfmt to actually handle them
<triallax> unless you're not saying we should restrict it to "parametrization"
benjaminl has joined #numbat
benjaminl has quit [Remote host closed the connection]
benjaminl has joined #numbat
benjaminl has quit [Remote host closed the connection]
benjaminl has joined #numbat
<sharkdp> If we want to add that at some point in the future (parametrization), then I think we *need* to parse the format specifiers on our own. Because any expression could appear inside those inner {…}s.
<sharkdp> Which is why I would postpone all kind of static checks. And the parametrization. What you have already solves >95% of use cases.
sharkdp has quit [Remote host closed the connection]
<triallax> sounds good