Skip to content

API for adding other visitors #4

@bridgesign

Description

@bridgesign

This issue is kind of a mix of question and feature request. I am not sure if it makes sense given:

  1. Its current stage
  2. The scope of the project (Not sure if its limited only to C)

Scenario:

The project relies on llvmlite which was developed by numba. The numba project has put in a lot of effort in making efficient jit around numpy API in addition to cuda support. What I ideally want to do is use the numba parser to create LLVM IR for functions dealing with maths and call it through a c function defined in PythoC. Calling numba jit function via cfunc is not possible in numba and I want to avoid the python wrap and unwrap between calls.

Main Issue:

Forgetting about the issue of where to find the relevant code in numba, for the PythoC code base, what will be the easiest way to add another visitor so that it is correctly added in the unified registry and handle function calls?

  • Is there already an API in PythoC to do this?
  • If not, then what is a likely direction to approach this?
  • Is it the case that it will require a huge refactor on the PythoC codebase?

In general, I think it will be good that PythoC exposes API to add separate visitors to allow adding or easy monkey patching for extending with other libraries.

PS: I am not a compilers person so I might have missed some obvious things.

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