s-expressionists/Trucler

More remarks.

Opened this issue · 1 comments

Second round of Trucler feedback:

  • variable-description should inherit ignore-mixin - every variable can be declared as 'ignore' or 'ignorable'.

  • authentic-variable-description should inherit dynamic-extent-mixin. The 'dynamic-extent' annotation makes sense for any value-bearing variable, as it refers to the values a variable takes on, not the variable itself. (Assuming I read the dynamic-extent entry in the spec correctly).

  • How does Trucler provide access to user defined declarations made via (proclaim '(declaration FOO BAR BAZ))?

  • The value held by a type-mixin is not specified. This is good because it allows clients to use a specialized internal type encoding that is not a valid type specifier. But it also means that there is little a user can do with the value returned by trucler:type. My suggestion would be to add another reader method (e.g., trucler:type-specifier, or trucler:external-type) that returns a valid CL type specifier.

Best regards,
Marco

Bike commented

with respect to the third point, i have filed a PR to add this, #17.

with respect to the fourth point, I think this is an issue for the client. If Trucler is used within, say, a compiler, the same code is producing and consuming types, i.e. it puts some object in the environment with an augmentation function, and then queries it later. So it presumably knows w hat it's doing.

If trucler is directly exposed to a user (e.g. for doing fancy things with &environment parameters) there's more of a problem, but I don't think it's Trucler's issue to deal with. For clients that have specialized type representations, like SBCL, I would expect them to provide operators for dealing with their special type objects directly. A specifier could be obtained from the type object, but not from the environment - any trucler:type-specifier method would probably just retrieve the actual type from the environment and call sb-kernel:type-specifier on it, that kind of thing.

Within s-expressionists/Cleavir, I have a "cleavir-ctype" system which is essentially a generic interface to this kind of type object. It isn't fully operational yet, but I think it's the way to go. It's actually like trucler in that the protocol is all generic functions and representation is up to the client.