caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Vincent Hanquez <tab@snarc.org>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Ocaml compiler features
Date: Wed, 17 Jan 2007 04:47:47 +1100	[thread overview]
Message-ID: <1168969667.5178.18.camel@rosella.wigram> (raw)
In-Reply-To: <20070116150027.GA17519@snarc.org>

On Tue, 2007-01-16 at 16:00 +0100, Vincent Hanquez wrote:

> Does you felix program have threads ? or lots of file descriptor ? or
> has to stay up for a long period of time ? or use side effect quite
> extensively ?
> 
> Absolutely not, it's a compiler that doesn't need much of these stuff.
> And even then, you can most of the time just rely on exit(3) to cleanup
> since it's a short live service.

Correct.

> What about a server now ? add threads in the mix where all mutex need to
> be properly unlocked, add also function with weird side effects that
> don't have any representation variable at the OCaml level (thus cannot be
> garbage collected), etc...

What about it? C manages to handle all that .. and has no exceptions.

> So please don't generalise your situation which is quite specific
> (compiler) to the whole world of OCaml and open your mind to the fact
> that people has different need/expectation.

Try not to make assumptions about what people know. 
I've been programming for three decades. My mind isn't
closed .. you just don't seem to get that what YOU think
is common practice may actually not be.

> (and that Felix doesn't have exceptions, I couldn't care less. OCaml
> does and there are no going away, so live with it.)

You missed the point. Neither C nor Felix have exceptions, and Ocaml
can be programmed the same way. There's no need for finally
if you program in an 'exception free' style.  

It may be convenient but your claim was that the need was 'common'.
I doubt this. 

I DO agree exceptions, as structured now, are not so good.
They're clumsy, hard to use, and dangerous (if not downright evil).

But adding 'finally' may not be the best solution,
the try/let construction looks better to me.

> > Actually I'm a Python ex-guru, I have two major pieces
> > of software written in it, and I've even *implemented*
> > a Python interpreter .. in Ocaml :)
> 
> Good for you. (interpreter still fall in the compiler category btw)

The interpreter actually needed finalisation, since it used
Ocaml GC instead of Python reference counting. In fact Ocaml
finalisers were more or less added to Ocaml *because* my
project provided a solid use case.

In fact I have used Ocaml in a telco environment .. using
the nice Event module, with many threads, services,
and clients interacting in (soft) real time. That was some
time ago so I can't say if I would have used 'finally'
in that context or not. But typically I do that kind of
thing the C way, which is generally the Ocaml way too:
you propagate return codes from functions using variants
up call chains.


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  reply	other threads:[~2007-01-16 17:47 UTC|newest]

Thread overview: 75+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-13  5:37 Edgar Friendly
2007-01-13  5:56 ` [Caml-list] " Tom
2007-01-14 17:35   ` Edgar Friendly
2007-01-14 17:59     ` ketty
2007-01-14 18:21       ` Edgar Friendly
2007-01-14 18:29         ` Jon Harrop
2007-01-13  7:41 ` David Baelde
2007-01-13  9:31   ` ketty
2007-01-14 17:33   ` Edgar Friendly
2007-01-14 18:23     ` Jon Harrop
2007-01-14 18:41       ` Vincent Hanquez
2007-01-14 20:49         ` Jon Harrop
2007-01-14 23:38           ` Gabriel Kerneis
2007-01-15  0:55             ` Jon Harrop
2007-01-15  6:12               ` skaller
2007-01-15  0:05           ` Vincent Hanquez
2007-01-15  5:59             ` skaller
2007-01-15 20:23             ` Martin Jambon
2007-01-15 21:30               ` Jon Harrop
2007-01-15 22:13                 ` Try finally (was Re: [Caml-list] Ocaml compiler features) Daniel Bünzli
2007-01-15 22:27                   ` Vincent Hanquez
2007-01-15 22:40                     ` Quôc Peyrot
2007-01-15 23:08                       ` Vincent Hanquez
2007-01-15 22:17               ` [Caml-list] Ocaml compiler features Vincent Hanquez
2007-01-16  1:18                 ` skaller
2007-01-16  2:11                   ` Jon Harrop
2007-01-16  5:18                     ` Edgar Friendly
2007-01-16  6:36                       ` skaller
2007-01-16  6:33                     ` skaller
2007-01-16 13:55                     ` Brian Hurt
2007-01-16  9:00                   ` Vincent Hanquez
2007-01-16 14:14                     ` skaller
2007-01-16 15:00                       ` Vincent Hanquez
2007-01-16 17:47                         ` skaller [this message]
2007-01-16 19:24                           ` Edgar Friendly
2007-01-17  3:28                             ` skaller
2007-01-17 11:41                               ` Vincent Hanquez
2007-01-17 12:53                                 ` Olivier Andrieu
2007-01-17 13:18                                   ` Vincent Hanquez
2007-01-17 14:09                                 ` skaller
2007-01-16 19:42                           ` Jon Harrop
2007-01-16 21:15                             ` Florian Weimer
2007-01-17  3:46                             ` skaller
2007-01-17 11:50                               ` Vincent Hanquez
2007-01-15  5:56           ` skaller
2007-01-15  9:35         ` Nicolas Pouillard
2007-01-15 18:28           ` Martin Jambon
2007-01-15 19:02             ` ls-ocaml-developer-2006
2007-01-14 19:01       ` Edgar Friendly
2007-01-14 18:51     ` Vincent Hanquez
2007-01-14 20:49       ` Jon Harrop
2007-01-15  0:19         ` Vincent Hanquez
2007-01-20 19:19           ` Jon Harrop
2007-01-20 21:40             ` skaller
2007-01-14 21:47     ` Tom
2007-01-15 10:36 ` Richard Jones
2007-01-15 14:24   ` Vincent Hanquez
2007-01-16  8:45     ` Hendrik Tews
2007-01-16  9:08       ` Vincent Hanquez
2007-01-21 17:07         ` [Caml-list] native-code stack backtraces (was: Ocaml compiler features) Xavier Leroy
2007-01-21 18:53           ` Pierre Etchemaïté
2007-01-16  5:21   ` [Caml-list] Ocaml compiler features Edgar Friendly
2007-01-16  5:33     ` ketty
2007-01-16  6:00       ` Edgar Friendly
2007-01-16  6:10         ` ketty
2007-01-16  5:55     ` Christophe TROESTLER
2007-01-16 17:51       ` Edgar Friendly
2007-01-16 19:09         ` Jon Harrop
2007-01-16 19:21         ` Brian Hurt
2007-01-16 20:06         ` Jonathan Roewen
2007-01-16 20:13         ` Florian Weimer
2007-01-16  6:51     ` skaller
2007-01-16 18:01       ` Edgar Friendly
2007-01-17  2:23         ` skaller
2007-01-16  8:00   ` Florian Hars

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=1168969667.5178.18.camel@rosella.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@yquem.inria.fr \
    --cc=tab@snarc.org \
    /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).