[HN Gopher] Cat9: A command-line shell written in Lua
       ___________________________________________________________________
        
       Cat9: A command-line shell written in Lua
        
       Author : HieronymusBosch
       Score  : 95 points
       Date   : 2022-10-17 12:28 UTC (10 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | BossingAround wrote:
       | Are there any good resources you'd recommend on implementing a
       | shell?
        
       | anthk wrote:
       | >The last flavour covers the no-man's land of everything in
       | between, the multi-million lines of UI toolkits. They come with
       | much of the complexity of the VMs and about as much barren legacy
       | as the terminals.
       | 
       | TCL/TK was like that.
       | 
       | >Authenticate against the device, not a dynamic 'user'. Then,
       | allow safe, ephemeral, secure sharing of the smallest, innermost
       | compartment or an interactively defined aggregation thereof. This
       | compartment is 'the window', not 'the desktop'.
       | 
       | From plan9 and the upgraded 9front: Factotum, namespaces.
       | 
       | >The core of the matter is the opaque and unpredictable 'opt-out'
       | nature of the automated system responses to user initiated
       | actions, no matter if it is plugging in a USB device, a network
       | cable or downloading a file. You only see the fire after you feel
       | the burns.
       | 
       | OpenBSD, enable and set hotplugd for lots of devices, just return
       | "true". Also, by default (I think) DHCP is not called upon
       | plugging in a cable.
       | 
       | On U3, I think it was used by PortableApps.
        
       | hawski wrote:
       | I love the concept. I must try it.
       | 
       | I have thought about long running jobs just being available right
       | away with whole log in very similar manner as here. I never
       | thought much about Arcan, but now I'm much more intrigued.
        
       | georgeoliver wrote:
       | I feel like this is a better introduction, https://arcan-
       | fe.com/2022/10/15/whipping-up-a-new-shell-lash...
        
       | spacedcowboy wrote:
       | I did this for an internal project - the system controller of an
       | embedded system.
       | 
       | The main CPU booted into a Lua shell, had a VFS implementation so
       | it could read "files" from disk (areas on the flash chip) and had
       | the same io interface to "/tmp" (which was RAM). It looked in
       | /boot to find 00-<whatever>, 01-<whatever> etc. and executed
       | those Lua scripts in numerical order at boot, and it provided
       | stdio redirection over a PCIe link (via thunderbolt, actually) to
       | the host.
       | 
       | Once the boot process was finished, all the peripherals were
       | booted, and the state was quiescent, it fell back into an
       | interactive Lua shell (using the stdio redirection). I could (on
       | the host) run an application that made it look as though I was
       | "logged in".
       | 
       | Since we exposed all the peripherals as Lua classes, and we could
       | interactively call methods on those classes, it was really easy
       | to reconfigure the thing on-the-fly, reset a peripheral with
       | different values, or tune things in the actual working
       | environment. A fair amount of initial work, but it really paid
       | off over the lifetime of the project.
       | 
       | Basically I wrote a very simple OS :) Lots of fun was had.
        
       | masukomi wrote:
       | this is very cool, and I love seeing folks experimenting with new
       | takes on the old shell.
        
       | ViceCitySage wrote:
       | This is actually a small proof of concept for the much larger
       | project that is Arcan or Arcan-fe. Did a fair amount of research
       | into it. Its philosophy is to move away from the traditional
       | desktop experience and create fundamentally unique, new
       | interfaces. More on its founding principles can be found on this
       | site: https://www.divergent-
       | desktop.org/blog/2020/08/10/principles.... The core of Arcan is
       | written in C with a little Lua and takes inspiration from game
       | engines, display servers, and streaming multimedia processors. It
       | combines similar functionality of these traditionally seperate
       | low level graphics to create an all-in-one graphical display
       | engine. According to this slideshow
       | (https://speakerdeck.com/letoram/arcan), the "last mile" for
       | making any gui/tui can be as little as simple scripts. Writing
       | scripts(mostly lua as of right now) can get you a tiling wm,
       | audio/video playback, a libretro-based emulator running a game,
       | and as this post shows a dynamic new command line shell. An
       | interesting project overall to keep an eye on. Can see it used as
       | another modern alternative to the aging X/X11/Xorg on GNU+Linux
       | and BSDs.
       | 
       | Useful links related to Arcan: Website(https://arcan-fe.com/),
       | Creator's Github (https://github.com/letoram), Arcan's Github
       | Repo(https://github.com/letoram/arcan), Creator's youtube channel
       | (https://redirect.invidious.io/user/arcanfrontend).
        
       | blaser-waffle wrote:
       | They couldn't have chosen a name that wouldn't conflict with
       | Ethernet standards?
       | 
       | We're already up to Cat7 and it's not crazy to think we'll be on
       | Cat9 in a little while.
        
         | stopdontthink wrote:
        
         | rconti wrote:
         | Actually, looks like we're up to Cat8!
         | 
         | https://www.tripplite.com/products/ethernet-cable-types
        
         | MisterTea wrote:
         | The windows appear to function like they do in plan 9's Rio so
         | I'm guessing that is the origin of 9. What cat has to do with
         | it is beyond me.
        
           | tejtm wrote:
           | from the readme "Cat9 is a user shell script for LASH"
           | 
           | Which would make it "cat-o-nine-tails" I am afraid
           | 
           | https://en.wikipedia.org/wiki/Cat_o%27_nine_tails
           | 
           | Note; I hope this is an incorrect interpretation as it is in
           | very poor taste.
        
             | gnubison wrote:
             | Where does the reference to the tails come from?
        
               | tejtm wrote:
               | the strands of the whip used to LASH
        
       ___________________________________________________________________
       (page generated 2022-10-17 23:00 UTC)