Elektrine lite

← Feed

@saikou@gts.chuuni.solutions

2026-05-20 01:32 UTC

plt research idea: language with strong support for "partially initialized" structures. specifically the pattern I want is where you can initialize fields A and B, then call some method to compute C using A and B, because the method and its callees are tagged as not requiring C

Replies (4)

  • @beccadax@soincredibly.gay 2026-05-20 01:52

    @saikou@gts.chuuni.solutions Swift has syntax to describe this, but I think it’s only allowed for init accessors right now.

    Open ##5277280

  • @deech@mastodon.social 2026-05-20 02:24

    @saikou@gts.chuuni.solutions does row polymorphism work? Think ocaml already has this.

    Open ##5277303

  • @darryl@toot.community 2026-05-20 02:58

    @saikou@gts.chuuni.solutions I really could have used this a few years ago on a codebase that did a lot of two-step initialization (some information was available at construction time, then an initialize() method was called later to provide more information, _then_ the object was usable) and I made it work reasonably safely but it was a headacheeeee

    Open ##5277306

  • @zwarich@hachyderm.io 2026-05-20 14:49

    @saikou@gts.chuuni.solutions The most relevant line of research here is probably the area of object initialization analyses for Java-like languages. This fell out of fashion for a while, but was later revisited. I would consider this work of Liu, Lhotak, et al to be a good starting point: https://dl.acm.org/doi/10.1145/3428243 There is a video of the talk on YT: https://www.youtube.com/watch?v=Ha37rTljRoA They have a followup paper doing something similar using abstract interpretation: https://dl.acm.org/doi/10.1145/3486610.3486895

    Open ##5277308