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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

C for all: Parametric polymorphism in C

68 点作者 r0naa将近 10 年前

6 条评论

kazinator将近 10 年前
&gt; Structure Prototypes: This was proposed in February 1998 in comp.std.c by bill@cafe.net (Kaz Kylheku). The idea is that eliding member names in a structure prevents access to the members.<p>Hey, thanks for the credit.
huhtenberg将近 10 年前
This has no chances of going mainstream, but this is a thoughtful and careful exploration of a C extension. Type system [1] is nicely done (though I think it looks a bit clunky in application).<p>Tangentially related - once you worked with C long enough, the lack of of &quot;templates&quot; becomes pretty obvious. If you need two functions that do the same thing for two different input types, you have two options - wrap it into a multiline define or use one generic function and use a callback to deal with type differences, a&#x27;la qsort(). Neither is exactly ideal.<p>Does anyone know of C dialects with some form of template support?<p>[1] <a href="http:&#x2F;&#x2F;plg.uwaterloo.ca&#x2F;~cforall&#x2F;typesystem.html" rel="nofollow">http:&#x2F;&#x2F;plg.uwaterloo.ca&#x2F;~cforall&#x2F;typesystem.html</a>
评论 #9829774 未加载
评论 #9829791 未加载
评论 #9831075 未加载
评论 #9829899 未加载
filereaper将近 10 年前
Peter Buhr also teaches CS343: Concurrent and Parallel Programming.<p>CS343 uses uC++ which has coroutines, threads, monitors and other constructs used to teach advanced control flow.<p>[0] <a href="http:&#x2F;&#x2F;plg.uwaterloo.ca&#x2F;~usystem&#x2F;uC++.html" rel="nofollow">http:&#x2F;&#x2F;plg.uwaterloo.ca&#x2F;~usystem&#x2F;uC++.html</a><p>[1] <a href="https:&#x2F;&#x2F;www.student.cs.uwaterloo.ca&#x2F;~cs343&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.student.cs.uwaterloo.ca&#x2F;~cs343&#x2F;</a><p>[2] <a href="http:&#x2F;&#x2F;plg.uwaterloo.ca&#x2F;~usystem&#x2F;pub&#x2F;uSystem&#x2F;uC++book.pdf" rel="nofollow">http:&#x2F;&#x2F;plg.uwaterloo.ca&#x2F;~usystem&#x2F;pub&#x2F;uSystem&#x2F;uC++book.pdf</a>
agumonkey将近 10 年前
Just when I was looking for C-with-tuple-and-destruct. Brilliant.
pavlov将近 10 年前
This is almost 20 years old, isn&#x27;t it?<p>The text refers to a C9x standard, so it must predate the standardization of C99.
评论 #9829950 未加载
anon3_将近 10 年前
We&#x27;re reaping the benefits of C&#x27;s resistance to feature bloat.<p>C powers the daemons and operating systems of the world.<p>When you&#x27;re working in the field, C&#x27;s transparency and absence of esoteric programming voodoo is a feature, not deficit.<p>Interest posting made today similar: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9827051" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9827051</a>
评论 #9829735 未加载
评论 #9830137 未加载