I'm searching for an algorithm package like algo/lovelace/typst-algorithmic, but where we can reference line numbers, like in LaTeX with algorithm2e. For instance some line in the algorithm would be i <- i+1; <line:increment> and then we would reference it with @line:increment which would output something like "line 3".
I think that the previously cited packages do not have this feature, because the labels would be defined inside the scope of the algorithm, and therefore cannot be referenced outside. Maybe this could be resolved using show rules, which would expose the context of the algorithm to the outside, like with templates?
A second technical hurdle would be to define a custom label type for line numbers. I know that you could do theoretically do that using a show rule as explained in the docs (https://typst.app/docs/reference/model/ref/) but I don't see what would be the code used to detect that we are referencing an algorithm line, and how to retrieve the line number.
If this is not currently possible, do you have some ideas on how to resolve the above challenges?