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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Parallel Python or Ruby?

6 点作者 randomhack将近 17 年前
If you were to add some parallel language constructs to Python or Ruby or <insert your favourite language>, what would you add? Lets assume you are only allowed to add 1 or 2 constructs so you dont go changing the whole language upside-down. Also assume that you are not allowed to take something out of the language only add to it. Please describe in detail with actual examples if possible. Dont just say "I will add actors" at a very high level.

6 条评论

kilowatt将近 17 年前
Keep in mind that Python 2.6 already has the new multiprocessing package, which presents a simple interface for multiprocess computation.<p>I'd like to poke around with Python's compiler module and look at the AST--you could enforce that a certain class of functions have no side effects, and then spawn multiple processes to execute them semi magically.<p>Futures like the ones in IO (<a href="http://www.iolanguage.com/scm/git/checkout/Io/docs/IoGuide.html#Concurrency-Futures" rel="nofollow">http://www.iolanguage.com/scm/git/checkout/Io/docs/IoGuide.h...</a>) always struck me as a pretty cool way to abstract away synchronization problems. Using the multiprocess stuff as a background would be fun.
评论 #224006 未加载
dhotson将近 17 年前
One change to ruby that would be useful, would be to make Enumerable.collect run in parallel.<p>There's probably a whole bunch of other Enumerable methods that could be made to run in parallel as well.
评论 #224033 未加载
jrockway将近 17 年前
If you use Coro with Perl, you can say something like:<p><pre><code> async { do_something; cede; do_something; } do_something_else; cede; </code></pre> See <a href="http://search.cpan.org/dist/Coro/Coro.pm" rel="nofollow">http://search.cpan.org/dist/Coro/Coro.pm</a> for more information.<p>[Edit: If you want to see a continuation-based web framework built with Coro, look at Continuity: <a href="http://search.cpan.org/~awwaiid/Continuity-0.994/lib/Continuity.pm" rel="nofollow">http://search.cpan.org/~awwaiid/Continuity-0.994/lib/Continu...</a><p>It's very cool.]
Kaizyn将近 17 年前
Hello randomhack,<p>Have you heard of Stackless Python? That might be what you are looking for. <a href="http://www.stackless.com/" rel="nofollow">http://www.stackless.com/</a>
评论 #224059 未加载
tzury将近 17 年前
Do we have here a solution looking for a problem?
评论 #224078 未加载
throttle将近 17 年前
Haven't you heard about the egregious buffer overflow vulnerabilities found recently in Ruby? Not a good idea to use it for anything serious in light of those, IMO.
评论 #223993 未加载
评论 #224080 未加载