🥀Azazelle🥀
🥀Azazelle🥀
MModular
Created by 🥀Azazelle🥀 on 11/10/2023 in #questions
Is there any known workaround for using external call with non-libc functions?
Yeah, thanks for the reply, and apologies for my former dumbassery
6 replies
MModular
Created by 🥀Azazelle🥀 on 11/10/2023 in #questions
Is there any known workaround for using external call with non-libc functions?
Ah, you mean like this?
from sys import ffi

def main():
let handle = ffi.DLHandle("math.h")
let cos = handle.get_function[fn(FloatLiteral) -> FloatLiteral]("cos")
print(cos(0.5))
from sys import ffi

def main():
let handle = ffi.DLHandle("math.h")
let cos = handle.get_function[fn(FloatLiteral) -> FloatLiteral]("cos")
print(cos(0.5))
6 replies