Live data from Hacker News

Closh – Bash-like shell based on Clojure

github.com

61–70 of 138 posts

Re: Closh – Bash-like shell based on Clojure

#61
post #49

Earlier quoted context omitted.

It seems like the concepts are orthogonal though. The reason powershell works is that it replaced the entire shell toolchain with object-oriented equivalents. Without that you're fundamentally limited because your inputs are still plain text, so you're still doing the equivalent of awk/sed scripts to transform text into structured data.

That aligns pretty much with my conclusion that to make an useful object shell, I'd be essentially rewriting the whole userland and probably some kernel bits too (/proc and /sys etc). So basically building a completely new OS on top of Linux kernel. I wouldn't expect such project to be very popular..

For quite a while now, I've fantasized about creating an object-oriented toy OS with an OO shell and something akin to Classic Mac OS's resource forks. As much information as possible would be stored as OO data structures in alternate file streams with native tooling to query them.

It would need to be based on Illumos and not Linux, though... IIRC, the only existing open-source filesystem that supports anything akin to a resource fork is ZFS, and the Linux kernel doesn't have the syscalls readily access it (ZFS implements extended attributes as forks, but the kernel has really tight limitations on what can be done with xattrs, much tighter than what ZFS can do).

It's just a fantasy, though, and not something I have the skills or the time to do.

Re: Closh – Bash-like shell based on Clojure

#62
post #50

Call me old. But I want my shell to be a tight binary, preferably distributed (at some point) by major distros. This needs freakin' Node.js. I'm more looking in the Rust/Haskell/OCaml direction for a hip bash/zsh replacement.

Racket's RaSH is heading there.

I have to say I have been using BASH, SED and AWK less. They are great tools but in the end it is getting easier and easier to get things done with a Macro in Racket for me.

Re: Closh – Bash-like shell based on Clojure

#63
post #9

Earlier quoted context omitted.

I really like this idea and I really like Clojure. Though I'm curious about performance. And do you know if anyone is doing something similar with Racket? (Looks like there is a Common Lisp shell http://www.cliki.net/CLISP-Shell )

There is also the scheme shell: https://scsh.net

The shell with the best acknowledgements section in any technical manual: https://scsh.net/docu/html/man.html

Re: Closh – Bash-like shell based on Clojure

#65

Earlier quoted context omitted.

i mean, really what is the point of Node ?

It's a highly performant platform, based on a rapidly evolving language that's easy to understand. As such it's largely democratised server/shell programming to millions of users and web developers who could have been turned off by more advanced syntaxes and programming concepts. These people have created millions of open source packages which now dwarf most other communities, and the platform has unlocked an incredi…

Aka BASIC.

Re: Closh – Bash-like shell based on Clojure

#66

Earlier quoted context omitted.

yes, and thankyou for answering. Why use Node over the JVM ?

That’s answered in the comments elsewhere on this page. Mainly because shell processes are started frequently and the JVM start-up time would be much too slow.

JVM starts pretty fast, the problem lies within Clojure's implementation.

One can even AOT to native code, if desired.

Re: Closh – Bash-like shell based on Clojure

#67
post #64

Looking forward to the day I can write backend code in clojure, frontend code in clojurescript, write all my terminal commands in clojure and use an IDE that is configurable via clojure code.

Which of these are missing right now? Is there a decent backend framework in Clojure?

Re: Closh – Bash-like shell based on Clojure

#69
post #24
post #9

Earlier quoted context omitted.

I really like this idea and I really like Clojure. Though I'm curious about performance. And do you know if anyone is doing something similar with Racket? (Looks like there is a Common Lisp shell http://www.cliki.net/CLISP-Shell )

eshell is another lispy shell that's been in Emacs for a very long time. Elisp is probably my least favorite lisp that's commonly available, but eshell probably has the largest user base and is certainly the most mature out of all of these contenders. You can reasonably use eshell as your primary shell.

I use eshell daily. It's nice to have a shell that also integrates with with list, but there's also a ton of value-add with integration with the emacs ecosystem.

For example in eshell you can do:

    cd /ssh:some-server:/
    top
    cd /docker:container:/
    find-file etc/hosts

Re: Closh – Bash-like shell based on Clojure

#70

Earlier quoted context omitted.

i mean, really what is the point of Node ?

It's a highly performant platform, based on a rapidly evolving language that's easy to understand. As such it's largely democratised server/shell programming to millions of users and web developers who could have been turned off by more advanced syntaxes and programming concepts. These people have created millions of open source packages which now dwarf most other communities, and the platform has unlocked an incredi…

Is this satire?
Post reply on HN