Structured annotations

Hello, here is an simple tool and idea to help tackle complexity:

The idea:
Code and thoughts already share the same space, but we can do more by adding structure.
This is like an interface where tools, persons, code and probably A.I can meet!

Here is an example of navigating code trough ideas:

structured_annotations

3 Likes

Awesome! Thanks for sharing :slight_smile:

I think this is an interesting idea Mojo could consider in some form. The ability to have a structured display for an equivalent of Rusts “Safety” comments and it allows tagging functions with extra information. Right now, there’s a soft standard of TODO: ... comments, but having tooling able to help a developer find TODOs for a particular tag (conditional conformance, where clauses, internal issue ID, etc) is quite helpful, especially in large codebases or for features which may block a lot of work. They can also provide “go to source” for external_call functions in multi-language codebases with a bit of tooling work.

In the absence of an effect system, they also can help notify users of hazards they might wish to be aware of, such as thread-unsafe functions (which may occur in C bindings), whether a function allocates, or whether the function might take a lock or do something else RT-unsafe.