comp.lang.ada
 help / color / mirror / Atom feed
From: "Chad  R. Meiners" <chad.rmeiners@gmail.com>
Subject: Re: Do people who use Ada also use ocaml or F#?
Date: Fri, 29 Oct 2010 20:44:10 -0700 (PDT)
Date: 2010-10-29T20:44:10-07:00	[thread overview]
Message-ID: <d2bce61d-8a1f-4404-b73a-ba58266f06b5@g25g2000yqn.googlegroups.com> (raw)
In-Reply-To: op.vlc9701wule2fv@garhos

On Oct 29, 10:22 pm, Yannick Duchêne (Hibou57)
<yannick_duch...@yahoo.fr> wrote:
> Le Sat, 30 Oct 2010 03:32:53 +0200, Chad  R. Meiners  
> <chad.rmein...@gmail.com> a écrit:
>
>
>
>
>
>
>
>
>
> > let reduce foo =
> >   let rec go carry = function
> >     | [] -> carry
> >     | value :: tail -> go (foo carry value) tail
> >   in go
>
> > the equivalent Ada would be (don't have an Ada compiler accessible)
>
> > generic
> >   type t is private;
> >   type t_list is limited private;
> >   with function foo(Left : t; Right : t) return t;
> >   with function head(item : t_list) return t;
> >   with function tail(item : t_list) return t_list;
> >   with function isNull(item : t_list) return Boolean;
> > function reduce(carry : t; list : t_list) return t is
> > begin
> >   if isNull(list) then
> >     return carry;
> >   else
> >     return reduce(foo(carry, head(list)), tail(list));
> >   end if;
> > end reduce;
>
> This would not be automatic generalization any more, but depending on the  
> objects, tagged types may help here. And if the object type is always the  
> same, there is even no need for a generic or a tagged type.

This is an interesting point.   F# implements reduce as a .Net
generic.  This is why you can do an apple to apple comparison with ML
to Ada.  Tagged types while cool are not needed.

val reduce : ('a -> 'b -> 'a) -> ('a -> 'b list -> 'a)

> That where ML and Ada differs : the fist required analysis is not the  
> same. With ML you do not have to know what will be the type(s) of the  
> object, with Ada you must. That is one of the reason why I said ML is  
> better at modeling, with Ada, the model is supposed to be known and not to  
> be later discovered.

This is not true.  With generics, the types are not known either, they
are discovered during instantiation, which is also later.  ML just
saves you the verbiage.  I do agree that the philosophy of Ada tends
to extract constraints better.  It is what I learned, and guess I try
to "program in Ada" in other languages.

> The example, although it is a good one, simply does not apply.
>
> If you want both : model with ML, when the model is stable enough, design  
> with Ada (and by the way you may discover and fix some flaws which was not  
> visible with the ML view).

There is a misunderstanding here.  I value your input.  However, I am
not trying to change Ada. I am trying to get other viewpoints (like
your).

ML is not a modeling language and neither is Ada.  If I want to
specify something, I will use Z, B or Alloy.  If I want to model
behavior, then I would use LOTOS or Promela, or make a custom model
checker.

Ada does not discover flaws that modeling does.  The type system is
nice, but not that nice.

> > It seems to me others may want to combine the nice traits in each
> > language.  I build research algorithms, conciseness is very desirable
> > because *I want to be able to fit complete algorithms on a page*
>
> Fitting all on a page, Ada is not made for that. A modeling language is ;)

No, this is common misunderstanding.  Modeling languages describe
behavior denotationally. Let me put it this way, when you model
something, you want the specification the be satisfied by a large
number of possible implementations.  When your specification can only
be satisfied by a specific implementation, your have specified an
implementation instead of the requirements, which is not desirable
because the latter are must harder to validate.

> > I know.  I have used SPARK before, and I have built model checker
> > generator in Ada.  I know a little bit about formal methods ;-p
>
> You are experienced so, I am not so much (I just learned and played with  
> SPARK).
>
> > I was asking for others' vague and concrete ideas.  It is pretty
> > difficult to figure out how ML feature and Ada features can be
> > combined.  I am working on a gut feeling that the combination could be
> > pretty awesome.  t'class would be pretty nice in an ML language.
>
> Combined together in a whole and large process, from idea to  
> implementation and deployment, certainly, but not combined at the language  
> level, neither from Ada to ML or the opposite (by the way, I prefer one of  
> the originals ML, which seems more pure to me, than OCaml and peers :p ).

I have friend who think ocaml could benefit from Ada features.  Is
this wrong?  I don't think so. We need to build on the shoulders of
giants.  We need to engage the designers of the language.  They my not
be able to make the changes their languages, but they can pass on
their opinions and experience, which benefit other latter on.

> > I was asking for others' vague and concrete ideas.
>
> Hope you will get many
>
> Have a nice day and enjoy your research

I hope I will too ;-p   I have enjoyed your responses.  This isn't
research, btw.  It is open dialog.





  reply	other threads:[~2010-10-30  3:44 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-29  2:27 Do people who use Ada also use ocaml or F#? Chad  R. Meiners
2010-10-29  2:58 ` Yannick Duchêne (Hibou57)
2010-10-30  1:32   ` Chad  R. Meiners
2010-10-30  2:22     ` Yannick Duchêne (Hibou57)
2010-10-30  3:44       ` Chad  R. Meiners [this message]
2010-10-30 12:15     ` Georg Bauhaus
2010-10-30 12:14   ` Florian Weimer
2010-10-30 12:46     ` Yannick Duchêne (Hibou57)
2010-10-30 13:59       ` Florian Weimer
2010-10-30 14:12       ` Niklas Holsti
2010-10-30 18:58         ` Yannick Duchêne (Hibou57)
2010-10-30 19:20           ` Georg Bauhaus
2010-10-30 23:11           ` Jeffrey Carter
2010-10-31 15:13             ` Florian Weimer
2010-10-29  7:53 ` Dmitry A. Kazakov
2010-10-29 17:10   ` Yannick Duchêne (Hibou57)
2010-10-29 19:10     ` Dmitry A. Kazakov
2010-10-29 22:16   ` Jeffrey Carter
2010-10-30  0:01     ` Vinzent Hoefler
2010-10-30  2:07       ` Chad  R. Meiners
2010-10-30 23:02         ` Jeffrey Carter
2010-10-30 23:30           ` Yannick Duchêne (Hibou57)
2010-10-31  2:31             ` Jeffrey Carter
2010-10-31  2:58               ` Yannick Duchêne (Hibou57)
2010-10-31 10:57                 ` J-P. Rosen
2010-10-31 11:04                   ` Yannick Duchêne (Hibou57)
2010-10-31 16:58                 ` Jeffrey Carter
2010-11-01 17:46                 ` Colin Paul Gloster
2010-11-01 17:03                   ` Vinzent Hoefler
2010-11-03 13:30                     ` Colin Paul Gloster
2010-11-03 19:16                       ` Yannick Duchêne (Hibou57)
2010-10-30  7:41     ` Dmitry A. Kazakov
2010-10-30 23:08       ` Jeffrey Carter
2010-10-30 23:15         ` Vinzent Hoefler
2010-10-31  2:36           ` Jeffrey Carter
2010-10-31  3:01             ` Yannick Duchêne (Hibou57)
2010-10-31  4:52               ` Jeffrey Carter
2010-10-31  5:12                 ` Yannick Duchêne (Hibou57)
2010-10-31  7:38         ` Dmitry A. Kazakov
2010-10-31  8:03           ` Yannick Duchêne (Hibou57)
2010-10-31  8:14             ` Dmitry A. Kazakov
2010-10-31 11:00           ` J-P. Rosen
2010-10-31 11:17             ` Dmitry A. Kazakov
2010-10-31 12:51               ` J-P. Rosen
2010-10-31 15:07                 ` Dmitry A. Kazakov
2010-10-31 15:32                   ` Yannick Duchêne (Hibou57)
2010-10-31 20:00                     ` Dmitry A. Kazakov
2010-10-31 20:04                       ` Yannick Duchêne (Hibou57)
2010-10-31 20:19                         ` Dmitry A. Kazakov
2010-10-31 18:23                   ` Jeffrey Carter
2010-10-31 18:02           ` Jeffrey Carter
2010-10-30  2:07   ` Chad  R. Meiners
2010-10-30  2:29     ` Yannick Duchêne (Hibou57)
2010-10-30  3:55       ` Chad  R. Meiners
2010-10-30  7:49     ` Dmitry A. Kazakov
2010-10-30 12:18   ` Florian Weimer
2010-10-30 12:59     ` Dmitry A. Kazakov
2010-10-30 19:12       ` Yannick Duchêne (Hibou57)
2010-10-30 19:37         ` Dmitry A. Kazakov
2010-10-30 20:04           ` Yannick Duchêne (Hibou57)
2010-10-30 20:54             ` Dmitry A. Kazakov
2010-10-30 21:53               ` Yannick Duchêne (Hibou57)
2010-10-31  8:12                 ` Dmitry A. Kazakov
2010-10-31  9:49                   ` Yannick Duchêne (Hibou57)
2010-10-31 21:46           ` Shark8
2010-11-01  9:32             ` Dmitry A. Kazakov
2010-11-01 10:17               ` Florian Weimer
2010-11-05 12:46               ` Robert A Duff
2010-11-05 16:39                 ` Dmitry A. Kazakov
2010-11-06 17:22                 ` Stephen Leake
2010-11-06 20:56                   ` Robert A Duff
2010-11-06 23:03                     ` Dmitry A. Kazakov
2010-11-06 23:41                       ` Yannick Duchêne (Hibou57)
2010-11-07  0:18                       ` Yannick Duchêne (Hibou57)
2010-11-07 11:51                       ` Simon Wright
2010-11-07 12:14                         ` Dmitry A. Kazakov
2010-11-07  3:05                   ` Chad  R. Meiners
2010-11-01 11:44             ` Brian Drummond
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox