Re: [9fans] mk time-check/slice issue

2013-12-18 Thread Jason Catena
In part to substitute issues with time with issues with checksums, I am
writing a build tool for Inferno loosely inspired by djb's redo.  I think
it deals nicely with some of the problems of make/mk tools: it handles
multiple outputs, treats shell variables as /env files for dependencies,
and uses the Inferno shell calling small programs, instead of a
domain-specific shell-like language in a build description file.

https://github.com/catenate/credo


[9fans] Credo: Inferno build tool

2013-03-25 Thread Jason Catena
> [Mk] only knows about the rules you give it. It does not
> understand the real dependencies in your software.
> Also, because of this you tend to give it general rules
> which are not always right.

I thirk this might be a good place to mention that I'm
working on a build tool which, in effect, extends and
modernizes the set of pre-written rules the build tool
knows about.  A user can add to the library by writing
a small shell script, which processes a given file.
The type of files which the system generates from
these shell scripts includes the list of dependencies
for a particular file, customized to that file.

This gives an opportunity to automate very fine-
grained dependency detection, written in a general
way and applied to find the dependencies for a
single file.

Of course, the same command (adddep) used to
add dependencies as above can also add them
manually, or add many dependencies found at
once for many files.

Of interest to this group, I wrote the tool in
Inferno's shell sh, and it uses /env to track
dependencies on shell variables, and <{} to
parallelize building dependencies.  I would
appreciate recommendations for a better
way to temporarily lock, or a lock-free solution
to multiple attempts to build the same target.

Finally, if someone wants to actually use it,
I can offer handholding and fast updates of
brokenness.

http://github.com/catenate/credo


[9fans] Watch?

2012-09-18 Thread Jason Catena
Where can I find the Watch command Russ showed in the Acme video?  It
doesn't seem to be in Inferno, in plan9port as far as I could tell, or
noted in the contrib index.

Or is it left as an exercise for the viewer? ;)

Jason Catena



[9fans] make-shells that create a file for you

2012-08-30 Thread Jason Catena
>>> anyway, a meld of Rc shell and mk? crazy idea.

>> Inferno (Vitanuova) released a "mash" a ways back, but apparently the 
>> sources were lost.  It was mind-bogglingly interesting!

> In case anyone's interested (like I was):
> http://www.vitanuova.com/inferno/man/1/mash.html

I kept expecting to see the make-shell act proactively to create a
file, if the shell encountered a reference to a file that did not
exist in the filesystem, but for which it had a matching creation
rule.  For example, presume someone wants to cat a formatted man page
file, but only the .1 sources exist, and the make-shell knows how to
create the file. When the make-shell sees that the user wants to
reference a file that does not yet exist, it will go ahead and create
the file (kind of like how the plumber does things, including creating
new files, based on the patterns it gets).

This completely hides the make step execution, but still allows the
user to (re)define how files are made, and requires integration with
the shell.  On the other hand, mash, as I understand it, forces the
user to type make and a file target.  This to me is not different from
the current way files are made with make tools, so I'm not sure what
was gained by bundling it into the shell.

Of course, the suggested feature does slow down the shell when it
encounters a file that does not exist, since it has to scan through
its rules for a possible creation rule, rather than just exit with an
error.

Jason Catena



Re: [9fans] Heresy alert, Zerox -> Clone

2012-06-09 Thread Jason Catena
Kurt H Maier: Are you claiming it is good through tenure, which is
obviously a fallacy, or are you actually calling this catastrophe of a
standard "great"?

Lucio De Re: You're not offering a comparison, so, yes, I'm calling
it "good".  So, apparently, do innumerable users, again, maybe for
want of a better product.  Twenty years old and no one has success-
fully dislodged it, what would you call it?


Windows.  Tenure and dislodging and number of users don't make
anything more suited to purpose or well-designed. "Great" is subjective
anyway, and better alternatives are usually available.

We've drifted quite a bit from the subject line.

Jason Catena



[9fans] Heresy alert

2012-05-31 Thread Jason Catena
There is a computer science concept analogous to what Zerox does. "Pass
argument by reference" also provides a look-in to a point in memory without
copying it. So if you want to name it something else, try changing it to
CpRef.


[9fans] using Sam idioms with Acme [SAC] Edit

2012-04-26 Thread Jason Catena
Rob DeHart  wrote:
> Jack Norton  wrote:
> > Now, the sam language quick reference card that one 9fan composed long
> > ago... THAT is a great little thing to have handy.  I printed it out but
> > removed the file so I don't have a link handy.
>
> http://plan9.bell-labs.com/sources/contrib/steve/doc/sam-refcard.pdf  seems
> to be the one

I tried out the Sam idioms with Acme [SAC]'s Edit.  These are the ones I got
to work, with the right characters (e.g., ^ instead of ˆ) to make them work.
(The carriage return for  is of course Alt-X 000d).

http://dl.dropbox.com/u/502901/acme-edit-idioms

These are the ones I couldn't get to work as I expected.
I know acme(1) says ! isn't supposed to work.
mail just needs a mail program, which might be Mail.

! date  get current date in sam window
-/ˆ/+#10goto the 10th column in the current line
/(.+0+/ matches blocks of text separated by blank lines
/text/+-p   highlight the lines containing text
> mailsend selection as Email to 
x/0 a/0 double space selection
x/^/ .,/0d  strip C comments from selection

Edit ,x[a-zA-Z]+/{
g/fred/ v/./ c/jim/
g/jim/ v/..../ c/fred/
}   swap fred for jim in file

Jason Catena



Re: [9fans] Go Plan 9

2011-04-05 Thread Jason Catena
leim...@gmail.com:
> r...@swtch.com:
>> What we need is an OS port of Plan 9 to Go that can run hosted on another OS 
>> or natively.
> InfernGo?

Seconded, or at least Acme SAC-n-Go.  I'd rather use Go than Limbo,
and I'd much rather only compile Go executables once.

Jason Catena



[9fans] nb—search and index notes in files by keyword

2010-03-05 Thread Jason Catena
http://swtools.wordpress.com/2010/03/05/nb%E2%80%94search-and-index-notes-in-files-by-keyword/

This isn't complicated, but it hit a sweet spot with me, since I like
to break up information into smallish chunks and index it by keyword.
It collects the keywords into one file per directory, and keeps a list
of all the indexes in a file in $HOME.  It searches all the existing
indexes for the given keyword, then reconstructs the index for the
current directory, so it presents slightly older results fast.  Its
relationship with plan9 is that it's written in rc, and outputs lines
in a /path/file:line format for right-clicking with acme.  I'm posting
it here because I find it really useful, and I wish I'd come up with
it years ago.  The more you put into it the more useful it becomes,
since it's got a fine degree of granularity (the particular keywords
attached to a bit of information) and composability of keywords (just
string a few grep and grep -v after the nb command).

Jason Catena



Re: [9fans] find command reloaded

2010-01-22 Thread Jason Catena
Recursively list only files; grep them with g to get full path,
filename, and line number; protect against John's semicolon trick by
quoting each file.

walk -f | sed 's,^,g '^$1^' '',;s,$,'',' | rc

walk apparently completely omits from its output files with a
single-quote in their names, and does not quote files with embedded
semicolons.  ls lists them both quoted, with the embedded single-quote
doubled.

All this tested in p9p.



Re: [9fans] find command reloaded

2010-01-22 Thread Jason Catena
If looking through code:
du -a . | xargs g pattern >[2]/dev/null

If looking through all files:
du -a . | xargs grep -n foo >[2]/dev/null

The -n is to be friendly with acme.

This presumes you have (at least a cheap knockoff of) xargs.



Re: [9fans] using acme/Mail from plan9port in Linux

2009-12-16 Thread Jason Catena
I followed these excellent instructions to the end (mailfs:
imapconnect: Success) and get this error when I try to button-2-click
Mail in acme.

mailfs: imapconnect: Success
Mail: cannot mount mail: dial unix!/tmp/ns.jdc.192.168.1.102:0/mail:
connect /tmp/ns.jdc.192.168.1.102:0/mail: No such file or directory

mail is indeed not in the namespace directory.  These files are present.

/tmp/ns.jdc.192.168.1.102:0/acme
/tmp/ns.jdc.192.168.1.102:0/factotum
/tmp/ns.jdc.192.168.1.102:0/plumb

What should I run to make it present?  Does mailfs mislead me by
saying it succeeded?

Jason Catena




On Sat, Nov 21, 2009 at 16:27, Mathieu Lonjaret
 wrote:
> On Sat, Nov 21, 2009 at 10:33 PM, Lorenzo Bolla  wrote:
>> Hi all,
>> can anyone point me to a document (if any) that explains how to use
>> acme/Mail to read e-mail in Linux?
>> I couldn't find any useful information in the plan9port distribution and it
>> does not work "out-of-the-box".
>> Thanks for your help!
>> L.
>
> 1) build and install mailfs
> cd $PLAN9/src/cmd/upas/
> mk install
> cd nfs
> mk install
>
> 2) configuration
> cd $PLAN9/log; chmod 666 smtp smtp.debug smtp.fail mail >smtp
>>smtp.debug >smtp.fail >mail
> cd $PLAN9/mail/lib
> edit rewrite
> optionnally edit remotemail
>
> 3) authentication
> factotum
> factotum -g 'proto=pass service=imap server=your.imap.server
> user=you_there !password?'
>
> 4) run it!
> mailfs -t your.imap.server (-t is for tls)
> button 2 exec on  'Mail' in acme (without the quotes)
> (you need the plumber running for everything to work as expected in acme)
>
> hth,
> Mathieu
>
>



Re: [9fans] What do you use plan 9 for?

2009-12-14 Thread Jason Catena
I use acme(-sac) from plan9port as my primary interface to unixes
(Windows).  Specifically, I enjoy its ability to move quickly about
the filesystem, edit files with a pipe through any shell command, and
retain a state of the files and commands (via guide files) I access
for a particular task.  I'm transitioning from LaTeX to UTF8 text
files for documents, especially my notebook: a few hundred "tagged"
files I keep in a dropboxed directory.  Acme makes entering UTF8 very
easy by its lib/keyboard shortcuts (eg, Alt a e), and
src/cmd/devdraw/mklatinkbd to change them, and by bin/unicode to
figure out which characters are which.  I love the plumber to start
programs to process non-textual files.

I use rc/getflags/usage to write better shell scripts at home, and at
work as an implementation layer beneath a ksh interface layer.  I need
ksh as an interface layer because you can't run a hashbang-rc script
without PLAN9 set, and I can't guarantee any coworker has PLAN9 set,
or $PLAN9/bin/9 in his path, or any desire to type
/home/mydir/plan9/bin/9 before each of my scripts.

I use the text processing and filesystem utilities as better versions of same.

I use dc for all of my (especially scripted) calculating needs.

I would like to use Mail instead of Outlook, if like nmh I can pull
files from an Exchange server.  I haven't really looked into this yet,
but it could be a huge win.

I know all this barely scratches the surface of what plan9(port) can do.

Jason Catena



Re: [9fans] tex

2009-12-08 Thread Jason Catena
> I would like to update my installation
> as I think I may be using LaTeX before long.

This doesn't address your issue /per se/, but if you'll indulge me,
I'll ramble a bit about LaTeX and text files.

For the past three years I used LaTeX for everything, including papers
suitable for publishing.  Since I mostly needed LaTeX for special
symbols and peculiar formatting, I decided to now use the full range
of Unicode in text files instead.  I find it's much faster to write,
since I worry less about finely adjusted fonts and layout, I don't
have an edit-compile cycle, and I can grëp all my notes and output.
This way probably wouldn't get a paper accepted at an international
conference for a research operating system, but it seems alright for
my own purposes, and to present information to my colleagues at
work.[1]  The only thing I miss about LaTeX is italics and sidenotes,
but I can /forward slant/ and use footnotes after paragraphs, which is
close enough to serve the same purposes (special, literal, or
foreign-language text, and notes near referring text) without
seriously interrupting the flow of text.

[1] A short text file dumped to a line printer beats, in expository
power, a huge animated powerpoint deck any day.  I don't buy "boring"
or "too complicated" as a good reason to mutilate a technical
discussion.  The point is to /understand/, not buy into a pitch: if
you understand, you'll agree or not on the merits.  If you only think
you understand, and are actually persuaded by me, then we both may
make a bad decision, and my pitch derailed both of us.

> -Steve

Jason Catena



Re: [9fans] grëp (rhymes with creep) and cptmp

2009-11-30 Thread Jason Catena
> it turns out that doing regular expressions is difficult, since
> it's not clear to me what [a-z] should match when unfolded.

I have discovered a truly marvellous proof of this, which this memory
is too narrow to contain.

209 runes in an unfolded a-Ǯ superclass later...
12498: signal: sys: segmentation violation

> - erik

Jason Catena



Re: [9fans] grëp (rhymes with creep) and cptmp

2009-11-30 Thread Jason Catena
> hey, this is great stuff!  i really like the approach.

Thank you.  It evolved from wanting to cut-and-paste character
classes, to automatically applying them to test them.  I suppose the
character classes file could be useful in other applications that
selectively don't want to care about accents.

I added a dash-and-hyphen class, keyed to the hyphen-minus as the
first character (since it's overused), so I had to change the sed
command.

sed '/^\[.+-/d;...

I also now "rm $classes" at the end, of course, though I guess it now
doesn't exit with the exit status of grep.  I should probably save
$status after the grep command, and exit with it.  Or, save the
expanded regex in a new shell variable, rm $classes, then grep with
the new shell variable so the grep is the last command.

> the patterns get really big in a hurry.

Agreed.  Part of grep's job is to be a regex engine, so I thought in
general it would be okay to push it here.

> i played with this a little bit, but quickly ran into problems.

> "reasonable" re size limits of say 300 characters
> just don't work if you're doing expansion.  expanding "cooperate"
> results in a 460-byte string!

Where does this 300-character limit come from?  If you code them by
hand I agree that a 300 character regex could be hard to fully
understand.  The regexes this script generates are very simple in
structure and (ahem) regular, so I'd be inclined to allow them past a
size restriction based on style.  As far as time and space required to
wade through the character sets, I haven't yet run into performance
problems or actual failures in my tests.

$ which grep
/usr/local/plan9/bin/grep

$ wc *|tail -1
  17655  118910  774237 total

$ time grëp Obergruppenfuhrersaal *
wewelsburg:155: (1938–1943): The "Obergruppenführersaal" (SS Generals' Hall) and
wewelsburg:161: floor of the "Obergruppenführersaal" lie on this axis.
 Both redesigned
wewelsburg:180: The "Obergruppenführersaal" (SS Generals' Hall).  On the ground
wewelsburg:181: floor the "Obergruppenführersaal" (literally translated:
wewelsburg:236: castle, in the so-called Obergruppenführersaal
("Obergruppenführer
0.00u 0.03s 0.03rgrëp Obergruppenfuhrersaal 0–31acme 0–31i850 1920s ...

0.03 was the biggest result I got in practice.  The first run had 0.02
user time.  This seems negligible to me, so I'm not yet pushing its
performance boundaries with this string (lots of vowels and other
characters with bigger classes) on this data set (a collection of
notes largely cut-and-pasted from the web).

> - erik

Jason Catena



[9fans] grëp (rhymes with creep) and cptmp

2009-11-29 Thread Jason Catena
I wrote a wrapper around grep to search for words regardless of
accents.  I didn't want to worry about whether I used accents on
characters (I sometimes use them inconsistently, and others decidedly
do), but I still wanted to limit the results to exact matches if I
supplied an accent.  Here's an example run.


$ grep facade word
treatment .  A false, superficial, or artificial

$ grëp facade word
89: to bow to man. façade. circa 1681.  French façade, from Italian
92: treatment .  A false, superficial, or artificial

$ grëp façade *
style:21: crucial difference to pronunciation: cliché, soupçon, façade, café,
wabisabi:51: or the crumbling stone façade of an old building.   Transience,
word:89: to bow to man. façade. circa 1681.  French façade, from Italian


Note that line word:92 (output by the second command) is not output by
the third command, since I supplied an accent on that particular
character (ç) in my input pattern.  I chose the umlaut or diæresis to
remind me that grëp provides the -n option by default, so I'll get a
line number and : in the output.  (I should probably just pass through
all of grep's command-line options.)


=
#!/usr/local/plan9/bin/rc

regex=$1
shift

classes=`{cptmp classes}
sed '/-/d;s,^\[(.),s/\1/\[\1,;s,$,/g,' charclass > $classes

grep -n `{echo $regex | sed -f $classes} $*


I translate each ordinary latin character in the input pattern (eg
[0-9A-Za-z]) into a character class (the attached charclass file,
which doesn't cut-and-paste well), and then call grep with the updated
pattern.  The first sed command in grëp turns the character classes in
charclass into s commands for sed.  The charclass file contains the
square brackets because I also use it to cut-and-paste from when I
need a character class for a sed script.

The script cptmp creates a temporary copy of an existing file, or a
temporary new file.


=
#!/usr/local/plan9/bin/rc
flag e +

if(~ $#TMPDIR 0)
TMPDIR=/tmp
base=`{basename $1}
tmp=$TMPDIR/$base.$USER.$pid

if (test -f $1) {
cp -pr $1 $tmp
}
if not {
touch $tmp
}
chmod +wx $tmp
echo $tmp


Jason Catena


charclass
Description: Binary data


Re: [9fans] OT (again) PERT charts?

2009-11-04 Thread Jason Catena
> Don't make me use MS Project, please...

This web page offers seven years of curated discussion on this (off-)topic.
http://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=76&topic_id=1&topic=

> -Steve

Jason Catena



Re: [9fans] sed question (OT)

2009-10-29 Thread Jason Catena
> Sorry, not really the place for such questions but...

Try stackoverflow.com.  They delight in problems such as these.

> I am trying to capitalise the first tow words on each line

I store the original line with h, and then pull it back out repeatedly
with G to mangle it.
I got far enough to translate "first second ..." to "First s" with this:

h
s/^(.).*/\1/
y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
G
s/^.([^ ]+ ).*/\1/
s/^.([^ ]+)$/\1/
G
s/^.[^ ]+ (.).*/\1/
#y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
#3y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
s/\n//g

There's a couple problems.  (1) It doesn't handle the case with only
one word on a line, because it's hard to tell, later on, that I pulled
out the single word once already. (2) I'd like to put in one of the
commented-out y commands, but (2a) the first uppercases the entire
pattern space, and (2b) the second refers to line 3 of the entire
file, not line 3 of the pattern space.

> -Steve

Jason Catena



Re: [9fans] Two suggestions for ape (was: egrep for Plan9)

2009-10-23 Thread Jason Catena
> What if you just made a command "gnuconfig" which rewrote the
> configure script, fixing the minor defects, and ran the result?

I wrote an rc script (vary
http://codereview.appspot.com/117087/diff/1/2) which generally applies
a sam script to a file (via ssam
http://codereview.appspot.com/95076/diff/9038/10015) and runs the
result.  For configure, it would be called something like

vary -x plan9port.sam configure --configure-opt

which would create a new variation of the configure script, called
configure.plan9port, and run it.

> Tim Newsham

Jason Catena



Re: [9fans] Two suggestions for ape (was: egrep for Plan9)

2009-10-23 Thread Jason Catena
> Jason: I understand your reasoning. However if two small fixes would
> unblock execution of many projects' configure on Plan9 IMHO they are
> worth making; they won't break anything.

I wasn't going to comment again on this, since it's ape's tools, not
the plan9 versions.  I was obviously mistaken in assuming that you
suggested changing plan9's version.

I still personally feel that for plan9 to mean something, additional
options and tools should be considered on their own merits and because
they fit the plan9 philosophy, not because some random tool uses them
and ignores them.  From what's been described here autoconf should not
have the expectation that it gets -i, just to ignore it.  For ape
that's fine, but from what I've had rejected I believe the core of
plan9 is held to a higher standard.

> Dmitry

Jason Catena



Re: [9fans] Two suggestions for ape (was: egrep for Plan9)

2009-10-23 Thread Jason Catena
Dimitry wrote:
> I have two suggestions for ape minor additions arising from my recent
> attempts to run configure scripts on Plan9
>
> These things are needed by autoconf.
>
> Looks like these
> things are hardwired in the autoconf macro library.

Since autoconf should deal with "any" unixy environment in which it
finds itself (that's supposed to be what it does for a living),
shouldn't it be patched to deal with a lack of POSIX grep's -E and
POSIX ls' -i?  In general, as a porting tool, it should not make
demands on the host system for the presence of egrep, or options are
defined by GNU tools (or even POSIX).  Making such demands places
arbitrary limits on how portable the gnu tools are, or any tools using
autoconf.  (Given the FSF's philosophy, this may be intentional.)

POSIX-ls has 23 options to Plan9-ls' 12.  I can't imagine that we'd
add in all the remaining options of ls just because some program or
another uses them.

egrep has 42 options to POSIX-grep's 11 options to Plan9-grep's
different 11.  I can't imagine that we'd change around the meaning of
the 11 options to suit POSIX, let alone add in the extra ones of
egrep.

Take all this with a grain of salt, because I don't speak for any
distribution. :)

> Dimitry Golubovsky

Jason Catena



Re: [9fans] Barrelfish

2009-10-17 Thread Jason Catena
>> One thing complicating this is that make and its common
>> variants aren't smart enough to handle the case where
>> version control systems regress a file and present an
>> earlier date not newer than the derived object.
>
> See cons/scons.

Thanks for the suggestion.  In this project someone actually made that
same suggestion, but rudely—basically insulting the very thought that
someone would be stupid enough to base a build system for commercial
software on make. (Right in line with gnu bias, I thought at the time:
forceful and disrespectful is no way to make change happen, even if
your target was previously inclined your way.)

In any event it's not compatible with the speedup tool we selected.
Which brings up the unnecessary additional complexity of embedding a
dependency analysis and shell-command tool in a general language.  Am
I expected to complicate my project management tool with python, just
to get it to rebuild if a file dependency's date changes at all,
rather than only if the file dependency has a newer date?  What's
wrong with a little language these days?  I don't think python needs a
file system dependency analysis engine any more than make needs a full
language around it.

I'd rather store the date of every leaf file on the dependency tree,
and in the next build delete any objects derived from a file with a
different date.  At least that's a consistent programming metaphor.

Even the academic project managers out there don't try to mind-merge a
general language.  For example, Odin complicates make's syntax and
execution, almost introducing a type system for targets.  This makes
it very tricky to generate and edit makefiles dynamically in an
existing system, since (IIRC) you have to reload the whole ruleset if
you change something.

> Dave Eckhardt

Jason Catena



Re: [9fans] Barrelfish

2009-10-16 Thread Jason Catena
> Instantaneous building of a complex project from source.
> (I'm defining instantaneous as less than 1 second for this.)

Depends on how complex.  I spent two years retrofitting a commercial
parallel make (which only promises a 20x speedup, even with dedicated
hardware) into the build system of a telecommunications product.  In
retrospect, it would have taken less time to write a new build system
with parallelism designed into it, but it seemed less risky to be
incremental.

There are a lot of dependencies in a complex project.  Bundles wrap up
a set of files which include executable tasks composed of libraries
(linked from their own objects derived from source code) and their own
source code: some hand-coded, and some derived from object-oriented
models, lexical analyzers and compiler-compilers, and message-passing
code generators (it can take a surprisingly long time to generate
optimized C code with a functional language).

Compile some of this for an ordinary unixy platform, some for any
platform which supports java, some for systems without a filesystem
where all code runs in the same space as the kernel.  Each unit of
code wants its own options; all code is expected to honor any global
options; build system should not restrict porting code between
platforms with different build processes (or produce any delay in the
schedule at all;).

All of these factors influence the build time of a project, in a
complex web of dependencies, even after you write or modify all the
build tools to be reentrant so you can run them all at once.

The most effective build strategy I've found is avoidance: just don't
build what you don't have to, and make sure you only build something
once.  One thing complicating this is that make and its common
variants aren't smart enough to handle the case where version control
systems regress a file and present an earlier date not newer than the
derived object.

In a nutshell, my experience is that unless developers abandon all the
fancy tools that supposedly make it easier for them to write mountains
of brittle, special-purpose, especially model-generated code, the tool
chain created by these dependencies will defeat efforts to make it run
faster in parallel.  So all your extra processors will only be useful
for running many of these heavy builds in parallel, as you try to have
each developer build and test before integration.

> Sam

Jason Catena



Re: [9fans] where are the results of GSoC 2009 hosted?

2009-10-14 Thread Jason Catena
"we'll post an update here when actual source code produced during
this year's Google Summer of Code has been made available on project
hosting on Google Code."

http://google-opensource.blogspot.com/2009/08/wrapping-our-fifth-google-summer-of.html

Some mentoring orgs already posted results.

http://google-opensource.blogspot.com/



Re: [9fans] Principles of Operating Systems

2009-10-13 Thread Jason Catena
>> I know you said you bought yours for $10, but why is the book $101.60 in
>> the first place?
>>
>> Jake Todd
>
> Why is any college textbook ridiculously priced?

Supposedly captive audience, and a monopoly purveyor.  Usually only
the university bookstore sells the latest edition, which professors
are pressured to use.



Re: [9fans] mishandling empty lists - let's fix it

2009-10-06 Thread Jason Catena
On Tue, Oct 6, 2009 at 14:27, John Stalker  wrote:
>> just write a single combinator that when applied to a command
>> makes it behave in the "no non-flag arguments == dont run" way.
>> Then its just:
>>
>>      l0 cat $args
>>      l0 chmod +x $args
>
>> Tim Newsham
>
> There is also a problem with identifying non-flag arguments.

For the original post's purpose ("commands such as cat, grep etc. do
not handle an empty argument list correctly") we might not have to go
this far.  If these new semantics are meant to process command line
arguments, then they should not be used with the l0 combinator to
process pipe input, which means they won't be called without some
attempt to supply them with arguments after options.  Common cases
where the attempt might provide no arguments would be shell variables
or backticked commands, which are both code that gets further
processed.  We can use this to delay the processing into the
combinator, and not execute the utility command if we have nothing to
do.

So, it should be sufficient to either (1) quote the argument-providing
code in the command line, to delay evaluating it until immediately
before the utility command in the combinator, and if non-nil apply its
output to the utility command; or (2) add some null argument like
/dev/null, depending on the command, in the combinator after any other
arguments, to make it quietly do nothing if the argument-providing
code evaluates to nil in the calling script.

Seems to me we have three different command sets now: one with the
current, traditional semantics which mix argument and pipe input, and
handle missing input inconsistently; a set (listed by John) which
handle no command-line arguments consistently. generally doing
nothing; and a set (listed by Ron) which handle standard input
consistently.  Of the three, Ron's set seems most interesting to me:
(1) if your tools can handle their arguments on standard input, they
ought to cleanly handle the null case too, (2) pipe is a cleaner
notation for passing output along than backtick within backtick within
backtick, and (3) pipes commonly pass multiple lines, not just
separated fields.

> John Stalker

Jason Catena



Re: [9fans] mishandling empty lists - let's fix it

2009-10-06 Thread Jason Catena
The pupils of the Tendai school used to study meditation before Zen
entered Japan. Four of them who were intimate friends promised one
another to observe seven days of silence.

On the first day all were silent. Their meditation had begun
auspiciously, but when night came and the oil lamps were growing dim
one of the pupils could not help exclaiming to a servant: "Fix those
lamps."

The second pupil was surprised to hear the first one talk. "We are not
supposed to say a word," he remarked.

"You two are stupid. Why did you talk?" asked the third.

"I am the only one who has not talked," concluded the fourth pupil.



Re: [9fans] tex on plan 9

2009-10-05 Thread Jason Catena
On Mon, Oct 5, 2009 at 19:40, erik quanstrom  wrote:
> On Mon Oct  5 20:18:06 EDT 2009, rminn...@gmail.com wrote:
>> I'm just now looking at tex on plan 9 and finding that a 14-year old
>> release is not that useful with the newer packages.
>>
>> Has anyone tried newer stuff at all?
>
> i just hate how the rush to use every last new feature
> leads to things like gnu configure and autotools, and
> ancient warhorses like tex no longer running.

The software landscape is an ever-expanding forest of few blazed
trails, thickly covering new continents of human endeavor,
ever-diverging as each and every programmer customizes it to scratch
each itch and make it all more amenable for people less compatible
with a minimalist, elegant toolset mindset.  No gatekeepers, wardens,
librarians, or gardeners can suppress the wild profusion—folly to
try—but here and there a few likeminded souls hoe rows and cut
irrigation channels to cultivate the wild... and bicker about whether
an empty row should lie fallow quietly or pool water in error, and
whether to cut another row to satisfy each end.  That's what makes the
field cultivated, but all the same without commerce with the wild,
without incorporation of new ideas, it becomes a stagnant and hostile
exercise in standards-keeping.

> - erik

Jason Catena



Re: [9fans] mishandling empty lists - let's fix it

2009-10-05 Thread Jason Catena
> If you really want to fix the problem then the sensible thing
> to do would be to write new versions of many utilities, with new
> names, and then write a shell without globbing.  For new scripts
> you would use the new utilities and shell and leave everything
> else as it is.  Is it worth the effort?  That's a question which
> can only be answered by the person who would be doing the work.

I see the point of having utilities handle no-input without failing
and without error output (other than maybe a status to test the case),
when their output is used as input to other utilities, especially as
embedded commands on the command line.  I often use the backtick style
to output into an assignment to *, to separate with $1 etc.  Currently
if a program fails, then instead of no output (maybe ok, depending on
the program) it delivers a noisy error message and an exit status.

This style is not the most common use case: most people mean to change
the state of the system when they run a command, and want to see error
messages when a list turns up empty.  So I'd welcome commands which
behave the new way, and I wouldn't have a problem calling them by
other names.  (My first thought was the suffix 0. You might want to
avoid the prefix g.)

> John Stalker

Jason Catena



Re: [9fans] remedial sources auth, connect, and mount in plan9port

2009-10-02 Thread Jason Catena
Instrumented each return from convM2S.c.

j...@jdc-desktop:/n/sources/contrib/catenate/times$ sudo cp
/home/jdc/contrib/latin1.7a.font .
ap(9cd1a0) + size(b) == p(9cd1ab)
ap(9d0510) + size(52) == p(9d0562)
ap(9d04e0) + size(21) == p(9d0501)
ap(9d02a0) + size(16) == p(9d02b6)
ap(9d02a0) + size(b) == p(9d02ab)
ap(9d0550) + size(5b) == p(9d05ab)
ap(9d02a0) + size(b) == p(9d02ab)
ap(9d0550) + size(5b) == p(9d05ab)
ap(9d02a0) + size(b) == p(9d02ab)
ap(9d04c0) + size(7) == p(9d04c7)
ap(9d04e0) + size(21) == p(9d0501)
ap(9cd1a0) + size(16) == p(9cd1b6)
ap(9cd1a0) + size(b) == p(9cd1ab)
ap(9d0570) + size(5b) == p(9d05cb)
last return
Oct  2 11:47:38.617 read bad packet from 5
n=62 nn=0
ap(9cd7d0) + size(7) == p(9cd7d7)
ap(9cd7d0) + size(7) == p(9cd7d7)
ap(9cd7d0) + size(7) == p(9cd7d7)
ap(9cd7d0) + size(7) == p(9cd7d7)
ap(9cd7d0) + size(7) == p(9cd7d7)
cp: cannot create regular file `./latin1.7a.font': Connection reset by peer

Jason Catena


On Thu, Oct 1, 2009 at 22:11, erik quanstrom  wrote:
>> My test case tries to copy a file over top of one that already exists.
>>  In this case, the bug decided to flit right by the check at
>> convM2S.c:216,217.
>
> i thought the original problem was trying to change
> modes or permissions on a file.  that's why i guessed
> the problem message would be a Rwstat.  perhaps i
> gave the wrong line numbers?  in any event, you're
> doing writes with your current example, so you
> may wish to instrument all the cases in M2S that
> return 0.
>
> - erik
>
>



Re: [9fans] remedial sources auth, connect, and mount in plan9port

2009-10-01 Thread Jason Catena
On Thu, Oct 1, 2009 at 11:22, erik quanstrom  wrote:
>> Every time I do so, either with touch or  chmod for example, I get
>> errors like this:
>>
>> Oct  1 08:52:39.288 read bad packet from 5
>
> add some debugging to 9pserve.c around 'read bad packet'.
> i'm gonna guess (since i don't have time to get p9p auth
> working) that this test has failed src/lib9/convM2S.c:216,217
>
> - erik

I instrumented the code as you suggested.

/usr/local/plan9/src/cmd/9pserve.c:
Msg*
mread9p(Ioproc *io, int fd, int dotu)
{
int n, nn;
uchar *pkt;
Msg *m;

if((pkt = read9ppkt(io, fd)) == nil)
return nil;

m = msgnew(0);
m->tpkt = pkt;
n = GBIT32(pkt);
nn = convM2Su(pkt, n, &m->tx, dotu);
if(nn != n){
fprint(2, "%T read bad packet from %d\n", fd);
fprint(2, "n=%d nn=%d\n", n, nn);
return nil;
}
return m;
}

/usr/local/plan9/src/lib9/convM2S.c:
uint
convM2Su(uchar *ap, uint nap, Fcall *f, int dotu)
{
/* snip */
case Twstat:
if(p+BIT32SZ+BIT16SZ > ep)
return 0;
f->fid = GBIT32(p);
p += BIT32SZ;
f->nstat = GBIT16(p);
p += BIT16SZ;
if(p+f->nstat > ep) {
fprint(2, "erik is the man! p(%x)+f->nstat(%x) > 
ep(%x)", p, f->nstat, ep);
return 0;
}
f->stat = p;
p += f->nstat;
break;
/* snip */
}

My test case tries to copy a file over top of one that already exists.
 In this case, the bug decided to flit right by the check at
convM2S.c:216,217.

j...@jdc-desktop:~$ 9 factotum
j...@jdc-desktop:~$ srv -a sources.cs.bell-labs.com

!adding key: role=client proto=p9sk1 dom=outside.plan9.bell-labs.com
user[jdc]: catenate
password:
!
j...@jdc-desktop:~$ sudo 9mount -i
'unix!/tmp/ns.jdc.192.168.1.101:0/sources.cs.bell-labs.com' /n/sources
[sudo] password for jdc:
9mount: mount: Not a directory
j...@jdc-desktop:~$ ls /n/sources
/n/sources
j...@jdc-desktop:~$ sudo 9umount /n/sources
j...@jdc-desktop:~$ sudo 9mount -i
'unix!/tmp/ns.jdc.192.168.1.101:0/sources.cs.bell-labs.com' /n/sources
j...@jdc-desktop:~$ ps ax|grep 9ps
10426 pts/3Sl 0:00 9pserve -u unix!/tmp/ns.jdc.192.168.1.101:0/factotum
10586 pts/3Sl 0:00 9pserve -u -M 8192 -A  0
unix!/tmp/ns.jdc.192.168.1.101:0/sources.cs.bell-labs.com
10603 pts/3R+ 0:00 grep 9ps
j...@jdc-desktop:~$ cd /n/sources/contrib/catenate
j...@jdc-desktop:/n/sources/contrib/catenate$ cd times
j...@jdc-desktop:/n/sources/contrib/catenate/times$ ls
latin1.7a.font
j...@jdc-desktop:/n/sources/contrib/catenate/times$ ls ~/contrib
acme  guide  latin1.7a.font
j...@jdc-desktop:/n/sources/contrib/catenate/times$ sudo cp
/home/jdc/contrib/latin1.7a.font .
Oct  1 21:52:45.219 read bad packet from 6
n=62 nn=0
cp: cannot create regular file `./latin1.7a.font': Connection reset by peer

Jason Catena



Re: [9fans] remedial sources auth, connect, and mount in plan9port

2009-10-01 Thread Jason Catena
On Thu, Oct 1, 2009 at 05:31, sqweek  wrote:
> 2009/10/1 Ethan Grammatikidis :
>> On Thu, 1 Oct 2009 04:50:40 -0500
>> Jason Catena  wrote:
>>> $ ls -lad
>>> drwxrwxr-x 1 4294967294 4294967294 0 2009-09-30 23:11 .
>>
>> You have numbers for user and group names there.  Un*x likes the
>> numbers, but plan 9 wants strings.
>
>  Yeah, I suspect at this point the linux kernel is denying the
> operation based on its idea of permissions. there's a v9fs mount
> option you might try... I forget what it is exactly but 9mount -i does
> it :)
>  Try:
>
> 9mount -i 'unix!/tmp/ns.jdc.192.168.1.101:0/sources.cs.bell-labs.com' 
> /n/sources

This does mount, and let me write into my directory, thanks!

Every time I do so, either with touch or  chmod for example, I get
errors like this:

Oct  1 08:52:39.288 read bad packet from 5

I can 9umount and then 9mount again for my next write operation as root.

Oddly enough, cp does not throw the error.  I can cp fine, then touch
gives me this

$ sudo touch that
[sudo] password for jdc:
Oct  1 10:20:25.502 read bad packet from 6
$ ls
ls: cannot open directory .: Input/output error

I unmount and remount and then I can cp again.

$ cd -
/home/jdc
$ sudo 9umount /n/sources
[sudo] password for jdc:
$ sudo 9mount -i
'unix!/tmp/ns.jdc.192.168.1.101:0/sources.cs.bell-labs.com' /n/sources
$ cd -
/n/sources/contrib/catenate
$ sudo cp /home/jdc/contrib/latin1.7a.font .
$ ls
lsguide  latin1.7a.font  that  this

So all the files get there, it's just annoying to have to
unmount/remount, and to have everything owned by root.

$ ls -la
total 2
-rw-r--r-- 1 root root  62 2009-10-01 08:59 guide
-rw-r--r-- 1 root root 577 2009-10-01 10:21 latin1.7a.font
-rw-r--r-- 1 root root   0 2009-10-01 10:20 that
-rw-r--r-- 1 root root   0 2009-10-01 08:49 this

> -sqweek

I also tried Abhishek's command also, but still got "permission denied".

Thanks everyone for your help.

Jason Catena



Re: [9fans] remedial sources auth, connect, and mount in plan9port

2009-10-01 Thread Jason Catena
Thank you very much, Venkatesh.  All the commands work (don't fail) as
you gave them.  I still get the same permission-denied error I got
before.  I can see it, but am not allowed to write to it.

$ 9 factotum
$ srv -a sources.cs.bell-labs.com

!adding key: role=client proto=p9sk1 dom=outside.plan9.bell-labs.com
user[jdc]: catenate
password:
!
$ sudo mount -t 9p
/tmp/ns.jdc.192.168.1.101\:0/sources.cs.bell-labs.com /n/sources -o
trans=unix
[sudo] password for jdc:
$ cd /n/sources/contrib/catenate
$ ls -lad
drwxrwxr-x 1 4294967294 4294967294 0 2009-09-30 23:11 .
$ touch this
touch: cannot touch `this': Permission denied
$ ls `namespace`
acme  factotum  plumb  sources.cs.bell-labs.com

Jason Catena


On Thu, Oct 1, 2009 at 02:44, Venkatesh Srinivas  wrote:
> Hi,
>
> In order to construct an authenticated mount of sources, you will need
> to start factotum, use srv -a to create an auth-ed connection to the
> server and to "post" it, and to mount the "posted" connection.
>
> (assuming you have a working plan9port install and are on a unix):
> $ 9 factotum
> (start factotum in the current 'namespace'. p9p's current namespace is
> the value of the NAMESPACE environmental variable).
>
> $ srv -a sources.cs.bell-labs.com
> (I am prompted for my userid and password on the server)
> user[venkatesh]: 
>
> [mount step; I use v9fs.You will have to adapt if you're using 9pfuse or 
> 9mount]
> $ sudo mount -t 9p $NAMESPACE/sources.cs.bell-labs.com  -o 
> trans=unix
>
> Good luck,
> -- vs
>
>



[9fans] remedial sources auth, connect, and mount in plan9port

2009-09-30 Thread Jason Catena
Geoff was kind enough to provide to me a contrib directory on sources,
so I'm now trying to write into it.

I can't seem to get the hang of the authorization, connection, and
mount steps necessary for an authorized mount of sources in plan9port,
so I can just copy files into my contrib directory.  Over several
dozen attempts to understand factotum, it never saves any actual data
for me, so I apparently have some serious misunderstandings.

For the mount, I can use the following to mount sources read-only, but
I can't save anything into it.
sudo 9mount 'tcp!sources.cs.bell-labs.com' /n/sources

9fs sources also doesn't seem to provide an authenticated connection,
or a mount.

Would someone be kind enough to chant the few magic plan9(port)
incantations with which I can store my sources-server username and
password with factotum, connect to sources, and mount sources
(specifically, my directory) as a writable filesystem?   I promise
diligent study, to understand what the commands do.

Jason Catena



Re: [9fans] acme without a heavy grid (SFW)

2009-09-30 Thread Jason Catena
On Wed, Sep 30, 2009 at 15:43, Jack Norton  wrote:
> Jason Catena wrote:
>> A quick edit frees acme from its "heavy grid prison", a la Tufte.
>> https://dl.getdropbox.com/u/502901/acmenogrid.jpg
>
> How about no grid whatsoever (while you're at it)?

I believe in a subtle or invisible grid to lay out text in columns,
divide columns into files, directories, and output, and whitespace to
separate them.  I seek to minimize, not deconstruct.

> There is plenty of contrast there to forego any kind of hard devisions.

I agree that all you really need are left-justified columns of text to
show a grid (eg a newspaper).  The remaining structural elements
(dirty button, scroll bar) are functional, so it would change acme too
much to remove or hide them, and would be counter-productive.

I used wily for a few years and took out the heavy black horizontal
and vertical window lines from it as well.  In comparison, Rob's color
scheme provides much better separation of tags and windows, so
removing them has less effect on the interface.

> However, I end up with the same conclusion: why?

To increase the ratio of visible, contrasting pixels used to indicate
data, program state, and commands, to pixels used to dress the screen.

> Is the 'grid' that distracting?

The black lines around each window currently have the most contrast
(black on beige and light blue), and largest scope (right to left, top
to bottom) of any element on the screen.  By giving them the least
contrast (white on beige and light blue), text and commands become
more prominent.  The lack of lines between tags serves as leading
(vertical space between horizontal lines), making each tag easier to
read.

> Also, if you have two text files open side-by-side, and your
> lines are long enough to wrap, you would have a glob of incomprehensible
> text in the middle.

I did not remove the scroll bars or dirty bits, which serve as gutters
between columns.  I agree that without them, run-on text in adjacent
columns would be very difficult to read.  Fortunately, their
functionality makes them easy to keep.

> I think at least a moderately thick grid is a necessary evil.

I agree that you have to have a grid.  I think we disagree on how
heavy and obvious you make its structural lines.

> -jack

Jason Catena



[9fans] acme without a heavy grid (SFW)

2009-09-29 Thread Jason Catena
A quick edit frees acme from its "heavy grid prison", a la Tufte.
https://dl.getdropbox.com/u/502901/acmenogrid.jpg

Jason Catena



[9fans] nice appearance to Times font with accented characters (in acme)?

2009-09-28 Thread Jason Catena
My try (times/latin1.7a.font) could be improved.  It does actually
display accented characters (from pelm/latin1.8) interspersed with
unaccented letters in the Times font.  But it's a bit like a ransom
note, or the Cyrillic font I designed and poked into my C64 in middle
school: the baseline of the accented characters is a pixel or two
higher than the baseline of times letters.  Is this about as good as I
can expect, or could anyone suggest a better composition?

17  12
0x  0x0001  ../lucsans/lsr.12
0x0001  0x009F 1R.7.1
0x00A0  0x00FF 0xA0 ../pelm/latin1.8
0x0100  0x017E  ../pelm/latineur.8
0x0250  0x02E9  ../misc/ipa.8
0x0370  0x03F5  ../misc/greek.8
0x0400  0x0475  ../misc/cyrillic.9
0x2000  0x2044  ../misc/genpunc.8
0x2070  0x208E  ../pelm/supsub.8
0x20A0  0x20AC  ../pelm/currency.9
0x2190  0x21EA  ../misc/arrows
0x2200  0x227F  ../misc/math1
0x2280  0x22F1  ../misc/math2
0x2300  0x232C  ../misc/tech
0x2500  0x257F  ../misc/chart
0x2600  0x266F  ../misc/ding
0x2700  0x27BF  ../misc/zapf
0xfee0  0xff5e  ../pelm/latin1.8
0xFFFD 0xFFFD 0x80 ../pelm/latin1.8

I'd like to keep using Times since I think the letter-forms look
better than the default Lucida (there's no "bit" directory, so which
file actually defines the default euro.8.font plan9port-acme uses?),
but are not so small as palatino/latin1.6.font (7 & 8 get clipped).

Jason Catena



Re: [9fans] linux stats in last year from linuxcon

2009-09-22 Thread Jason Catena
> There were no proofs about the behavior of the C compiler or the underlying 
> cpu.

In related news, there is a verified Clight compiler out there for
PowerPC machines.

Leroy, X.  2009.  Formal verification of a realistic compiler.
Commun. ACM 52, 7 (Jul. 2009), 107-115.  DOI=
http://doi.acm.org/10.1145/1538788.1538814

This paper reports on the development and formal verification
(proof of semantic preservation) of CompCert, a
compiler from Clight (a large subset of the C programming
language) to PowerPC assembly code, using the Coq proof
assistant both for programming the compiler and for proving
its correctness. Such a verified compiler is useful in the
context of critical software and its formal verification: the
verification of the compiler guarantees that the safety properties
proved on the source code hold for the executable
compiled code as well.

> Tim Newsham

Jason Catena



Re: [9fans] Chaucer on 9fans

2009-09-13 Thread Jason Catena
Eris discordantly quoted, from a Pink Floyd song
(http://en.wikipedia.org/wiki/Several_species), "an account of the
famous defeat of Mary Queen of Scots at the battle of Langside that
took place in the 16th Century."  Here's a translation and analysis of
the full text, written in a Scottish dialect on the other side of the
great vowel shift from Chaucer's middle English.

http://blogs.myspace.com/index.cfm?fuseaction=blog.view&friendId=116217231&blogId=178646624

(Sorry for contributing to off-topic-ness.)

Jason Catena



Re: [9fans] nice quote

2009-09-09 Thread Jason Catena
Skip intoned:
>> anyone written any software recently?
>
> i've been; though mostly in rc. in the process i (re)discovered this
> idiom:
>
> doing=`{ifs=/ echo `{echo /talking/about/it/is/more/fun}}
> echo $doing

*=`{ifs=/ echo `{echo /talking/about/it/is/more/fun}}
echo $3 $4 doing that $6 $4 $2

Put that in bash's pipe and smoke it.

Jason Catena



Re: [9fans] nice quote

2009-09-09 Thread Jason Catena
> anyone written any software recently?

I wrote ssam, a stream interface to sam, and its man page (ssam.1,
from sed.1) for (at least) plan9port.  It's still under review.

http://codereview.appspot.com/95076/show
latest ssam is patch set 8
latest ssam.1 is patch set 9

I also have a little script called vary (not published yet) which
takes a sam script and another file, applies the sam script to the
file, saves it with a new name, and optionally executes it.  So you
don't have to maintain many nearly-identical scripts.  I should upload
vary to the same patch set soon, for review.

Jason Catena



Re: [9fans] nice quote

2009-09-05 Thread Jason Catena
Hailed Eris:
> I was alluding to the expressive power of C versus LISP considered with
> respect to the primitives available on one's computing platform and
> primitives in which solutions to one's problems are best expressed.

I think one of the reasons there exists little languages, and cliches
such as "the right tool for the job", is that the "primitives
available on one's computing platform" are very often not the
"primitives in which solutions to one's problems are best expressed."
In this respect rating the "expressive power of C versus LISP" depends
very much on the problem domain under discussion.

For "systems programming", C has the advantage in both practice (use
in running systems) and theory: processes which take a lot of system
resources to execute also tend to take a lot of C code, whereas in
most higher-order languages, things which represent high-level
runtime-consuming abstractions tend look little different than simple
bit-level operations.  The difference is one of approach, I guess:
whether you want to write optimal code yourself, and see what the
machine is doing, or trust the compiler to find a good way to
translate to machine language and run (in real-time) your
efficient-to-code higher-order functions.  The better the translation
from the higher-level language, the more this difference becomes a
matter of taste, programming style, availability of programmers, and
the body of domain knowledge already represented in language
libraries.

I would like to see Haskell fill C's niche: it's close to C's
execution speed now, and pure functions and a terse style gives real
advantages in coding speed (higher-order functions abstract common
"patterns" without tedious framework implementations), maintainability
(typeclasses of parameters in utility functions means you don't write
different implementations of the same function for different types,
yet preserve type compatibility and checking), and reliability (pure
functions don't depend on state, so have fewer moving parts to go
wrong).

Jason Catena



Re: [9fans] nice quote

2009-09-04 Thread Jason Catena
Hailed Eris:
> One serious question today would be: what's LISP _really_ good for?

It's not LISP, but I've found Haskell good for writing terse code that
works.  Once you get your code past the type checker, it's likely to
just work for the forseeable future if it's pure.  Most tricky code
ends up pure, since the transforms are usually the more extensive,
interesting, and clever (ie difficult to debug) part of a (especially
pipeline-based) program.

I don't really care that a language is or is not close to the machine,
if the compiler (ie GHC) gets it in the same order of magnitude
runtime as C.  In fact, I'd rather manipulate lists with higher-order
functions, and just get the job done, than hack around with this
year's new idioms to make C all things to all people.  Best tool for
the job and all that: C has a great niche as an OS language, but
sometimes it's better just to write less, more stable code (eg xmonad
vs any C-based window manager).

Jason Catena



Re: [9fans] Compiling plan9port under Mac OS X 10.6

2009-09-03 Thread Jason Catena
On Thu, Sep 3, 2009 at 04:53, plus 852 wrote:
> CC9=gcc -m32 to a $PLAN9/LOCAL.config file, but when running ./install
> I ended up with a variety of the following errors:
>>>> /Users/--/plan9/config: line 1: -m32: command not found

If LOCAL.config is a shell script, then the shell interprets "CC9=gcc"
as setting a shell variable named CC9 to gcc, and -m32 as the name of
an executable file to run.  For example:

; CC9='gcc -m32' echo $CC9
gcc -m32

In the shell, you have to use quotes when you have a space in a
variable's value.  In makefiles you don't.

Jason Catena



Re: [9fans] nice quote

2009-09-03 Thread Jason Catena
> If the language can't be explained in 50 pages, it's no good.

If it's not possible to clearly describe the core of a computer
programming language in fifty pages, then it has probably been
embellished with features, unnecessary to the language proper, to help
it compete in the lame one-size-fits-all strand of programming
language debate.  In this respect Perl is a cautionary example, having
no coherent core that I could tell, just a cobbled-together collection
of features intended to try to replace single purpose programs. (But
then again, "those days are dead and gone and the eulogy was delivered
by Perl.")

Jason Catena



Re: [9fans] Using Guide Files

2009-08-11 Thread Jason Catena
> Given how useful and important it is to have Edit in the tag of text
> windows, is there some reason that it isn't there automatically?

Probably to avoid temptation for files you shouldn't, and see at a
glance which files you edited and saved (since the dirty bit will be
clear).

>        thanks,
>        Peter Canning

Jason Catena



Re: [9fans] Using Guide Files

2009-08-10 Thread Jason Catena
> Find it in the forum.

A search for "Run title" uniquely found Russ' post.
http://9fans.net/archive/2009/06/138 (Well, it did until this post.)
Once I installed Run and studied Russ' illustration, I can set up my
own commands, thanks.

In acme I highlight some text to process (filenames, data, whatever);
highlight (if not already) in the guide file a command that (with
xargs' help) takes stdin, and its carriage return; highlight the name
of the guide file and 2-1 it to |Run or >Run in the tag of the first
window.

wily simplifies this particular operation a bit, by bringing it inside
the program: the name of the guide file (or scratch buffer containing
commands) is not highlighted by the user.  In wily, I'd highlight the
text to process, 2-highlight the command (with | or >) to run on it
(with or without a carriage return) if not already highlighted, then
chord-1-and-release to execute the command.

Jason Catena



Re: [9fans] Using Guide Files

2009-08-10 Thread Jason Catena
> I can have that '|fmt -w 72' anywhere in any window, but other than
> where my text is. I ensure I have 'Edit' in the tag line of the text
> window. I highlight the text I want be formatted. I go to the window
> with the command, |fmt -w 72. I highlight that. I go back to the Edit
> in the text's window. I 2-1 chord on that Edit. And it does do, what
> you want. Or not? Where is the trouble?

And so it does.  I assumed I could only use Edit in conjunction with
sam commands, but apparently Edit (or at least its author) is smarter
than that.

I assume Run works similarly? That is, I can put Run in a directory's
tag, highlight a filename in that directory, then highlight a command
and apply it to Run with 2-1 to run the command on the file?

> Ruda

Thanks, I'm a happier acme user now.

Jason Catena



Re: [9fans] Using Guide Files

2009-08-10 Thread Jason Catena
> just run the command in the context of some
> arbitrary window.

Wily does this.  The 2-1 chord uses the context of the object applied
to the command, rather than the command.

This makes commands like New useful from the top of a column.  When
you type in a new file name in its directory, highlight the name,
apply it with 2-1 to New atop the column, then a new file is created
in the directory where you selected the new filename, not the
directory from which you started acme.

This also makes centralized guide files more useful: you can write a
command once for very many directories.  When you select a file in a
directory window, and apply it to the single, centralized guide file
in a different directory, the command runs in the selected file's
window rather than the guide's.

After switching to acme, I've say that if you can write a guide file
into the directory you're working with, you end up with smaller guide
files, which usually works faster.  However, with directories you
can't write to, you have to store the guide somewhere else, which
means you have to copy the command into the context you work with to
apply it to a selection in that directory's window.  With commands
that apply across a directory tree (eg version control), this can
result in some duplication, which means if you change an idiom you
might end up updating all its guides (or inadvertently use the old
idiom).

Edit can apply a sam command (which selects its range) to the entire
file.  Run can apply a shell command to a directory, or directory
context of a file.  But in each case, you can't select a range of text
or a file name within the window to use as the target of the
operation, since you're using the select-appy operation to figure out
which command to do.

For example, I often run "|fmt -w 72" to justify a paragraph in a text
file.  With wily, I can highlight text in any window, and justify the
text from one copy of the command stored in any guide file.  With
acme, I can't apply this command to highlighted text until I copy the
command to the particular window (tag or body) that needs it.  I can't
even use it from a guide file in the current directory: if I sweep
some text in a window, then apply that text to a pipe command in a
guide file in the current directory, the pipe command runs against its
own line in the guide file.

So from the standpoint of having used Wily for years, acme requires
more cutting and pasting, and some commands don't seem directly useful
in place.  For example, to use New without copying it somewhere else
or retyping it, you must know and type (or get on the screen in some
way) the path between the directory where you started acme and the
directory where you want the file.

Jason Catena



Re: [9fans] 9base-3

2009-08-07 Thread Jason Catena
In recently-updated Cygwin (under WinXP), I got several dozen of these
warning types ...

In file included from regex/regcomp.c:2:
./regexp9.h:8: warning: weak declaration of '__p9l_autolib_regexp9'
not supported

... before a compile error ...

regex/regcomp.c: In function `regcomp1':
regex/regcomp.c:487: error: invalid lvalue in unary `&'
regex/regcomp.c:487: warning: implicit declaration of function `p9setjmp'
make[1]: *** [regex/regcomp.o] Error 1
make[1]: Leaving directory `/cygdrive/d/Profiles/cjc040/opt/src/9base-3/lib9'
make: *** [all] Error 2

... with this code (line 487 is the if line).

if(setjmp(regkaboom))
goto out;

This project is welcome, for two reasons significant to me.  A minimal
subset of the scripting tools means I can stop maintaining ksh scripts
for machines that I don't want to install plan9port on (eg lab
machines I won't use often.)

For me, plan9port won't extract fully from its tar file (even if I
extract and repackage it) on my brain-dead Windows+Cygwin laptop at
work.  The plan9port distribution works fine on a Linux machine, so I
assume it's Cygwin (I do have enough disk space free).  Maybe I should
try hg when I'm not behind the firewall, to download the whole
distribution file-by-file.

Jason Catena



Re: [9fans] Acme Configuration

2009-08-07 Thread Jason Catena
On Fri, Aug 7, 2009 at 12:23, yy wrote:
> 2009/8/7 roger peppe :
> Contents of all the taglines
>
> i have lost precious one-liners in column headers.

Didn't copy them into guide files in the current directory?  Seems to
work just as well for file commands, if not edit commands (which just
need copied back).

>> - Dump would dump to the restored-from file rather than
>> $home/acme.dump by default.

I put "Dump /where/ever/dumps/go" in the top tagline and highlight it,
works well enough for me.

> very good judgement is needed to accept or reject acme patches.

I can definitely attest to this principle in my own work.  In terms of
apprentice/journeyman/master for a particular program: the apprentices
write a lot of code, most of which is thrown away to get to a few good
ideas; the journeymen refine ideas into something worthy of a patch,
and may own a subsystem; and the master vets all code for
architectural coherence.  These roles vary by code base: I'm
apprentice of Plan 9, master of a 10-year-old build system.  I can
transfer some knowledge and skills, but still need to learn the
conventions and architecture before suggesting any dramatic (indeed,
noticeable) change.

Jason Catena



Re: [9fans] Acme Configuration

2009-08-07 Thread Jason Catena
I keep many dump files around with different names, to easily suspend,
switch, and resume acme configurations depending on what I need to
work on.  This significantly reduces my context switch time, over and
above the advantage I get from guide files keeping me from
(mis)retyping commands.

in acme: highlight and execute "Dump /home/me/dump/whatever"
in shell: rum "acme -l /home/me/dump/whatever"

Jason Catena



Re: [9fans] contrib dir

2009-08-06 Thread Jason Catena
Hi Geoff,

I would also like to request a directory in sources/contrib, to store
a stream wrapper around sam (ssam), a script which uses mk to
parallelize a command over a set of arguments (apply), a script to
port ksh/bash scripts to rc (torc), et cetera.  Many thanks.

Jason Catena (jdc)



Re: [9fans] unsuscribe

2009-07-27 Thread Jason Catena
And gets all the cleverest guys.  Sometimes they're a bit full of
themselves, and they don't cruise the highways normally (they'd rather
teleport), but they know all the neatest party tricks.


Re: [9fans] unsuscribe

2009-07-27 Thread Jason Catena
On Mon, Jul 27, 2009 at 14:36, root wrote:

> unsuscribe
>
>
I guess Unix isn't interested in Plan 9 anymore.
Jason Catena


Re: [9fans] plan9port behind corporate firewall with no DNS or port access

2009-07-24 Thread Jason Catena
On Fri, Jul 24, 2009 at 23:35, andrey mirtchovski wrote:

> Just checking: have you tried accessing it by IP address
> (204.178.31.8) rather than hostname? (this, of course, assumes that
> you've ruled out a bad ndb configuration as the reason).
>

traceroute can't get to that IP address, so I'm pretty sure the corporate
firewall is doing its job.


> how about trying with a 9p client such as cl.py from your "normal" machine?


Bleh, its python doesn't have 9P.

I think I'd rather spend my time trying to figure out how to get a
sources/contrib dir and mount it on my home Ubuntu machine.  Whom do I ask
very nicely for that?


[9fans] plan9port behind corporate firewall with no DNS or port access

2009-07-24 Thread Jason Catena
At work I sit behind a corporate firewall which neither knows
sources.cs.bell-labs.com nor would provide me direct access to its ports if
it did.  I can get out through http proxies (eg curl).  Is there any way to
mount sources through this kind of static, or should I resign myself to only
seeing sources from my home computer?

9fs sources
srv: dial tcp!sources.cs.bell-labs.com!9fs: unknown host
sources.cs.bell-labs.com
9fs: exit 1

Jason Catena


Re: [9fans] iwp9 updates

2009-07-24 Thread Jason Catena
Sorry, didn't mean to imply one should vary from the conference's writ.
Jason Catena


Re: [9fans] iwp9 updates

2009-07-24 Thread Jason Catena
To complicate the answer: there's an effort to make article and book styles
along the lines of Tufte's books.  Sidenotes, Palatino and Bera Mono fonts
(I use Inconsolata for both paper code segments and in Acme), and shallow
sectioning without numbers.
http://code.google.com/p/tufte-latex/

Jason Catena


Re: [9fans] Does "as little software as possible" include a modern browser?

2009-07-23 Thread Jason Catena
On Thu, Jul 23, 2009 at 04:48, C H Forsyth  wrote:

> >I hope the services I want to use (will) have a non-browser API (eg
> Twitter).
>


> in fact, since a browser must ultimately send messages, it's not clear
> what a `browser API' would look like.


Many AJAX and image-map interfaces wouldn't mean much outside a graphical
interface that displays the pretty pictures and maps how the user interacts
with them back to the server. Evernote, for example, would be easier to
render to the user and mount as a filesystem than Google maps.  I'm just
wondering whether it seems enough without good support for the latter kind
of (currently) browser-based interaction.


Re: [9fans] Does "as little software as possible" include a modern browser?

2009-07-22 Thread Jason Catena
On Wed, Jul 22, 2009 at 18:19, Charles Forsyth wrote:

> >if there is no real browser for the platform,
> >how will Plan 9 participate in the "cloud computing" (r)evolution?
>
> not using a browser.
>

Fair enough.  I hope the services I want to use (will) have a non-browser
API (eg Twitter).

Jason Catena


[9fans] Does "as little software as possible" include a modern browser?

2009-07-22 Thread Jason Catena
This passage seems to me to speak to the minimal spirit in Plan 9.

"... the best choice of software is often no software -- and barring that,
as little software as you can possibly get away with, and even then, only
from the most reputable and reliable sources."


http://www.codinghorror.com/blog/archives/001289.html


I'd add that you need a way to combine what little you have with other
little bits, to build up a new, custom tool that does what you want at this
moment.

I like the part about bluescreening the city block, but hope we're past the
point where anyone would seriously think of wiring Windows that deeply into
the fabric of our real-world systems.  I like to think Vista broke the
upgrade spell, and remote computing will anyway make desktop OS choice
mostly irrelevant.

Which brings me to repeat a question about Plan9, from another thread: if
there is no real browser for the platform, how will Plan 9 participate in
the "cloud computing" (r)evolution?  I suppose it would be enough to have a
Chromium port, if Chrome and the Chrome OS gain traction.

Jason Catena


Re: [9fans] dcp - a deep copy script, better than dircp

2009-07-20 Thread Jason Catena
I've been thinking for a while that I don't quite like directories, as
organizing metadata.  Too restrictive: you can only really choose one place,
to find something you already have to know where to look (or search through
everything), and if you choose long, comprehensible names, your unique set
of metadata to find a file becomes very long.

Consider, by contrast, a service like Evernote.com (KPhotoAlbum also does
tags well, and delicious.com for web pages).  It has folders, yes, but
what's better is that it lets you assign keywords to the note (really just
arbitrary textual (or other) data).  The note's topic is in essence the
combination of all the keywords, so if you are interested in one of those
keywords in the future, looking for the keyword (or some combination of
keywords) would list all the notes with those keywords attached.

I think the latter approach would produce a more usable, less frustrating
filesystem than the former.

Jason Catena


Re: [9fans] first timer - editing plan9.ini

2009-07-19 Thread Jason Catena
The advantage of Acme is that there isn't much learning: all the commands
are obvious (eg Put writes back to disk), but you do have to learn the mouse
clicks to execute them.

I use sed's language constantly, and look forward to expanding my bag of
tricks with sam.  Stream editors are without-a-doubt the most useful tool I
have for editing files, because I can write scripts that edit them for me.

I found that sam had a limiting command-line interface, so I wrote a script
around it (ssam) that gives at a more sed-like stream-editing interface: -e
accepts a (series of) sam commands; -f accepts the name of a file with sam
commands; and you can pipe in the text you want to change, then use -e or -f
to supply the commands.  It puts all the text it changes on standard output.
 It's in code-review right now, so if you use it let me know (-G sends a
gripe with mail) if it doesn't work well for you.

http://codereview.appspot.com/95076/diff/1/2

Jason Catena


Re: [9fans] Why does Acme only show text?

2009-07-15 Thread Jason Catena
Real World Haskell ch4 pp71-72
>> do x <- foo
>> y <- bar
>>
>> the y <- bar must be directly under the x on the previous line or it's a
>> syntax error, and the error you get from GHC is "the last statement of a
do
>> construct must be an expression"
>
> Huh, so this Haskell syntax actually prevents you from indenting something
that would be indented in any other language. Okay...

I didn't read it like this.  The x and y must be lined up because they are
both part of the same set of do-statements.  If the y line was a standalone
statement, then it could be indented as shown in this code segment.  But in
that case there's no need for a do, since the point of do is to order
statements in sequential time.

the following is a complete Haskell program, using do, which passes through
its input file to an output file.  The > specifies code lines, other lines
are considered comments. (I hope gmail preserves the spacing.)

Real World Haskell ch4 pp71-72

> import System.Environment (getArgs)
>
> interactWith function inputFile outputFile = do
>   input <- readFile inputFile
>   writeFile outputFile (function input)
>
> main = mainWith myFunction
>   where mainWith function = do
>   args <- getArgs
>   case args of
> [input,output] -> interactWith function input output
> _ -> putStrLn "error: need exactly two arguments"

Replace id with any function (of the same type)
to process the data.

> myFunction = id


Re: [9fans] Why does Acme only show text?

2009-07-15 Thread Jason Catena
Devon's anecdote is along the lines of my position.  I'm sure there's
a paper somewhere that counts parenthesis versus whitespace errors,
but I haven't yet read it.  I have programmed Lisp and Haskell (at two
extremes), and from this experience at least much prefer whitespace to
parentheses.  In addition, I rely on design theory (esp. Tufte et al
on his web site) that reducing clutter aids comprehension, and
delimiters very much seem clutter to me.

Jason Catena



Re: [9fans] Why does Acme only show text?

2009-07-15 Thread Jason Catena
> Again, the layout mode seems to be a bug in Haskell not a feature, but
> that's not a popular belief in that community.

It's only as complex as the various levels of scope you end up needing
in your program.  Meaningful whitespace enforces a clean, readable,
delimiter-free style, making programs look more like each other.  It's
a lot easier to see (and not have in the first place) incorrect scope
and continuation with whitespace than with braces or parentheses.

Acme only has two indentation rules (nothing, or same as the existing
line), so Emacs' constant re-parsing of the file to determine the
correct indentation level is always going to be more "correct".  This
kind of programming support seems akin to me to colorful syntax
highlighting: great if you need it, distracting once you really get
good with a language.  In the case of indenting, I might not actually
code the next line right away, but auto-indent to just the right place
for it means I have to go out of my way more often to get the cursor
to where I actually want it.

> Dave

Jason Catena



[9fans] Why does Acme only show text?

2009-07-14 Thread Jason Catena
I've been wondering for years now why Acme (and Wily, which I used
first) only display text files.

It seems to me that the content of an Acme window could be anything: a
picture, a postscript or PDF file, a star chart, a web page.  Keeping
with the spirit of small parts brought together, Acme could outsource
the displaying of the content to another program, place its output in
the Acme window, and operate on it by sending commands from the tag to
the rendering program.  Browsers do this (except the tag-command part)
with PDF for example, displaying a PDF file within an embedded viewer
(usually Acrobat).  Looking through the Oberon document, I see that
its Acme-like interface uses exactly this kind of embedded-viewer
architecture, and commands in the tag suitable to the object viewed.

I know Oberon came first, so my question is, is there an architectural
or design reason the plumber invokes programs completely outside Acme
to view and control files other than text?  Is the embedded capture
and control a planned feature or enhancement that was just never added
to Acme yet?  Is it considered too much work or too complicated to
implement for the benefit of a more integrated interface?  Or is any
format other than text considered a red-headed stepchild to be
delegated to other programs in the few cases where it must be used?

Jason Catena



Re: [9fans] nemo's book - where is it currently hosted?

2009-07-12 Thread Jason Catena
> The more hosts, the less chance of it going missing.

In this spirit, newly mirrored at
https://files.getdropbox.com/u/502901/9.intro.pdf

Jason Catena



Re: [9fans] Plan9 as an everyday OS

2009-07-10 Thread Jason Catena
"Much anger there is in him. Too much pride in his powers."

Jason Catena



Re: [9fans] plan 9 interface color ergonomy

2009-07-10 Thread Jason Catena
Rob explains the fonts and colors (inspired by Tufte, no less) a bit
in this reposted message, and mentions Renee French.

http://www.mail-archive.com/9f...@cse.psu.edu/msg13035.html

Jason Catena



Re: [9fans] Google finally announces their lightweight OS

2009-07-09 Thread Jason Catena
On Thu, Jul 9, 2009 at 16:34, erik quanstrom wrote:
>> For the task to be done "print the k most common words in a file", the
>> Unix approach and the Unix tools give everything to create a "program"
>> far more rapidly than the from scratch approach adopted by D. Knuth. But
>> because the tools exist (are already written... but in what language?
>> Easily understandable? Maintainable? etc.).
>
> the problem i have with "literate programming" is that it
> tends to treat code like a terse and difficult-to-understand
> footnote.  it seems to me that "literate programs" tend to
> spend too much time commenting on straightforward code
> or code that is easier read than explained.  ironicly, the
> assumption seems to be that one is illiterate in the computer
> language at hand.

I'd guess that depends a great deal on the author's style.  In the
paper I quoted, I wouldn't say that's true at all of Knuth's
discussion.  I personally am very aware of this tendency, and only
comment to introduce a bit of code and place it within the overall
structure, on extremely clever constructions (on the BWK gibe that I
won't be smart enough to debug it later), and to describe how the code
segment interacts with others and maps to the problem domain.

Jason Catena



Re: [9fans] Google finally announces their lightweight OS

2009-07-09 Thread Jason Catena
> But this does not mean that _in general_, literate programming has not
> its strength especially for complex and weaven program... or even for
> writing the tools, the bricks one combines in a pipeline like McIlroy does.

I'll say amen, especially for a system of many little parts.  My point
wasn't to bash literate programming at all.  Rather I'd say that big
elaborate constructions of many aspects are fragile, hard to
understand and work with, and of limited use.  Instead, let our tools
combine bits of code into a bigger whole, and reuse the tools for
other wholes (cf Lego bricks).

I've used LaTeX and noweb daily since the first quarter of 2007 to
write papers that are literate programs.  They work well to organize
and document collections of many small command-line guide files, shell
scripts, makefiles, data files, C and lex source, and a real-time
gnuplot driver I downloaded from the page of a guy at NASA. (I posted
a few recent simple examples, in the tufte-handout style, at
http://swtools.wordpress.com/papers/ . I plan to ask for a publishing
release for the really interesting ones now behind a corp firewall.)

> Thierry Laronde

Jason Catena



Re: [9fans] Google finally announces their lightweight OS

2009-07-09 Thread Jason Catena
>>> i think one could write quite an interesting
>>> book critiquing modern software development for failing to
>>> stop at good enough.
>>
>> Why would it take a book?  DMR [sic] made the point succinctly in his
>> critique of Knuth's literate program, showing how a few command-line
>> utilities do the work of the Don's elaborately constructed tries.
>
> Do you have a URL for this?

Yes, sorry I didn't look it up earlier.

Bentley, J., Knuth, D., and McIlroy, D. 1986. Programming pearls: a
literate program. Commun. ACM 29, 6 (Jun. 1986), 471-483. DOI=
http://doi.acm.org/10.1145/5948.315654

It is McIlroy (not DMR), but it looks like he focused on, not writing
a literate program, but the engineering benefits of constructing a
pipeline from common tools, vs Knuth's elaborate, single-purpose
program.

>From the paper:

"To return to Knuth’s paper: everything there---even
input conversion and sorting---is programmed
monolithically and from scratch. In particular the
isolation of words, the handling of punctuation, and
the treatment of case distinctions are built in. Even
if data-filtering programs for these exact purposes
were not at hand, these operations would well be
implemented separately: for separation of concerns,
for easier development, for piecewise debugging, and
for potential reuse. The small gain in efficiency from
integrating them is not likely to warrant the resulting
loss of flexibility. And the worst possible eventuality
eventuality---being forced to combine programs---is
not severe.

The simple pipeline given above will suffice to get
answers right now, not next week or next month. It
could well be enough to finish the job. But even for
a production project, say for the Library of Congress,
it would make a handsome down payment, useful
for testing the value of the answers and for smoking
out follow-on questions."

Jason Catena



Re: [9fans] data analysis on plan9

2009-07-09 Thread Jason Catena
I'd also be interested in knowing whether gnuplot or an equivalent is
yet ported to Plan 9.  Ron Minnich et al. seem to prefer gnuplot, and
reported that they generated data for it and used it in a paper, but
weren't specific whether the gnuplot ran on the same plan9 box or
another *nix.

>From http://doc.cat-v.org/plan_9/IWP9/2008/trace.pdf pp. 19-21:

"4.1 Visualizing trace device output

Once we had the data, we needed a way to analyse the information. After
working with the data for a while, we realized that the output as
shown in Figure
1 would be very useful. No graphiing [sic] tool available to us in
Plan 9 or Linux
was able to create that output. In the end, we determined that gnuplot was the
most appropriate tool, but even then the data required significant processing to
get it into the proper form.

We wrote a suite of scripts usng rc, the plan 9 shell; acid, the Plan
9 debugger;
awk, and sed to generate data appropriate for plotting with gnuplot.
The createplot
script has the ability to filter out functions which ran for less than
a specified number of clock cycles, which is useful for reducing the amount of
noise in a plot. To generate a plot from the data collected earlier, discarding
functions which completed in less than 4000 cycles, we just ran:

plots/createplot /amd64/9k8pf 4000 ./trace > plotme

and fed the input into gnuplot."

Jason Catena



Re: [9fans] Google finally announces their lightweight OS

2009-07-08 Thread Jason Catena
On Wed, Jul 8, 2009 at 23:10, erik quanstrom wrote:
>> > I expect to see code immediately, by the way, finished or not, and you 
>> > better be
>> > around to answer my questions.
>>
>> You have something here: these are central software-development tenets
>> of agile/scrum/xp/lean/kanban du jour, and help the open-source
>> community work.  Essentially, "done" is an elusive illusion, so enlist
>> others throughout the process.
>
> i'm just going to take a guess that you have never had egg
> on your face caused by publishing code before it's time?

I have, often enough that I got past it really bothering me
personally.  Rather, the only way to get changes out to the people
that need it, when they need it, is to release after some sanity test.
 Users of my system tested it far better than I can, and faster.  For
the people who found problems, I fixed them ASAP.  For people who
didn't see any difference, my code passed.  For those who needed the
primary change, they got it quick and got on with their jobs.  To none
of these groups was it worth significantly lengthy testing on my part
to make sure everything was "perfect," so long as I quickly fixed any
knock-on, secondary errors.  Managers don't think like that though.

> i can't stand my own silly mistakes, unfinished and crap code.

It's just a process of learning how to build better theories that map
problem to program domains.  Tomorrow you won't be able to stand code
you consider correct, finished, and great today.

> why should i look at anyone elses?

To find giants on whose shoulders you may stand. A capital reason to
study Plan 9.

> by the way, can you
> name operating systems that develop in this way?  i
> was under the impression that even, e.g., linux code is submitted
> in fairly complete fashion and tends to get rejected even
> on style grounds.

Everywhere "pair programming" is used.  Less obviously, every OS is
incomplete and has rough edges made better through open source, where
it's done.  This was most of my original point, that your demands are
essentially what many customers who can code want.  Why else would
people on this list complain about not being able to see Bell Labs'
broken AMD64 code?

> i think the idea that is illusary is that there is no difference
> between code that doesn't work and code that does work
> but might be improved.

Whether code works depends on your point of view, what your
requirements are for the code.  Just like any system that we build,
and any aspect from which we consider it.

> part of the craft of programming is to know when something
> is actually finished.  the mistake is to "improve" things that
> work well enough.

Why bother with Plan 9, or write software at all?  Windows and Unix
are essentially finished, and good enough for what almost all people
want to do with a computer. So we could say "improving" the state of
the art with Linux or Plan 9 are mistakes.  The only code we should
bother to write is completely novel in concept.

> i think one could write quite an interesting
> book critiquing modern software development for failing to
> stop at good enough.

Why would it take a book?  DMR made the point succinctly in his
critique of Knuth's literate program, showing how a few command-line
utilities do the work of the Don's elaborately constructed tries.

> but one would need to be quite a bit
> smarter, more educated and less lazy than i.  i'll satisfy myself
> by quoting some such people.  (oddly #1 and #3 are missing
> from fortune)
>
> Rule 3.  Fancy algorithms are slow when n is small, and n is usually small.
>        - rob pike, Notes on Programming in C
> Inside every large problem is a small problem struggling to get out.
>        - niklaus wirth
> When in doubt, use brute force.
>        - ken thompson

Agree, but these are off the point of when to release code, however
well-spoken and perceptive.

> - erik

Jason Catena



Re: [9fans] Google finally announces their lightweight OS

2009-07-08 Thread Jason Catena
> I expect to see code immediately, by the way, finished or not, and you better 
> be
> around to answer my questions.

You have something here: these are central software-development tenets
of agile/scrum/xp/lean/kanban du jour, and help the open-source
community work.  Essentially, "done" is an elusive illusion, so enlist
others throughout the process.

Jason Catena



Re: [9fans] Guide to using Acme effectively?

2009-07-06 Thread Jason Catena
> How far off topic are we now? Can we get away with carrying on? :)

Not unless you're wearing Spock ears.



Re: [9fans] Guide to using Acme effectively?

2009-07-01 Thread Jason Catena
This page collects some tips for working more efficiently with an
acme-like program.

http://www.cse.yorku.ca/~oz/wily/idioms.html

wily is a unix port of just acme which rarely gets updated.  It has a
few differences, mostly in the direction of being more unixy. I used
it for 5 years before switching wholly over to plan9port.  Probably
its greatest advantage to me now is that it's small and compiles easy
to any platform I've tried: Linux, Solaris, even Cygwin.  So I tend to
load it on machines I will be on only briefly, to avoid having to use
vi or emacs.

Jason Catena



Re: [9fans] p9p acme: incredibly slow typing in tag line for file.

2009-06-28 Thread Jason Catena
On Sun, Jun 28, 2009 at 03:04, ron minnich wrote:
> I am unable to type at more than about one char per second (I am not
> making this up) in p9p acme in the tag line for a file. Only for file
> tag lines, not other tag lines, and it's all fine in the actual file
> window.
>
> This is ubuntu 9.04. Any hints welcome.

I just pulled down the latest versions with hg, compiled, and don't
see this problem on my Ubuntu 9.04 box.  No appreciable difference in
typing rate for tags for files, directories, or shell-output windows,
or their bodies.

I have seen this kind of response time, but for the whole interface,
because I exported an X-display through VPN from Red Hat to Windows XP
with Cygwin/X.

Does the same delay occur if you write into the tag file under
/mnt/acme?  I don't actually know the source code base that well, but
it seems like it would help narrow things down if writes to the tag
file showed up faster than input from the display.

Jason Catena



[9fans] plumbing to get files from odd filesystems, and get pages from local manuals

2009-06-17 Thread Jason Catena
Some plan9port plumbing I wrote which may help someone.

Using the plan9port plumber to find files in ClearCase VOBs.
http://www.evernote.com/pub/catena/public#7d2e9774-964f-423c-96e9-5e8721b1a78d

Also plumb man(1) pattern to local manual.  New convention "man(1l)"
to name eclipsed local manual pages.
http://www.evernote.com/pub/catena/public#73edd473-f300-4e1f-991c-9876eb29dba0

Jason Catena



Re: [9fans] plan9port acme can't load dump file with shell output of "9p read plumb/rules"?

2009-06-08 Thread Jason Catena
On Mon, Jun 8, 2009 at 23:46, Russ Cox wrote:
> On Mon, Jun 8, 2009 at 8:19 PM, Jason Catena wrote:
>> Applied fix locally, works like a champ.  Thanks!  Now I should
>> probably set up hg to get updates without patching it myself.
>
> If you downloaded the archive and extracted it,
> you can always use "cvs up -dAP" instead of hg.
> I keep the two in sync and the archive is a tar
> of a nightly cvs checkout.  9 man cvs

Thanks, but already cloned with hg, compiled, and verified it doesn't fail.

Actually prefer a more advanced VC tool.  I'm a big SCM geek, used
ClearCase for past 15 years. Out of curiosity, why Mercurial over Git?
 Don't know either well enough to judge.

Jason Catena



Re: [9fans] plan9port acme can't load dump file with shell output of "9p read plumb/rules"?

2009-06-08 Thread Jason Catena
Applied fix locally, works like a champ.  Thanks!  Now I should
probably set up hg to get updates without patching it myself.

Jason Catena



[9fans] plan9port acme can't load dump file with shell output of "9p read plumb/rules"?

2009-06-08 Thread Jason Catena
plan9port acme calls it a "bad load file" when I try to load a dump
file in which a shell window contains the output of "9p read
plumb/rules".  Specifically, the error message refers to the line in
the dump file just before a "data matches" line containing one of the
complicated regular expressions with special characters ("i- ") in the
basic rules.

Are there certain characters which acme does not expect to see in the
load file, and fails when it does see them?  Or is there a similar
problem with what's okay to print when reconstructing an +Errors
window (this seems farther-fetched)?  The plumb/basic file itself
comes back fine, probably because its content doesn't go through the
dump-file parser.

I can work around it easily enough, by clearing any buffer in which
I've output the read command before I dump.  I also tried to manually
edit the dump file, which only works if I delete the "bad" +Errors
window's tag and all windows and tags after it.

If this is a known problem, or you would like a bug report, would
someone kindly direct me to (its record in) the appropriate
bug-tracking system?

Jason Catena