Live data from Hacker News

Closh – Bash-like shell based on Clojure

github.com

111–120 of 138 posts

Re: Closh – Bash-like shell based on Clojure

#111

Earlier quoted context omitted.

I'm a big fan of fish, particularly with omf. Though honestly it has some performance issues, particularly if your prompt line calls something that could take some time to resolve (such as git status or a du).

I've been having big performance issues with tab completion. Also, I just don't find the language to be that much better than bash, and writing in fish means i can't share my shell scripts with any coworkers. I've been writing everything in bash lately even though i still use fish.

Same. I love fish as an interactive shell, but write all my scripts in Bash or some other, suitable scripting language. I don't mind having separate interactive and batch languages.

Re: Closh – Bash-like shell based on Clojure

#112
post #29

Nice, I've been waiting for a good modern shell to replace ZSH. Fish just wasn't enough of an improvement for me to abandon ZSH. This is an area where most open-source developers have avoided, as it's a "solved" problem, but it really isn't. I'm currently waiting on Elvish [1] to mature. It's written in Go [2], but they're developing a new language on top of it for shell scripting, which I tried for a week. It's a ni…

I've been using xonsh (shell + Python ) for about 18 months now to great effect. Bash stuff basically works as-is because of the operational semantics that completely separate shell stuff from Python stuff

If you're looking to contribute to something, the devs are really helpful and open to stuff (I was able to hack together an autopair feature pretty quickly and they took it)

Re: Closh – Bash-like shell based on Clojure

#113
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.

This needs freakin' Node.js. Yeah, that's an old sentiment. I used to echo the same thing, but it's worth coming to terms with the fact that node is a pretty good platform to build on.

>node is a pretty good platform to build on.

Lol.

Re: Closh – Bash-like shell based on Clojure

#114
post #68

Is there a bash-like shell based on Python? I would love something like that.

ipython shell with its magic commands is pretty powerful, although not a bash replacement. For example, you can assign output of ls command to a variable (e.g. a = !ls) and then use that variable as a python list.

Good overview of its power here: https://jakevdp.github.io/PythonDataScienceHandbook/01.00-ip...

Re: Closh – Bash-like shell based on Clojure

#115
post #71
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.

Ideally, we want a Symbolics Clojure Machine.

Yup. This is the holy grail!

Re: Closh – Bash-like shell based on Clojure

#116
post #3

Author here, thanks for posting. The project is still very early in the development and there is a lot of work to be done to make it ready for daily use. I would appreciate any feedback. What are the less known features of existing shells you really like? What things would you change about existing shells if you could?

Thanks for the amazing work! This is a project that many would look forward too. Shell is a place where Clojure's program to abstractions and data oriented programming philosophy can do wonders.

Ability to browse documentation of Clojure functions at the shell might help. Currently, man pages can be accessed for utilities. But quickly browsing doc of, say, Clojure re-find will add value, although features from stage 2 and 3 of roadmap are more important/show-stoppers.

Re: Closh – Bash-like shell based on Clojure

#117

Earlier quoted context omitted.

This needs freakin' Node.js. Yeah, that's an old sentiment. I used to echo the same thing, but it's worth coming to terms with the fact that node is a pretty good platform to build on.

>node is a pretty good platform to build on. Lol.

Yeah. I have the feeling people like Node because they know JS, and Node gives them JS. That's it.

Re: Closh – Bash-like shell based on Clojure

#118
post #58

Earlier quoted context omitted.

> This is an area where most open-source developers have avoided, as it's a "solved" problem, but it really isn't. I've found the complete opposite to be the case. This is one area where there are hundreds of different shells out there as it seems a "cool" thing to try since it's basically just an extension of writing your own language. Most never go beyond pet projects though. If you're curious about Go shells, I'm…

> This is one area where there are hundreds of different shells out there... Most never go beyond pet projects though. I have had the same experience. For every scripting/interpreted language out there, there is at least one person who thinks "ooh, wouldn't it be neat if I could use this as a shell?" or, almost as often, "to program my text editor?" Soon they realize that interactive programs like shells and text edi…

From an academic perspective I think it is totally worth the effort. It can teach you how to write a parser, a greater understanding of pseudo-TTYs, process IDs, and UNIX file streams (eg handling EOT bytes). Plus ANSI escape sequences (for readline support), globbing, etc. There's a lot of theory that can be learnt from writing even an unsuccessful shell. Even with myself who has been a Linux administrator for 10+ years and a developer for twice that, there were lessons I've learned when writing murex.

Re: Closh – Bash-like shell based on Clojure

#119
post #105
post #80

Earlier quoted context omitted.

It'd better be.

I don't think it is. In the words of Bill Clinton: "it's the economy, silly". Economic/social factors trump technical aspects 99% of the time, the 1% being technical revolutions. And Java or C# or Lisp being better than Javascript doesn't fall into the "revolution" category. Ergo Javascript everywhere :)

can run Javascript on the JVM, so I'm wondering what Node has over the JVM

Re: Closh – Bash-like shell based on Clojure

#120
post #89

Earlier quoted context omitted.

> I'm not sure how this would work with Python or JS. .method().method()?

I think the concept of piping is actually more similar to function(function()) than .method().method(), because you're not limited to the scope of your initial object's methods. And the truth is that functionB(functionA()) reads much worse than functionA | functionB , so yeah I agree that this is something that shell scripting languages got right.

Clojure has threading macros that turn (function(function(function) into

    (-> function
        function
        function)
An interesting take on that is a library called swiss arrows that lets you do

    (- (function arg1 )
         (function  arg2)
         (function arg1 arg2 )
Using the to indicate where the result of calling one shall be threaded into the next.
Post reply on HN