Zulip Chat Archive

Stream: lean4

Topic: ownership / borrow-checking


Adrien Champion (Jan 31 2023 at 08:57):

The end of the Counting Immutable Beans paper mentions the idea of supporting some form of borrow-checking

In order to statically approximate this extended system, we would need to extend our type system with support for some kind of lifetime annotations on return types as featured in Cyclone [Jim et al. 2002] and Rust [Matsakis and Klock 2014].

I think I remember a dev log where this was briefly discussed. Is this idea (still) on the table, and if it is is there additional info on this somewhere, like a paper/blog post/zulip thread?

Sebastian Ullrich (Jan 31 2023 at 09:17):

You might be interested in @Marc Huisinga's master's thesis to be finished and published in about a month that will discuss ownership and borrowing, though lifetime annotations are not part of it

Locria Cyber (Feb 16 2023 at 05:01):

How to make some type that cannot be copied? Is that possible in lean?

Locria Cyber (Feb 16 2023 at 05:01):

Adrien Champion said:

The end of the Counting Immutable Beans paper mentions the idea of supporting some form of borrow-checking

In order to statically approximate this extended system, we would need to extend our type system with support for some kind of lifetime annotations on return types as featured in Cyclone [Jim et al. 2002] and Rust [Matsakis and Klock 2014].

I think I remember a dev log where this was briefly discussed. Is this idea (still) on the table, and if it is is there additional info on this somewhere, like a paper/blog post/zulip thread?

Check out Clean, ATS or Idris 2.

Adrien Champion (Feb 24 2023 at 12:56):

@Marc Huisinga maybe it would be useful for me to leak the email you sent me so that people like me have a few papers to read until your work is published? Is that okay?

Alex Keizer (Feb 24 2023 at 12:56):

I would certainly be interested in reading those papers!

Adrien Champion (Feb 24 2023 at 12:59):

Well the short version is that "uniqueness types" are investigated. That's a concept related to, but different from, linear types

If you'd like to know more about uniqueness types and how it relates to linearity, the recently published "Linearity and Uniqueness: An Entente Cordiale", as well as de Vries' PhD thesis "Making Uniqueness Typing Less Unique" are good places to start.

I found the former in particular to be extremely useful

Adrien Champion (Feb 24 2023 at 13:01):

Ended up paraphrasing Sebastian

James Gallicchio (May 06 2023 at 17:23):

Sebastian Ullrich said:

You might be interested in Marc Huisinga's master's thesis to be finished and published in about a month that will discuss ownership and borrowing, though lifetime annotations are not part of it

was this ever published? I can't find anything online but I don't really know where I should be looking!

Sebastian Ullrich (May 09 2023 at 12:37):

It now is at https://github.com/mhuisi/Uniq/releases/tag/submission!

Marc Huisinga (May 09 2023 at 16:17):

The official thesis "publication" can also be found here: https://pp.ipd.kit.edu/publication.php?id=huisinga23masterarbeit

Henrik Böving (May 09 2023 at 16:19):

Are there plans on your side to get this integrated into the actual compiler at some point? Or is that something the compiler team will have to deal with? @Marc Huisinga

Marc Huisinga (May 09 2023 at 16:25):

Difficult to say at this point - I work full-time now and definitely need a break from Lean related things for a bit. I wouldn't mind if someone other than me who has some prior experience with substructural type theory takes a stab at it.

There's also some additional theory work left to be done for the type theory to be user-friendly.

James Gallicchio (May 09 2023 at 16:32):

I'm definitely interested in helping push the implementation forward. I might also be able to help on the theory side after this Fall semester (hopefully taking a special topics course on substructural TTs...)


Last updated: Dec 20 2023 at 11:08 UTC