百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

micro-mitten

> 编程语言
开源

你可能不需要垃圾收集器

539 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

你可能不需要垃圾收集器

micro-mitten

metal's too hot? wear a mitten!

micro-mitten??

micro-mitten is a bare-bones Rust-like programming language, stripped down to simplify control-flow structures and the type system.

Like Rust, micro-mitten offers a static approach to memory management; however, micro-mitten's approach is significantly different from Rust's. Rather than depending on single ownership and a complex lifetime system, micro-mitten uses a series of data-flow analyses to statically approximate heap liveness. This means that it maintains the ability to insert freeing code at appropriate program points, without putting restrictions on how you write your code. The theory behind the approach is documented in this thesis (Proust 2017).

Long story short, this is an attempt to see if we really can have unrestrictive compile-time garbage collection.

How can I use it?!

The project depends on libgc and the LLVM-8 toolchain. Cloning this repository and running the following should get you set up with a working copy of mmtnc (the micro-mitten compiler).

bash
./tools.sh # installs `mitten-test`, `mitten-bench`, `knit` and the language runtime
cargo install --path ./ --force # installs `mmtnc`

mmtnc compiles .mmtn files to LLVM IR (.ll) and just dumps the textual representation. Much more helpfully, you can get binaries directly using knit. To build a binary (example) from a source file (example.mmtn) use:

bash
knit --src example.mmtn --gc-strategy=proust 

The --gc-strategy argument is optional, but the default is to use no garbage collection (your computer will hate you). The other options are proust (uses static memory management) and bdw (uses libgc).

Notes

To get an idea of the language syntax, check out the examples in src/test/. If you get something wrong, the compiler should moan at you. Otherwise, please open an issue!

Please note, micro-mitten is purely a research language and its performance is not brilliant when using static memory management. For a full run-down, see my dissertation. Most of the examples in src/test/ will run with static memory management, but there are some notable exceptions and one or two memory leaks.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustcompile-time-garbage-collectioncompilersdata-flow-analysismemory-management

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言