3 ms·
The fact that posix shell is somehow state of the art of concurrent pipeline and filesystem interface is really more a critique of state of the art than a prais
by lapinot 4y ago
The fact that posix shell is somehow state of the art of concurrent pipeline and filesystem interface is really more a critique of state of the art than a praise of shell.
I'm doing programming language research and it's just infuriating how retrograde shell is. Its design is a fossil of history, and boy did our understanding of what makes a good language evolve. As a proof of this look at the jq tool. It is so powerful and clean. The implementation is simple and reasonably fast. It has been designed by a researcher from functional languages (an ocaml guy). This is a way to build a language around pipelining. At a lesser level, look at how moving from vimscript to lua in neovim has brought so many high-quality new plugins, look at how many people now tinker with low-level stuff and write high-perf libraries now that C/C++ is not the only choice. Surface language and having very little very orthogonal concepts is important.
Some core implementation patterns for PL are very old, but there have been lots of simplifications and rationalizations in surface language. Error handling, values hygiene, scoping, simple datastructures. Posix shell might have been a prowess in the 70s, now it is mostly a hack and this is a fact. Let's be a bit less superficial when honoring the unix mantras and dream about something better (making a better shell for its core ideas(!), that is, handling processes and fds).
- lozenge 4y agoPowershell is the new shell. As it passes objects the filtering, sorting, joining is generic across files or any other data type.
- chasil 4y agoAnd it is so wonderously mistaken in assigning a boolean type to $?. I really cannot fathom how this could be, as Microsoft bundles curl, which has nearly 100 exit codes on various types of failure. Whoever made this language decision needs to explain themselves.
- delta_p_delta_x 4y ago> And it is so wonderously mistaken in assigning a boolean type to $? Use $LASTEXITCODE for native executables, and $? for PowerShell cmdlets. https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-7.3#lastexitcode https://learn.microsoft.com/en-us/powershell/module/microsof...
- _dain_ 4y agoThe oil shell is an attempt to move forward: https://www.oilshell.org/ https://www.oilshell.org/