Information represented in some format or language:
Some languages are better than others for certain tasks
Nature is encoded in many formats.
Sensory/Perception - translation to a human format
Computation transforming data into a different state or format
Example:
88 = 1011000
100 = 4
1 + 3 = 4
Data - Input/Output
Code - Instructions
Computation - change data into other data using code
Decode language of nature into human language.
Data - phenomena
Code - scientific process
Good: Inference
"Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are."
Bad: Arithmetic
"8329438*19834"
Good: Social logic
"Are you thirsty?"
Bad: Formal Logic
Ice-cream sales increased as a result of increased sunscreen consumption.
Neuron populations - probabalistic (non-deterministic)
Transistors - strictly logical.
Your computer only speaks a specific dialect of binary
All machine codes must be very simple and exact
HUGE gap!
Programming languages are an interface
Still exists a very large gap in complexity between binary and programming languages
Programming code needs to be compiled or translated into machine code before it runs.
With human to machine language
…still a gap!
Programming code needs to be compiled or translated into machine code before it runs.
Symbols simplify ideas making them manageable through abstraction
Complex ideas are packaged into language.
Binary is a symbolic representation of voltage states across a transistor
Bindings associate some data with other data.
Name bindings = symbol/name + binding
They are functional functional: 1 symbol for each input
Name/Symbol | Data |
---|---|
1 | 0001011 |
A | 0001101 |
+ | 1011010 |
Nothing special about 001011 vs 01101 - CONVENTIONS!
\[\underbrace{{\underbrace{\text{myFile}}_\text{symbol/name}}\rightarrow \underbrace{\text{Data}}_{\text{value}} }_\text{name binding}\]
Folders have their own namespace
Namespaces represent symbolic limits
The folder keeps things separated or provides context.
Example:
Filename "notes.txt" in directory "Programming" vs "Biology"
The scope is the context where a specific binding is applicable.
Directory 1/
File1
File2
Directory 2/
File 3
cat File1 > File2
cat File1 x File3
For our file, the scope is within the directory.
A namespace represents all possible names, those used, and whats available.
The scope is in reference to a specific variable: what can see it, what can it see?
An alias or reference is a name for a name.
It points to the name of the first.
e.g. Dave
\[\underbrace{{\underbrace{\text{myAlias}}_\text{symbol/name}}\rightarrow \underbrace{\text{myFile}}_{\text{symbol/name}}}_\text{reference (binding)}\]
Pointers point to where the Data is.
\[C\underbrace{\underbrace{\text{A}}_\text{symbol}\rightarrow \text{Data A}}_\text{variable (binding)}\]
Pointers point to where the Data is.
\[\underbrace{\underbrace{\text{A}}_\text{symbol}\rightarrow{} \text{Data A}}_\text{variable (binding)}\]
\[\underbrace{\underbrace{\text{B}}_\text{symbol}\rightarrow{} \underbrace{\text{Data A Location}}_{\text{address}}}_\text{pointer (binding)} \rightarrow \text{Data A}\]
Example:
SSN
Let:
What happens to A and P when B is:
renamed?
deleted?
bound elsewhere?
Example:
Variable A bound to Data A.
Pointer P bound to Data A address.
Reference B bound to variable A.
What happens to A and B when P is:
renamed?
deleted?
bound elsewhere?
Example:
Variable A bound to Data A.
Pointer P bound to Data A address.
Reference B bound to variable A.
What happens to B and P when A is:
renamed?
deleted?
bound elsewhere?
name binding | order | bound to |
---|---|---|
traditional | primary | Data (+ address) |
pointer | secondary | address |
reference/alias | tertiary | symbol |
filenames \(\rightarrow\) files
Drive Letters \(\rightarrow\) hard-drives
variables/functions/code \(\rightarrow\) code
=3;
threepi=3.141593;
='David White'; myName
=3;
threepi=3.141593;
='David White';
myName
% What happends when I do...
=3;
A=A;
B=5;
A==5;
B
=copy(A)
Bclear A;
% What do I want to happen?
Bindings take
All data, even symbols
Details depend on
Example:
Run an experiment with subject info.
How do I treat my data? As
Programming paradigm
Imperative | Object Oriented | |
---|---|---|
Order | Low | High* |
Compute time | Fast | Slower |
Initial Implementation time | Fast | Slow |
Human friendliness | Low | High |
Generalizability | Low | High |
Each level of abstraction requires additional
In C
int A=5;
float B=3.2;
return A*A;
In python
=5
A=3.2
B*B A
Filename | Full Path | Inode | Data |
---|---|---|---|
A-z | A-z/A-z/ | 0x01fac9 … 0x0fffff | 010100011101… |
\(10 \text{ vs. } 0.1\)
\(1.0 \text{ vs. } 1.00001\)
Both determined by data type
integers
int8 -111111111 to +
int16
int32
uint8
float/decimal
single 16integers 16decimals
double 32 32
char
ABC &-
The more precise a value, the more required