Re: ADA Popularity Discussion Request
From: jayessay (nospam_at_foo.com)
Date: 08/29/04
- Next message: jayessay: "Re: ADA Popularity Discussion Request"
- Previous message: takizzle: "using java from within ada - AONIX"
- In reply to: Kevin Cline: "Re: ADA Popularity Discussion Request"
- Next in thread: Kevin Cline: "Re: ADA Popularity Discussion Request"
- Reply: Kevin Cline: "Re: ADA Popularity Discussion Request"
- Reply: Kevin Cline: "Re: ADA Popularity Discussion Request"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Aug 2004 11:08:18 -0400
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)
==> #<Function (:ANONYMOUS-LAMBDA 1971) @ #x774811ba>
(((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].
> 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++???
/Jon
1. The actual input form resulting in the compiled function here would
be
(lambda (x)
(+ 3 (/ (- (cos x) (* x (- (sin x))))
(expt x 2))))
2. See: Greenspun's tenth law
-- 'jay' - a n t h o n y at romeo/november/charley com
- Next message: jayessay: "Re: ADA Popularity Discussion Request"
- Previous message: takizzle: "using java from within ada - AONIX"
- In reply to: Kevin Cline: "Re: ADA Popularity Discussion Request"
- Next in thread: Kevin Cline: "Re: ADA Popularity Discussion Request"
- Reply: Kevin Cline: "Re: ADA Popularity Discussion Request"
- Reply: Kevin Cline: "Re: ADA Popularity Discussion Request"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|