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,c406e0c4a6eb74ed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews2.google.com!not-for-mail From: kevin.cline@gmail.com (Kevin Cline) Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request Date: 30 Aug 2004 13:21:17 -0700 Organization: http://groups.google.com Message-ID: References: <49dc98cf.0408110556.18ae7df@posting.google.com> NNTP-Posting-Host: 198.23.26.253 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1093897300 17712 127.0.0.1 (30 Aug 2004 20:21:40 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 30 Aug 2004 20:21:40 +0000 (UTC) Xref: g2news1.google.com comp.lang.ada:3184 Date: 2004-08-30T13:21:17-07:00 List-Id: jayessay wrote in message news:... > kevin.cline@gmail.com (Kevin Cline) writes: > > > You can not judge the readability of a program by testing whether a > > naive programmer can understand the program line by line. Would you > > consider a book on multivariate calculus to be poorly written because > > it was not immediately understandable by the average high-school > > graduate? Concise mathematical notation makes it possible to reason > > about mathematical objects at a high level. > > So, instead of "limit(e->0) [f(x + e) - f(e)] / e", we write "f'(x)" > > I tend to agree with you here. Paul Graham has some interesting > things to say about this stuff: > > http://www.paulgraham.com/power.html > > [Actually, he has insightful things to say about a lot of stuff...] > > With Common Lisp you could (actually this has been done...) define > some macros creating a small domain specific language for > differentiation and integration. Then you could do things like: > > (d/d? (3*x + (cos x)/x) x) > > ==> # > (((cos x) - (x * (- (sin x)))) / (x ^ 2)) + 3 > > where the function returned is the compiled (yes, to machine code) > form of the derivative.[1] > > So, you could then write something like this: > > (defun apply-derivative (fn &key (of 'x) to) > (funcall (d/d? fn of) to)) > > (apply-derivative ((x ^ 2) + 2) :to 3) > > ==> 6 > > For functions the system doesn't know how to differentiate (or more > likely integrate), you could punt off to a typical iterative > approximater. > > > > Similarly, writing applications concisely at a high level of > > abstraction makes it easier for programmers experienced in the domain > > to modify the application to meet new requirements. > > This is definitely true. This is why domain specific languages are so > potent, but unless you are using something like Common Lisp they tend > not to be built because the effort is much too high to make them cost > effective [2]. As awkward as they are, you can get pretty far with C++ templates. > > > > The Boost::spirit parser library for C++ is an excellent example of > > the power of C++ templates... > > But this is what I don't understand. Why would anyone with this point > of view hamstring themselves by using something so inexpressive as > C++??? That is a good question. At home my projects are small, and I don't use C++ unless they are compute-bound. At work really expressive languages aren't an option, since no one else here knows any of them.