TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

On the benefits of using C as a language back end

20 pointsby BafSover 5 years ago

4 comments

registerover 5 years ago
Debugging is not a problem per se. As an example you can see how Nim generates debugging info while transpiling to C with the --debuginfo --linedir:on options. The real problem with C transpilation is proper garbage collection support. A C compiler doesn't track roots and that means that for a language transpiled to C it is not practically feasible as of today to support garbage collection algorithms that are not conservative. There are published tecniques that should allow implementing full non conservative GC on top of C but they have remained in research settings so far.As a matter of fact the de facto standard GC for such langauages is Bohem's which has known limitations.
评论 #21711764 未加载
tom_melliorover 5 years ago
&gt; The V compiler hasn&#x27;t crashed once for me, and I haven&#x27;t received any crash reports from other users.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;vlang&#x2F;v&#x2F;issues&#x2F;2838" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;vlang&#x2F;v&#x2F;issues&#x2F;2838</a> &quot;Compiler crash during filtering&#x27;s assignment operation on a mutable array&quot;<p><a href="https:&#x2F;&#x2F;github.com&#x2F;vlang&#x2F;v&#x2F;issues&#x2F;2565" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;vlang&#x2F;v&#x2F;issues&#x2F;2565</a> &quot;Compiler crash when using inexistent struct type in const block&quot;<p>(One of these is from two days after the author wrote the above statement, but the other isn&#x27;t.) There are other reports where the V compiler seems to generate C code that does not compile, or only with very nasty type warnings, for example: <a href="https:&#x2F;&#x2F;github.com&#x2F;vlang&#x2F;v&#x2F;issues&#x2F;2960" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;vlang&#x2F;v&#x2F;issues&#x2F;2960</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;vlang&#x2F;v&#x2F;issues&#x2F;2981" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;vlang&#x2F;v&#x2F;issues&#x2F;2981</a>
评论 #21719901 未加载
xedracover 5 years ago
This looks like an improved version of Go. The website claims that it will guarantee no data races at compile time (work in progress). I&#x27;d like to know how he plans to accomplish this as it&#x27;s not a trivial problem to solve completely. Also, a lack of algebraic (sum) data types makes it much less attractive to me. Otherwise, neat little language.
FpUserover 5 years ago
What about debugging?