-
|
How can I use a compiled Codon module without the source code, and import it in Codon? Is this supported, similar to linking a shared library in C++? If I want to distribute my Codon package in a way similar to a Python module (e.g., as a .whl file), is it correct that, for now, the only available method is to share the source code folder and require users to set the CODON_PATH in order to use it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
# v1.codon
def say_hi():
a = 1
b = [1,2,3]
print("say hi")
print(b)
# compile v1.codon as a shared library or so# v2.codon without v1.codon, only v1.so or so
import v1
v1.say_hi() |
Beta Was this translation helpful? Give feedback.
-
We don't yet support compiling to individual modules/library in the same way as C++. But you can generate shared libraries with Codon via
Yes that's currently the best solution. |
Beta Was this translation helpful? Give feedback.
We don't yet support compiling to individual modules/library in the same way as C++. But you can generate shared libraries with Codon via
codon build -lib ...that you can then load from another Codon program (just remember to mark the public functions with@export).Yes that's currently the best solution.