dongweihuan8610 2009-11-16 17:12
浏览 242
已采纳

Go和Cython之间的差异

Today a great friend of mine asked me what are the main differences between the newest Go language and Cython, which is a set of C-extensions for Python. I don't have much knowledge on Python, can anyone tell me why Go is better/worse than Cython?

  • 写回答

6条回答 默认 最新

  • doubeizhong5178 2009-11-17 13:55
    关注

    Cython isn't really a language in the conventional sense. It is a preprocessor for building Python extensions that takes Python-like syntax (actually they strive for full Python compatibility) and produces C code (using the Python C API). Doing this they are able to include some special case optimisations, but the real benefits come when you add Cython specific static type information which is incorporated into the C code, bypassing the Python runtime for those operations and resulting in a high speed up.

    Go is a compiled programming language. The first thing that can be done in Go is producing an executable that doesn't include the Python runtime/start a Python interpreter - this is impossible in Cython. (May not be technically impossible - but there is really no point to use Cython if you are not working with Python). Since Cython just produces C most of your questions in the comment don't really apply - you can use any C debugger (although the fact that's a Python extension makes things a bit more complicated).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看