my experience at porting some code to core

Francois Berenger francois.berenger.working at gmail.com
Wed Nov 14 05:10:11 GMT 2012


Hi,

The project is about 3k LoC, one man.
I removed dependency to batteries, the standard library and
some ugly macros I had for logging.

I had to:
- add a lot of labels
- use Float.XXX instead of *float* from the std lib
- code BatString.tail
- code BatString.starts_with
- code a kind of BatOption.get
- do a lot of code re-reading to make sure I preserve semantic

I'm starting a new project, so I am OK to break things,
I just want all things to compile for the moment.
There will be some scientific validation of the results later on.

I didn't adopt core's Hashtbl yet.
A little because I am lazy, a little because I am annoyed
by some signature changes (for example: find) that would force me
to update a lot of my code.

It was not so funny to do but I hope it will pay-off in the future.
I started this on Monday and was about 60% of the time on it.
I might start to use labels more in my own code.

I already miss the ocamldoc from batteries, which is quite complete
and nice.

The most difficult part is code re-reading I think.
Sometimes also, compiler parsing errors because of missing labels
are not so trivial to understand.

Regards,
F.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ocaml.org/pipermail/core/attachments/20121113/f9ffd621/attachment.html>


More information about the core mailing list