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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC 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!feeder2.cambriumusenet.nl!feed.tweaknews.nl!87.79.20.105.MISMATCH!news.netcologne.de!ramfeed1.netcologne.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: The state of functional programming Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <2adc4d8d-210e-429c-8188-9b1e99c2718e@d17g2000yqb.googlegroups.com> <1oubrlamjqe8q$.bdwkb9i7ys6b$.dlg@40tude.net> Date: Thu, 29 Jul 2010 22:40:02 +0200 Message-ID: <17hhchqy1a2si.1akul43vk1sd9.dlg@40tude.net> NNTP-Posting-Date: 29 Jul 2010 22:39:59 CEST NNTP-Posting-Host: 665ce579.newsspool3.arcor-online.net X-Trace: DXC=[?: 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. > 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. The actual problem is that Ada code can be in most cases effectively translated into machine code (and later into electrical signals), while for FP code it is much more difficult. There are also other problems related to maintainability. To be readable and maintainable the code must be easily translated back into "how". I.e. the programmer must understand what the code does. Arguably, FP code is farther removed from programmer's "how" than Ada code. > In FP, you define the "problem" (instead) and require from > it a solution. Rather you declare a solution. This is how declarative paradigm works. (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".) > But FP cannot always solve that "problem". Same in Ada. Not every legal Ada program is compilable. I doubt that there is a higher language where any legal program is compilable. The difference is in relation, not in principle. Non-compilable Ada programs are less interesting and numerous than their FP counterparts. But my point was that this is characteristic for *all* declarative languages. I think that no language can be 100% declarative. You can have some well defined parts declarative, as in Ada, but making everything declarative is like flying faster than light, or going beyond Turing completeness, name it. Even if that were possible, we wound not be able to understand what these programs do. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de