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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why GADTs matter for performance (2015)

83 点作者 hyperbrainer7 天前

5 条评论

cosmic_quanta5 天前
Interesting, thanks for posting.<p>I share the author&#x27;s frustration with the lack of non-compiler-related examples of GADT uses. It seems like such a powerful idea, but I haven&#x27;t been able to get a feel for when to reach for GADTs in Haskell
评论 #43967511 未加载
评论 #43967468 未加载
rbjorklin5 天前
Does anyone have some hard numbers on the expected performance uplift when using GADTs? Couldn&#x27;t see any mentioned in the article.
评论 #43965690 未加载
cryptonector4 天前
What&#x27;s not clear from reading TFA is whether the compiler monomorphizes TFA&#x27;s `Compact_array` for the two special cases of it (array of bytes vs. array of anything else), but I&#x27;m assuming so. Perhaps if I was familiar with OCaml the answer would be blindingly obvious. What&#x27;s happening here is that w&#x2F; GADTs you can have a _singular_ abstraction with multiple distinct implementations for specific types and others for generic types, and you don&#x27;t have to think about it too much, except you have to remember to use these type hints in the interface definitions to get the compiler to do what you want.<p>&gt; Yaron Minsky joined Jane Street back in 2002, and claims the dubious honor of having convinced the firm to start using OCaml.<p>That&#x27;s pretty cool. And I guess Stephen Dolan ended up there due to his work on OCaml, which is pretty cool too. (I&#x27;d like to meet Stephen some day.)
hyperbrainer5 天前
Related: <a href="https:&#x2F;&#x2F;github.com&#x2F;ocaml&#x2F;RFCs&#x2F;blob&#x2F;881b220adc1f358ab15f7743d5cd764222ab7d30&#x2F;rfcs&#x2F;unboxed-types.md">https:&#x2F;&#x2F;github.com&#x2F;ocaml&#x2F;RFCs&#x2F;blob&#x2F;881b220adc1f358ab15f7743d...</a>
goldchainposse5 天前
I know Jane Street love OCaml, but you have to wonder how much it&#x27;s cost them in velocity and maintenance. This is a quant firm blogging about a programming language they&#x27;re the most famous user of.
评论 #43966798 未加载
评论 #43968597 未加载
评论 #43968242 未加载
评论 #43968979 未加载
评论 #43966877 未加载
评论 #43967578 未加载