From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9e7db243dfa070d7 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news2.google.com!news3.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Do people who use Ada also use ocaml or F#? Date: Sat, 30 Oct 2010 04:22:38 +0200 Organization: Ada @ Home Message-ID: References: <4aacf4ab-6e56-421d-8381-26f8aeb5c840@p1g2000yqm.googlegroups.com> NNTP-Posting-Host: +ZcidqkMrHe8tAUIMyA1Yg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.63 (Win32) Xref: g2news2.google.com comp.lang.ada:15925 Date: 2010-10-30T04:22:38+02:00 List-Id: Le Sat, 30 Oct 2010 03:32:53 +0200, Chad R. Meiners = a =C3=A9crit: > let reduce foo =3D > let rec go carry =3D 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 th= e = objects, tagged types may help here. And if the object type is always th= e = same, there is even no need for a generic or a tagged type. 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. 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, desig= n = with Ada (and by the way you may discover and fix some flaws which was n= ot = visible with the ML view). > 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 = ;) > 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 langua= ge = 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 was asking for others' vague and concrete ideas. Hope you will get many Have a nice day and enjoy your research -- = Si les chats miaulent et font autant de vocalises bizarres, c=E2=80=99es= t pas pour = les chiens.