4 ms·
Never used OilShell (OSH) before, but this opening line on their home page struck me: > … and it's a new language for Python and JavaScript users who avoid she
by maegul 4y ago
Never used OilShell (OSH) before, but this opening line on their home page struck me:
> … and it's a new language for Python and JavaScript users who avoid shell!
Why not work towards using python/JavaScript as shell languages? There was a HN thread a few days ago on Xonsh, the main python attempt at this which looks nice to me, which naturally got a lot of anti-anti-bash energy. But if we want better shell ergonomics and are willing to ditch bash, why not take popular versatile and capable languages and get them shell-appropriate? It seems like a natural use case for these languages, and even the place where they could retire to peacefully in the future.
I suppose OSH is aiming at bash compatibility, but how good or viable is that really (not a rhetorical question)? Seems to me like an all or nothing thing as someone who recently ran into some bash-zsh incompatibility.
~~~
HN thread on Xonsh: https://news.ycombinator.com/item?id=33044772 https://news.ycombinator.com/item?id=33044772
Xonsh homepage: https://xon.sh/ https://xon.sh/
- Dylan16807 4y agoI tried xonsh for a while but it was just so slow to chdir a good fraction of the time that I gave up. (Running under WSL2, navigating around linux and windows directories.) Also looking up the syntax was awkward and I still had to copy and paste to make editing multi-line commands be sane.
- aidenn0 4y agoThese questions are mostly addressed here: https://www.oilshell.org/blog/2021/01/why-a-new-shell.html#i-dont-understand-why-not-use-a-different-a-programming-language https://www.oilshell.org/blog/2021/01/why-a-new-shell.html#i... Note that osh is (really very nearly[1]) bash compatible by default, but you can opt in to incompatible parts. This lets you convert a large body of shell code gradually. 1: I think the only incompatibility is that in osh you can't index into associative arrays with unquoted words. IIRC this was to make parsing of osh decidable.
- matheusmoreira 4y ago> Why not work towards using python/JavaScript as shell languages? I always refer to this awesome answer to that question: https://stackoverflow.com/a/3640403/512904 https://stackoverflow.com/a/3640403/512904
- maegul 4y agoNice run down. But in this context it seems to boil down to > I have the feeling that trying to address these points by bolting features or DSLs onto a general-purpose programming language doesn't work. At least, I have yet to see a convincing implementation of it. … and what is worth doing, a new shell or new features in an old language, which isn’t addressed by that post AFAICT.
- chubot 4y agoA short answer would be that dozens of projects like this already exist and have existed for decades (scsh was mentioned in this thread), and they aren't widely used as shell replacements: https://github.com/oilshell/oil/wiki/Internal-DSLs-for-Shell https://github.com/oilshell/oil/wiki/Internal-DSLs-for-Shell https://github.com/oilshell/oil/wiki/Alternative-Shells https://github.com/oilshell/oil/wiki/Alternative-Shells It doesn't mean they aren't useful, but we still need a better successor to Bourne shell / bash.