TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Autowrap C functions at runtime for the Python/C API

7 pointsby orangeduckabout 13 years ago

1 comment

Erwinabout 13 years ago
What do you mean "runtime" ? You have to compile some C code with macros to wrap a unique type signature for each function you want to wrap, so this seems to require a compilation step unlike e.g. ctypes which is a runtime FFI. If there's a compilation step, why wouldn't I just want to use Pyrex/Cython which let me write this:<p><pre><code> def py_do_something(float a, float b): return c_do_something(a,b) </code></pre> while, during the Pyx -&#62; .c compilation step, taking care of all the C API plumbing (refcounting, initializing a module structure, type checking etc.)
评论 #3836566 未加载