HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
rust-lang-nursery
lazy-static.rs
Rust2014–2021
rust-lang-nursery / lazy-static.rs · Archived

lazy-static.rs

A small macro for defining lazy evaluated static variables in Rust.

6Distinct people
6Mentions
1Explicit recommenders
2KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A small macro for defining lazy evaluated static variables in Rust.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

Much like Go! i'm not a big fan of languages whose includes are managed as such: [dependencies.lazy_static] git = "https://github.com/Kimundi/lazy-static.rs" Does Rust, like…

killertypo used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 1:57:11 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year6 dated mentions

Observed mentions: 2014-10-29 22:00:38 UTC to 2021-04-17 15:12:33 UTC.

0122014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments20142015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC202
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC000
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC101
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101

What Hacker News says

1 sources
I'm an embedded Rust developer, and was a little confused by this paper until I noticed it was written in 2015. There are now solutions to a number of the problems they pose both at the language level and the library level: Here's one in particular: In principal, this would allow us to statically allocate a buffer sized for each particular closure. Unfortunately, there is no size_of keyword in Rust, and static initialization cannot invoke functions— in this case the function size_of<T>() -> usize provided by the Rust core library. This can be solved by using the lazy_static crate: https://github.com/rust-lang-nursery/lazy-static.rs From the description in the README: Using this macro, it is possible to have statics that require code to be executed at runtime in order to be initialized. Hey look,
Read the rest
it's exactly what they need! It's also "no_std" compatible and can work just fine in a kernel-like context. Take this paper with a grain of salt: it's a bit dated at this point, and there are solutions for a number of the problems posed.
In Ownership is Theft: Experiences Building an Embedded OS in Rust (2015) [pdf]

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.