gleam-lang/gleam

Use memory arena for types when type checking

Open

#2,250 创建于 2023年6月29日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)Rust (960 fork)batch import
help wanted

仓库指标

Star
 (21,417 star)
PR 合并指标
 (平均合并 10天 19小时) (30 天内合并 69 个 PR)

描述

Currently, we represent types using a nested tree structure in which nodes are reference counted. This is at times awkward to work with, not particularly well-suited to a multithreaded compilation, and potentially slower than using an arena due to the overhead of reference, counting and memory fragmentation. Use an id based memory arena instead.

It is only during type interference and checking that we need to mutate types and to have the various different kinds of type variables, so for all other parts of the compiler, we can have a different, simpler data structure with which to represent types. Related to https://github.com/gleam-lang/gleam/issues/865

贡献者指南