On 17/10/11 8:07 AM, vintagecoder at
aol.com wrote:
...
Many languages have a lot of "support" these days (for example, one can
no longer say that Scheme or CL or Haskell etc lack organised libraries).
The examples you listed aren't general purpose programming languages by any
stretch and Scheme and CL are normally byte code compiled although if you
look hard enough you can find a native code version here or there, but
they all have various quirks. Any language that forces you into a paradigm
like "everything is tail recursion" or "every solution is a functional
program" is (far) too narrow for general use.
A problem with this characterisation is that it is dangerously
misleading. Try this with C, PHP, Java, Python, Pascal, BASIC, C#, D, E,
F, G, or $YOUR_FAVOURITE_LANGUAGE:
; Oh gosh, this language lacks something that I liek. What do???
(define-syntax for
(syntax-rules ()
;; iterate over list elements, binding given var to each element
((_ (var list-arg) . body)
(let for-iter ((lst list-arg))
(unless (null? lst)
(let ((var (car lst))) . body)
(for-iter (cdr lst)))))
;; C-style loop with initialisation, condition, & increment clauses
((_ ((var init) cnd step) . body)
(letrec ((var init)
(for-iter (lambda ()
(when cnd
(begin . body)
step
(for-iter)))))
(for-iter)))))
; if you like C's operators, you can have them too:
(define-syntax ++
(syntax-rules ()
((_ sym)
(begin
(set! sym (+ sym 1))
sym))))
; Now we can write programs just like we did in 1980!
; YAY?
(for ((i 0) (< i 10) (++ i))
(print i))
(for (i '(larry moe curly)) ; Try this in C.
(print i))
(for ((i 1.007)
(< i 100)
(set! i (* i i)))
(print i))
There is a much bigger point here,* but 90% of working programmers will
wilfully miss it,? because they apparently consider LEARNING or
intellectual growth as something SUBTRACTED from their lives rather than
added to it. This may be the same backward thinking referenced by
Dijkstra when he pointed out that every line of code is a liability, not
an asset.
--Toby
* - Informal bullet list related:
http://lists.common-lisp.net/pipermail/pro/2011-July/000621.html
? - I can't improve much on this summary of the state of the industry:
http://www.loper-os.org/?p=69