TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Real world examples of interaction between Python and Go?

6 点作者 wareotie超过 7 年前
My manager allows me to use some of my time on personal projects so I started a library for an internal tool. More as a learning project that anything else, but now, it seems is useful for other people.<p>The thing is, the library is completely written in Go and I would like to use it as a Python library.<p>I found a few blog posts but I cannot find real world examples of libraries written in Go but been use from Python and I feel a little lost.<p>Anyone knows public repos like this?

1 comment

itamarst超过 7 年前
Sadly the experiment I did isn&#x27;t public. My memory is I compiled the Go thing to a shared library, and exposed a C API, and then used cffi to talk to the C API (based on <a href="https:&#x2F;&#x2F;blog.filippo.io&#x2F;building-python-modules-with-go-1-5&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.filippo.io&#x2F;building-python-modules-with-go-1-5&#x2F;</a>, except cffi instead of Python C API).<p>Go objects needed to be managed C style: internally Go thing had a map between integer identifier and object, and Python just got the integer identifier and had to manually tell Go code to deallocate.
评论 #15810737 未加载