From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA29440; Wed, 19 May 2004 23:35:08 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA29419 for ; Wed, 19 May 2004 23:35:07 +0200 (MET DST) Received: from ptb-relay03.plus.net (ptb-relay03.plus.net [212.159.14.214]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i4JLZ6SH008574 for ; Wed, 19 May 2004 23:35:07 +0200 Received: from [80.229.56.224] (helo=chetara) by ptb-relay03.plus.net with esmtp (Exim) id 1BQYiO-0000du-Oy for caml-list@inria.fr; Wed, 19 May 2004 21:35:04 +0000 From: Jon Harrop Organization: University of Cambridge To: caml-list@inria.fr Subject: Re: [Caml-list] Large projects in OCaml Date: Wed, 19 May 2004 22:33:57 +0100 User-Agent: KMail/1.5.4 References: <20040519172442.30413.qmail@web14522.mail.yahoo.com> In-Reply-To: <20040519172442.30413.qmail@web14522.mail.yahoo.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200405192104.29698.jdh30@cam.ac.uk> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Miltered: at concorde with ID 40ABD30A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 vastly:01 undergrad:01 intricate:01 runtime:01 gcc:01 gcc:01 gratuitous:01 pointers:01 type-safe:01 brittle:01 leroy's:01 2004:99 end-user:01 quirky:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I have been using ocaml to write a vector graphics library over the past fo= ur=20 months. I intend to commercialise it. However, I am not yet sure exactly ho= w=20 I can do that... =46rom my experiences, I would say that you are likely to find programming = in=20 ocaml to be vastly more productive than programming in C++. In the case of = my=20 project, for example, I would say that development in ocaml is about 10 tim= es=20 faster than in C++ and code density is about 4 times greater. I would also= =20 say that your programming style (if you are used to imperative style) is=20 likely to change significantly over the first month of using ocaml. It may = be=20 worth noting that I had already dabbled in functional programming as an=20 undergrad. I think it is important to emphasise that the efficiency of developing in=20 ocaml goes a long way to offsetting the (relatively minor) drop in=20 performance. This is because a given project has a finite lifetime and, in= =20 that lifetime, you can try a much wider variety of approaches and algorithm= s=20 using ocaml than you could in C++. If you want to see examples of good ocaml code to learn from then I'd=20 recommend looking at the core library (in the ocaml distribution) and a=20 select few third party libraries. However, you are unlikely to appreciate t= he=20 way in which the code is written without some more intricate knowledge of t= he=20 language itself. > a) Are there examples of > commercial s/w developed in OCaml? I am not aware of any existing commercial software written in ocaml. > b) Is the native compiler/runtime/tools mature for > large commercial projects? Primarily due to the clean design of the language itself (I believe) the to= ols=20 are already of extremely high quality. I have found several bugs in gcc but= =20 none in the ocaml compilers, for example. Having said that, I pushed gcc to= =20 its limits (e.g. gratuitous template partial specialisation) but I have nev= er=20 used the more risque features in ocaml. However, if you are planning on using external libraries in other languages= =20 then, I think, it is highly likely that you will need to develop your own=20 interfaces to them (which you could then productively distribute for free!)= =2E=20 This is mildly tricky as (I would say) there is relatively little=20 documentation and it involves the use of several magic C macros. You could= =20 also try some of the automated tools (SOAP, camlidl). > We would really appreciate feedback from folks who > have worked on large projects with OCaml. If this > has been answered earlier, we appreciate pointers > to the thread(s). There are some other, important aspects which you haven't covered: The type-safe linking offered by ocaml makes for a very brittle interface=20 between objects (see Xavier Leroy's post to this list on 17 May 2004 entitl= ed=20 "Ocaml shared libraries"). Therefore, I don't believe it is feasible to=20 distribute commercial code in object form. If you intend to sell your code = to=20 programmers and you don't want them to have your source (like me!) then=20 you're a bit stuck. I suspect that selling executables for the end-user wou= ld=20 be comparatively trouble-free. There are some issues with libraries too. The compiler comes with a "core"= =20 library which the compiler itself uses. Although these are extremely well=20 written, they can be a little quirky and their functionality is quite limit= ed=20 (e.g. data structures). Although there are other libraries, such as Extlib= =20 and "the library formerly known as Extlib": http://sourceforge.net/projects/ocaml-lib http://raevnos.pennmush.org/code/annexlib/index.html for example, there is no "Standard library". Part of this problem stems fro= m=20 the fact that, the INRIA team is intended for research and not for the=20 development of such (mundane) code and although they may recieve great code= =20 snippets for contribution to the "core" library, they cannot accept them du= e=20 to copyright issues: http://caml.inria.fr/archives/200403/msg00171.html Additionally, people who know about external libraries often aren't very go= od=20 at designing/writing ocaml code and vice-versa. =46inally, I am not sure how well ocaml runs under Windows. HTH. Cheers, Jon. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners