Live data from Hacker News

Closh – Bash-like shell based on Clojure

github.com

31–40 of 138 posts

Re: Closh – Bash-like shell based on Clojure

#31
post #12

Earlier quoted context omitted.

Node is the runtime for ClojureScript. The whole shell runs in Node.

what's the tradeoff of clojurescript over native clojure? wouldn't the java clojure runtime be much faster?

I find to hack on clojurescript on node easier. Also it is easier and starts faster.

But many parts of code are platform agnostic. I think it would be cool to eventually port the system specific parts to java apis and have both.

Re: Closh – Bash-like shell based on Clojure

#32
post #12

Earlier quoted context omitted.

Node is the runtime for ClojureScript. The whole shell runs in Node.

what's the tradeoff of clojurescript over native clojure? wouldn't the java clojure runtime be much faster?

Clojure/JVM apps are very slow to start, which makes them particularly unsuitable for a shell, where you typically don't want to wait a few seconds for the prompt to become interactive.

Re: Closh – Bash-like shell based on Clojure

#34
post #20

Very cool! I use Clojure on a daily basis for coding, this is a great addition to the arsenal :) Actually, my main argument against _not using it_ is that Bash has this awkward syntax that is hard to remember if you don't use it often... But anyway, I keep forgetting it after years so I might as well embrace it and take the leap to use this. Thanks for the initiative!

Thanks, exactly!

Re: Closh – Bash-like shell based on Clojure

#35
post #27

Earlier quoted context omitted.

yes. and multithreaded. Theres no meaningful reason to use cljs other than to avoid java or if the java runtime isn’t available (eg. browser).

startup time: not sure it's good ux to wait seconds for every command... lumo/cljs is instantaneous

500-600ms is, to be fair, a big one time cost.

The downsides are pretty darn significant though. I can’t imagine a situation where I would trade ‘starts a bit faster’ for ‘throw away all parallelism in code’ personally... but hey. Plenty of people use node for very serious stuff.

I suppose I just think this is an example of fast and cheap on the fast/cheap/good scale.

Re: Closh – Bash-like shell based on Clojure

#37
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…

Rash? Rust Already SHell (There's already a "RuSH" made with Ruby). Oh. https://github.com/redox-os/ion

CLASH - Common Lisp Again SHell? Oh. http://www.cliki.net/CLISP-Shell

Doh! https://docs.racket-lang.org/rash/index.html

Someone put OO in my Linux shell! https://virtualizationreview.com/articles/2017/06/01/how-to-...

Re: Closh – Bash-like shell based on Clojure

#38
post #6

another lisp shell: https://scsh.net/

scsh is awesome, although I don't believe it was intended to be used interactively.

eshell[0] is another one. Has a few warts, but is generally pretty cool.

Someday I'd like to write one in Common Lisp. Just haven't gotten a round tuit yet.

[0] https://www.gnu.org/software/emacs/manual/html_mono/eshell.h...

Re: Closh – Bash-like shell based on Clojure

#39
post #31

Earlier quoted context omitted.

what's the tradeoff of clojurescript over native clojure? wouldn't the java clojure runtime be much faster?

I find to hack on clojurescript on node easier. Also it is easier and starts faster. But many parts of code are platform agnostic. I think it would be cool to eventually port the system specific parts to java apis and have both.

What does your development environment look like? Every time I bail on a Cljs project it's because tooling is worse than for Clj.

Re: Closh – Bash-like shell based on Clojure

#40
post #39
post #31

Earlier quoted context omitted.

I find to hack on clojurescript on node easier. Also it is easier and starts faster. But many parts of code are platform agnostic. I think it would be cool to eventually port the system specific parts to java apis and have both.

What does your development environment look like? Every time I bail on a Cljs project it's because tooling is worse than for Clj.

I use Spacemacs and have the following in inside my .spacemacs in the dotspacemacs/user-config functions:

      (require 'cider)                                  
      (setq cider-cljs-lein-repl                                                                             
        "(do                                        
            (require 'figwheel-sidecar.repl-api)                                                         
            (figwheel-sidecar.repl-api/start-figwheel!)
            (figwheel-sidecar.repl-api/cljs-repl))")
Then I just use figwheel to manage my cljs projects (I think this is the default now for reagent and luminus projects, it's also the default for re-natal for react native development in cljs). Life is pretty good and I have a nice debugger via Chrome.

I prefer the debugger in CIDER (which doesn't work for cljs) to the debugger in Chrome, but the Chrome debugger is decent (and it's what I'd have in Javascript anyway). There is a nice chrome extension to help with clojurescript eval in the browser/debugger called dirac: https://github.com/binaryage/dirac

Post reply on HN