[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Low-level vs. High-level programming (was My First Computer)



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In article <pan.2003.06.20.07.22.12.341074@tjonk.now>,
Tjoff Tjonk <tjoff@tjonk.now> wrote:
>On Thu, 19 Jun 2003 17:09:30 -0500, Randy McLaughlin wrote:
>> I will use Basic v C/C++ since basic like a browser interprets.  HTML tags
>> command the interpreter (browser) that the following should be treated a
>> particular way.  Does that mean that the basic statement print is just a
>> tag, it just lets its interpreter know the following should be acted opon in
>> a particular way.  
>
>... and that's thing that makes HTML different from programming
>languages: there are no actions, instructions or commands in HTML,
>only tags that can be used to give hints to the HTML renderer. A BASIC
>statement is a well-defined instruction to the compiler/interpreter to
>change the state of the machine on which the code is run; there is no
>such state, nor a machine in an HTML renderer.

For a more concrete example, consider this:

    LDA  #$C1
    JSR  $FDED

On an Apple II, this assembly-language snippet will write an "A" to the
display.  Specific instructions are given to the processor (load a register
with a constant and call a subroutine at some address in ROM), which are
carried out the same way every time.  Now consider this:

<p style="text-align: center">
Here's some normal text and some <i>text we want displayed as italic</i>.

Depending on browser capabilities, you'll get different results.  Any
browser should at least display the text, but the tags are little more than
suggestions.  A browser that doesn't grok CSS will blow right past the style
attribute and leave the text left-justified instead of centered.  A browser
(such as Lynx) that works in text mode might underline text that is flagged
as italic.  A browser that converts its input to speech will use some
alternate means of representing different tags.

While 6502 machine code won't run too well on an Athlon, HTML fed to Lynx
and HTML fed to Internet Explorer will (if the HTML is well-formed) produce
results that are usable in both cases, but different.  This non-determinism
would be a Bad Thing in a programming language (which should produce the
same results every time), but it's no big deal with HTML.

  _/_   Scott Alfter
 / v \  salfter@salfter.dyndns.org
(IIGS(  http://alfter.us            Top-posting!
 \_^_/  pkill -9 /bin/laden         >What is the most annoying thing on Usenet?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+80BIVgTKos01OwkRAkYOAJ0fLOGlwIV/AZzE8s1L8EunrNiuQQCdFMS4
9JofCOD1leQvAiJKSDwcyxI=
=bpfe
-----END PGP SIGNATURE-----