Live data from Hacker News

Show HN: Lisp Shell

github.com

31–40 of 61 posts

Re: Show HN: Lisp Shell

#31
post #22
post #11

For the Emacs users, there's eshell - a Shell, implemented in Elisp with the common GNU tooling, but also with the option to hook into regular elisp functions. Pretty cool stuff!

With the major caveat that piping commands together doesn't work that well, eshell has been an amazingly useful feature of emacs for me. Combined with TRAMP support, it makes dealing with remote machines much much more friendly. As an example, "cd 'ssh:firstmachine|ssh:secondmachine:/'" works just like you would anticipate, bounces you through first machine to second machine. All commands from that point are executed…

> Even better, "cp someFile ~/" will transmit a file back to my local machine so that I don't have to work with the scp commands that it requires.

Did not know that. That’s a neat trick! Do feel free to share more if you have any :)

Re: Show HN: Lisp Shell

#32
post #24
post #20

Earlier quoted context omitted.

Unless you’re seven directories deep and accidentally hit the button instead of the button. In which case, uh, you want the current functionality.

You can use "cd -" to go back to the previous directory.

If you use "mkdir -", bash will not change into this directory. Not even if you use "cd -- -". "cd ./-" works.

Re: Show HN: Lisp Shell

#33
I really like seeing more people use Lisp, and it's neat to see what other people come up with, but I'll stick with Emacs, Slime and occasionally eshell.

More often than not it's easiest to just use the Common Lisp functions for creating directories and interacting with the system, but when that doesn't work, I have a function similar to this one in my .sbclrc file:

(defun run (cmd) (with-output-to-string (outs) (uiop:run-program cmd :output outs)))

At work, I've even created a small Common Lisp library for calling our JSON APIs over HTTPS and running commands on our test clusters using SSH. It's all tightly integrated into Emacs, and I can use it do things like open remote files in my local Emacs.

Re: Show HN: Lisp Shell

#34
post #11

For the Emacs users, there's eshell - a Shell, implemented in Elisp with the common GNU tooling, but also with the option to hook into regular elisp functions. Pretty cool stuff!

I want to like Eshell, but it's hard to get past the fact that it has existed for almost 20 years and still doesn't support basic input redirection. Modern shells like Fish and Zsh are far more polished and convenient command-lines.

Re: Show HN: Lisp Shell

#35
post #3

Fun Unix Trivia Time: Touch is supposed to update modified times. That it creates files when they don't exist is only the most common use, not the point of the thing.

Oh, the update times feature is pretty common, at least among those who use a shared system where "scratch" files are deleted when they are seven days old.

Re: Show HN: Lisp Shell

#36
post #11

For the Emacs users, there's eshell - a Shell, implemented in Elisp with the common GNU tooling, but also with the option to hook into regular elisp functions. Pretty cool stuff!

What I love about it is that elisp functions can either be called like lisp functions or as unix-style commands. For example:

$ (defun sq (x) (* x x))

$ sq 5

25

Re: Show HN: Lisp Shell

#37
post #23

You might be interested in an experiment of mine, https://github.com/tonyg/racket-something/blob/master/src/so... , which combines an indentation-based reader with a handler for unbound variables to permit fluid interoperation between Racket procedures and external programs. Here's an example ( https://github.com/tonyg/racket-something/blob/master/exampl... ): #lang something/shell // Simple demos ls -la $HOME | grep…

Fantastic! Thanks so much for writing. I'll study all this ASAP.

Re: Show HN: Lisp Shell

#39
post #3

Fun Unix Trivia Time: Touch is supposed to update modified times. That it creates files when they don't exist is only the most common use, not the point of the thing.

I suppose this is a similar situation as with `cat' - it's meant to conCATenate stuff, but the most common usage I've seen (and one I've learned) is the idiom of `cat somefile | some-commands'.

(Whenever I share a snippet with this idiom, I get told by one of my cow-orkers to stop abusing kittens...)

Re: Show HN: Lisp Shell

#40
post #3

Fun Unix Trivia Time: Touch is supposed to update modified times. That it creates files when they don't exist is only the most common use, not the point of the thing.

Oh, the update times feature is pretty common, at least among those who use a shared system where "scratch" files are deleted when they are seven days old.

Funny thing. I work in the computational field where we deal with TBs of data regularly. We are supposed to backup sim outputs to tape asap and using touch to modify modification times to avoid this is explicitly forbidden.
Post reply on HN