Version française
Home     About     Download     Resources     Contact us    
Browse thread
Ocaml compiler features
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: tab@s...
Subject: Re: [Caml-list] Ocaml compiler features
On Wed, Jan 17, 2007 at 01:14:32AM +1100, skaller wrote:
> No it isn't. First, I don't use exceptions like that: I usually
> wrap them. Second, this technique isn't that useful in a language
> with garbage collection: this is not C++. A thirdly, in my own
> language Felix there ARE no exceptions .. so it can hardly
> be 'common'.
> 
> The Felix compiler (an Ocaml program) throws exceptions
> in three circumstances:
> 
> (a) Errors: no cleanup is required.
> 
> (b) Library functions: either it is a program error
> or I map the exception to a variant: no cleanup is
> required.
> 
> (c) Exiting a deep recursion: in no case is any
> cleanup required.
> 
> So actually in a 60Kloc program, no cleanup is done
> anywhere for any reason. It just isn't necessary.

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.

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...

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.

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

> 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)

Cheers,
-- 
Vincent Hanquez