>useful drawing operations can be done with this library without having to build a dozen procedures  on top

Unfortunately, the essence of SICP is to "build a dozen of procedures on top" as a teaching method :).

>(3) canvas-refresh needs to be clarified.  "A Scheme object which can be used for drawing operations" might be clearer

I am hesitant about calling it a scheme object. For example, the reference implementation returns a uuid-generated string. While a string is certainly a scheme object, it's emm... not some kind of a scheme object specific to drawing...
I am not sure how to describe this properly.
It is expected that every implementation will have a different way of representing these objects.

> What does "the canvas may not exist unless it has been drawn on" mean?

In the sample implementation, it means "I have generated a unique file name to use later to draw, but haven't created the actual file yet. However, if a file with such a name had existed, I have deleted it."
In an abstract implementation, it would mean something like "I checked that the graphical subsystem exists and works, but haven't created the actual window".

I am not sure how to word this properly.

>What do drawing procedures do if no canvas has been created

They create it, I added this to the draft. (I'll puch it to my repo and will ask for a new draft to be published.) SICP is very explicit about this. When drawing procedures are called, they draw.

> if there are multiple canvases?

SICP doesn't specify this. In the sample implementation, the canvas ' name and dimensions are parameter objects (as in r7rs), so parameterizing them lets you work with multiple canvases.

The default name for the canvas is generated at library loading time. Not use if it is a good idea, as it will be littering the disk with files, but at least the user is not obliged to use the default canvas.

>it seems like it would be easy to create a version of
the language with no global state

Kawa does something like this. I would actually be very grateful to anyone who would do a Kawa version of the SICP's language on top of Kawa's drawing library. I had it on my todo list (kawa seems fun to try any way), but so far was too busy with the ICFP. All code contributions welcome.

>`rogers' seems far too specific to be useful

Sorry, I can't do anything about that. That's what SICP has and uses in the examples.

>Providing image-file->painter and showing an example with "rogers.jpg" or the like is probably all that's needed to show how to implement `rogers'

That is how it is implemented in the sample implementation actually.

>This is, in my opinion, too specific and should just be image-file->painter

I would be delighted if implementations provided such an option. Shall I add it to the "recommended" part?

On the other hand, I would like the code to be as portable as possible. Mandating _one concrete_ encoding method means that demos which work with these files also work on other schemes implementing this srfi pedantically. image-file->painter would be vaguer.

>Are these supposed to be included in the SRFI, or are they internal
to the sample implementation?

They are internal. I'd encourage the implementations to provide them, but SICP never uses them, so I can't require that.

>it's a very limited core which  would need significant extension to be used for any other purpose

SICP is one of the biggest applications of Scheme. It is a bit sad, but at least partially true.
Also, codifying a one-fits-all drawing language seems a very hard task, given the range of setups on which Scheme works. It is probably possible, but my level of abstract thinking is just not enough.

In particular, I would like to avoid codifying anything related to canvas-name and canvas-size at all, because some systems just have a single display, and some don't even have any pixels.

>Feel free to add any or all of the above prose to the SRFI 203 Rationale.

I added the part that explains the SRFI-96 analogy. Thank you for contributing.



On Fri, 14 Aug 2020 at 09:47, John Cowan <xxxxxx@ccil.org> wrote:


On Thu, Aug 13, 2020 at 12:13 AM Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz> wrote:
 
(1) "The scope of this SRFI is not to implement the whole drawing
library..." If the SRFI implementation doesn't provide the actual
drawing routines, and also doesn't provide an extensive drawing
library, it seems too limited to be useful--the bottom and top
"layers" are both missing, and much of what it does provide is
unspecified.

 Those things are true, but I believe they miss the point of the SRFI.  The SICP drawing language (SDL) is not intended as a general-purpose language for drawing, but as a tool for experimentation that "is designed to make it easy to experiment with patterns [...] composed of repeated elements that are shifted and scaled".  As such, its purpose is more pedagogical than practical, and there is really no point in adding more features to SDL: it is what it is.

As things now stand, with just a few shim procedures you can work through all the SICP exercises with any Scheme — until you come to 2.2.4, and then you are blocked unless you are working with MIT Scheme or Racket (possibly others?).  SDL is already documented in SICP 2.2.4[1]; , and the non-primitive code is in the SICP repo[2], but that is not enough to make it usable.

What this SRFI defines is the set of primitives which a Scheme must provide in order to host SDL.  Screen graphics being as non-portable as they are, it's necessary for the Scheme to provide a canvas and the ability to draw lines on it.  The portable implementation uses a JPEG file (I think) as the drawing canvas, which is clunky but correct.

This SRFI can be compared to SRFI 96, which is to SLIB as this SRFI is to SDL.  SRFI 96 makes no attempt to document SLIB (which has over 200 modules), much less to extend it.  Instead, it documents the constants, variables, procedures, and syntax forms that a Scheme must provide in order to fully host SLIB, which amount to less than forty.

(SRFI 96 should eventually be updated for R6RS and R7RS, and also to see which of the primitives are not actually in use in the current SLIB release so that they can be removed.  I've tried to do this a number of times, but to no avail: it's not a trivial effort.)

Vladimir: Feel free to add any or all of the above prose to the SRFI 203 Rationale.




John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
Any day you [see] all five woodpeckers is a good day.  --Elliotte Rusty Harold



--
Yours sincerely, Vladimir Nikishkin