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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Lua as a Python’s secret weapon

74 点作者 ceyhunkazel超过 8 年前

6 条评论

travisoliphant超过 8 年前
Lua is indeed a pretty nice language for some use-cases and it&#x27;s nice to see this example. It would also be great to see a comparison to Numba which is a Python JIT particularly suited for fast numerical computing with Python: <a href="http:&#x2F;&#x2F;numba.pydata.org" rel="nofollow">http:&#x2F;&#x2F;numba.pydata.org</a><p>Numba provides speed-ups over NumPy and Python and does so in way very easy for Python programmers to use with decorators on Python functions. Numba can be used to easily build new &quot;ufuncs&quot; which are NumPy&#x27;s universal functions and it has multiple interfaces for programming the GPU directly from Python for even higher performance.
magicbuzz超过 8 年前
Lua is amazing. I&#x27;ve used it to reimplement an API served by Python and it was consistently twice as fast i.e. half the time to serve a request compared to the Python framework in basically the same code.
评论 #13066427 未加载
andrewmcwatters超过 8 年前
Or you know, just use Lua.
评论 #13066485 未加载
wiz21c超过 8 年前
As anyone experience with adding new types to Lua ? I mean, in a fundamental type, not just simulating them with regular Lua features. For example, adding a 128 bit float number ?
评论 #13066483 未加载
kayamon超过 8 年前
I suspect that this is not using stock Lua, but LuaJIT instead. Stock Lua wouldn&#x27;t be much different than Python itself.<p>The real gains come from Mike Pall&#x27;s amazing JIT implementation, not the language itself.
评论 #13068336 未加载
评论 #13069936 未加载
评论 #13070302 未加载
Chris2048超过 8 年前
Can&#x27;t you achieve the same by embedding, say, rust?
评论 #13073485 未加载