The Trunk: Kernel-eem.1316.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
30 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: ?? Live documentation rendering (was: self error:        'comment only')

David T. Lewis
Ha! Thanks. I knew it couldn't have been a new idea :-)

Dave

On Sun, Mar 22, 2020 at 01:06:24PM -0400, gettimothy via Squeak-dev wrote:

> SeasideDoc may be of use to you here.
>
>
> http://squeaksource.com/@98wPRO3xoqcWHC8c/NtvPSZ9c
>
>
>
>
>
> ---- On Sat, 21 Mar 2020 17:34:10 -0400 [hidden email] wrote ----
>
>
> Hmmm.... good points Christoph.
>
> I'm sure this must have been done before, but how about a Seaside
> application with an image keeping itself up-to-date with the trunk
> update stream, and with Seaside rendering something similar to the
> "show all comments" browser that Subbu reminded us about?
>
> I recall an early Seaside demo that implemented Smalltalk browsing,
> so it might be something similar to that browser but more focused
> on rendering the documentation (comments) than the code.
>
> I suppose that in this case, "editing the document" would amount
> to putting some new or improved comments into trunk.
>
> I think we already have (or had???) some way to embed href links
> in Squeak comments, so possibly that would be a way to provide
> links to more extensive documentation on the swiki. This has not
> been very useful in the image (once apon a time we had the embedded
> Whisker browser, but those days are gone). But maybe that sort
> of linkage might be more useful if comments were being rendered
> from a Seaside app.
>
> Something like this might be a nice thing to have running on our
> Rackspace servers and linked to squeak.org.
>
> Dave
>
>
> On Sat, Mar 21, 2020 at 07:11:08PM +0000, Thiede, Christoph wrote:
> > > Actually, javadoc can do a very nice job of generating documentation if someone has taken the time to write good comments in the first place. Not unlike the situation in Squeak.
> >
> > I think I don't like documentation generation. This is a classical scenario of creating a representation that lacks liveness and needs to be kept in sync, making it impossible to edit the generated document, unless the synchronization is implemented as a bidirectional process. Especially in Squeak, we should be very careful to create such derived representations. Ideally, we should also never copy documentation stuff into the Swiki, but implement a hook/special syntax there that allows citing it directly from the Swiki server's image.
> >
> > Best,
> > Christoph
> >
> > ________________________________
> > Von: Squeak-dev <[hidden email]> im Auftrag von David T. Lewis <[hidden email]>
> > Gesendet: Samstag, 21. M?rz 2020 20:03:36
> > An: The general-purpose Squeak developers list
> > Betreff: Re: [squeak-dev] self error: 'comment only'
> >
> > On Sat, Mar 21, 2020 at 11:21:39AM -0700, tim Rowledge wrote:
> > >
> > >
> > > > On 2020-03-17, at 12:56 AM, K K Subbu <[hidden email]> wrote:
> > > >
> > > >>
> > > >
> > > > It already does - Browser -> Object -> show all comments -> class side
> > >
> > > Hunh. Never noticed that before; which is an example of a mix of "long-habit making new stuff almost invisible" and "too long menu disease".
> > >
> >
> > I overlooked this too. Thanks Subbu!
> >
> >
> > > I think it does the wrong thing though; a more consistent approach would be to have the HelpBrowser page with that info installed in the HB that opens when you ask for Help. Removes a then-pointless menu entry and make the HB more useful.
> > >
> > > A related issue is the lack of actually useful class comments - and indeed the fact that class comments are a small part of the total need to explanations. If we were to make really thorough use of the HB to document things one might argue that individual class comments would become irrelevant. Certainly the tragically simplistic approach I've seen (I think it was called javadoc?) that simply gathers up every comment and tries to pretend that it makes actual documentation is not one to copy.
> > >
> >
> > Actually, javadoc can do a very nice job of generating documentation
> > if someone has taken the time to write good comments in the first
> > place. Not unlike the situation in Squeak.
> >
> > Dave
> >
> >
> > > Making good doc and good tools to make that easily available and easy to keep up to date is hard work. I think we have a lot of decent starting points though. We can, for example fetch swiki pages fairly easily, which would be a great thing to improve for major doc items. They can be updated easily by a wide community, which is hopeful. A downside is the requirement to be online, which means we might want to work out a way of having some basic doc held in local space (probably best is the sources file since we usually at least have that) as well. And being better at parsing the content of swiki pages would be nice; or perhaps extending the swiki system to be able to return data in a more digestible form when the requestor is an HB?
> > >
> > > tim
> > > --
> > > tim Rowledge; [hidden email]; http://www.rowledge.org/tim
> > > <-------- The information went data way -------->
> > >
> > >
> > >
> >
>
> >
>
>

>


Reply | Threaded
Open this post in threaded view
|

Re: self error: 'comment only'

Eliot Miranda-2
In reply to this post by K K Subbu
Hi Subbu, Hi All,

> On Mar 22, 2020, at 2:37 AM, K K Subbu <[hidden email]> wrote:
>
> On 21/03/20 11:51 PM, tim Rowledge wrote:
>> Making good doc and good tools to make that easily available and easy
>> to keep up to date is hard work. I think we have a lot of decent
>> starting points though. We can, for example fetch swiki pages fairly
>> easily, which would be a great thing to improve for major doc items.
>
> Separating document from code has never worked out well in the past. Code is for machine to execute and no amount of comments embedded in code will replace a proper narrative guide intended for programmers. When reading such comments, I tend to miss the forest for the trees.
>
> Most documents that have endured in the past (The C Programming book by K&R, anyone?) fall primarily into two types: guides and references. The guides are compact narrations intended for on-boarding programmers. The references are comprehensive dictionaries intended for lookup by experienced programmers. One could refine these into more sub-types (like tutorials, cookbooks etc), but these two are essential and sufficient (for small self-supported groups like us).
>
> Examples of the first kind are - Introduction to Morphic, Back to the Future, Etoys Quick Guides. These are difficult, but not impossible, to get off the ground and need support from the code (e.g. for active essays). Whenever a new concept or design is introduced in a release, a chapter/section/glossary should be added to it (even if empty). In Squeak, it is easy to write small narrations as active essays and update them every Squeak release. We do this already in bits and pieces but we need to put all the wood behind a single arrow.
>
> The class comments and terse guide belong to the second category. They can serve to refresh memory but are not substitutes for a proper narrative. Comments like whatIsAPrimitive should be merged into a narrative flow rather than stick out in isolation.
>
> While I use Squeak swiki, I feel it is inferior to an in-image guide. Swikis don't let me switch into browsers or inspectors. We could write narrative texts as Help topics and books and use a in-image swiki server to export to HTML on the fly (or produce PDFs for offline reading). Topics can be patched with changesets just like code. An in-image guide and swiki server may add an extra 2-3MB but it would take less effort overall in keeping them in sync with code. Experienced developers can always strip them out from production images if size becomes an issue.
>
> I am not in favor of placing guides outside Squeak image and using in-image PDF or WWW browser to read them. Browser specifications have become too baroque and complex for any sane implementation. An in-image browser would result in a huge code bloat and divert efforts away from the core product.

+1000

And in-image the problem is not so much the form of the documentation as it is bringing it to the attention of the programmer.  If we were in the habit of reading the image, as we were in the ‘80’z when it was a small fraction of its current size, then we would all be familiar with and I surprised by Object’s class side documentation, and be in the habit of checking the class comment if every class we browse.  But we’re not and a key party of this is just a scaling problem.

What I think Subbu’s analysis and this scaling problem implies is that the Help Browser is a great central location to go to to find documentation, but the Help Browser will be better if it is able to display class comments and documentation methods as well as its own help pages.  My vote is to make the Help Browser multi-modal and about indexing tool for accessing help and documentation in as many turns as possible, including pointers to web pages and videos.

>
> Regards .. Subbu
>

Reply | Threaded
Open this post in threaded view
|

Re: self error: 'comment only'

timrowledge
In reply to this post by K K Subbu
I agree very substantially with you on this, but not completely.

> On 2020-03-22, at 2:36 AM, K K Subbu <[hidden email]> wrote:
>
> On 21/03/20 11:51 PM, tim Rowledge wrote:
>> Making good doc and good tools to make that easily available and easy
>> to keep up to date is hard work. I think we have a lot of decent
>> starting points though. We can, for example fetch swiki pages fairly
>> easily, which would be a great thing to improve for major doc items.
>
> Separating document from code has never worked out well in the past. Code is for machine to execute and no amount of comments embedded in code will replace a proper narrative guide intended for programmers. When reading such comments, I tend to miss the forest for the trees.

Dan Lanovaz (an old colleague of mine & Eliot's) used to say "Don't document the program, program the document" which I like as a pithy way of illustrating how badly the software world does things in general. He also hacked up a neat trick to make a Word doc file go through a compiler such that the code would be seen by the compiler and all the rest was treated as comment. Thus a nicely written design doc could (in theory) actually contain all the code. This is not massively different to some of the things Alan Kay has used for demos over the years.

It's certainly true that code (class/method) comments are not usually a good place for information about the wider system/package, no matter how conscientious the programmer is.

>
> Most documents that have endured in the past (The C Programming book by K&R, anyone?) fall primarily into two types: guides and references.

Maybe you would include them in your list of 'guides' but I'd say there is a third type, the system description; not a bare operation by operation reference but a soldi description of the intent, limitations, usage and ethos of the system.

>
> Examples of the first kind are - Introduction to Morphic, Back to the Future, Etoys Quick Guides. These are difficult, but not impossible, to get off the ground and need support from the code (e.g. for active essays). Whenever a new concept or design is introduced in a release, a chapter/section/glossary should be added to it (even if empty). In Squeak, it is easy to write small narrations as active essays and update them every Squeak release. We do this already in bits and pieces but we need to put all the wood behind a single arrow.

Definitely with your there.

>
> The class comments and terse guide belong to the second category. They can serve to refresh memory but are not substitutes for a proper narrative. Comments like whatIsAPrimitive should be merged into a narrative flow rather than stick out in isolation.

Yup.

>
> While I use Squeak swiki, I feel it is inferior to an in-image guide. Swikis don't let me switch into browsers or inspectors. We could write narrative texts as Help topics and books and use a in-image swiki server to export to HTML on the fly (or produce PDFs for offline reading). Topics can be patched with changesets just like code. An in-image guide and swiki server may add an extra 2-3MB but it would take less effort overall in keeping them in sync with code. Experienced developers can always strip them out from production images if size becomes an issue.

OK, now there we part ways a little. I suspect you're sticking the swiki into a box labelled 'www & browser' which I am going to claim isn't really the case. Yes, the swiki lives on the web and can be accessed by a full blown (and boy, do most of them blow) browser. BUT since the swiki syntax is much simpler, and indeed under our control, we *could* decide to extend the swiki server to return the bare swiki-text and then have a swikibrowser in the HelpBrowser.

This would mean we could render it our way instead of using www circumlocutions. It would have some problems with pointers to outside URLs, obviously. But we really don't need to parse html if we get the swiki-markup text. We could, I think, make a HelpBrowser that reads the input and handles our images and texts and links and whatever. It could read that input from anywhere we like including in-image or online or files included with the release just as we  include i18n translation files.


>
> I am not in favor of placing guides outside Squeak image and using in-image PDF or WWW browser to read them. Browser specifications have become too baroque and complex for any sane implementation. An in-image browser would result in a huge code bloat and divert efforts away from the core product.

Definitely no need for a full html parsing monstrosity. But a swiki-capable browser is much less of a 'thing' - indeed we already have a lot of it in the image I suspect. Consider the Book, TabbedPalette, StackMorph & related morphs.

And of course, tools are great but it's meaningful, up to date, useful, content that is the essential...


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
The world will end in 5 minutes.  Please log out.



Reply | Threaded
Open this post in threaded view
|

Re: self error: 'comment only'

K K Subbu
In reply to this post by Eliot Miranda-2
On 23/03/20 3:29 AM, Eliot Miranda wrote:
> What I think Subbu’s analysis and this scaling problem implies is
> that the Help Browser is a great central location to go to to find
> documentation, but the Help Browser will be better if it is able to
> display class comments and documentation methods as well as its own
> help pages.  My vote is to make the Help Browser multi-modal and
> about indexing tool for accessing help and documentation in as many
> turns as possible, including pointers to web pages and videos.

You're right! HelpBrowser is a great idea with lots of promise. Just as
CodeHolder extends StringHolder to accept and compile code into objects,
we need a HelpHolder be able to accept small text runs (paragraphs and
spans, figures, tags and links etc.) and weave them into a graph. We
could elevate the current comment node into such a holder.

The code holder, through which we accepted structured text, comes with
many facilities (e.g. explain, code completion, senders, etc). We need
similar facilities for accepting parts of help topics (e.g. class/ivars
name changes should be applied not only to code but also to the docs,
generate warnings about refs to deprecated classes/methods, identify
orphan nodes).

The current browser is designed for viewing/editing code. But to change
any large system, one has to build a mental model by studying existing
class hierarchy, instvars and methods and only then move into code-test
cycles. For people who work with Squeak daily, mental model is always
active. But weekend Squeakers like me will need to refresh our mental
models through reading. My typical workflow is - study topic, recall
hierarchy (with its instance vars) and then subclass or modify methods.
The code pane could start with the help topic swiki instead of the code
holder (subclass template).

In short, help topics should be a live and direct view into the object
graph of both machine-readable code and human readable text so every
code is browsed within this larger context. This will reduce most of the
tedium of keeping code and doc in sync.

Regards .. Subbu

Reply | Threaded
Open this post in threaded view
|

Re: self error: 'comment only'

K K Subbu
In reply to this post by timrowledge
On 23/03/20 4:16 AM, tim Rowledge wrote:
> Maybe you would include them in your list of 'guides' but I'd say
> there is a third type, the system description; not a bare operation
> by operation reference but a soldi description of the intent,
> limitations, usage and ethos of the system.

Thanks for making it explicit. Yes, I include them under guide. The
Implementation part of BlueBook is an example.

My email was already too long, so I didn't elaborate further.
Essentially, a guide should help us understand the five aspects of a
system - Principles, Concepts, Facts, Processes and Procedures.
Researchers depend on the first two, programmers on middle three and
field support on the last two.

Principles deal with perpetual invariants in the system (e.g. everything
is an object, class-metaclass). This part does not change from release
to release. These invariants are what makes Squeak squeak ;-).

Facts also deals with invariants but these are subject to change in the
future releases through enhancement, deprecation or obsolescence. E.g.
Character is now an immediate object.

Concepts deals with new features introduced in a release (e.g. jit,
object representation, new bytecodes). Being new, the burden to create
new help nodes will fall on the authors. Others can step in to
interconnect these nodes into the help graph before release.

Processes deal with rules/rationale (why?), choice (tradeoffs) and time
(how? workflows?). E.g. Passwords should not be stored in clear text
(rule), why should ProtoObject be left alone (rationale). why can't we
get all instances of a Character (tradeoffs), how to submit a fix
(workflow). This is the most tedious part of writing help text. But if
other four are taken are of, then many people can step in to ease the load.

Procedures describe the precise steps (what to do) to be taken to
complete an operation (e.g. how to run benchmarks) or to work around
faults and exceptions. Squeak makes it easy to encode these into the
system itself. But if the method name changes, the doc should also be
changed to be in sync.

Regards .. Subbu

Reply | Threaded
Open this post in threaded view
|

Re: self error: 'comment only'

Nicolas Cellier
Hi all,
since Tim raised the subject, let's return to caesar https://en.wikipedia.org/wiki/Literate_programming
Otherwise, what Subbu said makes a lot of sense for me.

Le lun. 23 mars 2020 à 07:14, K K Subbu <[hidden email]> a écrit :
On 23/03/20 4:16 AM, tim Rowledge wrote:
> Maybe you would include them in your list of 'guides' but I'd say
> there is a third type, the system description; not a bare operation
> by operation reference but a soldi description of the intent,
> limitations, usage and ethos of the system.

Thanks for making it explicit. Yes, I include them under guide. The
Implementation part of BlueBook is an example.

My email was already too long, so I didn't elaborate further.
Essentially, a guide should help us understand the five aspects of a
system - Principles, Concepts, Facts, Processes and Procedures.
Researchers depend on the first two, programmers on middle three and
field support on the last two.

Principles deal with perpetual invariants in the system (e.g. everything
is an object, class-metaclass). This part does not change from release
to release. These invariants are what makes Squeak squeak ;-).

Facts also deals with invariants but these are subject to change in the
future releases through enhancement, deprecation or obsolescence. E.g.
Character is now an immediate object.

Concepts deals with new features introduced in a release (e.g. jit,
object representation, new bytecodes). Being new, the burden to create
new help nodes will fall on the authors. Others can step in to
interconnect these nodes into the help graph before release.

Processes deal with rules/rationale (why?), choice (tradeoffs) and time
(how? workflows?). E.g. Passwords should not be stored in clear text
(rule), why should ProtoObject be left alone (rationale). why can't we
get all instances of a Character (tradeoffs), how to submit a fix
(workflow). This is the most tedious part of writing help text. But if
other four are taken are of, then many people can step in to ease the load.

Procedures describe the precise steps (what to do) to be taken to
complete an operation (e.g. how to run benchmarks) or to work around
faults and exceptions. Squeak makes it easy to encode these into the
system itself. But if the method name changes, the doc should also be
changed to be in sync.

Regards .. Subbu



Reply | Threaded
Open this post in threaded view
|

Re: self error: 'comment only'

Squeak - Dev mailing list
In reply to this post by K K Subbu
This is a great discussion.

Regarding Eliot's and Subbu's comments

---- On Mon, 23 Mar 2020 01:23:33 -0400 [hidden email] wrote ----

On 23/03/20 3:29 AM, Eliot Miranda wrote:
> What I think Subbu’s analysis and this scaling problem implies is
> that the Help Browser is a great central location to go to to find
> documentation, but the Help Browser will be better if it is able to
> display class comments and documentation methods as well as its own
> help pages. My vote is to make the Help Browser multi-modal and
> about indexing tool for accessing help and documentation in as many
> turns as possible, including pointers to web pages and videos.



In short, help topics should be a live and direct view into the object
graph of both machine-readable code and human readable text so every
code is browsed within this larger context. This will reduce most of the
tedium of keeping code and doc in sync.

Regards .. Subbu


__------_-----------snip


In Seaside doc, I encabsulate a bit of knowkedge into Doclets .Doclets get their information from anywhere...class comment, Help page, Swiki page, (comments on topics like in stack exchange) and they live in image.

Collecting and storing them is easy,  Per Subbu's point, having them self organize is the key to creating the structures Tim listed in another thread.

The other very important principle is that they are displayable anywhere, and (ignoring security for now). Writable from any where.

I.e. an entry on the swiki becomes a docket in the system and is viewable in the Help Browser and visa versa.

Tl;dr....decouble the knowledge from the presentation, store it in image as its own system, ask it to organize it's doclets to organize themselves conceptually...i.e terse guide, book paragraph, design pattern...Subbu's and Tim's taxonomy.

Presentation and content creation become interface agnostic..Class comment, Help stuff, web based.


Cheers

Tty





Reply | Threaded
Open this post in threaded view
|

Re: self error: 'comment only'

K K Subbu
In reply to this post by Nicolas Cellier
On 23/03/20 12:20 PM, Nicolas Cellier wrote:
> Hi all,
> since Tim raised the subject, let's return to caesar
> https://en.wikipedia.org/wiki/Literate_programming
> Otherwise, what Subbu said makes a lot of sense for me.

Thank you for your supportive words.

LP was a great idea for creating books or articles describing code in
languages like Pascal or C, but it doesn't fit our needs. Times have
changed. Squeak code graph is huge, live and 3D [1]. A static linear
rendering will be woefully inadequate.

[1] Craig Latta's Nexus demo https://youtu.be/xCwidGFkn4Q

I expect a modern guide to be like the guided tours in science expos or
film studios - live, direct, concrete and interactive. It should be
built with the same materials and operated by the same tools (staff) as
the rest of the system.

As Timothy and Tim have pointed out, we already have most of the low
level support (doclets, hypertext, help topics) in place. We need a high
level perspective and design to get them to work together to create a
seamless experience.

Regards .. Subbu

Reply | Threaded
Open this post in threaded view
|

Re: self error: 'comment only'

Eliot Miranda-2


> On Mar 23, 2020, at 9:57 PM, K K Subbu <[hidden email]> wrote:
>
> On 23/03/20 12:20 PM, Nicolas Cellier wrote:
>> Hi all,
>> since Tim raised the subject, let's return to caesar https://en.wikipedia.org/wiki/Literate_programming
>> Otherwise, what Subbu said makes a lot of sense for me.
>
> Thank you for your supportive words.
>
> LP was a great idea for creating books or articles describing code in languages like Pascal or C, but it doesn't fit our needs. Times have changed. Squeak code graph is huge, live and 3D [1]. A static linear rendering will be woefully inadequate.

+1000.  One of the flaws of Literate Programming is that it presents a post-hoc rationalization of the code, not how it actually came to be.  Another is that it is designed to present a program rather than a library.  Documenting an evolving library, that includes executable examples and tests, is a different thing.

Something Alan Kay and I nearly started discussing on Quora is how to write unit tests as both specification and documentation of an API.  This could be literate programming done right.  It doesn’t fit every use case; only certain kinds of API (say sequence manipulation APIs such as includesSubstring:, copyReplace:from:to:with:startingAt:, and arithmetic).  But if the tests are written to be read as a guide one may be able to combine language/api specification with verification and documentation in the same single piece of executable code.

> [1] Craig Latta's Nexus demo https://youtu.be/xCwidGFkn4Q
>
> I expect a modern guide to be like the guided tours in science expos or film studios - live, direct, concrete and interactive. It should be built with the same materials and operated by the same tools (staff) as the rest of the system.

+1000. Somewhat related, see Tudor Girba’s examples extension of unit tests.

>
> As Timothy and Tim have pointed out, we already have most of the low level support (doclets, hypertext, help topics) in place. We need a high level perspective and design to get them to work together to create a seamless experience.

And you, Subbu, have they vision.  I especially liked your characterization of principles, etc, three or do messaged earlier in this thread.  Please push this.

>
> Regards .. Subbu
>

Reply | Threaded
Open this post in threaded view
|

Re: self error: 'comment only'

Nicolas Cellier


Le mar. 24 mars 2020 à 15:55, Eliot Miranda <[hidden email]> a écrit :


> On Mar 23, 2020, at 9:57 PM, K K Subbu <[hidden email]> wrote:
>
> On 23/03/20 12:20 PM, Nicolas Cellier wrote:
>> Hi all,
>> since Tim raised the subject, let's return to caesar https://en.wikipedia.org/wiki/Literate_programming
>> Otherwise, what Subbu said makes a lot of sense for me.
>
> Thank you for your supportive words.
>
> LP was a great idea for creating books or articles describing code in languages like Pascal or C, but it doesn't fit our needs. Times have changed. Squeak code graph is huge, live and 3D [1]. A static linear rendering will be woefully inadequate.

+1000.  One of the flaws of Literate Programming is that it presents a post-hoc rationalization of the code, not how it actually came to be.  Another is that it is designed to present a program rather than a library.  Documenting an evolving library, that includes executable examples and tests, is a different thing.

Agree, I don't think that literate programming perfectly fits very versatile Smalltalk style.
It's just that we cannot avoid to cite the original conceptor.

Something Alan Kay and I nearly started discussing on Quora is how to write unit tests as both specification and documentation of an API.  This could be literate programming done right.  It doesn’t fit every use case; only certain kinds of API (say sequence manipulation APIs such as includesSubstring:, copyReplace:from:to:with:startingAt:, and arithmetic).  But if the tests are written to be read as a guide one may be able to combine language/api specification with verification and documentation in the same single piece of executable code.

I would like to see such thing!
This is the reason why I sometimes tend to write too long tests, like FloatTest>>testCharacterization for the sake of linking the pieces of logic togethers.
I don't know if it is an antipattern (because the failure reports are no more informative if ran by CI bots), but we need some form of narration.
 
> [1] Craig Latta's Nexus demo https://youtu.be/xCwidGFkn4Q
>
> I expect a modern guide to be like the guided tours in science expos or film studios - live, direct, concrete and interactive. It should be built with the same materials and operated by the same tools (staff) as the rest of the system.

+1000. Somewhat related, see Tudor Girba’s examples extension of unit tests.

>
> As Timothy and Tim have pointed out, we already have most of the low level support (doclets, hypertext, help topics) in place. We need a high level perspective and design to get them to work together to create a seamless experience.

And you, Subbu, have they vision.  I especially liked your characterization of principles, etc, three or do messaged earlier in this thread.  Please push this.

+1
>
> Regards .. Subbu
>





12