Fork me on GitHub
#babashka
<
2021-06-28
>
Jakub Šťastný01:06:12

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!

❤️ 9
🎉 3
solf02:06:35

> not for interactive shell yet

Jakub Šťastný02:06:37

@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!

solf02:06:37

Besides closh, which I’ve heard before but never used, there’s also emac’s eshell

solf02:06:29

I +1 the completions issue, not having them is for me one of the biggest issues using eshell

Jakub Šťastný14:06:17

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.

mmz10:06:14

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

borkdude10:06:30

Awesome, thank you!

3
borkdude11:06:20

@U088NU894 what is next... tetris? :)

mmz12:06:23

probably 😅

borkdude12:06:06

if you don't want to do it from scratch, you could try to port https://github.com/borkdude/console-tetris

🤓 3
borkdude12:06:45

this relies on the lanterna library but I think it would be nicer to have it as a "simple" script

babashka 3
borkdude12:06:33

the most complicated part is reading a single key without enter

mmz12:06:55

good point :thinking_face:

mmz12:06:01

:face_with_monocle:

greg22:06:15

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?

cfleming05:06:03

So there isn’t really a great solution for this at the moment. I’m working on it though, assuming there are no major hiccups bb support will be in the next Cursive version (1.11, I’ve had more 1.10.x releases than expected due to bugs).

2
greg11:06:16

Thanks a lot @U0567Q30W 🙇