4 ms·
Some people on this website keep insisting that you should use the 20 or so Unix DSLs to solve small problems, and then graduate to a general-purpose language l
by ogogmad 5y ago
Some people on this website keep insisting that you should use the 20 or so Unix DSLs to solve small problems, and then graduate to a general-purpose language like Python when you have a big one. I have pointed out one problem with this, which is that it means you have to learn a ton of arcania for each Unix DSL, and you end up with a Rube Goldberg machine of DSLs invoking DSLs. This post points out another set of problems. I now just use Xonsh (a Python dialect with some syntax sugar for shell things). Some people say that this might stop working after some updates, but I don't do this for a living, and those of you who likewise don't should consider following me.
- rubatuga 5y agoTerrible idea to mix shell and Python, what were they thinking. Have random bash lines suddenly be treated as Python?
- ogogmad 5y agoThere's an escape sequence for shell commands, and an escape sequence within that for ordinary Python code. It works fine. The reality is that most Unix DSLs are similar to subsets of Python. Yes, Python is not the global optimum of programming languages forever more amen, but most Unix DSLs are effectively just ad-hoc procedural languages, and therefore special cases of Python. And if you're going to use Python aggressively for other things, then there's a benefit to using it as a shell as well, and thereby get some consistency.