【Hacker News搬运】MetaWare High C编译器丢失的语言扩展(2023)
-
Title: The lost language extensions of MetaWare's High C compiler (2023)
MetaWare High C编译器丢失的语言扩展(2023)
Text:
Url: https://duriansoftware.com/joe/the-lost-language-extensions-of-metaware's-high-c-compiler
很抱歉,作为一个AI,我无法直接访问外部链接来获取或分析网页内容。不过,我可以根据您提供的链接地址和标题来尝试提供一个可能的总结。 链接地址指向的是一个名为 Joe 的作者在 Durian Software 网站上的一篇文章,标题为 "The Lost Language Extensions of Metaware's High-C Compiler"。以下是根据标题和常见主题的推测性总结: --- 文章可能讨论了以下内容: 1. **Metaware High-C 编译器背景**:首先介绍了 Metaware High-C 编译器,这是一个为嵌入式系统设计的编译器,特别针对 C 语言。 2. **语言扩展**:文章可能探讨了 Metaware High-C 编译器支持的语言扩展,这些扩展可能是为了更好地适应嵌入式系统的特定需求。 3. **丢失的扩展**:标题中提到“丢失的语言扩展”,这表明文章可能聚焦于那些已经不再支持或被遗忘的扩展特性。 4. **分析**:作者可能对这些扩展进行了分析,讨论了它们为何被放弃,以及它们对嵌入式系统编程的影响。 5. **总结**:文章可能以总结的方式结束,讨论了这些扩展的历史意义,以及它们在当前嵌入式系统开发中的潜在价值。 由于无法访问原文,以上总结仅基于标题和常见主题进行的推测。如果您需要具体的、基于原文的内容总结,请提供文章的文本内容,我将尽力为您分析并提供总结。
Post by: PaulDavisThe1st
Comments:
JdeBP: I wrote up the iterator-driven for back in 2011, because it was one of those things that had been long-since forgotten about; along with what it would look like were it to be incorporated into the (then) C++ standard.<p>I am fortunate enough to own a copy of the High C/C++ Language Reference in English. (-:<p>* <a href="http://jdebp.uk./FGA/metaware-iterator-driven-for.html" rel="nofollow">http://jdebp.uk./FGA/metaware-iterator-driven-for.html</a><p>* <a href="http://jdebp.uk./Proposals/metaware-iterator-driven-for.html" rel="nofollow">http://jdebp.uk./Proposals/metaware-iterator-driven-for.html</a>
JdeBP: 我早在2011年就写下了迭代器驱动,因为它是那些早已被遗忘的东西之一;以及如果它被纳入(当时的)C++标准,它会是什么样子<p> 我有幸拥有一本High C/;英语C++语言参考。(-:<p>*<a href=“
jdebp.uk.
FGA为.html驱动的元软件迭代器”rel=“nofollow”>http://jdebp.uk。
FGAmetaware iterator为.html驱动</a><p>*<a href=“http://jdebp.uk.
提案`为.html驱动的元软件iterator”rel=”nofollow“>http:/;jdebp.uk。O;提案 ;metaware-iterator-driven-for.html</a>WalterBright: D (also in Das BetterC) has:<p>1. underscores in literals:<p><pre><code> int a = 1_234_567;
</code></pre>
2. case ranges:<p><pre><code> case 5 .. case 6:
</code></pre>
3. named arguments:<p><pre><code> void test(int a, int b);void foo() { test(b:3, a:4); }
</code></pre>
4. nested functions:<p><pre><code> int foo(int i) {
int plus(int a) { return a + i; }
return plus(3);
}
</code></pre>
5. static nested functions:<p><pre><code> int foo(int i) {
static int plus(int a) { return a + i; }
return plus(3);
}Error: `static` function `test.foo.plus` cannot access variable `i` in frame of function `test.foo`
</code></pre>
6. a feature similar to generators <a href="https://dlang.org/spec/statement.html#foreach_over_struct_and_classes" rel="nofollow">https://dlang.org/spec/statement.html#foreach_over_struct_an...</a>WalterBright: D(同样在Das BetterC中)有:<p>1。文本中的下划线:<p><pre><code>int a=1_234_567;</code></pre>2.案例范围:<p><pre><code>案例5。。案例6:</code></pre>3.命名参数:<p><pre><code>void test(int a,int b);void foo(){test(b:3,a:4);}</code></pre>4.嵌套函数:<p><pre><code>int foo(int i){int plus(int a){返回a+i;}返回加(3);}</code></pre>5.静态嵌套函数:<p><pre><code>int foo(int i){静态int plus(int a){返回a+i;}返回加(3);}错误:
static
函数test.foo.plus
无法访问函数test_foo框架中的变量
i``</code></pre>6.类似于生成器的功能<a href=“https:/;dlang.org&#spec&#statement.html#foreach_over_struct_and_classes”rel=“nofollow”>https:/;dlang.org;规格;statement.html#foreach_over_struct_an</a>hgs3: Related: The 'lcc-win' C compiler added operator overloading, default function arguments, and function overloading (see "generic functions") [1]. The Plan 9 C compiler introduced several language extensions, some of which, like anonymous structs/unions would eventually be incorporated into the C standard. Present day GCC accepts the -fplan9-extensions flag [2] which enables some nifty features, like automatically converting a struct pointer to an anonymous field for function calls and assignments.<p>[1] <a href="https://lcc-win32.services.net/C-Tutorial.pdf" rel="nofollow">https://lcc-win32.services.net/C-Tutorial.pdf</a><p>[2] <a href="https://gcc.gnu.org/onlinedocs/gcc/Unnamed-Fields.html" rel="nofollow">https://gcc.gnu.org/onlinedocs/gcc/Unnamed-Fields.html</a>
hgs3: 相关:#x27;lcc赢了;C编译器增加了运算符重载、默认函数参数和函数重载(参见“泛型函数”)[1]。Plan 9 C编译器引入了几个语言扩展,其中一些,如匿名结构;工会最终将被纳入C标准。目前的GCC接受-fplan9扩展标志[2],该标志启用了一些漂亮的功能,例如自动将结构指针转换为匿名字段以进行函数调用和分配<p> [1]<a href=“https:/;lcc-win32.services.net/-C-Tutorial.pdf”rel=“nofollow”>https:/;lcc-win32.services.net;C-Tutorial.pdf</a><p>[2]<a href=“https:/;gcc.gnu.org/-onlinedocs/-gcc/ Unnamed Fields.html”rel=“nofollow”>https:/;gcc.gnu.org;onlinedocs;gcc;未命名字段.html</a>
nyanpasu64: The generators remind me of Rust's internal/external iteration question and try_fold() (<a href="https://scribe.rip/@veedrac/rust-is-slow-and-i-am-the-cure-32facc0fdcb" rel="nofollow">https://scribe.rip/@veedrac/rust-is-slow-and-i-am-the-cure-3...</a>).
nyanpasu64: 发电机让我想起了Rust;s内部;外部迭代问题和try_fold()(<a href=“https:”scribe.rip“@veedrac”rust-is-slow and i-am-thecure-32facc0fdcb“rel=”nofollow“>https:”scribe.rip”@veedrac-“rust-is-slow and i-am-thecure-3…</a>)。
JoshTriplett: For anyone wondering why the string literals in the pictured examples end with ¥n rather than \n, it looks like these code examples were written in Shift-JIS, and Shift-JIS puts ¥ where ASCII has .
JoshTriplett: 对于那些想知道为什么图中示例中的字符串文字以¥n而不是\n结尾的人来说,这些代码示例似乎是用Shift JIS编写的,Shift JIS将¥放在ASCII有\的地方。