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.

Show HN: ShivyC – Hobby C compiler created in Python

120 pointsby ssarodiaabout 7 years ago

2 comments

userbinatorabout 7 years ago
The parser has a somewhat unusual structure:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ShivamSarodia&#x2F;ShivyC&#x2F;blob&#x2F;master&#x2F;shivyc&#x2F;parser&#x2F;statement.py" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ShivamSarodia&#x2F;ShivyC&#x2F;blob&#x2F;master&#x2F;shivyc&#x2F;p...</a><p>It&#x27;s been a while since I&#x27;ve had to use the phrase &quot;exception-oriented programming&quot;, but it fits that code well. While that might be a useful or even necessary pattern to parse something like C++ which can have almost unbounded ambiguities, AFAIK C can be parsed solely by branching on the next token in the stream except for one tiny case (typedefs).
评论 #16721391 未加载
评论 #16722163 未加载
评论 #16723911 未加载
评论 #16722886 未加载
评论 #16723842 未加载
评论 #16720994 未加载
deaddodoabout 7 years ago
Now, compile CPython in it and you&#x27;re fully boot strapped.
评论 #16721426 未加载