Re: [std-proposals] Exception compatibility with aliens

On Wed, Jan 18, 2023 at 3:07 PM Jason McKesson wrote:
Also, this proposal seems to be missing the biggest issue with cross-language exception handling: the fact that you can't throw exceptions across languages. The only thing you *can* do is catch exceptions on the source language end, convert them into some data packet, and throw a different exception on the destination language side.
Yes this is what I had in mind. Behind the scenes, the C++ compiler would catch the Python exception and then throw something that C++ can deal with "such as std::aliens::python::exception".

On 18 Jan 2023, at 15:35, Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> wrote:
On Wed, Jan 18, 2023 at 3:07 PM Jason McKesson wrote:
Also, this proposal seems to be missing the biggest issue with cross-language exception handling: the fact that you can't throw exceptions across languages. The only thing you *can* do is catch exceptions on the source language end, convert them into some data packet, and throw a different exception on the destination language side.
Yes this is what I had in mind. Behind the scenes, the C++ compiler would catch the Python exception and then throw something that C++ can deal with "such as std::aliens::python::exception".
In PyCXX I allows exceptions to go into and out of python and C++. https://cxx.sourceforge.net/ You can raise in C++ go into python and back into C++ and the exception arrives as expected. You can riase in Python fo into C++ and back to Python and again the exception arrives as expected. That is as long as its a python exception. Barry
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/5OARJXOX... Code of Conduct: http://python.org/psf/codeofconduct/

Table this, perhaps?
On Jan 18, 2023, at 5:04 PM, Barry Scott <barry@barrys-emacs.org> wrote:
On 18 Jan 2023, at 15:35, Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> wrote:
On Wed, Jan 18, 2023 at 3:07 PM Jason McKesson wrote:
Also, this proposal seems to be missing the biggest issue with cross-language exception handling: the fact that you can't throw exceptions across languages. The only thing you *can* do is catch exceptions on the source language end, convert them into some data packet, and throw a different exception on the destination language side.
Yes this is what I had in mind. Behind the scenes, the C++ compiler would catch the Python exception and then throw something that C++ can deal with "such as std::aliens::python::exception".
In PyCXX I allows exceptions to go into and out of python and C++. https://cxx.sourceforge.net/
You can raise in C++ go into python and back into C++ and the exception arrives as expected. You can riase in Python fo into C++ and back to Python and again the exception arrives as expected. That is as long as its a python exception.
Barry
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/5OARJXOX... Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/NFUSVJB2... Code of Conduct: http://python.org/psf/codeofconduct/
participants (3)
-
Barry Scott
-
Frederick Virchanza Gotham
-
Josh Engroff