Is this a true statement?
tanzer at swing.co.at
Mon Jun 25 08:52:29 CEST 2001
D-Man <dsh8290 at rit.edu> wrote:
> 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 :-)).
> 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 :-).
What about this? A python application generates C code which is
compiled and linked with application code supplied by the programmer?
In many cases, writing python code generating C code is much
faster than implementing the C code by hand.
In the particular case I'm thinking about, the generated code is
specifically adapted to the properties of the user's application --
writing the C code by hand simply isn't an option (the
application domain is distributed hard real-time systems using
embedded CPUs, e.g., little memory footprint, low computing power).
But to return to the original question: as several people already
pointed out, all programming languages are in principle equivalent.
Different languages don't differ in what problems you can tackle with
them but in how long it takes to do so and what the resulting code
base will afford you.
IMHO, the question really should be: how do different languages
compare for solving a specific problem given a limited amount of
resources (programmers, time, memory, CPU cycles, ...)?
Christian Tanzer tanzer at swing.co.at
Glasauergasse 32 Tel: +43 1 876 62 36
A-1130 Vienna, Austria Fax: +43 1 877 66 92
More information about the Python-list