Discussion:
Fundamental design constraints
s***@public.gmane.org
2003-10-29 14:17:42 UTC
Permalink
Even if the SRFI were withdrawn, when I resubmit it for draft it would
still contain the following major design attributes, which are
essential to a successful collections interface.

1. Generic dispatch: This is absolutely essential in order to write
collection agnostic code. Without this ability, you cannot write
generic logic that acts on collections. This is the foundation of
a large body of library code in languages with collections.

2. Necessary operators (as opposed to a Kitchen Sink): This
follows the general Scheme philosophy. There are two reasons for
including necessary operators rather than all possible operators.
Firstly, choosing a necessary subset contstrains future collections
less. This is essential because one cannot hope to guess what
collections will be used in the future. Odd collections are an even
tougher match, such as infinite collections, generated collections,
and external-sourced collections. Secondly, it keeps the barrier to
mapping data structures to the SRFI low and allows for efficient
implementation of the necessary set, as well as allowing future
operators in those collections to be efficient. Having too many
specific operators means those operators will have widely varying
efficieny on future collections... when they can be made to work at all.

3. Metaness - This is just too important in order to have a framework
for collections interoperability. As in [1], the real power of a
collections framework comes not from the specific collections that are
eventually created, but the fact that the collections can be used with
each other, passing values and mappings between them, and being able to
interchange collections and pass them to functions as easily as we do
with higher order functions in Scheme.

4. Enumeration - A traversal mechanism is a must for collections.
Iterators/Cursors have problems as noted previously on the list.
Enumerations have been shown to have advantages where iterators have
weaknesses, and yet the advantages of cursors are a conversion operator
away. Its the best of both worlds, and the Right Thing.

For this reason arguments for withdrawal citing any of the above are
immaterial, and I will start ignoring any comments about them towards
withdrawal. Additionally, the SRFI process arguments are outside the
scope of discussion. We can continue to discuss this on the
srfi-discuss list if you like, but its just wasting bandwidth at this
point, given that even the editor doesn't agree that this SRFI is
abusing the process in a harmful manner.

I'm extending an olive branch to continue rational discussion of
improving the flaws that remain. I've updated the SRFI at
http://sgmiller.org/code/srfi-44.html to reinsert the references section
and add *-get-all to the dictionary API to support m-to-n mappings.
Lets stop bickering and fix the issues that remain.

Scott
Bradd W. Szonye
2003-10-30 05:59:56 UTC
Permalink
Post by s***@public.gmane.org
Even if the SRFI were withdrawn, when I resubmit it for draft it would
still contain the following major design attributes, which are
essential to a successful collections interface.
OK.
Post by s***@public.gmane.org
1. Generic dispatch: This is absolutely essential in order to write
collection agnostic code. Without this ability, you cannot write
generic logic that acts on collections. This is the foundation of a
large body of library code in languages with collections.
I agree. However, I would like to see the need for "collection agnostic
code" justified. That sounds a lot like "generic meta-programming," but
SRFI-44's support for generic meta-programming is actually very weak.
(Most of the things that would support it are currently left for later
SRFIs.)
Post by s***@public.gmane.org
2. Necessary operators (as opposed to a Kitchen Sink): This follows
the general Scheme philosophy ....
Is that really Scheme philosophy, or is it Scheme pragmatism? A recent
c.l.s. explanation of the minimalism in R5RS claimed that it wasn't for
philosophical reasons, but simply to avoid conflicts with existing
implementations.

If that's true, then this SRFI isn't following the principles, since it
isn't a compromise between existing implementations. Indeed, it mostly
seems to ignore prior art and set off in its own direction. If your goal
really is to avoid constraining existing implementations (like R5RS
did), then you really should do more research on those implementations
and make a better effort to avoid incompatibilities.
Post by s***@public.gmane.org
3. Metaness - This is just too important in order to have a framework
for collections interoperability. As in [1], the real power of a
collections framework comes not from the specific collections that are
eventually created ....
It sounds like you're just repeating #1 here, and the same answer
applies: I would like you to justify the importance of this and explain
why SRFI-44 doesn't actually include the usual mechanisms to support
this. There's more to it than just generic dispatch.
Post by s***@public.gmane.org
4. Enumeration - A traversal mechanism is a must for collections.
Iterators/Cursors have problems as noted previously on the list.
Sure, no problem there, but you may want to do more research in this
area before implementing. Rather than a simplistic, one-collection,
left-and-right only approach, you may want to consider the use of
collection adapters, enumeration adapters, and the possibility of
supporting bidirectional and random-access cursors.
Post by s***@public.gmane.org
For this reason arguments for withdrawal citing any of the above are
immaterial ....
Problem: You've stated these as design goals without demonstrating that
they are actually valuable (or even true, in the case of the "Scheme
philosophy" justification).
Post by s***@public.gmane.org
Additionally, the SRFI process arguments are outside the scope of
discussion. We can continue to discuss this on the srfi-discuss list
if you like, but its just wasting bandwidth at this point, given that
even the editor doesn't agree that this SRFI is abusing the process in
a harmful manner.
Could you please stop speaking for the editors? And writing in this
"Nyah, nyah, the editors said it's OK" tone? You put a spin on it here
that I didn't get from the editors' actual writings.

Also, you'd do well to take things a little less personally and to treat
your reviewers more fairly. For example, you've repeatedly challenged us
to back up our criticisms with hard examples and detailed
justifications. However, you expect us to accept your design goals as if
they were obvious and universal desires. As you can see above, I feel
that you're overestimating the importance of this proposal, and that
some of your goals may not be supportable.
--
Bradd W. Szonye
http://www.szonye.com/bradd
Anton van Straaten
2003-10-30 07:20:20 UTC
Permalink
Post by Bradd W. Szonye
Post by s***@public.gmane.org
2. Necessary operators (as opposed to a Kitchen Sink): This follows
the general Scheme philosophy ....
Is that really Scheme philosophy, or is it Scheme pragmatism?
It really is Scheme philosophy - it's laid out in the intro to R5RS.
Post by Bradd W. Szonye
A recent c.l.s. explanation of the minimalism in R5RS claimed that
it wasn't for philosophical reasons, but simply to avoid conflicts
with existing implementations.
That's a somewhat different situation, and a one-sentence summary doesn't do
it justice - i.e., is essentially wrong. There are a lot of factors that
make it difficult to develop a core Scheme standard like RnRS.
Post by Bradd W. Szonye
If that's true, then this SRFI isn't following the principles, since it
isn't a compromise between existing implementations. Indeed, it mostly
seems to ignore prior art and set off in its own direction.
What prior art, in Scheme implementations, is there in this area? There are
collections, but are there any with a common set of generic interfaces?

The prior art I'm aware of is mostly listed at the bottom of SRFI-44. To
that I'd add the C++ STL, and things like Common Lisp's sequences (which
operate only on lists and vectors).

Anton
Alex Shinn
2003-10-30 07:37:58 UTC
Permalink
Post by Anton van Straaten
What prior art, in Scheme implementations, is there in this area? There are
collections, but are there any with a common set of generic interfaces?
In SCM (require 'collect) will give you generic collections based on
YASOS.

Gauche has a very nice collections API with a generic interface
(especially nice when working with uNvectors and you later realize you
need u{N*2}vectors).

I wouldn't be surprised if there were more.
Post by Anton van Straaten
The prior art I'm aware of is mostly listed at the bottom of SRFI-44. To
that I'd add the C++ STL, and things like Common Lisp's sequences (which
operate only on lists and vectors).
Smalltalk should be in there, it's pretty much the father of modern
object systems. Probably worth look at Ruby too, they love their
iterators. Stay far away from Perl though :)
--
Alex
Bradd W. Szonye
2003-10-30 10:16:24 UTC
Permalink
Post by Anton van Straaten
A recent c.l.s. explanation of the minimalism in R5RS claimed that it
wasn't for philosophical reasons, but simply to avoid conflicts with
existing implementations.
That's a somewhat different situation, and a one-sentence summary
doesn't do it justice - i.e., is essentially wrong. There are a lot
of factors that make it difficult to develop a core Scheme standard
like RnRS.
Hm, OK, I'll trust you on that for now.
Post by Anton van Straaten
If that's true, then this SRFI isn't following the principles, since
it isn't a compromise between existing implementations. Indeed, it
mostly seems to ignore prior art and set off in its own direction.
What prior art, in Scheme implementations, is there in this area?
There are collections, but are there any with a common set of generic
interfaces?
The SRFI casually stomps on the naming conventions of those individual
collections; it doesn't coexist with them peacefully. The author has
stated that the conflicts and potential confusion with existing
collections are "minor," and his general attitude has been that it's the
user's fault if this causes trouble.

It would be much better to incorporate the conventions of these existing
collection types. Of course, they aren't terribly consistent, so that
probably isn't possible in general. However, actually conflicting with
those interfaces isn't going to win any admirers, and it's likely to
cause widespread non-adoption. What good is a "generic collection"
interface that doesn't actually work well with the collections you
already have?

I get the impression that this spec just wants to forge ahead and ignore
the past, but that doesn't actually work in practice. There's too much
"wouldn't this be cool?" and not enough "will it actually work?"
Post by Anton van Straaten
The prior art I'm aware of is mostly listed at the bottom of SRFI-44.
To that I'd add the C++ STL, and things like Common Lisp's sequences
(which operate only on lists and vectors).
While the C++ STL isn't a perfect role model, a generic collection API
would do well to pay attention to STL's metaprogramming-friendly design.
--
Bradd W. Szonye
http://www.szonye.com/bradd
Loading...