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

Handle printing of logical types in the LLVM backend #504

Merged
merged 4 commits into from
Jul 19, 2022

Conversation

namannimmo10
Copy link
Collaborator

@namannimmo10 namannimmo10 commented May 18, 2022

fixes #322

@namannimmo10 namannimmo10 marked this pull request as draft May 18, 2022 05:13
@czgdp1807
Copy link
Collaborator

I reviewed. Thanks for requesting review.

@czgdp1807 czgdp1807 added the please take over PRs which can be taken over by other contributors label Jun 19, 2022
@Smit-create
Copy link
Collaborator

I think this is already fixed in main.

print(True, False)

Gives,

1 0

Handling booleans as integers in the LLVM backend is good in my opinion because ASR is language independent and the LLVM backend is used for different frontend languages, we might have some confits in printing booleans explicitly like "True" in some front-end languages and "true" in some others.

@certik
Copy link
Contributor

certik commented Jun 27, 2022

The issue is that LPython should print it like CPython does, and LFortran like other Fortran compilers do. But this can be easily configurable, say as an option to asr_to_llvm, so not a big deal in practice.

@namannimmo10 namannimmo10 marked this pull request as ready for review July 19, 2022 16:50
@namannimmo10
Copy link
Collaborator Author

namannimmo10 commented Jul 19, 2022

I am sorry for the long delay in addressing the comments.

Note that this is ready for the Python frontend for now. We have to think of a way to make this work for LFortran, too.

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 this works. Thanks!

@certik certik merged commit 8e4ab9f into lcompilers:main Jul 19, 2022
@namannimmo10 namannimmo10 deleted the logical_print branch July 20, 2022 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
please take over PRs which can be taken over by other contributors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle printing of logical types
4 participants