Gene Theory - C core commands

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael

    Gene Theory - C core commands

    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


  • Jeff Schwab

    #2
    Re: Gene Theory - C core commands

    Michael wrote:[color=blue]
    > 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.[/color]

    <snip/>
    [color=blue]
    > 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.[/color]

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

    Comment

    • James Connell

      #3
      Re: Gene Theory - C core commands

      Michael wrote:
      [color=blue]
      > 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.
      >[/color]

      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.


      [color=blue]
      >
      > 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
      >
      >[/color]

      Comment

      • Richard Heathfield

        #4
        Re: Gene Theory - C core commands

        Michael wrote:
        [color=blue]
        > 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.[/color]

        Er, okay (so why did you post to comp.lang.c++?) . I've set followups to
        alt.comp.lang.l earn.c-c++ since my response assumes that, when you say C,
        you mean C, not C++.
        [color=blue]
        > 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.[/color]

        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.
        [color=blue]
        > 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.[/color]

        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).
        [color=blue]
        > I am not entirely sure that this is making any sense whatsoever!![/color]

        Oh, I think I see what you want to do, but I think you're probably going
        about it the wrong way.
        [color=blue]
        > 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.[/color]

        <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.
        [color=blue]
        > (I do hope that last part is not excessively cheeky!!)[/color]

        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. :-)

        --
        Richard Heathfield : binary@eton.pow ernet.co.uk
        "Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
        C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
        K&R answers, C books, etc: http://users.powernet.co.uk/eton

        Comment

        Working...