24 September 2004

code size

As you know I'm experimenting with OCaml lately. A few days ago (yesterday?) I've solved a simple problem from TopCoder. Very roughly the statement was: you are given a suface and some recatangle masks cover it. Return an ordered set of areas of the remaning "holes". The solution is not interesting. What is interesting is that I've implemented it in both C++ and OCaml. By byte count the OCaml solution was roughly 45% the size of the C++ one. After compression (with bzip2) it was about 67% of the C++ solution. Sounds cool. Anyway, I still spend much more time starring at the monitor when writting in OCaml. The automatisms are not there yet. Also, my knowdgedge of the library is, to say at least, shaky.

No comments:

Post a Comment

Note: (1) You need to have third-party cookies enabled in order to comment on Blogger. (2) Better to copy your comment before hitting publish/preview. Blogger sometimes eats comments on the first try, but the second works. Crazy Blogger.