Live data from Hacker News

Show HN: A Lisp Interpreter for Shell Scripting

github.com

11–20 of 26 posts

Re: Show HN: A Lisp Interpreter for Shell Scripting

#11
post #4

Very nice! I've often wondered how close you could get to a POSIX-like syntax with something like this while maintaining a LISP semantics as much as possible. Especially pipelines are much easier to read with the | and > operators. I guess you need some sort of LISP dialect that supports infix operators

Unless someone has already provided a library for it, write some wrappers around pipes and forks and use OCaml utop.

It's not a Lisp but close enough, I'd say. If I didn't have the rather extensive background of using Picolisp and some other REPL-like tools as a form of shell I'd probably have settled for utop, at least until I reached my iex era.

Re: Show HN: A Lisp Interpreter for Shell Scripting

#12

> writing your shell scripts in Lisp instead of Bash. in a Lisp ;) Related, for Common Lisp: - unix in lisp https://github.com/PuellaeMagicae/unix-in-lispMount Unix system into Common Lisp image. - kiln https://github.com/ruricolist/kiln - an infrastructure (managing a hidden multicall binary) to make Lisp scripting efficient and ergonomic. - CIEL https://github.com/ciel-lang/CIEL/ - CIEL Is an Extended Lisp is a col…

And don't forget scsh: https://scsh.net/

Re: Show HN: A Lisp Interpreter for Shell Scripting

#15
post #2

awesome! I have wanted something like this for a long time. Currently I use a janet fork https://github.com/eshrh/matsurika > with some trivial additions, the most important of which is a `$` macro that does what the `sh` does here. I have two questions: - I see that `sh` does not take in strings but instead lisp forms. How do you distinguish between variables that need to be substituted and commands? In my fork, the…

can you give an example of how variable substitution in your language looks like?

one of the things i think a lisp for shell should have, and i agree that this may not be easy, but unix commands should be first class functions, as in, you should not need a $ or sh macro to make them work. the other thing is that strings should not be quoted, and so you need something else to designate variables like $path or ($ path)

Re: Show HN: A Lisp Interpreter for Shell Scripting

#16

> writing your shell scripts in Lisp instead of Bash. in a Lisp ;) Related, for Common Lisp: - unix in lisp https://github.com/PuellaeMagicae/unix-in-lispMount Unix system into Common Lisp image. - kiln https://github.com/ruricolist/kiln - an infrastructure (managing a hidden multicall binary) to make Lisp scripting efficient and ergonomic. - CIEL https://github.com/ciel-lang/CIEL/ - CIEL Is an Extended Lisp is a col…

Many of these projects are on:

Alternative Shells - https://github.com/oils-for-unix/oils/wiki/Alternative-Shell...

Internal DSLs for Shell - https://github.com/oils-for-unix/oils/wiki/Internal-DSLs-for... - nearly every language: Python, many schemes and Lisps, Haskell, OCaml, JavaScript, etc.

Feel free to add them if they're not there

Re: Show HN: A Lisp Interpreter for Shell Scripting

#18
post #16

> writing your shell scripts in Lisp instead of Bash. in a Lisp ;) Related, for Common Lisp: - unix in lisp https://github.com/PuellaeMagicae/unix-in-lispMount Unix system into Common Lisp image. - kiln https://github.com/ruricolist/kiln - an infrastructure (managing a hidden multicall binary) to make Lisp scripting efficient and ergonomic. - CIEL https://github.com/ciel-lang/CIEL/ - CIEL Is an Extended Lisp is a col…

Many of these projects are on: Alternative Shells - https://github.com/oils-for-unix/oils/wiki/Alternative-Shell... Internal DSLs for Shell - https://github.com/oils-for-unix/oils/wiki/Internal-DSLs-for... - nearly every language: Python, many schemes and Lisps, Haskell, OCaml, JavaScript, etc. Feel free to add them if they're not there

nice thanks, I'll check them out.

They are also on https://github.com/CodyReichert/awesome-cl/

Re: Show HN: A Lisp Interpreter for Shell Scripting

#19
post #12

> writing your shell scripts in Lisp instead of Bash. in a Lisp ;) Related, for Common Lisp: - unix in lisp https://github.com/PuellaeMagicae/unix-in-lispMount Unix system into Common Lisp image. - kiln https://github.com/ruricolist/kiln - an infrastructure (managing a hidden multicall binary) to make Lisp scripting efficient and ergonomic. - CIEL https://github.com/ciel-lang/CIEL/ - CIEL Is an Extended Lisp is a col…

And don't forget scsh: https://scsh.net/

The OG.
Post reply on HN