Is this a true statement?
David C. Ullrich
ullrich at math.okstate.edu
Mon Jun 25 09:57:18 EDT 2001
On Sun, 24 Jun 2001 13:29:24 -0400, D-Man <dsh8290 at rit.edu> wrote:
>On Sun, Jun 24, 2001 at 04:12:49PM +0000, David C. Ullrich wrote:
>[snipped long discussion]
>
>When I read the original question I got the impression that "write a
>device driver in Python" meant "A person sits down at a console with a
>text editor, writes some Python code that implements the device's spec
>in terms of the driver API specified by the kernel". David Ullrich is
>taking "write a device driver in Python" to mean "output the bytes
>that comprised the finished driver to a file that the kernel can load
>and execute". In the former meaning, no a device driver can't be
>written in Python. In the latter, then yes, python has the ability to
>write binary data to a file. It also goes, then, to say that one
>could write the driver using only a hex editor (or the "front panel",
>for Steve :-)).
To be fair, I think that using Python to write a device
driver would be a lot easier than using a hex editor. But
never mind that:
>I think that most people thought the first interpretation of the
>original question was obivous and thus did a poor job of answering
>David's questions. At the pratical level, (as David also says) a
>device driver can't be written in Python. At a more theoretical
>level, David is correct, almost. A device driver isn't a file, but a
>sequence of bytes in memory in the kernel's address space :-).
This seems like a reasonable place to insert my retraction:
Ohhh... So _that's_ what we mean. Well of course no, we cannot
write a device driver in Python!
The problem was a single huge misconception - I was right when I
continually speculated that I was missing something. I don't
think that what I was missing was ever explained, which is
not a criticism, what I think is that people reasonable assumed
I understood the one thing that I didn't.
Can you write a GIF in C? I imagine people would say yes - I
know I would, or would have until recently. If someone says
you can write a GIF in C they mean that you can use C to
write a program that writes GIF's. If someone says you
can write a PDF file in C they mean that you can write
a program that writed PDF files...
Believe it or not, I was taking "write a device driver in
C" to mean "use C to write a program that writes device
drivers". The huge misconception at the bottom of all this
was I didn't realize that a device driver (typically) _is_
a program, in the same format as typical executables (or
close enough to the same format that a C compiler with
an appropriate switch will ouput a device driver instead
of a program.) The idea that we actually meant "write C
code which the compiler will turn into a device driver"
did not occur to me, simply because I was thinking
of device drivers as something on a totally different
level from ordinary executable programs.
(Yes, people did try to explain the difference between
writing a program and writing a file. But since I thought
that we were taking "write a device driver" to mean
"write a program that writes a device driver" the
explanations made no sense to me...)
Who said you should never attribute to trollery that
which can be explained by awesome ignorance? Wasn't
trollitudinously blurring the distinction between
"write a file" and "write a program" as was suggested.
Also wasn't actually unable to comprehend simple English.
The "distinction" between "write a file" and "write
a program" _is_ blurry, since when we write a program
we _are_ writing a file.
The relevant distinction is between "write a program which
writes a file" and "write a program". Certainly did not
mean to be blurring _that_ distinction, rather I've been
wrongly thinking through all of this that we were talking
about writing programs which write files.
So maybe I am unable to comprehend simple English. Or
maybe "write a file" is an incomprehensibly simple way
to say "write a program that writes a file". In any
case, I don't think that the answers I got were all
that bad, assuming that I was aware of things that
it would be quite reasonable to assume I must be
aware of. Almost everything almost everyone has
said makes much more sense than it did yesterday.
Never mind.
>I hope the original poster now understands the answer to his question
>and not too many people have been upset by the miscommunication in the
>discussion.
I figured all along I must be missing something.
>-D
>
>
David C. Ullrich
*********************
"Sometimes you can have access violations all the
time and the program still works." (Michael Caracena,
comp.lang.pascal.delphi.misc 5/1/01)
More information about the Python-list
mailing list