Is this make sence? Dynamic assembler for python

Carl Banks pavlovevidence at gmail.com
Mon Jun 21 05:40:42 EDT 2010


On Jun 21, 12:00 am, Dave Angel <da... at ieee.org> wrote:
> Steven D'Aprano wrote:
> > On Sun, 20 Jun 2010 18:21:43 -0400, Dave Angel wrote:
>
> >> Something's intrinsically wrong with the argument made in this thread
> >> against generating assembly code.  That's exactly what happens every
> >> time you write code in C.
>
> > I don't know whether C compilers generate assembly mnemonics or direct
> > machine code, but the distinction for this argument is irrelevant.
>
> > The argument in this thread is that it's not worth the *human coder*
> > writing assembly, not that no assembly code is involved in the process
> > anywhere.
>
> But the OP said of his friend:
>
> "He dynamically generates mashine code and call that from python."
>
> I took that to mean he dynamically generated machine code, not that he hired some human to do it.

Well we know what you meant, but he did post a snippet of the code
showing handwritten assembly, from which the machine code is
dynamically generated.

Inline assembly not too useful for general purpose Python programming,
but I'm sure there's a time and place for it.

I wonder how easy it'd be to bundle a small C compiler.


Carl Banks



More information about the Python-list mailing list