Port MatchPy to C++20

66 views
Skip to first unread message

manik taneja

unread,
Mar 24, 2020, 4:40:52 PM3/24/20
to sympy
Hey , 
    taking into consideration the suggestion by Mr. Francesco ;  porting  of Matchpy to C++ 20  is of utmost importance since C++20 has introduced coroutines .
    I am going  to open an issue for the same in SymEngine also, on GitHub . Open for advise and other feedback . 


(apologies for deleting the message in the last post ; i had made some error )

Francesco Bonazzi

unread,
Mar 25, 2020, 10:41:24 AM3/25/20
to sympy
OK, can you also post some code drafts?

manik taneja

unread,
Mar 25, 2020, 10:42:45 AM3/25/20
to sy...@googlegroups.com
Sure sir I’ll start working on it right away and get in touch with you as soon as I am done with it.
Thank you 

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/67dc06dd-e240-4221-bb78-a1d0ce207ad8%40googlegroups.com.

manik taneja

unread,
Mar 26, 2020, 3:26:37 AM3/26/20
to sy...@googlegroups.com
I am starting to get a hold of the porting technique and the logic shall I start by working to port parts of expressions.py (https://github.com/HPAC/matchpy/blob/master/matchpy/expressions/expressions.py)
to c++20 ?

Also Sir , I've read through your work and the implementations before starting off to work on the port. I've also read through the following repository https://github.com/luncliff/coroutine/tree/master/interface/coroutine .
Correct me if I'm wrong here ;
The steps to port the code is to pick any function create a header file for the same and then the implementation? because i saw both (.h) and (.cpp) files in SymEngine's repository.

manik taneja

unread,
Mar 26, 2020, 7:03:24 AM3/26/20
to sy...@googlegroups.com

Actually I saw that the primary issue was to incorporate coroutines and use generators in the already established matchpycpp file in the repository so I’ve started working on that I should be able to send you the draft codes soon .
Thank you 

manik taneja

unread,
Mar 26, 2020, 7:59:52 AM3/26/20
to sympy
I also looked at clang for compiling the coroutines implemented code with generators .  The C++20 standard specifies std::generator<> but clang 9.0.0 does not implement it so we would need to have a generator header file also to implement it in the MatchPycpp code.

Francesco Bonazzi

unread,
Mar 27, 2020, 3:49:23 AM3/27/20
to sympy

On Thursday, 26 March 2020 08:26:37 UTC+1, manik taneja wrote:
I am starting to get a hold of the porting technique and the logic shall I start by working to port parts of expressions.py (https://github.com/HPAC/matchpy/blob/master/matchpy/expressions/expressions.py)
to c++20 ?

No, SymEngine already has expressions.

manik taneja

unread,
Mar 27, 2020, 3:58:31 AM3/27/20
to sy...@googlegroups.com
Yes I noticed after  I had sent the mail sorry for the confusion.

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.

manik taneja

unread,
Mar 27, 2020, 4:07:34 AM3/27/20
to sy...@googlegroups.com
Also if it’s not an issue could I seek more guidance on coroutines because I’ve gone through a number of research papers that only highlight the keyword features , videos and github repositories . I’ve seen the implementation but more examples would help establish a strong foundation for the concept .

manik taneja

unread,
Mar 27, 2020, 4:07:58 AM3/27/20
to sy...@googlegroups.com
Coroutines pertaining to c++20

Francesco Bonazzi

unread,
Mar 27, 2020, 8:54:39 AM3/27/20
to sympy


On Friday, 27 March 2020 09:07:34 UTC+1, manik taneja wrote:
Also if it’s not an issue could I seek more guidance on coroutines because I’ve gone through a number of research papers that only highlight the keyword features , videos and github repositories . I’ve seen the implementation but more examples would help establish a strong foundation for the concept .

Coroutines are like generators in Python (i.e. the yield statement), very roughly.

MatchPy has lazy generators for the associative pattern matching algorithms. MatchPyCpp doesn't... they were transformed in for-loops, which are computationally inefficient as they compute all matchings.

We only need to compute the matchings lazily in order to prevent the computational requirements to explode.

manik taneja

unread,
Mar 31, 2020, 4:27:04 AM3/31/20
to sy...@googlegroups.com
Hello , 
      I have prepared a better approach to the GSOC application which is a complete change from the previous one. The primary issue of implementation of coroutines and generators is being worked upon in this application. The resources on coroutines is quite limited therefore draft codes for the same were limited . Post the deadline of submitting the application I am going to continue working on the issues and keep contributing regularly . I would be highly obliged if the mentors could give me a feedback on the same . 
Thank You 

--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
GSOC DRAFT APPLICATION 3.0.docx

manik taneja

unread,
Mar 31, 2020, 8:58:48 AM3/31/20
to sy...@googlegroups.com
I know it’s a lot to ask for at the last minute but any feedback or suggestions?
Reply all
Reply to author
Forward
0 new messages