From: Jon Harrop <jdh30@cam.ac.uk>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Large projects in OCaml
Date: Wed, 19 May 2004 22:33:57 +0100 [thread overview]
Message-ID: <200405192104.29698.jdh30@cam.ac.uk> (raw)
In-Reply-To: <20040519172442.30413.qmail@web14522.mail.yahoo.com>
I have been using ocaml to write a vector graphics library over the past four
months. I intend to commercialise it. However, I am not yet sure exactly how
I can do that...
From my experiences, I would say that you are likely to find programming in
ocaml to be vastly more productive than programming in C++. In the case of my
project, for example, I would say that development in ocaml is about 10 times
faster than in C++ and code density is about 4 times greater. I would also
say that your programming style (if you are used to imperative style) is
likely to change significantly over the first month of using ocaml. It may be
worth noting that I had already dabbled in functional programming as an
undergrad.
I think it is important to emphasise that the efficiency of developing in
ocaml goes a long way to offsetting the (relatively minor) drop in
performance. This is because a given project has a finite lifetime and, in
that lifetime, you can try a much wider variety of approaches and algorithms
using ocaml than you could in C++.
If you want to see examples of good ocaml code to learn from then I'd
recommend looking at the core library (in the ocaml distribution) and a
select few third party libraries. However, you are unlikely to appreciate the
way in which the code is written without some more intricate knowledge of the
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 tools
are already of extremely high quality. I have found several bugs in gcc but
none in the ocaml compilers, for example. Having said that, I pushed gcc to
its limits (e.g. gratuitous template partial specialisation) but I have never
used the more risque features in ocaml.
However, if you are planning on using external libraries in other languages
then, I think, it is highly likely that you will need to develop your own
interfaces to them (which you could then productively distribute for free!).
This is mildly tricky as (I would say) there is relatively little
documentation and it involves the use of several magic C macros. You could
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
between objects (see Xavier Leroy's post to this list on 17 May 2004 entitled
"Ocaml shared libraries"). Therefore, I don't believe it is feasible to
distribute commercial code in object form. If you intend to sell your code to
programmers and you don't want them to have your source (like me!) then
you're a bit stuck. I suspect that selling executables for the end-user would
be comparatively trouble-free.
There are some issues with libraries too. The compiler comes with a "core"
library which the compiler itself uses. Although these are extremely well
written, they can be a little quirky and their functionality is quite limited
(e.g. data structures). Although there are other libraries, such as Extlib
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 from
the fact that, the INRIA team is intended for research and not for the
development of such (mundane) code and although they may recieve great code
snippets for contribution to the "core" library, they cannot accept them due
to copyright issues:
http://caml.inria.fr/archives/200403/msg00171.html
Additionally, people who know about external libraries often aren't very good
at designing/writing ocaml code and vice-versa.
Finally, 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
next prev parent reply other threads:[~2004-05-19 21:35 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-19 17:24 ramu ramamurthy
2004-05-19 21:33 ` Jon Harrop [this message]
2004-05-19 23:04 ` David J. Trombley
2004-05-20 16:31 ` Eric Stokes
2004-05-20 17:37 ` Jon Harrop
2004-05-20 20:30 ` Eric Stokes
2004-05-20 21:04 ` Jon Harrop
2004-05-20 21:41 ` Eric Stokes
2004-05-21 11:28 ` Jon Harrop
2004-05-21 12:49 ` Ville-Pertti Keinonen
2004-05-21 16:27 ` Jon Harrop
2004-05-24 3:07 ` Jacques GARRIGUE
2004-05-24 5:20 ` skaller
2004-05-24 12:14 ` Jacques GARRIGUE
2004-05-24 13:54 ` skaller
2004-05-24 14:20 ` Xavier Leroy
2004-05-24 16:48 ` Alex Baretta
2004-05-24 17:38 ` brogoff
2004-05-25 5:25 ` Alan Schmitt
2004-05-24 19:24 ` skaller
2004-05-24 19:52 ` Brandon J. Van Every
2004-05-24 14:20 ` Daniel Bünzli
2004-05-24 19:34 ` skaller
2004-05-24 16:49 ` james woodyatt
2004-05-19 21:38 ` Richard Jones
2004-05-20 8:46 ` skaller
2004-05-20 11:56 ` [Caml-list] A problem with nan sejourne kevin
2004-05-20 20:42 ` Jon Harrop
2004-05-20 22:24 ` David J. Trombley
2004-05-20 22:45 ` Damien Doligez
2004-05-20 13:10 ` [Caml-list] Large projects in OCaml Jon Harrop
2004-05-20 16:23 ` skaller
2004-05-20 6:35 ` David Monniaux
2004-05-20 7:17 ` Dustin Sallings
2004-05-25 7:26 Mattias Waldau
2004-05-25 19:07 ` Richard Jones
2004-05-25 19:54 ` Evan Martin
2004-05-26 6:57 ` skaller
2004-05-26 8:09 ` Richard Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200405192104.29698.jdh30@cam.ac.uk \
--to=jdh30@cam.ac.uk \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).