Re: [pypy-dev] RFC: Copy-on-write list slices

2015-01-20 Thread Maciej Fijalkowski
Hi Mike A good test suite is pypy benchmark suite (https://bitbucket.org/pypy/benchmarks) which is relatively comprehensive and we run it nightly. If you run in trouble running it, please pop in to #pypy on freenode and we can help :-) On Tue, Jan 20, 2015 at 6:26 AM, Mike Kaplinskiy wrote: > He

[pypy-dev] cppyy questions

2015-01-20 Thread Omer Katz
I'm trying to use protobuf with PyPy and I've been quite successful doing so with cppyy. I generated the protobuf in C++ and used reflex to generate the bindings. I've encountered some problems that I don't know how to deal with and the documentation doesn't describe what you can do to resolve them

Re: [pypy-dev] cppyy questions

2015-01-20 Thread Amaury Forgeot d'Arc
Hi, 2015-01-20 14:14 GMT+01:00 Omer Katz : > The documentation is unclear how you can pass a pointer to a Python > variable e.g.: > str = "" > > e.SerializeToString(str) > Message::SerializeToString() updates its argument in-place, but Python strings are not mutable. You should allocate a std::s

[pypy-dev] Sudden failures during compile-c

2015-01-20 Thread Timothy Baldridge
Recently my builds on linux with --opt=jit have started failing with the following error: [translation:info] Error: [translation:info]File "/home/travis/build/pixie-lang/externals/pypy/rpython/translator/goal/translate.py", line 316, in main [translation:info] drv.proceed(goals) [trans

Re: [pypy-dev] Sudden failures during compile-c

2015-01-20 Thread Armin Rigo
Hi Timothy, On 20 January 2015 at 15:59, Timothy Baldridge wrote: > I find this odd as it works just fine without the JIT, and compiles fine on > OS X. The code in question is basically a copy-and-paste from PyPy's code: > https://github.com/pixie-lang/pixie/blob/master/pixie/vm/threads.py#L90 M

Re: [pypy-dev] cppyy questions

2015-01-20 Thread Omer Katz
That's correct but can't we handle those cases in cppyy? We should provide a native Python interface whenever it's possible. 2015-01-20 15:40 GMT+02:00 Amaury Forgeot d'Arc : > Hi, > > 2015-01-20 14:14 GMT+01:00 Omer Katz : > >> The documentation is unclear how you can pass a pointer to a Python

Re: [pypy-dev] Sudden failures during compile-c

2015-01-20 Thread Armin Rigo
Re-hi, On 20 January 2015 at 16:04, Armin Rigo wrote: > Maybe related: there is a copy mistake in after_external_call(). It > should not call the get/set_saved_errno() functions. Also, did you mean "_cleanup_()" instead of "__cleanup__()"? Armin ___

Re: [pypy-dev] cppyy questions

2015-01-20 Thread Amaury Forgeot d'Arc
2015-01-20 16:07 GMT+01:00 Omer Katz : > That's correct but can't we handle those cases in cppyy? > We should provide a native Python interface whenever it's possible. > It's not possible to take a Python string as mutable reference. Here are some options that cppyy could implement: - Use bytea

Re: [pypy-dev] cppyy questions

2015-01-20 Thread Omer Katz
I tried to pass a bytearray and that's also not currently supported. Any clue about what should I do with the exception? It definitely shouldn't crash the process. I need it to raise a python exception instead. בתאריך 20 בינו 2015 17:49, ‏"Amaury Forgeot d'Arc" כתב: > 2015-01-20 16:07 GMT+01:00 O

Re: [pypy-dev] cppyy questions

2015-01-20 Thread Amaury Forgeot d'Arc
2015-01-20 17:00 GMT+01:00 Omer Katz : > I tried to pass a bytearray and that's also not currently supported. > Any clue about what should I do with the exception? It definitely > shouldn't crash the process. I need it to raise a python exception instead. > The only way to prevent a crash is to ad

Re: [pypy-dev] cppyy questions

2015-01-20 Thread Omer Katz
The fatal exception is not really that fatal. It just means that it can't serialize the protobuf object to a string. The normal protobuf Python bindings just raise Python exceptions. See https://github.com/google/protobuf/search?l=python&q=Exception&utf8=%E2%9C%93 The problem with IsInitialized()

Re: [pypy-dev] cppyy questions

2015-01-20 Thread Omer Katz
Also how do I catch exceptions that are caused when parsing an event? >> e.ParseFromString('') >> [libprotobuf ERROR google/protobuf/message_lite.cc:123] Can't parse message of type "MyProtobufType" because it is missing required fields: header >> False 2015-01-20 18:18 GMT+02:00 Amaury Forgeot d'

Re: [pypy-dev] cppyy questions

2015-01-20 Thread wlavrijsen
Hi, I tried to pass a bytearray and that's also not currently supported. no, it really expects an std::string object to be passed through an std::string*, as Amaury advised. Any other type would require the creation of a temporary. (A C++ string is not a byte array. Typically, it carries a len

Re: [pypy-dev] cppyy questions

2015-01-20 Thread Omer Katz
So cppyy isn't production ready yet? If C++ exceptions can cause the process to crash that's very dangerous in production systems. Can we warn about this in the documentation. I think that people should know about this before investing time with it. 2015-01-20 19:03 GMT+02:00 : > Hi, > > I tried

Re: [pypy-dev] cppyy questions

2015-01-20 Thread wlavrijsen
Omar, So cppyy isn't production ready yet? that will always be in the eye of the beholder. :) If C++ exceptions can cause the process to crash that's very dangerous in production systems. Yes, C++ exceptions do that in C++ as well. :) Which is why we forbid them. Can we warn about this i

[pypy-dev] Numpy Topics

2015-01-20 Thread Steven Jackson
Hey I'd like to know if the proposed numpy projects list at https://bitbucket.org/pypy/extradoc/src/extradoc/planning/micronumpy.txt is still up to date, and if so what is meant by "a good sort function." If it's just a matter of implementing a known good algorithm, that seems like a good way to st

Re: [pypy-dev] Sudden failures during compile-c

2015-01-20 Thread Timothy Baldridge
I fixed both of those now, but to no avail. The build still fails. But looking at the error it's interesting to note that "do_yield_thread" does exist, but "do_yield_thread_reload" does not. From what I can figure out, this "_reload" function is generated by asmgcroot. My OSX build is defaulting to

Re: [pypy-dev] Numpy Topics

2015-01-20 Thread Dan Stromberg
On Tue, Jan 20, 2015 at 4:57 PM, Steven Jackson wrote: > > Hey I'd like to know if the proposed numpy projects list at > https://bitbucket.org/pypy/extradoc/src/extradoc/planning/micronumpy.txt is > still up to date, and if so what is meant by "a good sort function." > If it's just a matter of imp

Re: [pypy-dev] Numpy Topics

2015-01-20 Thread Armin Rigo
Hi Dan, On 21 January 2015 at 03:19, Dan Stromberg wrote: > It includes a pure-python version of timsort, among others. There is one in PyPy too. Kind of obvious, in fact: we need one for implementing `list.sort()`. I think the original question was instead very numpy-specific: it refers, I gu

Re: [pypy-dev] Sudden failures during compile-c

2015-01-20 Thread Armin Rigo
Hi Timothy, On 21 January 2015 at 02:07, Timothy Baldridge wrote: > I switched all builds to use shadowstack and the > build error goes away. So I guess that was the issue. Can you tell us how to reproduce anyway? It's strange that you get this problem, because a "void pypy_g_do_yield_thread_re

[pypy-dev] OrderedDict.move_to_end()

2015-01-20 Thread Armin Rigo
Hi all, About the new OrderedDict and how to support `move_to_end(last=False)` in the py3k branch: an implementation of the correct complexity is possible. It would piggy-back on the part of `lookup_function_no` that acts as counter for how many entries at the start are known to be deleted. This