[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C as Universal Standard



    Date: Fri, 18 Jan 91 19:34:04 -0800
    From: magerman@Neon.Stanford.EDU


	 The toughest argument, which naive programmers, managers, poverty-stricken
	 academics latch onto, is price performance ratios, cheap MIPS and
	 expensive LISPs, Lisp workstations, Lisp programs.  Of course, if one is
	 writing trivial programs (the definition of programming in C), then why
	 bother with Lisp?

    I was getting a little upset about the UNIX bashing going on in slug.
    But I realized that UNIX does have it's problems (the command names and
    "keywords" are pretty funny).

    But C bashing is going too far.  In many ways, C is a much more powerful
    language than common-lisp.  I can think of many non-trivial applications
    that require number-crunching, text searching and sorting, and/or massive I/O
    that can't afford to wait for garbage collection or consing of any sort:

If you don't cons your datastructure, you must get truly fast execution!

	    Computer vision (although I am not an expert)
	    Statistical Models for Natural Language
	    Regular expression search (a la grep)
	    Any application associated with loading large data sets into a
		    connection machine without a data vault
	    etc.

    There are many situations where you want to have control over the way memory
    is allocated and where in memory things get written.  In the case of large
    data sets, you frequently want to allocate memory in such a way that data
    objects that will be compared or used together will be close together (i.e.
    on the same page) in memory.  Otherwise your OS goes crazy.  This type of
    situation (IMHO) *demands* C programming.

    Lisp is great for writing very clear, concise code.  But when clear, concise
    code causes your OS to thrash on large data sets, it's time to recode the
    algorithm in C.  IMHO, it is precisely the non-trivial problems that
    eventually need to be written in C.

Localizing GCs, areas, destructive operations, and intelligent use of
datastructures eliminate thrashing -- at least if you're using a lisp machine.
Furthermore, paging performance is in fact better on contemporary lisp
machines than unix boxes.  I happen to exercise these features on large data
sets.  I can't speak for Common Lisp running on other archiectures.

Unless your program is trivial (or you reinvent abstraction), you'll never get
it recoded in C.  What shall we call trivial?  Under 50,000 lines of Lisp
(500,000 lines of C)?

    -- David Magerman
    Stanford University
    CS Dept.