I wonder what is the policy of putting something to scripts/
(not to vmlinux
) that is written with #Rust? I.e. build time utility. Just curious.
And actually, since bindgen
is installed from crates.io, not from kernel tree, should it be actually submitted there, and not to the kernel tree?
Kernel documentation gives pretty bad rationale for bindgen
being in Cargo: “The bindings to the C side of the kernel are generated at build time using the bindgen tool. A particular version is required.” I’m sure there are good reasons to install it using cargo
but why the documentation does not list those reasons, no matter how obvious they might be to some.
So I guess I put my build time tool to crates.io because at least first it is an experiment, and secondly bindgen
is managed like this. But even this does not conclude the story fully. I have no idea in what license that out-of-tree pulled build-time utility is expected to be. It is not documented, or at least I cannot find it documented anywhere.
@jani OK, did not check the implementation. I thought the point was to find the nearest power of two.
I’d probably use __fls()
and << 1
unless the exact same number (i.e. already pow2). Like for the stuff I thought it was used for to be more specific… I guess I stay away from those functions, feels for me more complicated to use them than do what I want open-coded :-) Probably would end up using them in a wrong way…
Other thing that puzzles in #Ethereum and #Swarm is that why waste bandwidth and CPU cycles to #JSON when you could #ASN1 the transaction like:
Root ::= SEQUENCE {
from INTEGER
to INTEGER
value INTEGER
gas INTEGER
gasPrice INTEGER
nonce INTEGER
data OCTET STRING
chainId INTEGER
}
Pretty trivial scalability optimization IMHO. Maybe I submit another talk just to say that hey use ASN1.