3 ms·
Show HN: Mount Unix system into Common Lisp image
- all2 3y agoOne 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.
- kscarlet 3y agoAuthor here! I've considered this before, but there are problems such as what does a single atom mean: Does test.sh run test.sh or returns the content of test.sh? I am a heavy Lisper myself so I end up choosing consistency over one less keystroke (I have paredit, so the difference between (ls) vs ls is just one keystroke), but I could be biased.
- all2 3y agoThat's a fair point. Consider that I have very little experience with any kind of Lisp beyond Scheme, and even that is very limited. I was coming at this recommendation from the perspective of a heavy command line user.
- jdougan 3y agowould it be hard to modify the readline mechanism to show the "implicit" parens and push them apart as you type?
- dmb2 3y agoDo you use this as a daily driver? I got addicted to evil-mode at some point and haven’t squared the circle of modal s-expression editing that this inevitably surfaces. At least readline respecting programs reward my early emacs years.
- kscarlet 3y agoYes I use it daily. I never squared the circle of modal editing and use mostly vanilla Emacs bindings (and paredit) :) Would love to hear feedback from evil-mode user. Just in case I port it to vim in the future.
- fiddlerwoaroof 3y agoI use these keys every day for just about every sort of balanced delimiter manipulation I do in any language: https://github.com/fiddlerwoaroof/dotfiles/blob/eff889f0b74956c9536bffffb9b71d9f65853f13/emacs.d/lisp/configurations/evil-conf.el#L67 https://github.com/fiddlerwoaroof/dotfiles/blob/eff889f0b749... A little below I bind this key map to the “,” prefix and I’ve found my layout of paredit commands pretty ergonomic to use long-term.
- vindarel 3y agoWow, that's crazy O_o Related: - Lish allows to mix&match shell and Lisp code, with regular syntax. https://github.com/nibbula/lish/ 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 https://github.com/bradleyjensen/shcl (it doesn't have completion. Not active.) https://github.com/CodyReichert/awesome-cl#shells-shells-interfaces https://github.com/CodyReichert/awesome-cl#shells-shells-int...
- kscarlet 3y agoThanks for the pointer to lish! I didn't know it had all that, I know it exists but was intimated by its non-standard packaging... I decided to not go too far on the structured/object shell route for Unix in Lisp, instead trying to get existing Unix utilities to work as seamlessly as possible first. But maybe in the future I could integrate some work from lish. That's lots of impressive work under yew/los and yew/tools!
- agambrahma 3y agoOne 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 :-)
- ahefner 3y agoNeat. 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.
- coolvimer 3y ago[dead]
- neilv 3y agoRelated: https://scsh.net/about/what.html https://scsh.net/about/what.html