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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b3f07bd1ad77d438 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder.news-service.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!.POSTED!not-for-mail From: Warren Newsgroups: comp.lang.ada Subject: Re: The state of functional programming Date: Thu, 29 Jul 2010 21:01:35 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <2adc4d8d-210e-429c-8188-9b1e99c2718e@d17g2000yqb.googlegroups.com> <1oubrlamjqe8q$.bdwkb9i7ys6b$.dlg@40tude.net> <17hhchqy1a2si.1akul43vk1sd9.dlg@40tude.net> Injection-Date: Thu, 29 Jul 2010 21:01:35 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="9f8M0iN5t54V+4DF/iqO8g"; logging-data="6689"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ofVQIeHf7ahu6qk0GfLDPs3OnJkht9co=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:NtLE/XDSkJuES9gbo6YWfEpeeIo= Xref: g2news1.google.com comp.lang.ada:12692 Date: 2010-07-29T21:01:35+00:00 List-Id: Dmitry A. Kazakov expounded in news:17hhchqy1a2si.1akul43vk1sd9.dlg@40tude.net: > On Thu, 29 Jul 2010 19:19:49 +0000 (UTC), Warren wrote: >> Dmitry A. Kazakov expounded in >> news:a3iznu9uq49d$.1m9cupr81yhut$.dlg@40tude.net: >>> On Thu, 29 Jul 2010 15:20:48 +0000 (UTC), Warren wrote: >> .. >>>> I think you missed my point - perhaps it wasn't expressed >>>> clearly. >>>> >>>> As I understand it, a FP tries to determine conclusions >>>> from a universe of facts, given some inputs. For smaller >>>> problems this can be _exhaustively_ analyzed and results >>>> obtained. >>> >>> And so does any declarative language. You declare some facts in >>> whatever form (as relations, as connections of blocks etc, for that >>> matter, as types in a strongly typed languages like Ada). The system >>> infers from them some executable code. >> >> No, there is a big difference here. >> >> In a non-FP language (Ada), you can solve _any_ problem so long >> as you code it (you are coding the "how"). > > Not quite. "How" need to be translated into the Ada code first. In > some cases it is not simple or even impossible. It doesn't matter. You've expressed the solution "in Ada". "You" solved the problem to begin with (i.e. "the how"). >> IOW, you have solved the problem and specified it in code. > > No difference here. Any code is a language (Ada language, machine > language, the language of differential equations and so on). The FP > code is as code as Ada code is. Code in the sense that it is the "specification". One language specifies the "how", and the other specifies the "problem". Surely you see that. >> In FP, you define the "problem" (instead) and require from >> it a solution. > > Rather you declare a solution. This is how declarative paradigm works. Again, in Ada you "declare" the "how". In FP, you "declare" the "problem" to be solved. In FP, you don't about the how, beyond how long will it take. > (Don't forget that Ada has a declarative parts as well. You declare > types for example, and ask the compiler to solve "range 0..100".) This is a pre-solved problem- that you re-apply in a larger solution. The solution has been worked out by the compiler/library writers. This is not "finding a solution" in the present tense. >> But FP cannot always solve that "problem". > > Same in Ada. Not every legal Ada program is compilable. If an Ada program doesn't compile, then the programmer hasn't spelled out the "how" correctly has he? A well formed FP OTOH, can yield a suboptimal or missing result. This is due to no fault in the input "program", but in the way FP was implemented. Anyway, I'm done here. I'm starting to feel like a parrot. Warren