On 01/23/2015 10:02 AM, Wolf K. wrote:
> On 2015-01-23 12:46 AM, Mark Filipak wrote:
>> No, Wolf, it's not semantics. HTML is a structured database. An HTTP
>> browser uses that database to populate a structure called the "DOM". The
>> rendering engine (Mozilla's is called "Gecko") then uses the DOM to
>> render (paint) the page image. During that process, javascript can be
>> used to modify the DOM, but it's only the javascript that is code, that
>> is: text strings that are converted to CPU machine instructions. HTML
>> never generates CPU machine instructions. That is not semantics. That's
>> a huge difference. For example, HTML will never lock up the computer,
>> but you can create javascript that will do it. HTML is not
>> multi-threaded, but javascript can be (with the appropriate and rather
>> obscure calls to built-in functions). [...]
>
> OK, so "code" is anything that is converted into machine instructions. I
> can live with that. ;-)
>
> But "convert into machine instructions" is a multi-layered process. As
> you say, "The rendering engine (...) then uses the DOM to render the
> page image." Yes, and any given datum ultimately invokes some specific
> machine language instructions.
You're inappropriately blurring the line between code and data, my
friend. It's really a bright line. Code will make decisions based on
data of course, but that doesn't mean that data is code. Code alters
(processes) data. The code is unchanged in the process. Data is what is
changed. Data is stuff that's worked on, like coke and iron to steel.
It's an input. The page is the steel. In this case, HTML is the recipe
for steel, but it's not the thing (code) that actually makes the steel.
Consider this: code is to travel as page markup (HTML) is to a map. Page
markup is no more code than a map is travel.
> From my POV, a datum is a merely one step
> more abstract than program code. IOW, datum --> program code --> [...]
> --> machine language, where [...] stands for whatever translation
> processes are invoked.
That "-->" between "datum" (why are you using the singular for "data"?)
and "program code" doesn't exist as a work flow. The program code exists
entirely independently from the data and is unaltered by the data. In
fact, it is the data that's altered. Your last step, "machine language",
is more properly "machine instructions" because at that point it is non
human-readable numbers (i.e., ones and zeros) that perform electrical
operations on registers (banks of electronic, "on"/"off" switches)
inside the CPU. It is inside those registers where the data is
manipulated. It's machine instructions that load the registers with
memory data (memory read), manipulate the contents, and store the
contents back to memory (memory write). Code is those machine
instructions (a compiled program), or human-readable text (scripts) that
an intermediate process called an "interpreter" translates into machine
instructions. The javascript interpreter built into Firefox is an
example of such an interpreter. The Basic programming language is
another. Perl is an interpreter that's built into many flavors of Linux
and Unix. PHP is an interpreter in many servers.
So the work flow is:
1, Compiled code flow: Machine instructions convert HTML data into
pictures by manipulating the data within CPU registers, or
2, Interpreter code flow: Machine instructions convert a text (script)
into machine instructions by manipulating the text within CPU registers,
which then convert HTML data into pictures by manipulating the data
within CPU registers.
Think of a compiled program as a script that's been "hardened". Scripts
are human readable, so they're easier to alter and adapt to various
purposes, but the 2-step interpreter process is much slower than what a
compiled program can do.
The reason why HTML is more like a map than a script is that it is
static like a map whereas a script is dynamic -- stuff happens! --
unless of course you're looking at a map of Hawaii or Iceland. :-)
> I can live with that too.
>
> This a.m., I woke realising that an ASCII stream may be considered a
> type of code. Given that the program assumes the data is ASCII, each
> byte is an instruction to display (etc) a specific character.
The ASCII code is merely an index into a dataset. "A" is 1000001, "B" is
1000010, "Z" is 1011010, "a" is 1100001. etc. An ASCII stream is, 1,
data strings of indexes, and 2, obsolete: ANSI is the 8-bit version of
ASCII and succeeded ASCII a few decades ago.
> This subthread is becoming philosophical. But thanks for making me once
> more think through what I understand as "programming", etc. BTW, I now
> understand the claim that "everything is data" a little better. I think.
> Maybe. ;-)
>
> Have a good day,
Take good care. I hope I didn't bore too much.