Elektrine lite

← Feed

@zwarich@hachyderm.io

Post #3763269

2026-07-12 13:57 UTC

@foonathan@fosstodon.org @joe@f.duriansoftware.com @slava@mathstodon.xyz Yeah, I am actually surprised that more languages don't have more first-class support for "fields" that are logically caches of functions applied to other fields. Lean has something like this, but since it's a purely functional language it exists mostly to add optimizations to the code without reducing the ability to prove things about it.

Replies (2)

  • @joe@f.duriansoftware.com 2026-07-12 14:30

    @zwarich@hachyderm.io @foonathan@fosstodon.org @slava@mathstodon.xyz i think swifts “property wrapper” feature (and ObjC’s `@property` adornments before it) were sort of scratching at this problem space, that you have a schema of fields you want a type to present outward, while doing storage optimization and caching shenanigans internally

    Open ##3763268

  • @joe@f.duriansoftware.com 2026-07-12 15:39

    @zwarich@hachyderm.io @foonathan@fosstodon.org @slava@mathstodon.xyz a related idea might be to have a systematic relationship between "builder" and "value" types. dave a was really excited about killing the String/StringBuilder distinction with value semantics, but in practice there are efficiencies in batching up updates and reconciling edits into a data structure all at once when the update is finished

    Open ##4299203