Re: [9fans] What are you using Plan 9 for?

2018-06-20 Thread Kurt H Maier
On Wed, Jun 20, 2018 at 10:35:42PM +0100, Ethan A. Gardener wrote:
> 
> a sort of operating system where the primary interface to all tasks is 
> a Forth interpreter.

I think we've talked about this in another venue some years back, but I
often thing of the OpenFirmware implementation used by the OLPC XO-1
laptop.  Instead of a BIOS or UEFI or linux trash in their stead, the
system was managed by an OpenFirmware installation, much of which was
written in Forth, and whose primary interface was a Forth shell.  This
environment had complete access to the hardware of the system, which
was used by the project to create really comprehensive hardware
diagnostics tools.

I mostly used it for screwing around, but it was fairly complete; it
supported the wifi hardware and the webcam, and I often thought I'd like
a computer that just booted into this environment and stayed there.  I'm
glad to hear you're still experimenting along these lines.  There's a
lot of value in a system whose primary interface is the programming
environment.  I work with computers because of the Commodore VIC-20...
and I wonder if I'd have ever given a damn about the field if my first
exposure to computers involved a Modern User Experience.

khM



Re: [9fans] What are you using Plan 9 for?

2018-06-20 Thread Bakul Shah
On Thu, 21 Jun 2018 05:58:42 +0200 Lucio De Re  wrote:
Lucio De Re writes:
> On 6/20/18, Ethan A. Gardener  wrote:
> > [ ... ] Most of it is going into game scripting at the moment, but on the b
> ack
> > burner is a Forth-based project; a sort of operating system where the
> > primary interface to all tasks is a Forth interpreter. [ ... ]
> 
> Bakul may not agree, but that sounds like a novel take on APL.
> Different underlying syntax, but conceptually quite similar. Forth is
> one of those things that happened while I wasn't watching, so I'm not
> at all familiar with it, so it makes sense for me to use the model I
> know, but this sounds quite intriguing.

As a matter of fact some APLers are quite fascinated with
"concatenative" languages like Forth, Joy, Factor etc.!

> Do you know APL and/or any of its derivatives? You'd bit a better
> judge. The idea of the full interpreter at the command line is a
> powerful one and APL's one liners handle much better the shortcomings
> of any Unix shell's regarding multi-line constructs.

There are some conceptual similarities between stream
programming using shell pipelines and array programing using
APL/j/k/q. Array programming is richer as you can pass many
different things, not just character streams.



Re: [9fans] What are you using Plan 9 for?

2018-06-20 Thread Lucio De Re
On 6/20/18, Ethan A. Gardener  wrote:
> [ ... ] Most of it is going into game scripting at the moment, but on the back
> burner is a Forth-based project; a sort of operating system where the
> primary interface to all tasks is a Forth interpreter. [ ... ]

Bakul may not agree, but that sounds like a novel take on APL.
Different underlying syntax, but conceptually quite similar. Forth is
one of those things that happened while I wasn't watching, so I'm not
at all familiar with it, so it makes sense for me to use the model I
know, but this sounds quite intriguing.

Do you know APL and/or any of its derivatives? You'd bit a better
judge. The idea of the full interpreter at the command line is a
powerful one and APL's one liners handle much better the shortcomings
of any Unix shell's regarding multi-line constructs.

It would interesting to explore your particular take on this and place
it in a broader context.

Lucio.



Re: [9fans] What are you using Plan 9 for?

2018-06-20 Thread Ethan A. Gardener
On Mon, Jun 11, 2018, at 7:14 AM, 刘宇宝 wrote:
> this makes me wondering 
> whether anybody still seriously uses(or used?) Plan 9 for serious work, 
> what software they frequently use, what software is most lack of.

For many years I used it and especially Acme to try to organise my life, 
including every area of interest I had. Plan 9 and Acme played their parts 
quite well. I even had multiple Acme sessions running, each with its own 
plumber. Some windows held sub-instances of Rio, again with their own plumber 
instances, for projects requiring graphics or PDFs. 

Another use I had for it was playing MUDs, MUSHes, MU* -- telnet-based 
multi-player games. I particularly liked Rio's "noscroll" feature in this case, 
as I could catch up with all the messages at my own pace. In fact, I very much 
like noscroll in general. On the other hand, the lack of color meant I could 
miss things sometimes, such as a clue in a room description or a private 
message while travelling -- noscroll isn't really feasible when you're 
following someone rapidly through a dozen rooms, each with their own 
description. I never got around to filtering different kinds of messages into 
different windows. I should have.

Overall, I asked Plan 9 to do quite a lot of things it wasn't really designed 
for, without writing a bit of C code, and for the most part it proved 
remarkably convenient. Frustration eventually built up over some things, 
particularly all the string manipulation -- converting data between the 
different programs' needs -- when, even after all these years of practice, I am 
_still_ bad at regular expressions! I developed ideas about another operating 
system with structured pipes, but around this time I learned to relax. I 
dropped most of my projects, stopped trying to play so many games so hard, and 
no longer needed Plan 9 to help me organize it all.

Ironically perhaps, relaxing has freed my creativity so that I'm now 
programming more than at any time since before I started using Plan 9 full 
time. Most of it is going into game scripting at the moment, but on the back 
burner is a Forth-based project; a sort of operating system where the primary 
interface to all tasks is a Forth interpreter. So far, I've written the basics 
of a text editor. It's *very* little code! Plan 9 is a very expressive system 
for how little code it has, but this seems to be a major step beyond that. It's 
a bit too early to really tell. 

It offers the full power of a systems programming language at the editor 
prompt. If that sounds like a problem, it's not yet. If it ever becomes a 
problem for common tasks, I can write safer, higher-level, and probably more 
convenient words (=functions, =commands,) to handle those tasks. That's 
arguably how the text editor's basics already work. For instance, change-dotlen 
performs safety checks before calling the (dangerous, powerful,) move word to 
adjust the contents of the buffer for inserted or deleted text. rdot ("replace 
dot") is a user command which calls change-dotlen to do most of the work, then 
calls move again to copy the string into the buffer. change-dotlen is well 
tested, rdot is so simple there are obviously no faults. :) (That's not 
something I really believe in, I tested it too.) None of the other user 
commands call move, they adjust dot and then call rdot. Adjusting dot means a 
call to dot! (dot-store), which also has safety checks.

When all the necessary tools are written, there's just no need to use the 
unsafe features, but neither is there a need to partition those features off 
into compiled program space. There's no need to learn five different languages 
for one task, and if you want to point out that a Forth system may well include 
lots of mini-languages, there's no need for the mini-languages to have -- or 
LACK -- their own loops, conditionals, variables, or function definitions, not 
to mention jammed-into-a-string terse syntaxes.

I'd better stop here because I'm getting enthusiastic. :) It is early days yet, 
I may have to retract some of my beliefs in the future. I still have a Plan 9 
system which is almost always on, but now I no longer have a desk of the right 
proportions to make mouse use comfortable, and can no longer bend over a laptop 
for hours on end, (a Thinkpad with 3 buttons,) text editing in Plan 9 has 
become unpleasant. I could patch Samterm and Rio to make it more comfortable, 
but it's not worth it. 

-- 
The lyf so short, the craft so long to lerne. -- Chaucer