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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

LLVM 3.0 Type System Rewrite

121 点作者 bmcniel超过 13 年前

2 条评论

barrkel超过 13 年前
By a peculiar coincidence, this move to add names to what used to be structural types is almost exactly the opposite of something I want to do to Delphi (Object Pascal) for reverse reasons.<p>When you have run-time type information (RTTI) in a language it turns out that having names for types is important, for data serialization in particular. But when you also have anonymous types (as Delphi does), you can end up with versioning problems, because you need to generate names for these things - and they usually end up involving numbers of some kind.<p>So you can see a type that looks like this:<p><pre><code> type R = record X: record E: set of (a, b); end; end; </code></pre> Only R has a name; the names of the types of the field R.X, and the field R.X.E, etc. are anonymous and end up being something like ':1', ':2' etc. But change the order of declarations and you change the numbering. So probably the most robust option is a name generated from the structure of the type, a bit like a mangled C++ signature.
评论 #3282002 未加载
jmah超过 13 年前
It's great to be able to get peeks into the development of a compiler toolchain. I'm always wary if I can't dispel magic, where "magic" means guardedly opaque. Corollary: Answers to questions about magic are typically, "you don't want to know." At least, that's the mood I've found surrounding GCC.