Gene Theory - C core commands

M

Michael

I am currently doing some genetic research on the life cycle of viruses
(biological as opposed to computer based) and require some information about
the core operations of the C programming language so that I can do a little
modelling of viral replication concepts.


As far as I remember from the courses I took many years ago, the majority of
the language is written as include files that are simply extra functions
consisting of a core set of instructions. I need to find out what these core
functions / commands are. Ideally I need to limit these in number to the
fewest numbers that would still allow the language to be as useable as it is
now.


I am not entirely sure that this is making any sense whatsoever!!


My second question is how would I go about allowing a running piece of code
to modify a piece of code, and then have that code compiled and executed
automatically? If any of you have any code fragments at all, this would be
extremely well appreciated as it would mean I could concentrate on my core
business of genetic research instead of spending six months attempting to
get a single piece of code doing what I am sure is a rather simple
operation.


(I do hope that last part is not excessively cheeky!!)


Thank you all in advance for what I am sure will be invaluable advice.

please send any replies not applicable to the group to michael at
futilequest dot com
 
J

Jeff Schwab

Michael said:
I am currently doing some genetic research on the life cycle of viruses
(biological as opposed to computer based) and require some information about
the core operations of the C programming language so that I can do a little
modelling of viral replication concepts.

My second question is how would I go about allowing a running piece of code
to modify a piece of code, and then have that code compiled and executed
automatically? If any of you have any code fragments at all, this would be
extremely well appreciated as it would mean I could concentrate on my core
business of genetic research instead of spending six months attempting to
get a single piece of code doing what I am sure is a rather simple
operation.

Try asking in comp.lang.c, and google for "self-modifying code."
 
J

James Connell

Michael said:
I am currently doing some genetic research on the life cycle of viruses
(biological as opposed to computer based) and require some information about
the core operations of the C programming language so that I can do a little
modelling of viral replication concepts.


As far as I remember from the courses I took many years ago, the majority of
the language is written as include files that are simply extra functions
consisting of a core set of instructions. I need to find out what these core
functions / commands are. Ideally I need to limit these in number to the
fewest numbers that would still allow the language to be as useable as it is
now.

no you're not quit right about that. "C" has a builtin set of
'instructions' ( key words ). you use those to implement the logic of
the program, what is "included" by the header files is a few 'time
saveing' functions ( so you don't have to reinvent the wheel each time )
and the system specific functions that communicate with the outside world.
 
R

Richard Heathfield

Michael said:
I am currently doing some genetic research on the life cycle of viruses
(biological as opposed to computer based) and require some information
about the core operations of the C programming language so that I can do a
little modelling of viral replication concepts.

Er, okay (so why did you post to comp.lang.c++?). I've set followups to
alt.comp.lang.learn.c-c++ since my response assumes that, when you say C,
you mean C, not C++.
As far as I remember from the courses I took many years ago, the majority
of the language is written as include files that are simply extra
functions consisting of a core set of instructions.

Er, no, but I can see why you might think that. What you are trying to
describe is the standard library of handy functions; these are not written
"as" include files, though, but merely /described/ in those files (we call
them headers), to give the compiler sufficient information to do
type-checking.
I need to find out
what these core functions / commands are. Ideally I need to limit these in
number to the fewest numbers that would still allow the language to be as
useable as it is now.

The language as you remember it is defined by the document ISO/IEC 9899:1990
(which, technically speaking, is obsoleted by its successor ISO/IEC
9899:1999).
I am not entirely sure that this is making any sense whatsoever!!

Oh, I think I see what you want to do, but I think you're probably going
about it the wrong way.
My second question is how would I go about allowing a running piece of
code to modify a piece of code, and then have that code compiled and
executed automatically? If any of you have any code fragments at all, this
would be extremely well appreciated as it would mean I could concentrate
on my core business of genetic research instead of spending six months
attempting to get a single piece of code doing what I am sure is a rather
simple operation.

<grin> After reading the first sentence, my first thought was "genetic
algorithms", but I don't suppose you'd care to hear that. And as for the
second part, er, you haven't been programming very long, have you? :)

I think you'd be better off ignoring the C language altogether (and this is
ME saying it) and, instead, writing a virtual computer - a simulator for an
*imaginary* machine of your own design, with its own registers, IP, memory,
and so on, all simulated in software. (Write it in C if it makes you feel
better! In fact, C is an excellent choice of language for this application
- as is C++, of course. Choose whichever you're most familiar with.)

Please ensure you are using a non-proportional font, or this diagram will
look a complete mess:


+----- your (real!) computer running Win32 or Linux -----+
| |
|+------- your simulator program, written in C ---------+|
|| ||
||+- virtual computer lives only insider your program -+||
||| |||
||| | | Virtual RAM, |||
||| | tiny | where your |||
||| Virtual Registers | little | programs live |||
||| Virtual Opcodes | scheduler | and breed and |||
||| Virtual Everything | | have their |||
||| | | being. |||
||| |||
||+----------------------------------------------------+||
|+------------------------------------------------------+|
+--------------------------------------------------------+

That way, you can automatically produce entire generations of "machine" code
programs (where *you* define the machine code) that can compete cheerfully
with each other in whatever address space you decide to define. Doing it
this way also makes it fairly trivial to keep stats and stuff.
(I do hope that last part is not excessively cheeky!!)

Well, genetics sounds pretty simple to those of us who are not experts in
that field (it's all just chemicals and cells and test tubes and stuff,
right?), so no programmer should be too surprised or upset to find that a
genetics guy thinks programming is simple. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top