Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Eval #11

Merged
merged 8 commits into from
Dec 1, 2024
Merged

Code Eval #11

merged 8 commits into from
Dec 1, 2024

Conversation

DronCode
Copy link
Owner

This PR contains an implementation of constexpr C++ code eval from Python side.
It makes able to ask python 'hey, evaluate some C++ constexpr code and return me a results'.

Supported trivial result types:

  • int (int64, uint64)
  • boo
  • float
  • double
  • string (LValue string literals only)

Python interface:

  1. Added a new class CodeEvaluator with default constructor and 1 method eval(code, capture)
  2. Added method CodeAnalyzer.make_evaluator - makes code evaluator with compiler preset
  3. Added method AnalyzerContext.make_evaluator - makes code evaluator with compiler preset

PR is ready to merge

         Added base implementation of CodeEvaluator class which able to evaluate constexpr code.
         Small refactoring in CodeAnalyzer.
         Fixed possible bug with id0.hpp file when it contents could be corrupted. Used better approach from LLVM with virtual files.
         Added macro definition __RG3_CODE_EVAL__ in code eval mode.
         Fixed string lvalue capture.
@DronCode DronCode self-assigned this Nov 30, 2024
@DronCode
Copy link
Owner Author

DronCode commented Dec 1, 2024

Looks good enough. Need to update docs (README.md) and add some examples into title page. Also, provide same changes to PyPI page.

@DronCode
Copy link
Owner Author

DronCode commented Dec 1, 2024

Awesome, ready to merge. Then release v0.0.23!

@DronCode DronCode merged commit b1b78be into main Dec 1, 2024
4 checks passed
@DronCode DronCode deleted the dev/code_eval branch December 1, 2024 18:01
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.

1 participant