writing python extensions in assembly

inhahe inhahe at gmail.com
Fri May 16 11:21:39 EDT 2008


You could be right, but here are my reasons.

I need to make something that's very CPU-intensive and as fast as possible. 
The faster, the better, and if it's not fast enough it won't even work.

They say that the C++ optimizer can usually optimize better than a person 
coding in assembler by hand can, but I just can't believe that, at least for 
me, because when I code in assembler, I feel like I can see the best way to 
do it and I just can't imagine AI would even be smart enough to do it that 
way...

For portability, I'd simply write different asm routines for different 
systems.  How wide a variety of systems I'd support I don't know.  As a bare 
minimum, 32-bit x86, 64-bit x86, and one or more of their available forms of 
SIMD.






"D'Arcy J.M. Cain" <darcy at druid.net> wrote in message 
news:mailman.1229.1210949533.12834.python-list at python.org...
> On Fri, 16 May 2008 10:13:04 -0400
> "inhahe" <inhahe at gmail.com> wrote:
>> Can anyone give me pointers/instructions/a template for writing a Python
>> extension in assembly (or better, HLA)?
>
> I am trying to imagine the requirements document for your project.
>
> - Must be error prone and hard to debug
> - Must take an order of magnitude longer to write
> - Must be unportable to other systems
>
> Really, why don't you write your etension in C?  Do you really think
> you will improve your code by writing it in assembler?  Even embedding
> assembler in C code make it unportable and I find it hard to imagine
> anything that you want to do in a Python context that can't be done at
> least as well in C if not pure Python.
>
> Just curious is all.
>
> -- 
> D'Arcy J.M. Cain <darcy at druid.net>         |  Democracy is three wolves
> http://www.druid.net/darcy/                |  and a sheep voting on
> +1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner. 





More information about the Python-list mailing list