<?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>Chen Yufei's blog &#187; compiler</title>
	<atom:link href="http://chenyufei.info/blog/tag/compiler/feed/" rel="self" type="application/rss+xml" />
	<link>http://chenyufei.info/blog</link>
	<description>Keep your head about you while all those are losing theirs</description>
	<lastBuildDate>Wed, 21 Jul 2010 05:30:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Ch &#8212; 一个 C/C++ 解释器</title>
		<link>http://chenyufei.info/blog/2009-11-05/ch-a-c-and-cplusplus-interprete/</link>
		<comments>http://chenyufei.info/blog/2009-11-05/ch-a-c-and-cplusplus-interprete/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 17:14:08 +0000</pubDate>
		<dc:creator>chenyufei</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[compiler]]></category>

		<guid isPermaLink="false">http://chenyufei.info/blog/?p=258</guid>
		<description><![CDATA[动态语言很重要的一个功能就是支持交互式的开发，用惯了 Python 有时候非常希望 C 也能有一个解释器来用，尤其是忘了 C 的某些语法想写个简单的例子来测试的时候。 很久以前就搜过 C 的解释器，搜到过 Ch，不记得当时为什么没有试用过。今天下了个免费版本的用了下，很不错，支持 C90 和 C99 的主要功能，C++ 支持不完全（不过 C++ 我基本不关心）。 以前想要测试 C 的某个语法功能时会写个文件，int main 什么的搞一堆，然后用 tcc (Tiny C Compiler) 来测试。tcc 可以把 C 代码的编译和执行放在一步完成，执行 tcc -run foo.c 就可以看到效果了，还算方便。 用 Ch 就更方便了。ch 命令出来个交互式的 shell，输入 C 代码马上执行，调 printf 直接看到效果，输入变量就可以看到它的值（struct 的话可以看到每个成员的值），做点小的测试就不需要写 int main 之类的了。另外 ch 还有函数名补全。]]></description>
			<content:encoded><![CDATA[<p>动态语言很重要的一个功能就是支持交互式的开发，用惯了 Python 有时候非常希望 C 也能有一个解释器来用，尤其是忘了 C 的某些语法想写个简单的例子来测试的时候。</p>
<p>很久以前就搜过 C 的解释器，搜到过 <a href="http://www.softintegration.com/">Ch</a>，不记得当时为什么没有试用过。今天下了个免费版本的用了下，很不错，支持 C90 和 C99 的主要功能，C++ 支持不完全（不过 C++ 我基本不关心）。</p>
<p>以前想要测试 C 的某个语法功能时会写个文件，int main 什么的搞一堆，然后用 <a href="http://bellard.org/tcc/">tcc (Tiny C Compiler)</a> 来测试。tcc 可以把 C 代码的编译和执行放在一步完成，执行 <code>tcc -run foo.c</code> 就可以看到效果了，还算方便。</p>
<p>用 Ch 就更方便了。ch 命令出来个交互式的 shell，输入 C 代码马上执行，调 printf 直接看到效果，输入变量就可以看到它的值（struct 的话可以看到每个成员的值），做点小的测试就不需要写 int main 之类的了。另外 ch 还有函数名补全。</p>
]]></content:encoded>
			<wfw:commentRss>http://chenyufei.info/blog/2009-11-05/ch-a-c-and-cplusplus-interprete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
