Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Consider emitting C/C++ instead of LLVM IR #2

@opti-mix

Description

@opti-mix

PythoC currently generates LLVM IR, which is great!

But to make it more portable and available on more exotic target platforms, one could also consider emitting C/C++ instead of LLVM IR. This would make the emitted code more readable, possible to inspect and change if needed and more importantly, possible to compile with a target C/C++ compiler on systems where LLVM toolchains may be unavailable (yet). BTW, IIRC Nim actually generates C/C++ instead of e.g. LLVM IR directly. So, there is definitely a prior art related to this idea.

Is it something technically doable?

Does PythoC use any LLVM IR or LLVM features that cannot be represented in C/C++ form?

Is current IR easy and rich enough to be used as a basis for generating C/C++ or it needs to be extended quite a bit to make it possible?

It would be really interesting to hear your thoughts about this idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions