caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* strict?
@ 2006-08-03  5:13 skaller
  2006-08-03  7:08 ` [Caml-list] strict? Francis Dupont
  0 siblings, 1 reply; 3+ messages in thread
From: skaller @ 2006-08-03  5:13 UTC (permalink / raw)
  To: O'Caml Mailing List

I'm looking for a pair of concepts such as

nice function/transparent expression

which allow an arbitrary choice of evaluation strategy.

A nice function is basically one like 'sin' which is
total, has no side effects, depends only on its arguments,
and always returns a value. I think this is basically
'total, pure and strict'.

A transparent expression is one which can be evaluated
at any time, anywhere. For example 'sin 1.0' is the same
no matter when and where it is evaluated. More or less
an expression is transparent if it is a constant or
application of nice functions to transparent arguments.

The idea is basically to know when a compiler can choose
the evaluation strategy based on performance, without
worrying that this will change semantics. More precisely
my translator *already* does this .. and I want to know
when this is justified (so I can figure out how to
give the programmer enough annotations and control
to get the result they want, and be able to reason
about their code).

Note I use the word 'function' in the C (or Ocaml) sense here.
Clearly the Wikipedia definition of strict:

	f(bottom) = bottom

is rubbish when applied to a mathematical function like 'sin', 
since bottom isn't a valid argument, but it makes sense
for 'sin' in the programming language sense.


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] strict?
  2006-08-03  5:13 strict? skaller
@ 2006-08-03  7:08 ` Francis Dupont
  2006-08-03 20:17   ` skaller
  0 siblings, 1 reply; 3+ messages in thread
From: Francis Dupont @ 2006-08-03  7:08 UTC (permalink / raw)
  To: skaller; +Cc: O'Caml Mailing List

 In your previous mail you wrote:

   Clearly the Wikipedia definition of strict:
   
   	f(bottom) = bottom
   
   is rubbish when applied to a mathematical function like 'sin', 
   since bottom isn't a valid argument, but it makes sense
   for 'sin' in the programming language sense.
   
=> as a student many years ago of the inventor of the "strictness" concept
I don't understand your statement: a strict function is simply a function
which uses its argument. In semantics this is caught by f(bottom) = bottom
where bottom is a semantics value (not a real one) so by definition always
a valid argument.

Regards

Francis.Dupont@fdupont.fr

PS: the inventor is Jean Vuillemin and of course the strictness concept
is central in the evaluation strategies.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] strict?
  2006-08-03  7:08 ` [Caml-list] strict? Francis Dupont
@ 2006-08-03 20:17   ` skaller
  0 siblings, 0 replies; 3+ messages in thread
From: skaller @ 2006-08-03 20:17 UTC (permalink / raw)
  To: Francis Dupont; +Cc: O'Caml Mailing List

On Thu, 2006-08-03 at 09:08 +0200, Francis Dupont wrote:
>  In your previous mail you wrote:
> 
>    Clearly the Wikipedia definition of strict:
>    
>    	f(bottom) = bottom
>    
>    is rubbish when applied to a mathematical function like 'sin', 
>    since bottom isn't a valid argument, but it makes sense
>    for 'sin' in the programming language sense.
>    
> => as a student many years ago of the inventor of the "strictness" concept
> I don't understand your statement: 

well .. I'll simplify it then: "I'm confused" :)

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-03 20:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-03  5:13 strict? skaller
2006-08-03  7:08 ` [Caml-list] strict? Francis Dupont
2006-08-03 20:17   ` skaller

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