Programming in R. COURSE NOTES 2 Hoganson Language Translation. Language Translation. Computer is all 0s and 1s, which is hard for humans. So we have created languages that are easier for us (humans) to work with.
COURSE NOTES 2 Hoganson
Computer is all 0s and 1s, which is hard for humans.
So we have created languages that are easier for us (humans) to work with.
Human-friendly languages require computer time to translate into computer-executable programs.
Ongoing trend since computer was created: make better human interfaces to the machine, using the ever increasing power of the computer to do the translation work “behind the scenes”.
Thing GUI interfaces and virtual-reality interfaces.
Two bits for instruction type. How many types of instructions are possible within this format?
Operation Code is 6 bits. How many types of operations are possible for a format?
The register operands are 4 bits each. How many different registers can be indicated with 4 bits? (similar to addressing)
This instruction format is a Register-Register instruction.
That means that it takes its inputs from two register operands.
The operation is performed on those two data elements, and the result goes back into the register specified by the first register operand.
Do you remember where the result of the addition is stored?
Assembly language is a big improvement over machine code.
Assembly is translated by an assembler program to 0s and 1s that the computer can work with.
More powerful (and human-readable) languages have been created (which must also be translated to 0s and 1s).
These are called High Level Languages
Basic, Fortran, C, C++, C#, R, etc.
Compiler takes the high-level language program (as text) as its input.
It produces the machine code version of the program as its output.
It does not change the high-level program, the machine code program is a new file.
The virtual machine/byte-code interpreter makes programs transportable and device-independent.
Converted byte-code can move over the internet.
Each different processor/machine needs its own virtual machine, which will be different from CPU to CPU.
Different because of different machine codes and operating systems.
A structured programming language (no objects or agents)
With extensions for Big Data – functions and techniques for manipulating large data sets using parallel opportunities.
An interpreted language, running on a Virtual Machine written in a language called “S”. S code is compiled, using a complier for the platform.
The “R” interpreter is compiled “S” code.