Newsgroups: comp.arch,comp.sys.super,comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!cam-news-feed3.bbnplanet.com!news.bbnplanet.com!su-news-hub1.bbnplanet.com!news.sgi.com!howland.erols.net!blackbush.xlink.net!unlisys!cs.tu-berlin.de!news.uni-hamburg.de!news.Hanse.DE!wavehh.hanse.de!cracauer
From: cracauer@wavehh.hanse.de (Martin Cracauer)
Subject: Re: Why do I like C? (was Parallelism (superior(?) programming languages)
Message-ID: <1996Dec16.114937.4699@wavehh.hanse.de>
Reply-To: cracauer@wavehh.hanse.de
Organization: Internet Breakdown Task Force
References: <5536n3$90j@nanaimo.island.net> <58ddn7$4rj@mozo.cc.purdue.edu> <58dfqa$95q@A-abe.resnet.ucsb.edu> <32ACC7FB.126@OntheNet.com.au> <58ivka$949@tokyo.engr.sgi.com> <E27nKp.8K0@world.std.com> <32B0C72D.15A@megafauna.com>
Distribution: inet
Date: Mon, 16 Dec 96 11:49:37 GMT
Lines: 89
Xref: glinda.oz.cs.cmu.edu comp.arch:73410 comp.sys.super:7694 comp.lang.lisp:24257

Steve Barnard <steve@megafauna.com> writes:

>1. It has all the control structures and support for data structures
>that I need.

So, has GWbasic all the constructs you'd need? No? IMHO, the features
a programmer feels a need for rely on what he did before.

People usually use a subset of what their language offers (mostly a
fairly complete subset). Since they already have some constructs they
don't need in their current langauge, the impression that more
powerful langauges offer no more features than needed is close.

The situation gets really bad when a programmers comes around to learn
a langauge where the number of features are minimized, but the
flexibilty of features is maximized (A dinfition of what Scheme is
intended to be).

At that point, one can get really frustrated with any number of
features as long as the langauge doesn't allow to define your own
implementations of features of the same power of they build-in
features of the language.

In other words: The point about Lisp is that you can work on a
'meta-level', in C you are bound to a number of language features.

>2. It lets me get as close to the machine as I want to get.

What about alignment in structures? The compiler doesn't support
control without non-ANSI extensions. You'll have to use byte arrays to
do so portably, but then you can do the same in Lisp.

>3. Pointer arithmetic is the single greatest language feature I've ever
>seen for a performance-oriented programmer (Java and Fortran90
>notwithstanding).

See below.

>4. It is extremely portable, if I decide that I want to write portable
>code.

printf is part of the language, no? So, could you please give me an
example how you can write a printf control string that prints a data
type where the actual type is hidden by a typedef inside an include
files that is machine-dependent? 

This is obviously not a difficult part for (format ...)

The NetBSD folks who have an OS that is portable across a number of
machine already though of adding a printf %-directive that accepts a
control string where the data type to print is given. Something like
printf("%(off_t)I",some_off_t). Of course, such a solution would still
require that your output format is still the same for all types.

>5. It doesn't take the stance that I'm an idiot and have to be protected
>from my own mistakes.  It lets me shoot myself in the foot if I want to.

A good Lisp compiler offers all the Guns you need. It is certainly
more difficult to use than in C, don't pointers to any lacation are
part of all high-quality Lisp implementations I know of.

>6. At the same time, it allows me to use the compiler to detect many
>programming errors, assuming I have the good sense to use function
>prototyping.

This is the usual static/dynamic typing debate and a matter of
taste. Common Lisp and Scheme clearly decided to be on the dynamic
side. You might want to look into SML if you want static typing. I
don't know too much about it, but my above points about low-level
features in high-quality Lisp implementation certainly apply to SML/NJ
as well. ML introduces some performance problems by definition, maybe
someone can point out a langauge that is Lisp-like, but to so much
functional-programming oriennted as ML (and has a descent compiler).

>I say this as a former Lisp hacker of many years (in my previous AI
>life).  The only problem I have with Lisp is that it hides the machine,
>which is bad if your God is performance.

I like C, too and there are many point I don't like about Common Lisp
and Scheme, but performance is no longer the reason to prefer one of
the other. A C function in a Lisp program usually does its job as
well when I'm too lazy to beat on my Lisp compiler.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin_Cracauer@wavehh.hanse.de http://cracauer.cons.org  Fax.: +4940 5228536
"As far as I'm concerned,  if something is so complicated that you can't ex-
 plain it in 10 seconds, then it's probably not worth knowing anyway"- Calvin
