Hacker News new | ask | show | jobs
by aterp 484 days ago
Might be interesting to folks in this thread - I'm working on a CLI tool/language which aims to let people write better scripts, more easily. It integrates well with Bash if it's needed, but lets you to avoid writing whole scripts in Bash and particularly some of the more painful aspects like arg parsing.

This page gives a bit of a preview, plus there are some links at the bottom to additional features. Still under development tho!

https://amterp.github.io/rad/guide/getting-started/

2 comments

Work on what you want, so don't let me deter you. But in my personal case, what pushed me from fish to xonsh was that I could never quite internalize the way it wanted to do functions, if statements (and tests inside them) and loops.

Once you were reading code, it made sense for the most part. But when I had to write a new multiline command or a script, I had to look things up in documentation constantly. For my brain "similar but different" was torture, not an advantage.

With Xonsh you get real Python and this solves all my problems. As soon as you learn what $VAR, $(CMD), and @EXPR do, you're good to go!

I hear you, real Python has its benefits :) The way I see it, these are different approaches to solving similar (but still quite different) problems. In the case of rad, it's just a language, it's not trying to replace your shell, but the fact that it's only Python-like might indeed deter some people. But - it also opens up some unique syntax that can be tailored really well to CLI scripts. For example, the syntax for args [1] or json "rad blocks" [2], as I've called them.

[1] https://amterp.github.io/rad/guide/args/#arg-declarations

[2] https://amterp.github.io/rad/guide/rad-blocks/#basic-example

Is composability not a goal of this language? Like how do you capture the output of an if block? Or how do you suppress one's output while retaining other side effects like variable assignments?
Don't think I'm understanding what you mean - composability of what exactly? It's a very Python-like language, so if-blocks behave like they do in Python/C, etc. Suppressing one's output: are you referring to invoking shell commands? Each shell invocation (at the moment) happens in its own session, independent of others, so variable assignments really only matter if you're basically embedding a shell script in RSL as e.g. a multiline string, and then invoking it. But I might be misunderstanding what you mean!
Oh, it's not like what I thought then. Okay