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 autolearn=ham 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!news1.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newspeer.monmouth.com!nntp.abs.net!rcn!feed3.news.rcn.net!not-for-mail Sender: jsa@rigel.goldenthreadtech.com Newsgroups: comp.lang.ada Subject: Re: ADA Popularity Discussion Request References: <49dc98cf.0408110556.18ae7df@posting.google.com> From: jayessay Organization: Tangible Date: 02 Sep 2004 10:26:21 -0400 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: DXC=IbMZ_>2e@S>0ihgk7Z]QP:0R]m=BkYWI7:6bU3OT9S9:V^XeI?Ik;I=LjhDjIjS^>1d0an^iIW^Y; X-Complaints-To: abuse@rcn.com Xref: g2news1.google.com comp.lang.ada:3259 Date: 2004-09-02T10:26:21-04:00 List-Id: kevin.cline@gmail.com (Kevin Cline) writes: > jayessay wrote in message news > > kevin.cline@gmail.com (Kevin Cline) writes: > > > > > > 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. You can get even further with a good macro assember. C++ templates are a good example of what is fundamentally wrong with C++: The entire _programming_ system (core language, stl, runtime, adhoc add on libs like boost, etc) is becoming an example of Greenspun's tenth. This is much worse than other such examples which are at least limited to one off applications. > > > 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. Even then it is extremely unlikely that C++ would buy you anything over Common Lisp (which has been shown on numerous occasions to beat C++ code in performance). OTOH, if you're using Python or Perl or somesuch, C++ will typically blow them away on this count. > At work really expressive languages aren't an option, since no one > else here knows any of them. You have my condolences. Your situation is not exactly atypical, it's just sad. /Jon -- 'j' - a n t h o n y at romeo/charley/november com