[pypy-dev] cppyy questions

Omer Katz omer.drow at gmail.com
Tue Jan 20 18:07:26 CET 2015


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 <wlavrijsen at lbl.gov>:

> 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
> length data member and a pointer to what is a byte array. Further, for
> short strings, those data members can be used as the actual payload.)
>
>  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.
>>
>
> Right, which is done on the CPython side. Haven't gotten around to
> implement
> the same on the PyPy side. Isn't hard, but takes time. (There's a separate
> issue for the cling backend, where we have yet to move to MCJit, which is
> needed to support C++ exceptions through LLVM JIT-ted code.)
>
> Likewise, returning out-parameters in a tuple is a nice pythonization that
> is on the TODO-list (which is long). Lacking time, again.
>
> Of course, this can be fixed on the python side also, by replacing the
> bound
> function with one that creates a temporary s = std.string(), calls the
> original function, then returns an str(s).
>
> Best regards,
>            Wim
> --
> WLavrijsen at lbl.gov    --    +1 (510) 486 6411    --    www.lavrijsen.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20150120/9e6c985e/attachment-0001.html>


More information about the pypy-dev mailing list