Re: implementation specific vs. standardized Dr. Arne Babenhauserheide 18 Sep 2026 22:45 UTC
Artyom Bologov <xxxxxx@aartaka.me> writes:

> But procedure-check-of return values are entirely suitable for your
> use-case being mere predicates. Even if they are derived from the
> original types—doesn’t really matter as long they check things properly,
> right?

Yes, for the editor checking that suffices.

For optimization it doesn’t.

An easier way to find the optimizations David Thompson describes in his
article on optimization.

>> That sounds like a check whether the arguments in a given form are valid
>> could be a way to relax the checking.
>
> Not sure I understand this sentence. Can you rephrase?

With form I mean all the arguments, however they are represented.

>> Something like (procedure-types-predicate proc) ⇒ macro that can check
>> any kind of values, so the editor can call:
>>
>> ((procedure-types-predicate start-repl) (current-language) #:debug #t) ⇒ #t
>
> That does sound fun, but I’m not sure if it’s still in scope. And it
> feels like the inner workings of this helper would be _really_
> implementation-specific. Could that be a library on top of SRFI-283?

The implementation would be fully implementation-specific, yes.

It would need support for however the implementation handles named or
optional and rest arguments.

It could also work with case-lambda and any other forms, because the
details of the arguments wouldn’t be relevant for the checking.

An editor could call read on the procedure call in the file and then let
the implementation check whether it’s valid. Maybe even emitting
diagnostics if it’s not, or if there’s room for optimization.

>> But that’s not implemented yet and I’m not sure whether it would be easy
>> and/or performant.
>
> SRFI-253/273 circumvents this by not allowing checks on rest arguments
> at all. But I’ll probably add this returned rest argument check in
> SRFI-283 because, if we derive checks from types, there might actually
> be types for rest arguments (they are on Chibi, at least.)

That sounds sensible, yes.

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
https://www.draketo.de