看板 Gossiping 關於我們 聯絡資訊
我是來問程式語言啦。 我發現了一個Python社群裡面的鬼東西,名字叫做Cython。 它的wikipeida 內容節錄於下面: Cython (/aɪθɒn/) is a superset of the programming language Python, which allows developers to write Python code (with optional, C-inspired syntax extensions) that yields performance comparable to that of C. 翻譯: Cython是Python程式語言的一個超集,它允許程式開發人員寫Python代碼,卻 能夠達成C語言的效能。 各位知道Python之所以被瞧不起,就是因為它是一行一行執行的直譯式語言,速 度很慢。可是Cython卻說它能夠達成C語言的效能。 那這到底是編譯式語言還是直譯式語言呀? 有沒有Cython的八卦? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 220.129.75.207 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Gossiping/M.1739785393.A.E14.html
plutox: 就是 42.72.21.154 02/17 17:45
lucifiel1618: python本來就是cpython編譯成c再編 61.227.140.139 02/17 17:46
lucifiel1618: 譯成機器碼的啊 61.227.140.139 02/17 17:46
lucifiel1618: cython只是多加一些syntax讓你可以 61.227.140.139 02/17 17:46
lucifiel1618: 繞過cpython一些安全檢查而已 61.227.140.139 02/17 17:47
lucifiel1618: 比方說你一個純python的code直接用 61.227.140.139 02/17 17:47
lucifiel1618: cython編譯通常是會比cpython來得 61.227.140.139 02/17 17:47
venomsoul: 是說,最近力叩python的處理時間都大 111.83.193.5 02/17 17:47
venomsoul: 幅縮短,不知道為何 111.83.193.5 02/17 17:47
lucifiel1618: 慢的 61.227.140.139 02/17 17:47
lucifiel1618: 你要得到很大的速度提升都是要加很 61.227.140.139 02/17 17:48
lucifiel1618: 多static type,跟寫c已經差不太多 61.227.140.139 02/17 17:49
s0914714: 不同版本的Python也會有效能優化 123.241.68.54 02/17 17:49
lucifiel1618: 了 61.227.140.139 02/17 17:49
lucifiel1618: 主要的意義相當於讓你用純c取代一 61.227.140.139 02/17 17:51
kashiwa27: 中國版的python啦 211.72.164.122 02/17 17:51
lucifiel1618: 部分的cpython轉譯,盡可能讓你用 61.227.140.139 02/17 17:51
lucifiel1618: 最小的努力得到最大的提升 61.227.140.139 02/17 17:51
喔喔,原來如此。但我覺得我還是得學C++。
mastoid: 蟒蛇 39.9.133.212 02/17 17:53
※ 編輯: SukaBlyat (220.129.75.207 臺灣), 02/17/2025 17:56:36