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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: Who is developing a programming language that compiles to C?

21 点作者 danielEM超过 1 年前
What is your programming language and it's status? Can you share a link to its code?

13 条评论

rnvannatta超过 1 年前
<a href="https:&#x2F;&#x2F;github.com&#x2F;rnvannatta&#x2F;vanity-scheme">https:&#x2F;&#x2F;github.com&#x2F;rnvannatta&#x2F;vanity-scheme</a><p>I am currently making a r7rs scheme derivative that compiles to C. The lofty goal is parallel fibers.<p>It&#x27;s in extreme early stages, and I don&#x27;t expect anyone will use it other than me, but I already like it. The compiler has been self hosted for a few months now. It has a cool FFI that you can see in use in the demos folder. Working on adding header generation to the module system.<p>While Chicken Scheme is cool, I don&#x27;t think it&#x27;ll be parallel, and not in the way I want it to be, and I am willing to make a lot of compromises Chicken isn&#x27;t to get there. As mentioned, I am willing to settle with fibers for parallelism, and heavily eschewing side effects, making changes from r7rs to get there. For example, there will be no dynamic-wind provided and parameter objects will have different, thread friendlier, semantics.<p>----<p>My main reason for choosing C as a transpile is that it&#x27;s easier to lean on gcc and C11 than it is to write my own codegen, and LLVM is too unstable for me to handle. I started writing this in June 2022, and since then LLVM has had 3 backwards compatibility breaking major release and millions of lines of code changed.
jhonsrid超过 1 年前
The language with a rude name sometimes known as &#x27;BF&#x27; compiles trivially to C (from C), for instance:<p><pre><code> #include &lt;stdio.h&gt; int main() { int c; printf(&quot;#include &lt;stdio.h&gt;\nint main() {\nchar a[30000] = {0}; char *p = a;\n&quot;); while((c = getc(stdin)) != EOF) { switch(c) { case &#x27;&gt;&#x27;: printf(&quot;++p;\n&quot;); break; case &#x27;&lt;&#x27;: printf(&quot;--p;\n&quot;); break; case &#x27;+&#x27;: printf(&quot;++*p;\n&quot;); break; case &#x27;-&#x27;: printf(&quot;--*p;\n&quot;); break; case &#x27;.&#x27;: printf(&quot;putchar(*p);\n&quot;); break; case &#x27;,&#x27;: printf(&quot;*p = getchar();\n&quot;); break; case &#x27;[&#x27;: printf(&quot;while (*p) {\n&quot;); break; case &#x27;]&#x27;: printf(&quot;}\n&quot;); break; } } printf(&quot;return 0;}\n&quot;); return 0; } </code></pre> (Though sorry to any BF fans if I&#x27;ve missed something in the implementation) ;-)
评论 #37825705 未加载
thesuperbigfrog超过 1 年前
Not my project, but Chicken Scheme is an awesome language that compiles to C:<p><a href="https:&#x2F;&#x2F;www.call-cc.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.call-cc.org&#x2F;</a><p>Source download: <a href="https:&#x2F;&#x2F;code.call-cc.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;code.call-cc.org&#x2F;</a>
stefanos82超过 1 年前
Nim, Crystal, Nelua...just search for &quot;transpilers to C&quot; and you will get lots of examples.
评论 #37826781 未加载
评论 #37831848 未加载
samuba超过 1 年前
V compiles to C <a href="https:&#x2F;&#x2F;vlang.io&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;vlang.io&#x2F;</a>
ingigauti超过 1 年前
I&#x27;m creating a new language but it &quot;compiles&quot; to C# - plang.is
worthless-trash超过 1 年前
Not me personally, but gnucobol compiles to C ( <a href="https:&#x2F;&#x2F;gnucobol.sourceforge.io&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;gnucobol.sourceforge.io&#x2F;</a> )
JaDogg超过 1 年前
Hello, I&#x27;m working on Yaksha programming language.<p>It has python like syntax and whole lisp subsystem as a macro preprocessor. Got bunch of builtin tools - syntax highlighting plugins etc.<p>Main website: <a href="https:&#x2F;&#x2F;yakshalang.github.io&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;yakshalang.github.io&#x2F;</a><p>Try it online (with full x86 vm running in the browser): <a href="https:&#x2F;&#x2F;yaksha.pages.dev&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;yaksha.pages.dev&#x2F;</a><p>------------<p>License is GPLv3 with few additional terms
mdwalters超过 1 年前
My friend is making a programming language called ACPL[1] that used to be written in Python, and outputs Python code, but now, he&#x27;s working on a C implementation called CACPL, which is written in C and outputs C code.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;rjmsg&#x2F;ACPL">https:&#x2F;&#x2F;github.com&#x2F;rjmsg&#x2F;ACPL</a>
gsuuon超过 1 年前
I have a toy language I play around with that&#x27;s just in specifications stage. Not mine but an interesting compile-to-c language: <a href="https:&#x2F;&#x2F;github.com&#x2F;koka-lang&#x2F;koka">https:&#x2F;&#x2F;github.com&#x2F;koka-lang&#x2F;koka</a>. Functional, effects, no-GC.
ofalkaed超过 1 年前
Not mine but one missing from your list, MinForth is a Forth which compiles to C.<p><a href="https:&#x2F;&#x2F;sourceforge.net&#x2F;projects&#x2F;minforth&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;sourceforge.net&#x2F;projects&#x2F;minforth&#x2F;</a>
nbenitezl超过 1 年前
Vala - <a href="https:&#x2F;&#x2F;vala.dev&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;vala.dev&#x2F;</a> compiles to C and is tailored to GNOME ecosystem.
mathverse超过 1 年前
Nim