<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mojo &#8211; 天地一沙鸥</title>
	<atom:link href="https://haoluobo.com/tag/mojo/feed/" rel="self" type="application/rss+xml" />
	<link>https://haoluobo.com</link>
	<description>to be continue....</description>
	<lastBuildDate>Fri, 12 May 2023 02:23:45 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>谨慎的乐观的看 Modular 提出的 Mojo 语言</title>
		<link>https://haoluobo.com/2023/05/modular-mojo/</link>
		
		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Thu, 11 May 2023 13:22:00 +0000</pubDate>
				<category><![CDATA[vicalloy的思考]]></category>
		<category><![CDATA[编程]]></category>
		<category><![CDATA[Mojo]]></category>
		<category><![CDATA[python]]></category>
		<guid isPermaLink="false">https://haoluobo.com/?p=12409</guid>

					<description><![CDATA[有了&#160;faster-cpython&#160;的前车之鉴，对&#160;Mojo&#160;谨慎的乐 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>有了&nbsp;<a href="https://link.zhihu.com/?target=https%3A//github.com/faster-cpython/ideas" target="_blank" rel="noreferrer noopener">faster-cpython</a>&nbsp;的前车之鉴，对&nbsp;<a href="https://link.zhihu.com/?target=https%3A//www.modular.com/mojo" target="_blank" rel="noreferrer noopener">Mojo</a>&nbsp;谨慎的乐观。</p>



<p>宣称将成为 Python 的超集是&nbsp;<a href="https://link.zhihu.com/?target=https%3A//www.modular.com/mojo" target="_blank" rel="noreferrer noopener">Mojo</a>&nbsp;相比&nbsp;<a href="https://link.zhihu.com/?target=https%3A//github.com/exaloop/codon" target="_blank" rel="noreferrer noopener">Codon</a>&nbsp;等项目最吸引人的一点。Codon类项目虽然宣称是Python的编译器，但实际上砍掉了 Python 所有的动态特性，几乎所有的 Python 库都无法正常使用。对我而言，如果用不了 Python 生态，那这和一个全新的语言又有什么区别。</p>



<p>如果 Mojo 真成为Python的超集，单就比 CPython 性能高出一大截的 Python 编译器就足够吸引人。但细看下来，“成为 Python 超集”可能只是一个美好的愿望，达成的可能性非常小。现在 Mojo 的完成度还非常低，除了支持 Python 风格的语法外，Python还差很远（连 Class 都不支持）。现在版本的 Mojo 支持导入 Python 模块，但导入的 Python 模块是以 Python 对象的方式运行。换句话说就是塞了个 CPython 解释器到 Mojo 里用来执行 Python 代码（是不是立马不高大上了）。</p>



<p>除去 Mojo 吹牛的部分（比如那个比 Python 快 3500 倍），对 Mojo 还是有所期待。Mojo 的创始人有着牛逼哄哄的履历（LLVM &amp; Swift 的作者）。虽然不能完全兼容 Python ，但承诺后期会提供相关的迁移工具。如果 Mojo 的性能和开发体验确实不错，Python库的迁移成本不高，还是会有不少人会自发的将 Python 生态迁移到 Mojo 到。</p>



<p>注：</p>



<ul class="wp-block-list">
<li><a href="https://link.zhihu.com/?target=https%3A//github.com/faster-cpython/ideas" target="_blank" rel="noreferrer noopener">faster-cpython</a>&nbsp;最初的目标是5年内5倍的性能提升。目前时间已经过去了2年，性能只提升了不到30%。照这样的情形看5年内最终性能能翻倍都挺难。</li>



<li><a href="https://link.zhihu.com/?target=https%3A//github.com/modularml/mojo/discussions/68" target="_blank" rel="noreferrer noopener">Is the relationship between Mojo and Python is similar to TypeScript/Javascript or Kotlin/Java?</a></li>
</ul>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
