Monday, November 29, 2004

lab 17 - samterm

NAME

lab 17 - fixup inferno samterm

DESCRIPTION

There's an inferno version of samterm intended for connection to remote sam running on unix/nt/plan9. It looks like it hasn't been updated for the latest tkclient interface. Get it working.

Simple edits to add samtk.b:/^tkcmds/ and samtk.b:/^cmd/

One of the bigger changes I made is to spawn a new proc samtk.b:/^tkproc/ for each file to handle events from the toplevel chan. This was the quickest way I could think of doing it. It might be more correct to create arrays of channels like those already in samterm.m:/Context:/ but that seemed like a lot more work.

I use the idiom of returning the pid samtk.b:711 so I can kill the proc when the file is removed, otherwise the windows would be left hanging around. I added the pid to samterm.m:/pid/

Menus were placed wrongly when middle or right clicking in an edit window. Menu(9) uses post command and takes x y coords. Read bind(9) it should take %X %Y so placement is relative to system screen instead of edit window. samtk.b:51,50

Cut doesn't work. Or rather, paste doesn't work once I've done a cut.

CONCLUSION

Mostly works. I tried some simple edits, opening and closing files. Mount cmd(3) from different machines to get remote connections to sam. All files names are relative to the remote sam of course, not the inferno namespace.

FILES

mkfile sam.b samstub.b samstub.m samterm.m samtk.b samtk.m

Thursday, November 25, 2004

lab 16 - canto

NAME

lab 16 - set up a styx service for active essays

DESCRIPTION

I created a readonly unauthenticated styx service for readers of IPN, who have inferno installed, and want to read the lab notes in acme and execute the embedded scripts. From here on I'll use the term canto for active essays authored and "read" (rather to execute or chant) in the Inferno environment.

This entry in my notebook is my first attempt of the new style. It describes the files and formats of the service.

Mount the service and open acme on the file for this lab.

mkdir /n/canto
mount -A tcp!canto.hopto.org!6700 /n/canto
acme -c1 /n/canto/16/index.txt

Each canto is in a numbered directory containing the following files:

text
the raw contents of the notes in man(6) format
post.html
the text file converted to html using man2html for sending to the blog.
guide
the file containing executable code within acme (see below)
index.txt
the main contents, usually text formatted using man(1).

Instead of embedding possibly long scripts within the main text, they are in the guide file, and at the appropriate point in the text are referenced. Right click on the link and then middle click on the selected text.

guide:/^pi/+1

While reading a canto at least three frames will be open; the index.txt, the guide file containing the executable expressions, and the Errors file containing the output from the scripts. I prefer to run acme with one column which fills half the screen and leave the other half of the screen for windows I open such as shell windows, debugger, task manager, etc.

guide:/^man/+1

The canto directory also contains limbo source code, possibly a mkfile and the executable dis files. The canto will contain links to the source instead of directly embedding samples in the text. E.g.

man2html.b:1

This will open other windows in acme and jump to the point in the code being discussed in the text.

Monday, November 22, 2004

active essay

in the second post to this blog i talked about wanting this lab notebook to be more interactive, with something like mathematica notebook or squeak project in mind. after reading more about squeak, and thinking again of what i want, i'll try and describe how i'll proceed with this notebook.

Alan Kay and Mitchel Resnick have used the term "active essay" to describe a publication that includes computational objects. Resnick describes them as "new forms of narrative expression, in which manipulable computational objects are integrated with text, graphics, and video." Kay in particular stresses the point that the objects in the essay can be deconstructed to learn how to put them together again. The squeak environment uses many visual elements targetted at children for building simulations of ideas they are learning in school--a constructionist view of education for math and sciences.

Kay believes the most important use for modern inexpensive personal computers is that "they form a new kind of reading and writing medium that allows some of the most important powerful ideas to be discussed and played with and learned than any book."

See the essays on education at squeakland.

here are some guiding principles for my notebook (blatantly stolen from other sources.)

  1. express ideas with narrative and programs in ways that are not possible with traditional media.
  2. all ideas can be expressed symbolically. this is the unifying idea of Mathematica. it is so obvious it doesn't seem worth mentioning. but it will require some work to be able to express everything we need to do in an active essay. the mathematica notebook is an expression in the mathematica language.
  3. every object can be deconstructed and reconstructed. provide the source for everything so it can be picked apart, including pictures, sounds, programs. "authoring is always on" -Kay

so the format of the lab notebook will now be presented as if the file is open in acme. text can be selected and executed. i'll make use of references to code using the acme Look format. i'll make use of plumbing to open programs in the system.

acme is a boon for the active essay. already emails on 9fans essentially contain this active element, simple one line shell scripts that a user of acme mail can select with middle mouse button to execute.

inferno already meets most of the above criteria. although, it is not always easy to express some actions in shell, such as window placement and manipulation. as part of the lab i'll be coming across these issues and hopefully solving them to make the authoring simpler.

essential to the idea of the essay is its means of distribution. i'll likely make a styx service available so the lab notes can be mounted and explored. but the simplicity of the format means the essays can be mailed, or just uploaded to the blog, maybe as a tar file with the associated code and files. i'll continue to convert the notes to html and post them to this blog.

related work

IETMs (Interactive Electronic Technical Manuals). the standards for IETMs are used heavily by the military. they include DTDs for SGML or XML documents. there are different levels of implementation of these concepts from static documents, to hyperlinked, to documents that contain computational elements. the focus is on guiding a technician through maintenance procedures rather than on exploring and creating ideas.

WIKIs in general offer the "authoring is always on" principle but do not offer the computational elements. However, the Plan 9 wiki, when edited within acme, does offer the embedded scripts. And then when combined with a mounted file server such as the plan9 sources it becomes a distribution mechanism for active essays.

look at the annotated source by nemo for the plan9 kernel. it contains all the acme references so that it can be read and plumbed to jump to the correct line while reading the source.

Friday, November 19, 2004

squeak

been very busy of late (new baby!) and had no time for inferno programming after work. I hope to get back into some kind of routine within the next month.

TODO list

  • clean up dsp module and write more instruments
  • try out the alphabet typesets with dsp, tickfs, grids
  • write a general btree module for indexes
  • port plan9 sort to inferno
  • ...

Aside from inferno I've been playing with the squeak smalltalk environment. I've been very impressed with this. The morphic interface and etoys scripting is very cool. It got me thinking about how these and other ideas could be transferred to inferno, and then I got into a kind of thought paralysis--I got too confused.

another interesting paper I read yesterday was protium an infrastructure for partitioning applications. i wonder if some ideas for session persistence could be explored within inferno.

i downloaded panda3d a 3d game and simulation engine with python scripting. wouldn't it be cool to link this to inferno as a new interface? the squeak environment mentioned above has moved in a similar direction with croquet.