[issue28266] setup.py uses build Python's configuration when cross-compiling

2016-09-25 Thread Rouslan Korneychuk
Rouslan Korneychuk added the comment: > The problem is: setting PYTHON_FOR_BUILD manually breaks cross-compiling. > Please remove it, add python3.6 to $PATH and cross-compiling should be OK. I see. > For the problem of libffi: since issue27976 using bundled libffi is > deprec

[issue28266] setup.py uses build Python's configuration when cross-compiling

2016-09-25 Thread Rouslan Korneychuk
Rouslan Korneychuk added the comment: I just tried compiling 3.6 unmodified for Android and it failed when trying to build libffi. The error message included these two lines: configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. so 3.6b1 is still

[issue28266] setup.py uses build Python's configuration when cross-compiling

2016-09-24 Thread Rouslan Korneychuk
Rouslan Korneychuk added the comment: Here is an updated patch for 3.6b1. I was able to compile Python with the changes, natively (x86_64 linux) and for ARM, using an Android "isolated toolchain." However, with the ARM build, a file named _sysconfigdata_m_linux_x86_64-linux-gnu.p

[issue28266] setup.py uses build Python's configuration when cross-compiling

2016-09-24 Thread Rouslan Korneychuk
New submission from Rouslan Korneychuk: When building Python, the setup.py script will use values from sysconfig, even when cross compiling. When cross compiling, the interpreter that runs setup.py is configured for the build system, not the host system, so the wrong values are used

Re: [OT] Re: Hyper-spacial ray-tracer

2013-10-05 Thread Rouslan Korneychuk
On 10/05/2013 11:26 AM, Peter Pearson wrote: On Fri, 04 Oct 2013 20:17:52 -0400, Rouslan Korneychuk rousl...@msn.com wrote: [snip] I was also wondering about general relativity. I'm not going to go into too much detail, but basically: if an object with synchronized clocks on either end

Re: Hyper-spacial ray-tracer

2013-10-04 Thread Rouslan Korneychuk
On 10/04/2013 04:23 PM, Tony the Tiger wrote: On Wed, 02 Oct 2013 17:05:32 -0400, Rouslan Korneychuk wrote: game Sorry, but that sounds awful. I hate games. This... isn't a game or even related to gaming. Is it because of the use of Pygame that you thought it was. I use Pygame because

Re: Hyper-spacial ray-tracer

2013-10-04 Thread Rouslan Korneychuk
On 10/04/2013 09:41 PM, Chris Angelico wrote: On Sat, Oct 5, 2013 at 10:17 AM, Rouslan Korneychuk rousl...@msn.com wrote: The point of this was to explore the concept of hyperspace, which is a mathematical curiosity and also has relevance in theoretical physics. I don't have any actual use

Hyper-spacial ray-tracer

2013-10-02 Thread Rouslan Korneychuk
I have been working on something I thought was interesting and I wanted to know what other people think. It's a ray-tracing library than can work with any number of spacial dimensions greater than two. It's a Python package that uses Pygame. The project and a screenshot are at:

Re: How do functions get access to builtins?

2013-01-20 Thread Rouslan Korneychuk
On 01/19/2013 09:59 PM, Steven D'Aprano wrote: I've been playing around with ChainedMap in Python 3.3, and run into something which perplexes me. Let's start with an ordinary function that accesses one global and one builtin. x = 42 def f(): print(x) If you call f(), it works as

Re: Brython - Python in the browser

2012-12-21 Thread Rouslan Korneychuk
On 12/20/2012 04:37 AM, Pierre Quentel wrote: To create an element, for instance an HTML anchor : doc = A('Python',href=http://www.python.org;) To me, that is a awful choice and I urge you to change it. '=' is not just an operator, it is a comparison operator. It normally return False or

Determining if any threads are waiting for GIL

2012-12-19 Thread Rouslan Korneychuk
I'm working on a package that can compile CPython byte-code into native machine code (so far: x86 and x86_64 are supported). I have support for almost every byte-code instruction implemented already, but to fully emulate the interpreter, I need an efficient way to determine two things: when to

Re: Lazy Attribute

2012-11-16 Thread Rouslan Korneychuk
On 11/16/2012 02:49 AM, Andriy Kornatskyy wrote: If accessing the descriptor on the class object has no special meaning, then the custom is to return the descriptor object itself, as properties do. If I would satisfy this, I will be forced to check for None 99.9% of the use cases (it is not

Re: Lazy Attribute

2012-11-16 Thread Rouslan Korneychuk
On 11/16/2012 04:32 AM, Rouslan Korneychuk wrote: On 11/16/2012 02:49 AM, Andriy Kornatskyy wrote: If accessing the descriptor on the class object has no special meaning, then the custom is to return the descriptor object itself, as properties do. If I would satisfy this, I will be forced

Re: How to improve the usability of nested packages

2012-11-05 Thread Rouslan Korneychuk
On 11/02/2012 12:11 PM, Michael Schwarz wrote: … which doesn't work. Some of the modules reference other modules in the same package. I'm not talking about cyclic references, but, for example, the dialog module uses the transaction module. The problem is that the dialog module uses the same

Re: a little parsing challenge ☺

2011-07-21 Thread Rouslan Korneychuk
On 07/21/2011 09:23 AM, Xah Lee wrote: Thanks for the code. are you willing to make it complete and standalone? i.e. i can run it like this: perl Rouslan_Korneychuk.pl dirPath and it prints any file that has mismatched pair and line/column number or the char position? Since you asked, I

Re: a little parsing challenge ☺

2011-07-18 Thread Rouslan Korneychuk
I don't know why, but I just had to try it (even though I don't usually use Perl and had to look up a lot of stuff). I came up with this: /(?| (\()(?matched)([\}\]”›»】〉》」』]|$) | (\{)(?matched)([\)\]”›»】〉》」』]|$) | (\[)(?matched)([\)\}”›»】〉》」』]|$) |

Re: a little parsing challenge ☺

2011-07-18 Thread Rouslan Korneychuk
On 07/18/2011 03:24 AM, Stefan Behnel wrote: That's solid Perl. Both the code generator and the generated code are unreadable. Well done! Stefan Why, thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: a little parsing challenge ☺

2011-07-18 Thread Rouslan Korneychuk
On 07/18/2011 12:46 PM, Thomas 'PointedEars' Lahn wrote: Rouslan Korneychuk wrote: I don't know why, but I just had to try it (even though I don't usually use Perl and had to look up a lot of stuff). I came up with this: I don't know why … you replied to my posting/e-mail (but quoted nothing

Re: basic bytecode to machine code compiler (part 3)

2011-06-21 Thread Rouslan Korneychuk
On 06/21/2011 06:55 AM, Ulrich Eckhardt wrote: Rouslan Korneychuk wrote: if i != pindex: (less if x= pivot else greater).append(x) Just curious, is there a reason why you wrote this last line that way instead of using a normal if/else clause? Cheers! Uli No special reason. I just

basic bytecode to machine code compiler (part 3)

2011-06-20 Thread Rouslan Korneychuk
My compiler now supports the x86-64 instruction set, in addition to x86. It also generates faster x86 machine code. Although it's designed to support 64-bit Windows, I have only tested it on Linux so far, and it doesn't support running with Windows' DEP yet. It's available at

basic bytecode to machine code compiler (part 2)

2011-05-17 Thread Rouslan Korneychuk
I mentioned before that I had a proof of concept to convert Python bytecode to native machine code. It's available at https://github.com/Rouslan/nativecompile Now that I have a substantial number of the bytecode instructions implemented, I thought I would share some benchmark results. The

Re: a basic bytecode to machine code compiler

2011-04-01 Thread Rouslan Korneychuk
Thanks for all the replies. I wasn't aware of some of these alternatives. Most of these seem to transform Python code/bytecode into another language. I was already well aware of Cython. On the Nuitka blog, I notice it says Compiling takes a lot [sic] time, Compyler seems to generate

a basic bytecode to machine code compiler

2011-03-31 Thread Rouslan Korneychuk
I was looking at the list of bytecode instructions that Python uses and I noticed how much it looked like assembly. So I figured it can't be to hard to convert this to actual machine code, to get at least a small boost in speed. And so I whipped up a proof of concept, available at

inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
I'm working on a program that automatically generates C++ code for a Python extension and I noticed a few limitations when using the weaklist and instance dictionaries (tp_weaklistoffset and tp_dictoffset). This is pertaining to the C API. I noticed that when using multiple inheritance, I

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
On 02/09/2011 02:42 PM, Carl Banks wrote: On Feb 9, 10:54 am, Rouslan Korneychukrousl...@msn.com wrote: I'm working on a program that automatically generates C++ code for a Python extension and I noticed a few limitations when using the weaklist and instance dictionaries (tp_weaklistoffset and

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
On 02/09/2011 04:58 PM, Carl Banks wrote: On Feb 9, 1:14 pm, Rouslan Korneychukrousl...@msn.com wrote: On 02/09/2011 02:42 PM, Carl Banks wrote: This is the only case I can think of where the layout conflict would be caused by a type setting tp_dictoffset. No, actually I have code that is

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
On 02/09/2011 05:02 PM, Carl Banks wrote: On Feb 9, 1:14 pm, Rouslan Korneychukrousl...@msn.com wrote: Each Python class is a wrapper for a C++ class. Also, if you want my opinion (you probably don't after you've already gone to so much trouble, but here it is anyway): No, your opinion is

Re: inheritance, multiple inheritance and the weaklist and instance dictionaries

2011-02-09 Thread Rouslan Korneychuk
On 02/09/2011 08:40 PM, Carl Banks wrote: I explained why in my last post; there's a bunch of reasons. Generally you can't assume someone's going to go through the type structure to find the object's dict, nor can you expect inherited methods to always use the derived class's type structure

My extension code generator for C++

2010-07-03 Thread Rouslan Korneychuk
It's still in the rough, but I wanted to give an update on my C++ extension generator. It's available at http://github.com/Rouslan/PyExpose The documentation is a little slim right now but there is a comprehensive set of examples in test/test_kompile.py (replace the k with a c. For some

Re: My extension code generator for C++

2010-07-03 Thread Rouslan Korneychuk
On 07/03/2010 01:54 PM, Thomas Jollans wrote: On 07/03/2010 07:22 PM, Rouslan Korneychuk wrote: It's still in the rough, but I wanted to give an update on my C++ extension generator. It's available at http://github.com/Rouslan/PyExpose Question that pops to mind immediately: How does

Re: My extension code generator for C++

2010-07-03 Thread Rouslan Korneychuk
I missed one: func=operator[] would also work, I assume? Yes, you can also supply a function if the first parameter accepts the type being wrapped (__rop__ methods will even accept the second parameter taking the wrapped type). -- http://mail.python.org/mailman/listinfo/python-list

Re: new extension generator for C++

2010-05-06 Thread Rouslan Korneychuk
I have the code up at http://github.com/Rouslan/PyExpose now. Any comments are welcome. -- http://mail.python.org/mailman/listinfo/python-list

Re: Picking a license (was Re: new extension generator for C++)

2010-05-06 Thread Rouslan Korneychuk
On 05/06/2010 04:22 PM, Aahz wrote: In article4be05d75.7030...@msn.com, Rouslan Korneychukrousl...@msn.com wrote: The only question I have now is what about licensing? Is that something I need to worry about? Should I go with LGPL, MIT, or something else? Which license you use depends

Re: new extension generator for C++

2010-05-04 Thread Rouslan Korneychuk
On 05/04/2010 03:06 AM, Samuel Williams wrote: Dear Rouslan, It looks interesting. I say go for it. You will learn something and might make some improvements on existing ideas. I recommend putting the code on www.github.com Kind regards, Samuel Thanks for the suggestion. I think I'll do

new extension generator for C++

2010-05-03 Thread Rouslan Korneychuk
Hi, I'm new here. I'm working on a program that exposes C++ declarations to Python and I was wondering if there is any interest in it. It's a hobby project. I was originally using Boost.Python on another project but found a couple of things I didn't like. Eg: you can't really have private