opening a text document to show a .txt file through abrowserlink

Cliff Wells LogiplexSoftware at earthlink.net
Tue Dec 31 15:50:07 EST 2002


On Tue, 2002-12-31 at 01:05, Erik Max Francis wrote:
> Cliff Wells wrote:
> 
> > Not intrinsically, but it can certainly be used as such.  I used a
> > custom XML parser to script interview questionaires for a call center
> > I
> > worked at.  The XML files were most definitely programs.  Markup tags
> > were used to set internal variables in the interpreter.  They even had
> > goto style logic and could loop.  Of course, this was all done
> > *outside*
> > the XML file itself (by the Python program reading the file),
> > nevertheless the XML file itself determined how this was done.
> 
> But when we write Python programs, we're actually creating ASCII (or
> perhaps Latin-1 :-) text files and then running them as Python scripts. 
> In your case, XML is just the medium.  It's certainly not the program
> language itself, anymore than ASCII is a programming language because
> you can write Python programs in it.

I think you miss my point (and perhaps I miss yours, but that's life ;) 
Certainly XML is just the medium.  So is a Python source file.  It's the
medium for describing *logic*.  If you can describe *logic*, in any
fashion, then it's a programming language.  In the case I outlined
above, the logic was embedded in the XML file, hence XML can be used as
a programming language (although, admittedly, most of the time it
isn't).  I suppose, given what I've just said, I'll backpedal a bit and
grant that whether HTML uses logic is arguable (I can already see both
sides coming).

> XML, like HTML, is purely markup.  Other programs may do something else
> with that markup (like interpret as a program, or run an embedded
> script), but HTML and XML are not programming language themselves,
> anymore than ASCII text is a programming language because compilers and
> interpreters can use them as input.

Yet, similarly, Python code is not always interpreted.  When used in
python-mode in emacs, code structure is used to colorize and format
(i.e. layout).  Does this mean that it is data?  I suppose so.  And yet,
in another context (the Python interpreter), it becomes a program. 
Clearly, what is data and what is code depend entirely upon the context
of the situation.  Emacs considers Python source code data and XML
parsers can consider XML source program code.  Once again, I suggest
that perhaps the line between data and progam is not as distinct as
people would believe.

> > Consider a "programmable" toy that was popular
> > several years ago.  You could specify, by using a numeric keypad on
> > it,
> > how far it should go in a given direction and various other things. 
> > It
> > certainly wasn't Turing-complete and yet it was certainly a "program"
> > entered onto its keypad.
> 
> Well, there are certainly different classes of the term _program_
> involved here.  We're talking about programming as in computer
> programming.  When people tell a VCR to record a certain channel at a
> certain time, they often refer to that as "programming," but obviously
> that's not the same thing.  Similarly, when television stations select
> what they're going to show at what times in a given week, that too is
> sometimes called "programming," but obviously again that's not what
> we're about here.

Ah, well perhaps here is where we differ.  I'd suggest that these are in
fact the same sort of thing, but just at differing levels of
complexity.  A computer is a machine, just like a VCR, and a program is
merely a set of instructions to be executed in a certain order, much
like "programming" a VCR to take an action at a certain time.  The fact
that a computer is a rather generic machine (i.e. it can take on
characteristics of other machines as in Tivo) or that it has a larger
number of instructions isn't really relevant, IMHO.

> You could say that when someone says "programming HTML," they mean one
> of these different kinds of programming, that just underscores the
> point.  If you wish it to call it that, it's _not_ the same kind of
> programming.

And I suppose we could also give weight to the old "Real Programmers
(tm) use <C|Fortran|assembler|etc>" adage and claim that Python isn't
really programming either ;)

Anyway, if you want to get the last word in, go ahead as we both must be
getting tired of this rather pointless and OT thread anyway.

Regards,

-- 
Cliff Wells, Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308  (800) 735-0555 x308





More information about the Python-list mailing list