Why do lifetimes need to be leaky?

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • mrustc

    Alternative rust compiler (re-implementation)

  • No, you don't. Existential proof: mrustc ignores lifetimes. Just flat out simply ignores. It changes some corner-cases related to HRBT, yet rustc compiled by mrustc works (that's BTW mrustc exist: to bootsrap the rustc compiler).

  • hylo

    The Hylo programming language

  • A model without lifetimes is also being explored in other languages, e.g. in Hylo. It sacrifices expressiveness, but on the other hand you don't have to deal with explicit lifetimes!

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • rust

    Empowering everyone to build reliable and efficient software.

  • For now the closest thing to inferred lifetimes are closures, which are effectively functions where the signature is fully inferred, and they already give headaches around lifetime inference (see for example https://github.com/rust-lang/rust/issues/70263). If you never encountered this issue, it's because you always passed closures to functions which take a generic type F: Fn(...), and the compiler could use that Fn(...) as the signature of your closure, hence avoiding inferring it. But if that Fn(...) is not present (even just using another trait that has a Fn(...) supertrait) then everything breaks!

  • polonius

    Defines the Rust borrow checker.

  • Correctness prover which uses lifetimes (Polonius).

  • gccrs

    GCC Front-End for Rust

  • That's why gccrs doesn't even consider lifetime checking a part of the language (they plan to use Polonius, too).

  • llvm-project

    The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.

  • C++ compiler which compiles the Rust as if it were C++ (LLVM).

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts