3 ms·
Even more important, let's stop seeing bash. If somebody had set out to create a language prone to error and exploitation, bash would result. (It's fine for i
by notacoward 10y ago
Even more important, let's stop seeing bash.
If somebody had set out to create a language prone to error and exploitation, bash would result. (It's fine for interactive use BTW, just not as a language in which to write anything complex or long-lived.) While it might not have C's pointer/memory problems, its lack of real types or scope rules and its other idiosyncrasies (e.g. making it nearly impossible to distinguish "" from an undefined variable or the whole $*/$@ mess) make it even more of a nightmare. I've actually gotten pretty handy with it because I had to, but it's a far worse crime against developer sanity than C ever was.
- seagreen 10y agoTotally agree! By the way, the Haskell community is working to make scripting easier in Haskell, so if you want to go from one of the most buggy languages straight to one of the least, now you can: https://docs.haskellstack.org/en/stable/GUIDE/#script-interpreter https://docs.haskellstack.org/en/stable/GUIDE/#script-interp... (Downsides: Haskell is weird (but good), you have to have Stack installed, and the first time you run the script it will take a while to download dependencies) More resources: https://github.com/Gabriel439/post-rfc/blob/master/sotu.md#scripting--command-line-applications https://github.com/Gabriel439/post-rfc/blob/master/sotu.md#s...
- nickpsecurity 10y agoIt was actually only recently that I realized how ridiculous bash was. I was looking for a formal semantics of it in reply to a comment here. I found nothing except a partial attempt by some academics plus a list of everything a real one would need. I thought "Holy crap, that's overcomplicated!" Interesting enough, a Scheme or even BASIC-like language with macros (eg 4GL) couldve handled about all that just as readably while building on a simpler, consistent core. Bash wasn't designed like that, though. So, I ditched it altogether except as compilation target.