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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Interactive GCC (igcc) is a read-eval-print loop (REPL) for C/C++

170 点作者 pr337h4m超过 1 年前

10 条评论

LukeShu超过 1 年前
This should perhaps have &quot;(2009)&quot; in the title; it is a fork of <a href="http:&#x2F;&#x2F;www.artificialworlds.net&#x2F;wiki&#x2F;IGCC&#x2F;IGCC" rel="nofollow noreferrer">http:&#x2F;&#x2F;www.artificialworlds.net&#x2F;wiki&#x2F;IGCC&#x2F;IGCC</a> . Andy Balaam worked on the original IGCC 2009, 2012. Alexandru Dina worked on this fork 2018-2021. The fork seems to be mostly minor modernization, and adding color.<p>It works by compiling and re-running the whole session each time and assuming that it only printed `n` bytes last time but printed `n+m` bytes this time, that it should only show the user the newest `m` bytes.
评论 #37692710 未加载
评论 #37704257 未加载
xvilka超过 1 年前
Similar to Cling[1] from ROOT.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;root-project&#x2F;cling">https:&#x2F;&#x2F;github.com&#x2F;root-project&#x2F;cling</a>
评论 #37686044 未加载
评论 #37686022 未加载
评论 #37686246 未加载
评论 #37687248 未加载
评论 #37692842 未加载
评论 #37686351 未加载
pwdisswordfishc超过 1 年前
The real deal, or is it yet another one of those Potemkin REPLs that append code to a temporary file, compile it and diff standard output?
评论 #37686005 未加载
评论 #37686040 未加载
loeg超过 1 年前
&gt; Compile errors can be tolerated until the code works<p>Huh, that&#x27;s not really great. You kind of want (1) the REPL to be syntax-aware, and not feed loops into the compiler until they&#x27;re syntactically complete (with a multi-line editor) and (2) to reject input that causes the overall program to fail to compile.
not2b超过 1 年前
Perhaps noise and wasted compile attempts could be reduced by having a simple counting mechanism for {}, (), and []. This wouldn&#x27;t be correct if the program uses macros with unbalanced characters, but that&#x27;s rare, so I suppose it would suffice to allow the user to turn it off.<p>So a compile wouldn&#x27;t be attempted if there are obvious unbalanced braces.
percentcer超过 1 年前
Coming to C++ from python had me looking for something like this for a long time, but I&#x27;ve come to embrace my little single-file &quot;replit.sln&quot; which has proven to be much more flexible anyway.
assbuttbuttass超过 1 年前
gdb has always been my go-to repl for C&#x2F;C++
评论 #37689590 未加载
trn超过 1 年前
I&#x27;ll give an unpaid plug to <a href="https:&#x2F;&#x2F;www.softintegration.com&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.softintegration.com&#x2F;</a> for their Ch product, which is beyond excellent (and has existed for a very long time.) Clang-Repl&#x2F;Cling is, however, nice to see, especially as it is open source.
jupiterelastica超过 1 年前
Is it possible integrate this in a notebook environment? This would be amazing for teaching C&#x2F;C++.
评论 #37688816 未加载
kookamamie超过 1 年前
&gt; using namespace std;<p>Good god.
评论 #37688838 未加载
评论 #37687970 未加载