How does programming work

Discussion in 'Computer Science & Culture' started by python, Jun 9, 2007.

Thread Status:
Not open for further replies.
  1. RubiksMaster Real eyes realize real lies Registered Senior Member

    I agree, the theory behind computing is quite interesting. What I find interesting is regular languages, and the abstract machines that accept them. I think pushdown automata are really neat.

    The idea that any algorithm can be computed on a Turing Machine is quite interesting.
  2. Google AdSense Guest Advertisement

    to hide all adverts.
  3. przyk squishy Valued Senior Member

    Unless you're working in DOS and have to access your graphics hardware directly, your program will (at the lowest level) send a message to the operating system, which the OS will interpret as "draw a window", "draw a button", and so on. You won't have to worry about manually resizing and minimizing windows when the user drags the edges or clicks the minimize button - these gritty details are the OS's (or window manager's) responsibility.

    If you want to do GUI programming in Python, you might want to try pyGTK: There's a tutorial on the site, which assumes you already know a little Python and the basics of object oriented programming.
  4. Google AdSense Guest Advertisement

    to hide all adverts.
  5. superluminal I am MalcomR Valued Senior Member

    Hi BillyT.

    Here's the story.

    Every processor family has its own set of op codes that it can translate into actions, like "add these two numbers and store the result at memory location M". The processor implementation of these codes is usually called "microcode" and is very specific to the type of processor you are working with. This is what actually translates the 1's and 0's into real actions and is a part of the microprocessor hardware.

    The next level up from that is "assembly" code. These are usually just shorthand mnemonics for the actions they perform. An assembler can take these and output an "object" code which is the 1's and 0's (op codes) the processor actually executes via the "microcode engine".

    Since assembly mnemonics are tedious and don't lend themselves to the human way of thinking very well, high level languages were created. These allow you to write like "if A then B else C" or "while A do the following" and such. A "compiler" translates this into assembly codes, and the assembler translates that into object or machine code.

    So it's Compiler >> Assembler >> Machine.

    There is no "universal" intermediate stage. The top level is what is universal. For instance, in C or C++ i can write a given program that adds two numbers. This is a valid program no matter which compiler you use (as long as it conforms to the ANSI standard for C or C++).

    To run this on different platforms you must have the compiler (all of which understand your C code) that compiles to the correct assembly code which builds the correct machine code for your chosen platform.

    Hope this makes sense for you.
    Last edited: Jun 10, 2007
  6. Google AdSense Guest Advertisement

    to hide all adverts.
  7. Xelios We're setting you adrift idiot Registered Senior Member

    The process of rendering a frame in a modern computer game is really interesting, it's amazing how much work goes into just one frame when you consider it's usually done 40-60 times per second.
Thread Status:
Not open for further replies.

Share This Page