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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: What is must-have for a systems programming language?

8 点作者 mrbait超过 1 年前
Obviously, any systems language must have predictable memory layout for at least a subset of its types, including atomic (as in primitive) and composite types -- but probably it&#x27;s not quite necessary (nor possible) for function types.<p>What are other <i>language</i> features that are similarly crucial? I&#x27;d argue even arrays are kinda optional, since they can be encoded as `Array = exists (n: Size, a: Type); (repeat a &gt; take n &gt; reduce ((x, y) -&gt; (x, y)))`

6 条评论

mikewarot超过 1 年前
It has to be able to link to and&#x2F;or predictably generate machine code, for all the bootstrapping sections.<p>Ideally, it has to support a return stack, and a data stack.<p>I&#x27;ve seen ROM code that couldn&#x27;t assume a return stack... not fun.<p>It would be really, REALLY nice if it could manage reference counted, counted, automatically allocated, strings, so that you could just use them without needing to allocate&#x2F;free them, etc... just return a string like you return an integer.
评论 #38708179 未加载
评论 #38700184 未加载
horsh1超过 1 年前
For a systems language execution environment there is a huge list of crucial questions: what is a library, what is a package, how does linking works, how do you interact with different build systems, how you separately compile having only interface declarations, how to manage alternative libraries for the same interface, how to tweak compilation for multiple targets, how do you ffi?<p>The answers to all of the above will have an impact on your language features: how you import, how you declare foreign entities, what visibilities are possible, what data storage classes are theere, what is the module initialization order, what code can be executed during module initialization, what is your conditional compilation mechanisms?
评论 #38700355 未加载
mrbait超过 1 年前
Is automatic register allocation necessary? Would anybody contest that?<p>Procedures? In and out parameters? Return values? Pointers? References? Integers? Signed? Unsigned? Structs? Unions? Arrays? Goto? Loops?<p>Do you enjoy implementing variable length encodings? What do you imagine would make that less error-prone?<p>What an application language can&#x27;t have that a systems language can? What a systems language cannot ever afford and how to cope with that? What a systems language can afford lacking that an application language won&#x27;t get away with?<p>I need your hottest takes!
Doctor-R超过 1 年前
You need to be able to generate any machine instruction. like clear the cache, turn interrupts off and on, access the hardware bits on the I&#x2F;O cards, access privileged instructions, etc. The language needs to use every instruction. In C, there is a feature to embed&#x2F;call assembly language instructions which are architecture dependent.
082349872349872超过 1 年前
I&#x27;d say a low-to-no dependency build: unless you&#x27;re planning on cross-compiling everything, you&#x27;ll want to be using your systems language to bring up other toolchains, not need to already have some other toolchain in place to bring up your systems language.
eimrine超过 1 年前
Pointers?