Earlier quoted context omitted.
that was kind of a rhetoric question. i was already pretty sure it would work. so the real question is what is actually needed. i found the call documentation. that's a good start, but that is pretty much what every other language also provides. what is still needed is a wrapper that allows me to write somestr: some command --with arguments and have that string be populated with the "some" command output. but then we…
Ah, yeah, that makes sense, then. I tried writing a shell in GNU Smalltalk, but had to mess with the parser - otherwise, the need to parenthesize subexpressions makes it really tedious. I implemented |> as a pseudo-operator that implicitly parenthesized everything before it, which was then removed from the expression. It worked for many simple cases, but wasn't pretty and quickly broke down for more complex ones. I t…
shell [
var: [cmd1 arg --switch arg2]
[cmd2 :var]
]
as a general shape of the DSL. The need for a separator goes away (and simplifies the grammar a lot) if you require commands to be nested blocks. :var works for interpolation, because it's loaded as get-word! - trying to cram $var there wouldn't work (that's a syntax for `money!` - only digits are accepted after `$`), but if you want A shell, not BASH specifically, I think you can get away with some syntactic changes. I checked some of the things the model proposed in the REPL, and they mostly seem to work. Subshells and piping would probably require more work in this setup, but it should be doable.Again: really interesting language and seemingly a good fit for an internal shell DSL. It's also trivial to make files written in this DSL execute as scripts. I might have jumped the gun a little with my "why would you" question at the start :) Personally, I would still seriously consider Io, but that's just a familiarity bias: I spent a year hacking Io internals, while I know little about Red.
[1] https://chatgpt.com/share/6a469cbb-1754-83eb-94b8-14bef67735...