Re: [std-proposals] Exception compatibility with aliens

Barry Scott <[email protected]> Wed, 18 Jan 2023 21:13:42 +0000
Newsgroups gmane.comp.python.devel,gmane.comp.lang.c++.isocpp.proposals
Message-ID <[email protected]>
--===============5155069174874924148==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_C47BF24F-E74A-45A1-BA87-B6FFB2A3FC18"


--Apple-Mail=_C47BF24F-E74A-45A1-BA87-B6FFB2A3FC18
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii



> On 18 Jan 2023, at 15:35, Frederick Virchanza Gotham =
<[email protected]> wrote:
>=20
> On Wed, Jan 18, 2023 at 3:07 PM Jason McKesson wrote:
>>=20
>> 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.
>=20
>=20
> 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 -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at =
https://mail.python.org/archives/list/[email protected]/message/5OARJX=
OXYFXHTO2OBHUGFVFSQHOVPVPO/
> Code of Conduct: http://python.org/psf/codeofconduct/
>=20


--Apple-Mail=_C47BF24F-E74A-45A1-BA87-B6FFB2A3FC18
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dus-ascii"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: =
after-white-space;"><br><div><br><blockquote type=3D"cite"><div>On 18 =
Jan 2023, at 15:35, Frederick Virchanza Gotham =
&lt;[email protected]&gt; wrote:</div><br =
class=3D"Apple-interchange-newline"><div><div>On Wed, Jan 18, 2023 at =
3:07 PM Jason McKesson wrote:<br><blockquote type=3D"cite"><br>Also, =
this proposal seems to be missing the biggest issue =
with<br>cross-language exception handling: the fact that you can't =
throw<br>exceptions across languages. The only thing you *can* do is =
catch<br>exceptions on the source language end, convert them into some =
data<br>packet, and throw a different exception on the destination =
language<br>side.<br></blockquote><br><br>Yes this is what I had in =
mind. Behind the scenes, the C++ compiler<br>would catch the Python =
exception and then throw something that C++ can<br>deal with "such as =
std::aliens::python::exception".<br></div></div></blockquote><div><br></di=
v>In PyCXX I allows exceptions to go into and out of python and =
C++.</div><div><a =
href=3D"https://cxx.sourceforge.net/">https://cxx.sourceforge.net/</a><br>=
</div><div><br></div><div>You can raise in C++ go into python and back =
into C++ and the exception arrives as expected.</div><div>You can riase =
in Python fo into C++ and back to Python and again the exception arrives =
as expected.</div><div>&nbsp;That is as long as its a python =
exception.</div><div><br></div><div>Barry</div><div><br><blockquote =
type=3D"cite"><div><div>_______________________________________________<br=
>Python-Dev mailing list -- [email protected]<br>To unsubscribe send =
an email to =
[email protected]<br>https://mail.python.org/mailman3/lists/pyth=
on-dev.python.org/<br>Message archived at =
https://mail.python.org/archives/list/[email protected]/message/5OARJX=
OXYFXHTO2OBHUGFVFSQHOVPVPO/<br>Code of Conduct: =
http://python.org/psf/codeofconduct/<br><br></div></div></blockquote></div=
><br></body></html>=

--Apple-Mail=_C47BF24F-E74A-45A1-BA87-B6FFB2A3FC18--

--===============5155069174874924148==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline