TIL about the box.leak() method in Rust: https://doc.rust-lang.org/std/boxed/struct.Box.html#method.leak
This leaks the box, but it also gives you a reference that can live longer! E.g. you can leak a Box<u64> and treat it as 'static.
It makes sense, but being able to use a value after leaking is new idea to me.
miniblog.
Related Posts
Should code completion offer private methods/fields?
If the user chooses a private method, you can offer a quickfix to change its visibility. It's clutter though.
I frequently find myself wanting fields that I haven't exposed yet, and frustrated that the IDE hides them.
I think you could build an interesting IDE with a tiny embedded LLM in addition to the usual tooling.
Features like 'extract method' would be much nicer if an LLM could provide a name. Choosing a good name is virtually impossible from just a typed AST.
Playing with Claude and my new programming language has made me add features that it wants. I think they're reasonable.
`for method in methods` -- custom syntax error explaining that `method` is a reserved word
`echo 'println("hello world")' | garden` -- eval snippets from stdin