I'm officially replacing ZSH with babashka โ for scripting, not for interactive shell. A lot to learn for me, but so far it works great and I'm really happy with the transition. ZSH is a great shell, but for writing long and complicated scripts it ain't no fun. Great job @borkdude, cheers!
> not for interactive shell yet
@dromar56 Wouldn't that be just totally wicked? I really loved the idea of https://github.com/dundalek/closh, but it doesn't seem to be developed much these days and the current state is not really that great. I'd love a modern shell, one that works with structured data rather than treating everything as a string. But the barrier is high: as much as the traditional shells are not great in many things, they have good/great UI and are supported by everyone. ZSH completions for instance are really great. With that said I'm rooting for some modern solution, preferably CJ-based!
Yeah, I was hoping something based on CJ, especially since I already chose babashka for scripting. But you're right, there's eshell and I actually do want to look into it, the integration of shell with Emacs sounds great (so one doesn't have to copy file paths from the shell and the like, because we're already in Emacs etc).
Any highlights / comments about eshell? Since I don't have much experience using it, I'd like to know how is it in practice.
I'm pretty fond of ZSH I have to say. But only for interactive shell, not for scripting. It has many very handy features. Unfortunately the documentation is bloody awful.
Still, I really wish for something that could mix some Lisp (preferably CJ) with commands. Closh does that. And stop treating everything as text, I mean it's so annoying when you parse output of something in tables, say ps aux
with awk '{print $2}'
and then there's a string with spaces in one of the columns, which throws off awk and now you have invalid data. (ps doesn't do that, but I run into this issue so many times and it's really hard to solve in shell).
It's a difficult issue to solve though, since output of commands really is strings, but maybe there could be some way around it? New convention of printing out say JSON, so we could understand what the data really mean, where is beginning/end of a cell etc?
Who knows, it's hard, but it should be solved.
Besides closh, which Iโve heard before but never used, thereโs also emacโs eshell
I +1 the completions issue, not having them is for me one of the biggest issues using eshell
Some Monday morning programming fun: Game of Life on the command line (thanks to @cgrand for the brilliant data structure and accompanying neighbours
and step
function). ~ 20 loc and then some data to create some game of life objects ๐ค
https://gist.github.com/mmzsource/655b9dcfe56eed8a045022837186ed84
@borkdude already added to https://github.com/babashka/babashka/discussions/categories/show-and-tell ๐
Awesome, thank you!
@mmz what is next... tetris? :)
probably ๐
if you don't want to do it from scratch, you could try to port https://github.com/borkdude/console-tetris
this relies on the lanterna library but I think it would be nicer to have it as a "simple" script
the most complicated part is reading a single key without enter
good point :thinking_face:
:face_with_monocle:
Hi, I'm using Cursive for writing Clojure. Recently I wrote some scripts in Babashka, but I couldn't manage to make code highlighting as good as it is for regular Clojure code. Do you have any hints how to write Babashka from Cursive?
Thanks a lot @cfleming ๐