From owner-freebsd-chat@FreeBSD.ORG Wed Apr 28 09:33:37 2004 Return-Path: Delivered-To: freebsd-chat@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A279A16A4CE for ; Wed, 28 Apr 2004 09:33:37 -0700 (PDT) Received: from mx.tele-kom.ru (mx.tele-kom.ru [213.80.148.6]) by mx1.FreeBSD.org (Postfix) with SMTP id 0788443D4C for ; Wed, 28 Apr 2004 09:33:36 -0700 (PDT) (envelope-from doublef@tele-kom.ru) Received: (qmail 18500 invoked by uid 555); 28 Apr 2004 20:33:34 +0400 Received: from shark (213.80.149.227) by t-k.ru with TeleMail/2 id 1083170013-18476 for cpressey@catseye.mine.nu; Wed, 28 Apr 20:33:33 2004 +0400 (MSD) Received: by shark (Postfix, from userid 1000) id A7DB6DA; Wed, 28 Apr 2004 20:31:05 +0400 (MSD) Date: Wed, 28 Apr 2004 20:31:04 +0400 From: Sergey Zaharchenko To: Dag-Erling =?utf-8?B?U23QrHJncmF2?= Message-ID: <20040428163104.GA10537@Shark.localdomain> References: <20040425215837.3f4708fe.cpressey@catseye.mine.nu> <20040426094335.GA7578@online.fr> <20040426115842.GA4144@Shark.localdomain> <20040427160737.GA1325@Shark.localdomain> <20040428023920.GA382@Shark.localdomain> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i cc: Rahul Siddharthan cc: Sergey Zaharchenko cc: Chris Pressey cc: chat@freebsd.org Subject: Re: Beginning C++ in FreeBSD X-BeenThere: freebsd-chat@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Non technical items related to the community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2004 16:33:37 -0000 --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 28, 2004 at 04:30:10PM +0200, Dag-Erling Sm=D0=ACrgrav probably wrote: > Sergey Zaharchenko writes: > > If the thesis sounds like > > > >> Any algorithm that can be written in one Turing-complete language can > >> be written in another Turing-complete language. > > > > then I think I understand it. >=20 > No. A language is Turing-complete if it can be used to implement a > universal Turing machine. What you quote is merely a consequence of > Turing-completeness, not its definition. >=20 OK. If I take out every word about main() from C's specification (making it an ordinary function), will the resulting `language' stay Turing-complete? If not, why? Is there an *algorithm* that I can write in C that I can't write in this derived language? (except that I have to run some of the functions of the resulting code from somewhere else). > > > In the functional way (`what it can do') C is not different from C++, as > > you all are pointing out (so I'm not trying to persuade you Turing was > > wrong). It's different in what it allows you to inform the system (the > > linker, for instance) about (and it will learn that *before* any actual > > algorithm of yours is executed). >=20 > The operating system, the C++ compiler and the linker are all written > in C, and using C, you can write an emulator for the computer, on > which the OS, C++ compiler and linker will behave exactly as you > expect. >=20 [ In fact, what I described is indeed intended to be a shared library, not a whole program... ] Within such emulation you will certainly be able to whatever you wish, including dynamically linking a library which has its own initialization in it (the constructor translated to C) to an executable. Fortunately, you don't have to do it. But how do you link a real executable against an emulated shared library:)? > DES > --=20 > Dag-Erling Sm?rgrav - des@des.no >=20 --=20 DoubleF Everything is worth precisely as much as a belch, the difference being that a belch is more satisfying. -- Ingmar Bergman --fUYQa+Pmc3FrFX/N Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAj9xHwo7hT/9lVdwRAt8hAJ9r4OJGbCpWZrLZOVNcGi/h/7+LywCcDIdk g7LZkf4zyPAWWUoSgNS1JN4= =5wV7 -----END PGP SIGNATURE----- --fUYQa+Pmc3FrFX/N--