|
|
Log in / Subscribe / Register

Locking

Locking

Posted Sep 23, 2024 20:45 UTC (Mon) by aszs (subscriber, #50252)
In reply to: Locking by atnot
Parent article: Resources for learning Rust for kernel development

Not mathematician but went down a googling rabbit hole.

The terms "linear types" and "affine types" comes from substructural logic theory which in turn borrows those terms from linear and affine equations in pure math theory.

The connection is this:

linear equations are of the form 𝑓(𝑥)=𝑎𝑥 and affine are 𝑓(𝑥)=𝑎𝑥+𝑏, where 𝑎 and 𝑏 are arbitrary constants.
So in the logic:

Linear: f(x) = a*x, (x^1 as opposed to x^2...) "use x once"
Affine: f(x) = a*x + b = a*x^1 + b*x^0, "use x once or zero times".

perfectly obvious!


to post comments

Locking

Posted Sep 24, 2024 6:53 UTC (Tue) by vasvir (subscriber, #92389) [Link]

Thanks - you just saved me a trip to this rabbit hole and back...


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds