From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <1529919198.1166425.1419218008.639C4326@webmail.messagingengine.com> From: "Ethan A. Gardener" To: 9fans@9fans.net MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In-Reply-To: Date: Mon, 25 Jun 2018 10:33:18 +0100 References: <1529530542.3279707.1414877304.5B04A2FD@webmail.messagingengine.com> <1529594591.3616046.1415871392.7B6B65AC@webmail.messagingengine.com> Subject: Re: [9fans] What are you using Plan 9 for? Topicbox-Message-UUID: d8c2ef74-ead9-11e9-9d60-3106f5b1d025 On Thu, Jun 21, 2018, at 7:03 PM, Bakul Shah wrote: > On Jun 21, 2018, at 8:23 AM, Ethan A. Gardener wrot= e: > >=20 > > Thanks! I don't know APL at all, beyond the fact that its need for a gr= aphical (or at least sophisticated) display held it back in the past. I sho= uld probably look into it now, I'm sure it would save me from making some m= istakes in my design. >=20 > Languages j, k & q are ascii only. K is > quite minimalist (compared to APL & j). > I quite like Scheme, k and plan9 for > their minimalist aesthetics. I have briefly used q and pure, but I remember nothing practical about them, only that pure is a verbose q. I've looked into APL a little now, got an introduction from a 1975 video which was interesting and a little amusing, and had a look at aiju's k pages -- http://aiju.de/code/k/ . I think the idea of combining operators is really cool, but I'm certain I'd get mixed up with both APL and k in the same way I struggle with regexps. Pure would be better, but I haven't heard mention of it since that one time I tried it. This amuses me because its documentation stated in true Gnu style, "q is unmaintained, new projects should use pure." I picked up an idea from microapl.com, workspaces. Saving system state is one of my goals for my OS, and the concept of workspaces pertaining to separate tasks keeps popping up when I get ideas. For those who don't know, it's this: Quoting from http://www.microapl.com/apl/introduction_chapter1.html > In addition, it has a very useful concept called the > workspace. This is basically a collection of the data > items, functions, and classes which you set up in the course > of doing a particular job. >=20 > The workspace is in computer memory while you work, making > everything you want immediately accessible. It can be saved > (i.e. copied on to a disc) in its entirety when you stop, > and loaded back into memory next time you want to use it. I'm finding other relevant ideas in that introduction, too. >=20 > Arthur Whitney, k=E2=80=99s designer, had told > me he was making it run on bare metal. > He was muttering about how Linux just > gets in the way! Though I don=E2=80=99t know if > he actually did that. Bare metal dreams! I have similar ambitions for my Forth OS, of course. :) This is where things like OpenFirmware are good, because you get a bunch of drivers for free. They may not offer the highest performance, but when developing an OS on your own, I'm sure they'd save a lot of time and frustration. And you may get things which might be last on your list to implement, like the webcam in an OLPC. >=20 > Another crazy bare metal tale: A few > years before Eben Upton came up with > Raspberry Pi, he had ported cpython to > run on the videocore on a GPU only > chip (bcm2707) using custom software > hackery. Using python like BASIC is a great idea! Wild! :) It's better than, but reminds me of the time I compiled Python to run alone on the Linux kernel. I was lazy, I didn't want to reimplement utilities like mount, and so I left it. Now, I think I should have pushed myself to implement those and a text editor too. It would have boosted my skills over a decade ago. >=20 > Personally I=E2=80=99d prefer something like k, Scheme, python or lua (an= d not=20 > forth) to boot into. I am admire forth but I=E2=80=99m > not a fan of *programming* in stack languages! Python and Tcl were on my list for my OS. I don't recall thinking of lisps except elisp for some reason. Anyway, I had high hopes for Forth's sequential nature. It is quite good, especially for the wide range of tasks I want to apply it to; the syntax is so flexible! As I said, I have trouble with regexps, and printf isn't far behind. Here's example usage for a sprintf-like system from Swift Forth: <% S" This is a test " %s DPL @ %d S" finally" %s %cr %> Literal strings, variable references, and escapes go in their logical order. There's no need for escapes to be just one character. These are features I want. As I write this, I realize that this all could be done in other languages with minor syntax variations. I can imagine it in Python as a tuple containing literal strings and the names of members of a class. In Lisp, a list with strings and symbols. (Do symbols work the same way in Scheme?) I'm thinking it over, but I may stick with Forth for other reasons. I haven't ruled out implementing some of my project in another language to see how it compares. Other reasons I like Forth are its efficiency (relative to Python and maybe Lisp), the fact that very low level work is natural, and especially the great simplicity of Forth interpreters. The stack can be a bit of a pain, but not as much as I expected, and it's what enables that flexible syntax. It helps to break code up into very small definitions, although it's not always obvious how to break it up. Also, in other languages I sometimes find myself fighting some aspect of the language; the language itself gets in the way. I can't see that happening with Forth, it doesn't have the same constraints. (Some Forth document made the same point.) The idea seems to be: instead of constraints, test every little part. A REPL makes that reasonable. Forth also taught me how to think better; some improvements I'd failed to pick up in any amount of Python or C, but that's probably just me. --=20 The lyf so short, the craft so long to lerne. -- Chaucer