01mf02 / jaq

A jq clone focussed on correctness, speed, and simplicity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libm's functions

kklingenberg opened this issue · comments

Rust's libm provides many of the functions described in jq's manual, with some exceptions (e.g. gamma). However, the manual states that availability depends on the system, since they're linked to the C standard library:

Unavailable math functions will be defined but will raise an error.

Should jaq do the same, always failing on functions that aren't defined in libm?

Also, and since including these would add another dependency, should they be feature-gated in jaq?

Should jaq do the same, always failing on functions that aren't defined in libm?

Yes, that sounds reasonable.

Also, and since including these would add another dependency, should they be feature-gated in jaq?

No, they should be unconditionally enabled, like regex (and soon time); see #85 (comment).

Should jaq do the same, always failing on functions that aren't defined in libm?

Yes, that sounds reasonable.

Oh, sorry, I misunderstood. You were referring to Rust's libm, not the system libm.

In that case, I would only define those functions as filters which are implemented in Rust's libm.