M
Modular•13mo ago
jordiae

Can I call a (compiled) Mojo function from Python?

Otherwise, do we have any ETA for when that is going to be available? It seems like the killer feature for Mojo.
15 Replies
Jack Clayton
Jack Clayton•13mo ago
Hi @jordiae it should work by packaging exported Mojo functions, I'm working on this today and will post back here
jordiae
jordiae•13mo ago
Looking forward! Thanks!
Sarctiann
Sarctiann•12mo ago
Hello, is there any guide or section in the documentation that shows how to do this? basically, my idea would be 1. write a module/package in Mojo 2. expose the functions (and if possible the structures) 3. compile it, I guess 4. import it from Python. is this possible?
jordiae
jordiae•12mo ago
@Jack Clayton any updates?
ModularBot
ModularBot•12mo ago
Congrats @jordiae, you just advanced to level 1!
Jack Clayton
Jack Clayton•12mo ago
@Sarctiann yeah should be possible @jordiae working on it as part of blog. I'll let you know in here when I have a solution to share 🙂
Sarctiann
Sarctiann•12mo ago
Happy to hear that 🙂 thank you!
Orwink
Orwink•12mo ago
This would be great, I've been using Rust since Python with pyo3. I would love to try Mojo from Python.
Jack Clayton
Jack Clayton•12mo ago
Hi @jordiae @Sarctiann @Orwink sorry there's currently no way to do this from the Mojo SDK my mistake. They want to make sure they design that feature the right way before releasing it.
Sarctiann
Sarctiann•12mo ago
Oh, I understand. Thanks for the update. For my part, I'm happy with the speed with which Mojo is advancing so I can't complain. I will continue practicing with the features we already have.
Orwink
Orwink•12mo ago
The best things in life take time. Thank you for all the work you are doing.
ModularBot
ModularBot•12mo ago
Congrats @Orwink, you just advanced to level 1!
franchesoni
franchesoni•12mo ago
we need this!
Pierre Augier
Pierre Augier•10mo ago
I created an issue about this feature to ask if it could be mentioned in the roadmap: https://github.com/modularml/mojo/issues/1423 It is frustrating that there is absolutely no mention of this in Mojo website.
GitHub
[Docs] Add to the roadmap: a good story for using Mojo from Python ...
Where is the problem? https://docs.modular.com/mojo/roadmap.html What can we do better? This issue is just about adding a new item to the roadmap :-) about building a good story for using Mojo from...
Jack Clayton
Jack Clayton•10mo ago
Good idea thanks, I pinged in your ticket
Want results from more Discord servers?
Add your server