Re: Choosing a PL - What you can do or how you do it?



On Jul 29, 11:58 am, Chris Barts <puonegf+hfr...@xxxxxxxxx> wrote:
e...@xxxxxxxxxxxxxxxxx < e...@xxxxxxxxxxxxxxxxx> wrote on Friday 27 July
2007 13:38 in comp.programming
<1185565136.200333.246...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>:

The title may be unclear. When choosing a programming language, I
think there are two, perhaps, mutually exclusive options, namely a) PL
that enables you to do whatever you want to do, but not necessarily
the way you (or your friends) would like to do it; and b) PL enables
you to do things the way you (and your friends) like, but not
everything you (and your friends) want/need to do.

A more important metric is how easily you can express the solution without
resorting to implementing another programming language in your program.

Greenspun's Tenth Rule of Programming: "Any sufficiently complicated C or
Fortran program contains an ad-hoc, informally-specified bug-ridden slow
implementation of half of Common Lisp."

This rule applies to a lot of things: People tend to re-implement databases,
threading libraries, and even garbage collection.

For example, I
think it's generally agreed that with C/C++ one can pretty much do
anything in the world one could think of with a computer program -

Not really, no. There are lots of things you cannot reasonably express in C
or C++. Helpful type systems, higher-order functions, and declarative
programming come immediately to mind.

I understand the desire to have these things in a programming
language. They make the programmer's life easier. However, these are
examples of programming techniques, not programs, in themselves.
Whatever program can be written using HOF, may look cleaner or
prettier in Haskell/Lisp/ML, but that doesn't mean C/C++ couldn't
achieve the same results (i.e. output. OTOH, I can point to a C
program like FFTW, and ask, could that be done in pure Haskell? (If
the answer is "yes", please let me know.)


including meeting real-world practical criterion, such as real-time
speed. On the other hand, more elegant/academic languages, such as
Haskell/Lisp, may be preferred by some for how they let you do things
(and express "personality" in doing those things) - even though these
languages may not be able to do all the things that one may need to do
in the real world.

Depends on what foreign function interfaces you have to hand. Common Lisp
with CFFI is quite powerful and can do quite a bit.



The reason I bring this up, is because I have been sort of on a "meta-
learning" quest to grok Haskell. From everything I read on the web and
in textbooks, Haskell does emphatically impress the geeky/academic
side of myself that would like to use the language for everything.
However, there are some things, for example real-time image
processing, that I think Haskell simply won't be able to do - that is
without interfacing an "uglier" low-level language.

I don't know how ugly FFIs are from Haskell. They aren't bad from Common
Lisp.

why do
necessary languages like C/C++ get such a bad rap, when it is pretty
clear we can't actually live without them?

Because they are unhelpful, weak languages that require massive amounts of
work from the programmer to do even simple things, and the work required
quickly ramps up into the unmanageable. For example, it would be
essentially impossible to give a real object system to C++, whereas it was
done repeatedly for Lisp prior to the Common Lisp standards project
blessing CLOS. C and C++ force you to straitjacket your thoughts into their
model, as opposed to being able to adapt to you and the problem at hand.

--
My address happens to be com (dot) gmail (at) usenet (plus) chbarts,
wardsback and translated.
It's in my header if you need a spoiler.


.



Relevant Pages

  • Re: Computer Algebra Algorithms
    ... If you want to learn CAS, learn lisp because that is what the ... The parser could be written in C or any other language. ... I would consider that such a minor aspect of a programming ... generally prefer righting there numeric algorithms in Maple and MATLAB ...
    (sci.math.symbolic)
  • Why should I care about Lisp and Scheme?
    ... Foreword to the book "Essentials of Programming Languages". ... It's an imaginary conversation between a newbie and a hacker. ... Why should I care about Lisp and Scheme? ... language, the result would be a Lisp interpreter. ...
    (comp.lang.scheme)
  • Re: F#
    ... Why did they take Lisp? ... properties of the language are only a part of the picture. ... If the favored programming style of a certain language ... Knowing a success story only tells me that other people ...
    (comp.lang.functional)
  • [ANN] 2nd European Lisp & Scheme Workshop
    ... Pascal Costanza, Programming Technology Lab, Vrije Universiteit Brussel ... Lisp has a tradition of providing a fruitful basis for language design ... and suggestions for breakout groups that discuss the opportunities Lisp ...
    (comp.lang.lisp)
  • Re: Opinions on intro lisp books
    ... But Lisp is a little different, ... Some languages support one style of programming better than they ... Even if that weren't the case, I'm not sure that a language being a ... I don't believe that learning to program in CL requires more theory ...
    (comp.lang.lisp)