from Hacker News

Show HN: Mount Unix system into Common Lisp image

by kscarlet on 5/24/23, 8:34 PM with 12 comments

  • by vindarel on 5/25/23, 12:27 AM

    Wow, that's crazy O_o

    Related:

    - Lish allows to mix&match shell and Lisp code, with regular syntax. https://github.com/nibbula/lish/

        $ echo ,*package*
        #<PACKAGE "LISH-USER">
        $ (defun hello (name) (format t "hello ~a!!~&" name))
        $ (hello "me")
        hello me!!
        NIL
        $ (hello "me") | wc -w
        => 2 
        
    It is usable. Interactive commands like sudo and htop work, some like less and fzf don't. So it ships a pager, `view`. It has a directory mode, a Lisp REPL with a debugger, completion…. It is not done, the author keeps hacking on it. Hackers invited to have a look.

    - SHCL is a posix-like shell written in CL. https://github.com/bradleyjensen/shcl (it doesn't have completion. Not active.)

    https://github.com/CodyReichert/awesome-cl#shells-shells-int...

  • by agambrahma on 5/25/23, 12:43 AM

    One of those "I wonder what it'd be like if someone made that", and then someone _does_ make that, kudos!

    Also, `defile` is a great name for a macro :-)

  • by ahefner on 5/25/23, 1:32 AM

    Neat. Funny enough I've recently considered writing sort of the exact opposite of this - a FUSE FS that maps every package and symbol of a running lisp image into the filesystem, so that the value of variables could be read/written from outside, fbound symbols would be marked executable and "callable" from unix by running them (via some weird shebang hack, I guess), etc.
  • by neilv on 5/25/23, 8:42 AM

  • by all2 on 5/24/23, 10:35 PM

    One of the examples in the readme is this

    Counting number of files

        /Users/kchan> (cd quicklisp/local-projects/unix-in-lisp)
        /Users/kchan/quicklisp/local-projects/unix-in-lisp> (pipe (wc -l) (ls))
               9
    
    Personally, I would want the top level parens to be implicit so I could write

        /Users/kchan> cd quicklisp/local-projects/unix-in-lisp
        /Users/kchan/quicklisp/local-projects/unix-in-lisp>
    
    This removes what could be trivial, but for a basic `cd`, I don't want to have to remember parens every time. Optionally having those parens would be nice for when they're needed, but for basic use-cases I'd rather not.