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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Representing Type Lattices Compactly

87 点作者 tekknolagi2 个月前

8 条评论

infogulch2 个月前
This seems similar to the way CUE type lattices work. <a href="https:&#x2F;&#x2F;cuelang.org&#x2F;docs&#x2F;concept&#x2F;the-logic-of-cue&#x2F;#the-value-lattice" rel="nofollow">https:&#x2F;&#x2F;cuelang.org&#x2F;docs&#x2F;concept&#x2F;the-logic-of-cue&#x2F;#the-value...</a>
noelwelsh2 个月前
No parametric polymorphism aka generic types?
评论 #43333046 未加载
评论 #43332274 未加载
评论 #43333878 未加载
cobertos2 个月前
You mention integer ranges as a specific type you hope gets handled. But how does something like that work? It feels somewhere between the general type and the specialization type? Would this just be a higher level in the integer section of the specialization lattice? Or would you want it out of the lattice structure completely? Because it would kinda conflict with integer unions, when thinking about it lattice-y<p>(Admittedly I&#x27;m in the same boat, I don&#x27;t know the math but stumbled upon implementing my own type system recently)
评论 #43340377 未加载
评论 #43342576 未加载
pizlonator2 个月前
Looks almost exactly like what JavaScriptCore calls SpeculatedType.
评论 #43336925 未加载
PhilipRoman2 个月前
wow I guess great minds really do think alike, I did almost the same exact thing a few years ago, but eventually gave up as my type hierarchy grew too complex.<p>You could probably represent a lot more complex relations with similar strategies by adding one or two cleanup instructions to union&#x2F;intersection operations, but whenever I&#x27;ve tried to do it, my head gets dizzy from all the possibilities. And so far I&#x27;ve been unable to find software that can assist in generating such functions.
评论 #43335373 未加载
mncharity2 个月前
OT, I&#x27;m <i>so very</i> looking forward to some language supporting a pushout (path independent) lattice of theories (types, operators, laws). So abstraction has math-like locality and composability and robustness.
IsTom2 个月前
This is also how Erlang&#x27;s Dialyzer works.
评论 #43337800 未加载
pjs_2 个月前
Come on man just do duck typing. You are killing me with this stuff.<p>It all reads so technical and long and mathematically academic but it’s just a bit mask.<p>I absolutely hate writing python now because I have to reason about a “list of list of errors” type defined by a teenager and they get mad at me if I don’t then define a new “list of list of errors, or none” type when I manipulate it. You guys are now employed by VSCode to make those hints look beautiful. VSCode is your boss now and your job is to make VSCode happy<p>I predict that in five years we will retvrn to duck typing in the same way that we are now retvrning to server side rendering and running on bare metal. Looking forward to the viral “you don’t need compound types” post on here. “Amazing - you can write code which does normal business tasks without learning or ever thinking about homotopy type theory”<p>Yes I get it if we are writing embedded code or navigation systems or graphics or whatever, please help yourself from the types bucket. Go ahead and define a dictionary of lists where one list can contain strings but all the other lists either contain 8-bit integers or None. But the academic cachet of insanely complex composable type systems bleeds through into a web server that renders a little more than “hello world” and it ruins my life
评论 #43334028 未加载
评论 #43340304 未加载
评论 #43336845 未加载
评论 #43334082 未加载
评论 #43334444 未加载