# Efficiency for calling Julia from python and purely run Julia

**URL:** <https://discourse.julialang.org/t/efficiency-for-calling-julia-from-python-and-purely-run-julia/81484>\
**Category:** General Usage\
**Created:** [May 23, 2022, 3:16am UTC](https://discourse.julialang.org/t/efficiency-for-calling-julia-from-python-and-purely-run-julia/81484 "2022-05-23T03:16:01Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [May 23, 2022, 6:17am UTC](https://discourse.julialang.org/t/efficiency-for-calling-julia-from-python-and-purely-run-julia/81484/4 "2022-05-23T06:17:43Z")

</div>

There is another mechanism, which is to use [PackageCompiler.jl](https://github.com/JuliaLang/PackageCompiler.jl) and export a C function pointer to a Julia function via [`@cfunction`](https://docs.julialang.org/en/v1/base/c/#Base.@cfunction). You can then call this C function pointer from Python.

@mlxd put together a presentation regarding this approach:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/c/ec700b2c33246e124dc298958cfaeb04ed9ea807.jpeg)

> <https://github.com/mlxd/PLext/blob/main/pres/PLext.pdf>

> **[GitHub - mlxd/PLext: An attempt at building Python wheels with external...](https://github.com/mlxd/PLext)**
>
> An attempt at building Python wheels with external packages compiled using Julia. - GitHub - mlxd/PLext: An attempt at building Python wheels with external packages compiled using Julia.

---

_[View the full topic](https://discourse.julialang.org/t/efficiency-for-calling-julia-from-python-and-purely-run-julia/81484)._
