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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

An Overview of the Dylan Type System

71 点作者 BruceM超过 10 年前

3 条评论

ekidd超过 10 年前
I&#x27;ve previous written about techniques for implementing fast multiple dispatch using Dylan&#x27;s type system: <a href="http://www.cs.dartmouth.edu/reports/abstracts/TR2001-404/" rel="nofollow">http:&#x2F;&#x2F;www.cs.dartmouth.edu&#x2F;reports&#x2F;abstracts&#x2F;TR2001-404&#x2F;</a><p>In my personal experience as a Dylan programmer and amateur compiler maintainer, here&#x27;s what I liked and disliked about Dylan&#x27;s types:<p>- Multiple inheritance and multiple dispatch have surprisingly clean semantics in Dylan, except for limited types. Yes, you really can have complicated multiple inheritance <i>and</i> runtime multiple dispatch in one language. It&#x27;s not even that hard to implement, if you know the right tricks.<p>- Limited integer types were a mess, particularly when it came to multiple dispatch. You don&#x27;t want two overrides of a function, one which applies to values from -1 to 7, and another which applies to values from 6 to 11. Similarly, limited collection types were supposedly used to implement typed collections, but it always felt like it was bolted on.<p>- Singletons had clean semantics but they made dispatch more expensive.<p>- Both type unions and subclass types worked quite well in practice.<p>- Dylan&#x27;s design suffered from &quot;sufficiently smart compiler syndrome&quot; in several areas. This manifested as language features which were painfully slow in the general case, but which could run quite fast in a few special cases. This made it hard for users to build a good mental model of Dylan performance. It also meant that Dylan compilers needed to provide multiple implementations of certain features and choose between them at compile time.<p>Dylan was an exceptionally good language for its time, and I had a ton of fun using it. I keep meaning to try out Julia, which apparently inherits quite a few cool features from Dylan.
评论 #8240330 未加载
评论 #8240030 未加载
joesb超过 10 年前
I like Dylan for its generic function and restart system is probably what should have been in Common Lisp. Generic function is the same in Common Lisp, but Dylan actually utilizes it in the standard library.
评论 #8240277 未加载
tel超过 10 年前
Convenient singleton types are quite interesting—what limitations do they have? Clearly this can become a massive thorny issue quickly if you try to achieve singletons in a general fashion.
评论 #8240289 未加载