-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List supported SRFIs #1
Comments
I'm working on an issue in Akku where I need to know the bundled SRFIs for R6RS implementations, so I'll be amending the lists here a little. The data eventually goes into |
Larceny 1.3 has a weird split in SRFI availability wrt the R6RS and R7RS names. An example is SRFI-127, which exists as |
I'm thankful to have you contributing to these listings as well. The practical experience from Akku will be valuable for sure...
...case in point :) I was waiting for special cases like this to show up. I think it should be split into two separate lists. But it's also possible that a Scheme implements an SRFI on one OS but not another, etc. We can't anticipate all situations. Hence, should we go whole hog and put a SRFI 0 |
Something like:
So a plain
|
If we have those conditional expressions, we could take the opportunity to decouple the lists from the
So each SRFI would always be represented as a list: The version list could have:
|
We also should not rely on any sort of lexicographic sorting algorithm to sort the versions from earliest to latest. We should probably not even rely on dates. Instead, the versions would be given in the right order in the file and the reader would trust that that is the correct sort order. |
I can't recall any case where a bundled SRFI is supported on only some of the target platforms, although I guess it could happen. But then I think it would be dependent on target OS, not the target architecture. How about inverting it and using a regular cond-expand, which can be omitted if it's not needed: (bundled-srfi-implementations
(cond-expand
(linux (1 13 98))
(windows (1 13)))) Who is the intended audience for this? I don't think I can use too detailed variants of this in Akku, there I just want to know which SRFIs are already provided by a particular Scheme. I don't really know the target OS, machine or implementation version in advance; I just need something reasonable. If that exists. :) |
The thing is, that kind of expressive power is bonkers for a task like this. Hopefully no-one will need it. But I was trying to prepare for the worst since schemas for data are much harder to change later than mere code is. If it was just code I would not start with something so complicated. If you need to know whether a particular SRFI is supported by a particular implementation version under any circumstances at all, just ignore the feature expression and assume it's always true :) But you need to check for R7RS. Hmm. What to do.. I can't think of anything that doesn't get ludicrous. |
We could add stuff like We could leave out the OS/architecture stuff but SRFIs for system interfaces are a reasonable idea, and it's quite plausible some could be implemented only for some OS (e.g. POSIX or Win32 API or some mobile stuff). |
The regular |
OK, this is getting embarrassing but this is the best I can think of:
So all the symbols (here Then it should work for all cases, with room for extension, and we only need and/or/not and not things like if/cond/equal/member. I also thought about tri-state logic (yes/no/maybe) but let's not go there :D |
Could just write the set of SRFIs supported in some environment by the implementation and amend it with a comment if needed. |
That could be done (i.e. rather have false positives than false negatives when it comes to SRFI support). But would that solve your R6RS vs R7RS case? I would avoid putting any valuable information in comments since the data can be expected to be mangled, filtered and combined by many different tools. |
The R6RS vs R7RS case could be solved by listing the built-in library names instead of just the SRFIs. That would also be more generally useful, I think, because there's also a bunch of code that is shipped as libraries in implementations (e.g. IronScheme and Sagittarius) that should be more widely available. |
OK, cool. Let's do that -- so we can keep the current simple format |
We should aim to eventually list the
bundled-srfi-implementations
for all releases of all implementations.Bundled vs third-party SRFI implementations
The word
bundled
is important. Some SRFIs can be implemented in pure Scheme, so for example Chicken offers some of them as optional third-party packages instead of bundling them with the implementation (Peter Bex brought this important distinction to our attention). A list of third-party SRFI implementations is not as easy to amass, hence the scope will be clearer if we stick to the bundled ones in this metadata.The problem of finding third-party SRFI implementations can be solved by putting that information in package metadata instead of Scheme implementation metadata. If each package (currently in packhack, eventually in some more principled package index :p) optionally lists what SRFI(s) it implements, and also lists what Scheme implementations it supports, then we can write a little code to derive a list of third-party packages that extend the SRFI support of a given Scheme implementation.
How to gather the list of bundled SRFIs for each Scheme implementation
We would ideally have a list for each release of each implementation, so we need some mostly automated solution tailor made to each of them. Writing the lists by hand is too error-prone if we want to cover all historical releases.
We could start from hand-written lists, though. Arthur has a comprehensive and reasonably error-free list covering recent versions of many, many implementations.
Frank has some code to auto-extract lists from the documentation of a few implementations. This could serve as the starting point for the auto-extraction tools.
The text was updated successfully, but these errors were encountered: