4 ms·
Haskell's higher gzipped code size might be due to assignment providing semantic compression for other languages -- that gzip isn't applying to Haskell I.e. gz
by tsegratis 6y ago
Haskell's higher gzipped code size might be due to assignment providing semantic compression for other languages -- that gzip isn't applying to Haskell
I.e. gzip is very unlikely to model assignment in it's compression algorithm, so it will compress other elements -- and those elements probably correlate with the ones Haskell already optimizes for
So gzip metric makes the other languages look better than a pure loc would
- tsegratis 6y agoDoes this imply that anti-functionalism is better? I.e. gzip and the human brain can probably compress repetition and local effects very easily -- and this is what purity gives. So with purity I can only represent the obvious (i.e. easily computable), and gzip suggests this is the part of the computation that least needs expressing -- since it is already the most clear But allowing anything to affect anything else in any way; as a maxima; allows me to represent the least-obvious algorithms most succinctly -- and least-obvious algorithms are the most important ones to represent succinctly! I feel like there is some truth here, but it is not the whole story. What am I missing?
- tsegratis 6y agoI suppose I assumed less-obvious algorithims always have semantically meaningful differences to more-obvious algorithims But we can hope that this is rarely the case More-obvious always wins if there are never any semantic differences Good programming is finding the most-obvious algorithim while keeping the same semantics -- and even sometimes changing the semantics to make them more obvious In that vein, a side question I often ask myself is, which should the algorithm represent clearly: 1) The problem 2) The solution 3) The transition between those two All 3 have validiy, and result in very different programming paradigm How can I choose one above the other??
- tsegratis 6y agoI'd like an answer to that if anybody would care to ;) 1) The problem. Maps well to macros 2) The solution. Maps well to prolog 3) The transition. Maps well to imperative What basis can I use for choosing between those goals?? -- The given mappings are examples
- amelius 6y agoShouldn't two programs with the same function but written in different languages zip to (just about) equal size, for a sufficiently powerful version of zip?
- tsegratis 6y agojpeg compression works better on photos, gif compression works better for horizontal lines of repeating color One of the easiest things to compress is repetition. After that local effects are going to be easiest Remote effects -- i.e. assignment, is going to be np complete -- i.e. if the best compression for x depends on everything else, then zip is going to have to look at everything else for every single bit it compresses!! So I don't know the details of zip's compression, but I'm sure it doesn't compress side-effects well
- CaptainRuhrpott 6y agoSuch a version of Zip can't exist. If it would, you could decide whether a program calculates a certain thing. According to Rice's theorem something like that can't exist without solving the Halting Problem https://en.wikipedia.org/wiki/Rice%27s_theorem https://en.wikipedia.org/wiki/Rice%27s_theorem