Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Pitfalls? - Changing Lisp to C (enlightened<g>)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kaz Kylheku  
View profile  
 More options Apr 12 2003, 8:33 pm
Newsgroups: comp.lang.lisp
From: k...@ashi.footprints.net (Kaz Kylheku)
Date: 12 Apr 2003 17:33:24 -0700
Local: Sat, Apr 12 2003 8:33 pm
Subject: Re: Pitfalls? - Changing Lisp to C (enlightened<g>)

Mark Conrad <nos...@iam.invalid> wrote in message <news:100420031719186670%nospam@iam.invalid>...
> In article <cf333042.0304101405.55edf...@posting.google.com>, Kaz
> Kylheku <k...@ashi.footprints.net> wrote:

> > There are Lisp implementations that compile to C ...<snipped>...

> Excuse me again (everyone) - I really got these threads all messed up.

> When I started these threads, I thought that the Lisp compilers
> converted the Lisp source-code to C - - - that was wrong, as someone
> here pointed out to me.

> The Lisp compiler that makes the standalone executable creates
> machine-code, I am told, not C code.

Not necessarily. Those compilers that produce C instead of machine
object code can also produce stand-alone executables.

> Thanks for pointing that out.

> As _you_  pointed out, Kaz, there are also CL implementations that
> convert the Lisp source-code to "incomprehensible" C code, code that
> looks entirely different than regular C code.

That's right. C is used this way not only by some Lisp
implementations, but by the implementations of other high level
languages, because using C eliminates the need to write
machine-specific code generation. C can only be used this way because
it is popular and because it has certain machine-language-like
semantics, like the flexible treatment of memory with pointer
arithmetic, and the ease by which the type system can be defeated (at
the penalty of writing C that is no longer well-defined by the ANSI C
standard).

> Is there anything that C is 'better at' than Lisp? <MCL Lisp>
> (other than C being able to work on practically every hardware platform)

C is currently better at being popular, and consequently better at
being found everywhere, including rare embedded systems. There are
probably machines for which your only programming alternative beside
assembly language is C.

C is more cleanly separated into a language and library than Lisp, and
the ANSI C standard even defines the requirements for a ``freestanding
implementation'' in which most of the C library is missing. Such an
implementation requires little or no run-time support. What this means
is that there is a readily identifiable subset of C which is suitable
for writing a kernel of code that runs on the bare hardware, with a
minimal amount of machine language glue or other run-time support.

People use C for writing embedded operating system kernels and other
components such as device drivers because it's a boneheadedly simple
technology for doing so that someone with an EE degree can understand.
On the other hand, these systems written in C exhibit bugs that
require years to hunt down, not to mention laughable security holes
that are discovered years after initial deployment. So it's hard to
conclude that C is actually a successful tool in its domain of
application. But when it's not corrupting data, or sending a copy of
it to an intruder's machine, and when it's carefully written to avoid
doing stupid things like copying the same data many times between
layers of code, code written in C can run fast as hell!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.