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 Why I Hate C

Received: by 10.224.31.20 with SMTP id w20mr2733943qac.2.1348190593147;
        Thu, 20 Sep 2012 18:23:13 -0700 (PDT)
MIME-Version: 1.0
Path: q11ni3565349wiw.1!nntp.google.com!feeder1.cambriumusenet.nl!feeder2.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!border2.nntp.ams2.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsreader4.netcologne.de!news.netcologne.de!news.glorb.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail
Newsgroups: comp.lang.lisp
From: Giorgos Keramidas <keram...@ceid.upatras.gr>
Subject: Re: Why I Hate C
References: <a6eeec27-6230-4129-9334-b72f32ece5bb@googlegroups.com>
 <92f0a4b7-5647-4f5b-b44d-bb76a8c914fa@googlegroups.com>
 <87394u792d.fsf@kuiper.lan.informatimago.com>
 <rNOSPAMon-996D10.08172114072012@news.albasani.net>
 <669632d3-b0fe-4ecd-9cf7-a82b61881b3c@googlegroups.com>
 <824nn4og2q.fsf@shevek.netfonds.no>
 <87r4q8hcr7.fsf@kuiper.lan.informatimago.com>
User-Agent: slrn/pre1.0.0-40 (Linux)
Date: 15 Sep 2012 16:38:32 GMT
Lines: 39
Message-ID: <5054af08$0$293$14726298@news.sunsite.dk>
Organization: SunSITE.dk - Supporting Open source
NNTP-Posting-Host: 217.162.217.29
X-Trace: news.sunsite.dk DXC=bO`AD5l?NU84J8>`6Toe6=YSB=nbEKnk;1iFZNlRb2C:GYG:0;0_3?>o_>`WUg<`1:oJZA^dLN@m=^5EK=O1Lj]5oP;ITIn4[i9anHn2b<mAJ2
X-Complaints-To: staff@sunsite.dk
Bytes: 3112

On 2012-09-11, Pascal J. Bourguignon <p...@informatimago.com> wrote:
>"Frode V. Fjeld" <frod...@gmail.com> writes:
>>> Second, why are other languages (e.g., Perl) written in C? I think I
>>> already know the answer to this one, but not really sure.
>>
>> It's probably because Unix is effectively a "C" OS. Windows is
>> similar although leaning somewhat more towards C++ (while Microsoft
>> is trying to shift it to a Microsoft-only runtime). This fact
>> permeates both the technology and "software culture" on these systems
>> (including the popular "high-level" programming languages).
>
> Not really.  Unix is a syscall OS.  Syscalls are as hard to code in C
> as they are in Lisp.  Actually, C needs an assembly library to call
> syscalls.
>
> Now of course, that'd concern only the kernel.  Libraries are also
> parts of the "OS", and since they're written in C, you want a C FFI to
> use them.
>
> But once you have the syscall API and the C FFI done, you don't have
> anything to do directly with C to write any language implementation.

The distinction between syscalls and library functions is kept
relatively 'clear' in well-formed UNIX systems.  The manual pages of
'section 2' are explicitly marked as 'system calls'.  The manual pages
of 'section 3' are also explicitly marked as 'library functions'.

The line is a bit blurry when libc.so is concerned, because it exports
symbols for *both* types of functions, but I fully agree iwth Pascal
here.  Once you have a syscall layer and you have a way to write
user-level libraries on top of it, UNIX is not necessarily tied to C, or
to Lisp for that matter.

What's happening though is that as soon as you move outside of your own
'software bubble', and you _have_ to use someone else's code, the vast
majority of user-mode libraries for UNIX *are* written in C.  Just like
if you are programming for the Android platform, it's far easier to find
libraries in Java instead of Objective Caml, or Fortran.