Re: [Python-Dev] Start writing inlines rather than macros?

2014-03-04 Thread Stefan Krah
Skip Montanaro wrote: > I do have one question though. Suppose you encounter a compiler that > doesn't understand the inline keyword, so you choose the static > declaration as Kristján suggested. The resulting Python executable > should be functionally correct, but if the optimizer doesn't happen

Re: [Python-Dev] Start writing inlines rather than macros?

2014-02-28 Thread Kristján Valur Jónsson
> -Original Message- > From: Python-Dev [mailto:python-dev- > bounces+kristjan=ccpgames@python.org] On Behalf Of Skip Montanaro > Sent: 27. febrúar 2014 19:12 > To: python-dev Dev > Subject: Re: [Python-Dev] Start writing inlines rather than macros? > one questio

Re: [Python-Dev] Start writing inlines rather than macros?

2014-02-27 Thread Stephen J. Turnbull
Skip Montanaro writes: > On Thu, Feb 27, 2014 at 1:23 PM, Antoine Pitrou wrote: > > Well, if we must maintain macros, let's maintain them everywhere and > > avoid the burden of two different implementations for the same thing. > > Would it be possible to generate the macro versions from the

Re: [Python-Dev] Start writing inlines rather than macros?

2014-02-27 Thread Antoine Pitrou
On Thu, 27 Feb 2014 13:27:02 -0600 Skip Montanaro wrote: > On Thu, Feb 27, 2014 at 1:23 PM, Antoine Pitrou wrote: > > Well, if we must maintain macros, let's maintain them everywhere and > > avoid the burden of two different implementations for the same thing. > > Would it be possible to generat

Re: [Python-Dev] Start writing inlines rather than macros?

2014-02-27 Thread Skip Montanaro
On Thu, Feb 27, 2014 at 1:23 PM, Antoine Pitrou wrote: > Well, if we must maintain macros, let's maintain them everywhere and > avoid the burden of two different implementations for the same thing. Would it be possible to generate the macro versions from the inline/static versions where necessary

Re: [Python-Dev] Start writing inlines rather than macros?

2014-02-27 Thread Antoine Pitrou
On Thu, 27 Feb 2014 13:12:24 -0600 Skip Montanaro wrote: > I think it's at least worthwhile to investigate the use of > inline/static functions over the current macros. It's been many years > since I looked at them. I doubt they have gotten any easier to read or > edit with all their backslashes.

Re: [Python-Dev] Start writing inlines rather than macros?

2014-02-27 Thread Skip Montanaro
I think it's at least worthwhile to investigate the use of inline/static functions over the current macros. It's been many years since I looked at them. I doubt they have gotten any easier to read or edit with all their backslashes. I do have one question though. Suppose you encounter a compiler t

Re: [Python-Dev] Start writing inlines rather than macros?

2014-02-27 Thread Antoine Pitrou
On Thu, 27 Feb 2014 17:22:37 + (UTC) Sturla Molden wrote: > Brett Cannon wrote: > > > The Visual Studio team has publicly stated they will never support C99, > > so dropping C89 blindly is going to alienate a big part of our user base > > unless we switch to C++ instead. I'm fine with trying

Re: [Python-Dev] Start writing inlines rather than macros?

2014-02-27 Thread Mark Shannon
On 27/02/14 13:06, Kristján Valur Jónsson wrote: -Original Message- From: Victor Stinner [mailto:victor.stin...@gmail.com] Sent: 27. febrúar 2014 10:47 To: Kristján Valur Jónsson Cc: Python-Dev (python-dev@python.org) Subject: Re: [Python-Dev] Start writing inlines rather than

Re: [Python-Dev] Start writing inlines rather than macros?

2014-02-27 Thread Brett Cannon
On Thu, Feb 27, 2014 at 12:22 PM, Sturla Molden wrote: > Brett Cannon wrote: > > > The Visual Studio team has publicly stated they will never support C99, > > so dropping C89 blindly is going to alienate a big part of our user base > > unless we switch to C++ instead. I'm fine with trying to pull

Re: [Python-Dev] Start writing inlines rather than macros?

2014-02-27 Thread Sturla Molden
Brett Cannon wrote: > The Visual Studio team has publicly stated they will never support C99, > so dropping C89 blindly is going to alienate a big part of our user base > unless we switch to C++ instead. I'm fine with trying to pull in C99 > features, though, that we can somehow support in a back

Re: [Python-Dev] Start writing inlines rather than macros?

2014-02-27 Thread Brett Cannon
On Thu, Feb 27, 2014 at 5:47 AM, Victor Stinner wrote: > Hi, > > 2014-02-27 11:22 GMT+01:00 Kristján Valur Jónsson : > > Now, Larry Hastings pointed out that we support C89 which doesn’t support > > Inlines. Rather than suggesting here that we update that compatibility > > requirement, > > In pra

Re: [Python-Dev] Start writing inlines rather than macros?

2014-02-27 Thread Kristján Valur Jónsson
> -Original Message- > From: Victor Stinner [mailto:victor.stin...@gmail.com] > Sent: 27. febrúar 2014 10:47 > To: Kristján Valur Jónsson > Cc: Python-Dev (python-dev@python.org) > Subject: Re: [Python-Dev] Start writing inlines rather than macros? > In practice, r

Re: [Python-Dev] Start writing inlines rather than macros?

2014-02-27 Thread Victor Stinner
Hi, 2014-02-27 11:22 GMT+01:00 Kristján Valur Jónsson : > Now, Larry Hastings pointed out that we support C89 which doesn’t support > Inlines. Rather than suggesting here that we update that compatibility > requirement, In practice, recent versions of GCC and Clang are used. On Windows, it's Vis

[Python-Dev] Start writing inlines rather than macros?

2014-02-27 Thread Kristján Valur Jónsson
Hi there. The discussion on http://bugs.python.org/issue20440 started me thinking that much of this bikeshedding could be avoided if we weren't constrained to writing macros for all of this stuff. For example, a Py_INLINE(PyObject *) Py_Incref(PyObject *obj) { Py_INCREF(obj); return obj;