Re: Is this make sence? Dynamic assembler for python

2010-06-21 Thread alex23
DivX wrote: > Another thing is that when you have assembler now you can write some > small C compiler so that you don’t have to write assembly language. That has to be the most paradoxical argument I've ever heard: "when you use assembler you have the ability to not use assembler" :) -- http://

Re: Is this make sence? Dynamic assembler for python

2010-06-21 Thread Rhodri James
On Mon, 21 Jun 2010 04:34:40 +0100, Steven D'Aprano wrote: On Sun, 20 Jun 2010 22:45:14 +0100, Rhodri James wrote: No. Modern C compilers often produce very good machine code, but the best hand-written assembly code will be better. I can usually write *very* marginally better code than GC

Re: Is this make sence? Dynamic assembler for python

2010-06-21 Thread Stephen Hansen
On 6/21/10 10:12 AM, MRAB wrote: > A human can write better assembly code than a compiler, but would take a > much longer, and usually for not much gain, so it's usually a waste of > time (premature optimisation, and all that). When you get to the point where you're considering writing something i

Re: Is this make sence? Dynamic assembler for python

2010-06-21 Thread MRAB
David Cournapeau wrote: On Mon, Jun 21, 2010 at 12:34 PM, Steven D'Aprano wrote: On Sun, 20 Jun 2010 22:45:14 +0100, Rhodri James wrote: Mixing Python and assembler is a bizarre thing to want to do in general, but... On Sun, 20 Jun 2010 01:52:15 +0100, Steven D'Aprano wrote: (3) Modern C

Re: Is this make sence? Dynamic assembler for python

2010-06-21 Thread David Cournapeau
On Mon, Jun 21, 2010 at 12:34 PM, Steven D'Aprano wrote: > On Sun, 20 Jun 2010 22:45:14 +0100, Rhodri James wrote: > >> Mixing Python and assembler is a bizarre thing to want to do in general, >> but... >> >> On Sun, 20 Jun 2010 01:52:15 +0100, Steven D'Aprano >> wrote: >> >>> (3) Modern C compil

Re: Is this make sence? Dynamic assembler for python

2010-06-21 Thread Dave Angel
Steven D'Aprano wrote: On Mon, 21 Jun 2010 03:00:12 -0400, Dave Angel wrote: 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, I

Re: Is this make sence? Dynamic assembler for python

2010-06-21 Thread DivX
On 20 lip, 12:57, DivX wrote: > On 20 lip, 12:46, Steven D'Aprano > > > > > cybersource.com.au> wrote: > > On Sun, 20 Jun 2010 03:19:48 -0700, DivX wrote: > > > On 20 lip, 02:52, Steven D'Aprano > > cybersource.com.au> wrote: > > [...] > > >> I think that mixing assembly and python is a gimmick

Re: Is this make sence? Dynamic assembler for python

2010-06-21 Thread Steven D'Aprano
On Mon, 21 Jun 2010 03:00:12 -0400, Dave Angel wrote: > 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, I suppose if his friend i

Re: Is this make sence? Dynamic assembler for python

2010-06-21 Thread Carl Banks
On Jun 21, 12:00 am, Dave Angel 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

Re: Is this make sence? Dynamic assembler for python

2010-06-21 Thread Dave Angel
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 a

Re: Is this make sence? Dynamic assembler for python

2010-06-20 Thread Paul Rubin
Steven D'Aprano writes: > Not that I don't believe you, but that is an extraordinary claim that > would require more evidence than just "Hey, some guy on the Internet > reckons his assembly code can regularly out-perform optimizing C > compilers" before I will change my opinion *wink* It is re

Re: Is this make sence? Dynamic assembler for python

2010-06-20 Thread Steven D'Aprano
On Sun, 20 Jun 2010 22:45:14 +0100, Rhodri James wrote: > Mixing Python and assembler is a bizarre thing to want to do in general, > but... > > On Sun, 20 Jun 2010 01:52:15 +0100, Steven D'Aprano > wrote: > >> (3) Modern C compilers can produce better (faster, more efficient) >> machine code th

Re: Is this make sence? Dynamic assembler for python

2010-06-20 Thread Steven D'Aprano
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

Re: Is this make sence? Dynamic assembler for python

2010-06-20 Thread Dave Angel
DivX wrote: On 20 lip, 12:46, Steven D'Aprano wrote: On Sun, 20 Jun 2010 03:19:48 -0700, DivX wrote: On 20 lip, 02:52, Steven D'Aprano wrote: [...] I think that mixing assembly and python is a gimmick of very little practical significance. If you really need the extra pe

Re: Is this make sence? Dynamic assembler for python

2010-06-20 Thread Rhodri James
Mixing Python and assembler is a bizarre thing to want to do in general, but... On Sun, 20 Jun 2010 01:52:15 +0100, Steven D'Aprano wrote: (3) Modern C compilers can produce better (faster, more efficient) machine code than the best assembly code written by hand. No. Modern C compilers

Re: Is this make sence? Dynamic assembler for python

2010-06-20 Thread Terry Reedy
On 6/20/2010 12:41 PM, Lie Ryan wrote: On 06/20/10 20:57, DivX wrote: On 20 lip, 12:46, Steven D'Aprano wrote: On Sun, 20 Jun 2010 03:19:48 -0700, DivX wrote: On 20 lip, 02:52, Steven D'Aprano wrote: [...] I think that mixing assembly and python is a gimmick of very little practical signif

Re: Is this make sence? Dynamic assembler for python

2010-06-20 Thread Lie Ryan
On 06/20/10 20:57, DivX wrote: > On 20 lip, 12:46, Steven D'Aprano cybersource.com.au> wrote: >> On Sun, 20 Jun 2010 03:19:48 -0700, DivX wrote: >>> On 20 lip, 02:52, Steven D'Aprano >> cybersource.com.au> wrote: >> [...] I think that mixing assembly and python is a gimmick of very little >>>

Re: Is this make sence? Dynamic assembler for python

2010-06-20 Thread DivX
On 20 lip, 12:46, Steven D'Aprano wrote: > On Sun, 20 Jun 2010 03:19:48 -0700, DivX wrote: > > On 20 lip, 02:52, Steven D'Aprano > cybersource.com.au> wrote: > [...] > >> I think that mixing assembly and python is a gimmick of very little > >> practical significance. If you really need the extra

Re: Is this make sence? Dynamic assembler for python

2010-06-20 Thread Steven D'Aprano
On Sun, 20 Jun 2010 03:19:48 -0700, DivX wrote: > On 20 lip, 02:52, Steven D'Aprano cybersource.com.au> wrote: [...] >> I think that mixing assembly and python is a gimmick of very little >> practical significance. If you really need the extra performance, check >> out PyPy, Cython, Pyrex and Psy

Re: Is this make sence? Dynamic assembler for python

2010-06-20 Thread DivX
On 20 lip, 02:52, Steven D'Aprano wrote: > On Sat, 19 Jun 2010 13:36:57 -0700, DivX wrote: > > On 19 lip, 21:18, geremy condra wrote: > >> On Sat, Jun 19, 2010 at 11:53 AM, DivX wrote: > >> > I found on the forum some discussion about crypting text and one guy > >> > did make assembly implementa

Re: Is this make sence? Dynamic assembler for python

2010-06-19 Thread Terry Reedy
On 6/19/2010 2:53 PM, DivX wrote: I found on the forum some discussion about crypting text and one guy did make assembly implementation of crypting algorithm. He dynamically generates mashine code and call that from python. Here are impressive results http://www.daniweb.com/code/snippet216632-5.h

Re: Is this make sence? Dynamic assembler for python

2010-06-19 Thread Steven D'Aprano
On Sat, 19 Jun 2010 13:36:57 -0700, DivX wrote: > On 19 lip, 21:18, geremy condra wrote: >> On Sat, Jun 19, 2010 at 11:53 AM, DivX wrote: >> > I found on the forum some discussion about crypting text and one guy >> > did make assembly implementation of crypting algorithm. He >> > dynamically gen

Re: Is this make sence? Dynamic assembler for python

2010-06-19 Thread DivX
On 19 lip, 21:18, geremy condra wrote: > On Sat, Jun 19, 2010 at 11:53 AM, DivX wrote: > > I found on the forum some discussion about crypting text and one guy > > did make assembly implementation of crypting algorithm. He dynamically > > generates mashine code and call that from python. Here are

Re: Is this make sence? Dynamic assembler for python

2010-06-19 Thread geremy condra
On Sat, Jun 19, 2010 at 11:53 AM, DivX wrote: > I found on the forum some discussion about crypting text and one guy > did make assembly implementation of crypting algorithm. He dynamically > generates mashine code and call that from python. Here are impressive > results http://www.daniweb.com/cod

Is this make sence? Dynamic assembler for python

2010-06-19 Thread DivX
I found on the forum some discussion about crypting text and one guy did make assembly implementation of crypting algorithm. He dynamically generates mashine code and call that from python. Here are impressive results http://www.daniweb.com/code/snippet216632-5.html Is this better approach then wr