Beginning C++ in FreeBSD

Sergey Zaharchenko doublef at tele-kom.ru
Thu Apr 29 07:53:08 PDT 2004


On Thu, Apr 29, 2004 at 09:39:04AM -0400,
 Rahul Siddharthan probably wrote:
> Sergey Zaharchenko said on Apr 29, 2004 at 08:39:54:
> > It wasn't me who spoke about Turing for the first time.
> 
> No, that was me.  But it was you who went off in a red-herring
> direction about it.  Go back and re-read the context.
> 

Actually, it wasn't the first post which mentioned Turing.

Anyway, re-reading:

> Which has very little relevance to programming languages.  Anything
> that can be done in one Turing-complete language can be done in
> another Turing-complete language.  The trade-off is in development
> time ("expressiveness") and running time.

Please define `anything'. 

I want to write a piece of code. I'll try to describe it detailedly
further. If it fits your definition of `anything', go ahead and try to
write it. If my understanding of `anything' is correct, I believe you
won't be able to do it in C, while it's easy to do that in C++.

a) It must be written in portable C.

b) It will be linked either as a (maybe part of) shared library (we
assume the system supports shared libraries for simplicity).

c) It has 3 functions: initialize() (like allocating memory and
registering run()), run() (anything you like) and deinitialize().

d) The main program (which will use the shared library) will export a
linked list (any kind you wish) which initialize() can access to
`register' run() and deinitialize() --- vice versa.

e) The main program knows nothing about any of these functions. No
details should be visible (the main program won't call [de]initialize()
or run() for you directly, you're on your own).

f) You don't want to hack the main program or the operating system to
overcome any difficulties you will have.

If you think these rules are so masochistic that no-one will ever think
of such a combination --- well, here I am:)

-- 
DoubleF
Corruption is not the #1 priority of the Police Commissioner.  His job
is to enforce the law and fight crime.
		-- P.B.A. President E. J. Kiernan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-chat/attachments/20040429/5d568b11/attachment.bin


More information about the freebsd-chat mailing list