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.

Cwerg: C-like language that can be implemented in 10kLOC

68 pointsby nateb2022about 1 year ago

8 comments

spacechild1about 1 year ago
Nice name :)<p>(For all the non-German speakers: &quot;Zwerg&quot; means &quot;dwarf&quot; and &quot;c&quot; is pronounced the same as &quot;z&quot;.)
bonkiabout 1 year ago
C-like and S-expressions? I guess my definition of a C-like language is a bit off.
评论 #39791334 未加载
评论 #39789404 未加载
评论 #39789691 未加载
评论 #39792107 未加载
hgs3about 1 year ago
For what it&#x27;s worth you can implement a C compiler in under 10kLOC. Chibicc is only a few thousand lines [1]. There is also Cake [2] and tinycc [3] which are both relatively small.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;rui314&#x2F;chibicc">https:&#x2F;&#x2F;github.com&#x2F;rui314&#x2F;chibicc</a><p>[2] <a href="https:&#x2F;&#x2F;github.com&#x2F;thradams&#x2F;cake">https:&#x2F;&#x2F;github.com&#x2F;thradams&#x2F;cake</a><p>[3] <a href="https:&#x2F;&#x2F;bellard.org&#x2F;tcc&#x2F;" rel="nofollow">https:&#x2F;&#x2F;bellard.org&#x2F;tcc&#x2F;</a>
评论 #39829049 未加载
muth02446about 1 year ago
Author here - happy to answer questions
评论 #39791685 未加载
评论 #39792276 未加载
samsquireabout 1 year ago
Thanks for sharing. Good work. It seems you&#x27;ve done a good amount of work on this, with the multiple backends.<p>From your other comments here it seems your emphasising &quot;understandability by one person&quot;, which Oberon as you mentioned was designed to be understandable.<p>It reminds me of Taylor Troesh&#x27;s wigwams<p><a href="https:&#x2F;&#x2F;taylor.town&#x2F;pardon-2023#wigwams" rel="nofollow">https:&#x2F;&#x2F;taylor.town&#x2F;pardon-2023#wigwams</a><p>I need to document my JIT compiler&#x27;s design which is really straightforward.<p>I&#x27;ve been loosely reading qbe&#x27;s sourcecode but I need to go through the bibliography to understand the code more. At the moment it&#x27;s all unfamiliar and not understandable.
vitiralabout 1 year ago
I love projects like this, but why S-expressions? Optimizing your frontend for the computer to parse (instead of the human) is the wrong tradeoff IMO unless you really really need an ultra-powerful macro language.<p>Also, I&#x27;d call it &quot;C runtime&quot; not &quot;C-like&quot; of you&#x27;re not going to have C-like syntax<p>Just my 2c
评论 #39827152 未加载
keyboredabout 1 year ago
This was submitted four days ago. But the comments and submission are less than six hours old? I also remember reading these comments. Got some major deja vu (spelling).
评论 #39826232 未加载
lprovenabout 1 year ago
Merely passing by to note an entire compiler, editor, IDE and OS implemented in under half that many LOC.<p><a href="http:&#x2F;&#x2F;www.projectoberon.net&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.projectoberon.net&#x2F;</a>
评论 #39827098 未加载
评论 #39826489 未加载