empirical-lang
empirical-lang copied to clipboard
docstring support and interactive help
Functions can accept a docstring:
func foo(x: Int64):
""" Some amazing notes here! """
return x + 1
end
However, there is currently no way to retrieve it. The proposed solution is a sema_function called help()
. Given an identifier, the resolved item's type and docstring are returned. This may necessitate adding an attribute to HIR's resolved
so that every kind of identifier can participate.
Bonus is to add syntactic sugar to the REPL:
x?
resolves to
help(x)