Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
How to refactor a large Ocaml program
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-12-13 (13:53)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] How to refactor a large Ocaml program
On Thu, 2006-12-14 at 00:09 +1100, Pietro Abate wrote:
> not an answer, but a general comment, maybe also a bit OT ...

> On the other hand, in ocaml, I've never written modules/logical units
> bigger than 1K lines, and even if the project can grow very big, the
> level of interaction between modules is often confined to the module
> interface and changing the name of a function is usually never a big
> problem.

Felix compiler (Ocaml code) is 100K loc. 
The largest hand written files appear to be around 5K  loc.
The compiler runs in phases so coupling is vaguely 'vine like' :)

One of the longest (5K loc) files is more or less
a single huge let-rec. I wish I *could* factor it
more easily. It is a very hard module to understand,
and also consumes about 65% of the compiler running time.

I'm not a very good programmer.. there's no way I could
have gotten this code running in C++ or Java.

Ocaml is quite reasonably expressive. It mainly lets
me think about semantics without too much worrying
about house keeping.

John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: