Exactly! and Scala’s version will not compress anywhere near as much as the Java version, which is basically reflecting the fact that Scala probably doesn’t have a lot of useless fluff that you have to write or read when working with it. So smaller compression ratios == more human friendly code.
Ideally we’d look at a 3D plot with three dimensionless axes:
Runtime / Minimum Runtime
Compressed Size / Minimum Compressed Size
Original Size / Compressed Size
(all of them arranged to be O(1) for good implementations, and smaller is better)
Totally tangential and my information theory is quite rusty, but I’d say the interesting limit is the Kolmogorov complexity rather than the Shannon entropy. (Which is equally information theoretic flavored.)
I agree that it is essential to be fair in the context of the rules - but for somebody who does not understand Julia at a deep enough level, I think it is understandable why one would consider that unsafe means unsafe and that is the end of it.
Besides what @jling already presented, are there some good arguments?
Or should we agree that, indeed, we are breaking the rules by using the StaticArrays package?
Noice. That article basically says the same thing I did, which is that compression ratio is a dimensionless measure of verbosity. Cobol compresses about 20:1 and R compresses about 4:1. I wonder how much Julia compresses… I’d guess maybe even less than R.
They’re free to choose their rules. It’s not clear to me if C would be allowed as a language, I guess since it doesn’t have any checks they aren’t “disabled”? Seems arbitrary to me.
I think I’d personally prefer a rule something like no use of unsafe in code written by the submitter. They’ve excluded “standard library” already, So there’s some arbitrary boundary set by whether the language maintainers want it in the “standard” library or in some “external package”. Julia chooses to push stuff into external packages for good reasons. But StaticVector is still a “standard package” and the code isn’t unsafe (ie. it does bounds check).
Not really, no. The reason MVector needed to do those pointer calls is that we don’t have a way of mutating tuples. i.e. it’s a difference between
mutable struct V1{N, T}
v::NTuple{N, T}
end
and
mutable struct V2{N, T}
v1::T
v2::T
v3::T
...
vN::T
end
With V1 we can only replace the entire Tuple at a time, not the individual elements of tuple without resorting to pointer tricks. We unfortunately can’t make the second one for arbitrary sizes, but if we could that’s how MVector would be implemented.
Because there’s a ton of other infrastructure built around StaticArrays.jl, and for the most part Mark’s implementation is just hitting default defined methods that aren’t taking advantage of the fixed size. Also the getindex and setindex! methods were using if-else branching which is not ideal, and also wasn’t eligible remove the error branch.