my experience at porting some code to core
Dominick LoBraico
dj at lobraico.com
Wed Nov 14 06:48:55 GMT 2012
On Tuesday, November 13, 2012 at 11:10 PM, Francois Berenger wrote:
> 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
Option.value or Option.value_exn
> - 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.
>
You know that you can generate ocamldoc documentation for most/all of the core and async libraries right? E.g.:
$ cd ~/.opam/4.00.1+short-types/build/core.108.07.01
$ make doc
Additionally, some of this is also hosted online, generated as recently as 8 October: https://ocaml.janestreet.com/ocaml-core/latest/doc/
> 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/20121114/075619a5/attachment-0001.html>
More information about the core
mailing list