Skip to content

Conversation

anutosh491
Copy link
Contributor

@anutosh491 anutosh491 commented May 21, 2024

Fixes #2018

@anutosh491
Copy link
Contributor Author

cc @isuruf @certik

@anutosh491 anutosh491 requested a review from isuruf May 22, 2024 09:57
@anutosh491 anutosh491 requested a review from certik May 23, 2024 18:05
@anutosh491
Copy link
Contributor Author

I think this might be ready to go now.

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this looks good now, this PR cleanly exposes the two methods for Add and Mul with minimal overhead. We leave the door open for any future improvement, such as making this work for "all classes". This minimal approach in this PR is enough to unblock us for Gruntz.

@certik certik merged commit 088aa01 into symengine:master May 23, 2024
@isuruf
Copy link
Member

isuruf commented May 23, 2024

Thanks. Can LPython generate code for the C/C++ library so that we get a gruntz code for free?

@certik
Copy link
Contributor

certik commented May 23, 2024

@isuruf that's what we are working on. LPython can generate LLVM, C and C++ code, in this order of maturity. The C++ code would still call SymEngine via the C API. We are still relatively at the beginning in the Gruntz implementation, you can follow our progress here: lcompilers/lpython#2688. Indeed, eventually it will be possible to just use the generated C code, possibly include it in SymEngine. The goal is that there is no runtime overhead of using SymPy in LPython compared to using C++/SymEngine directly.

@anutosh491 anutosh491 deleted the as_two_terms branch May 24, 2024 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Supporting basic_as_two_terms() through the cwrapper
3 participants