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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

PicoC: a very small C interpreter for scripting

76 点作者 rw-超过 14 年前

9 条评论

jakevoytko超过 14 年前
Language interpreters are great for experimenting with new or buggy pieces of code - just experiment at the prompt and copy what works into a file for posterity. I've started looking through the parsing code for PicoC, and its all nice and readable. But I'm surprised this was used in an actual system, embedded or not. C is an absolutely miserable language whose saving graces are executable size and speed. It lacks reasonable features to use for scripting, like code-as-data in Bash or the dynamism of Python and Ruby. There are even embedded scripting languages like LUA. What does C offer as a scripting language, except perhaps familiarity?
评论 #1659321 未加载
mahmud超过 14 年前
I used Ch[1] in a commercial product and I would highly dis-recommend C as a scripting language. Something has to be said for high-level semantics, dynamism and syntax designed for interactive work. I find Lisp, Lua and Groovy to be joy to work with, but C is not an ideal extension/embedded/scripting language. Use something easier.<p><a href="http://en.wikipedia.org/wiki/Ch_interpreter" rel="nofollow">http://en.wikipedia.org/wiki/Ch_interpreter</a>
igravious超过 14 年前
The links for these should read (code.google.com)
评论 #1659608 未加载
imurray超过 14 年前
See also: <a href="http://bellard.org/tcc/" rel="nofollow">http://bellard.org/tcc/</a> a compiler, but small and #!tcc can be put at the top of .c files to make them scripts.<p>Also see: <a href="http://root.cern.ch/drupal/content/cint" rel="nofollow">http://root.cern.ch/drupal/content/cint</a> — an interpretor, but large.
评论 #1659148 未加载
评论 #1659974 未加载
评论 #1659317 未加载
jacquesm超过 14 年前
How refreshing to see something that only has 'readline' as a dependency and otherwise just requires a working C compiler and 'make'.
评论 #1659134 未加载
davidw超过 14 年前
I wonder how it compares to other small systems like Lua, or, say Antirez' Jim interpreter, in terms of speed and features.
评论 #1659088 未加载
antirez超过 14 年前
Very cool, there is even an interactive prompt. I wonder how hard is to make this interpreter "safe".
评论 #1658996 未加载
sgt超过 14 年前
Personally I would use Forth for this. PicoC looks interesting but if I were to weigh my options (i.e. PicoC vs Forth in his example app UAV-onboard system, I would definitely go Forth).
评论 #1659544 未加载
nitrogen超过 14 年前
Would this be allowed in an iPhone application, since it's all C?
评论 #1659071 未加载