4 ms·
This is php.ini level of madness, and I'm glad it's gone from (semi-)modern shells. A formal (e.g. programming) language should be defined in its entirety by it
by rollcat 2y ago
This is php.ini level of madness, and I'm glad it's gone from (semi-)modern shells. A formal (e.g. programming) language should be defined in its entirety by its formal grammar, its semantics by a formal spec, etc. There's barely any good reason to let the system administrator change the logic and semantics of deployed code.
You could argue that Lisp reader macros also somewhat violate this rule. As a longtime Lisp fan, I dislike reader macros, but I'm more conflicted about macros in general. A good macro system should aim to provide enough context for IDEs and LSPs to aid the developer, but Lisp macros are entirely about just transforming the AST. It's usually just better to evolve the language.
- JdeBP 2y agoIt's not there to give the system administrator flexibility. It's there because early Unix was heavily constrained, and doing thing with lots of little overlays (and what was decades later known as "Bernstein chaining") rather than 1 big program was the way to architect stuff. exit(1), goto(1), and if(1) were all external commands in the Thompson shell. * https://v6sh.org https://v6sh.org
- rollcat 2y agoI would argue with almost anyone else, that this is a poor design, but... Thank you for your perspective, work, and contributions.
- hnlmorg 2y agoThe other thing to bear in mind is that it’s undergone literally decades of evolution while still being backwards compatible. The shells weren’t originally intended to be Turing complete. They were just a job launcher. What you use today would have been unimaginable when these shells were first designed. Whereas all other programming languages have had a drastically smaller evolution in comparison and yet still had a worse compatibility story. It’s very easy to be critical of the Bourne shell (and compatible shells too) because they are archaic by modern standards. But they weren’t written to solve modern problems. So it’s like looking at a bicycle and complaining how the designers didn’t design a sports car while ignoring the fact that technology didn’t exist and still push bikes are good enough for millions to use daily.
- pwg 2y agoYou are likely looking at this design from a modern system perspective. But the PDP-11 system that many of these designs were made upon had a minimum memory size of 4K bytes and with varying models that had different maximum memory sizes that are smaller than a single JPEG photo in today's world: PDP 11/45 max memory 256kbyte - PDP 11/70 max memory 4Mbyte. And this was the total memory for everything, the OS, and the users, and the system supported multiple users sharing the same machine at the same time. With those resource constraints, the design rules that determine good from poor are radically different than with one of today's systems with multiple Gb of RAM.
- JdeBP 2y agoAlso remember that in the early days Unix did segment swapping, with demand paging only coming in with BSD and the VAX. So there was no paging in just a tiny part of a big executable.
- ars 2y agoWhat in the world is "php.ini level of madness"? If you are trying to attack php you are not doing a good job of it, especially because there were good reason for using a separate program for glob.
- rollcat 2y agoI didn't consider the historical context, which several people in this thread provided. I already knew that "/etc" used to literally mean "etcetera" - "whatever doesn't fit elsewhere", but didn't immediately connect the dots that "/etc/glob" was still considered a fixed part of the system, and wasn't meant to be substituted by the administrator. I won't argue about PHP. I've dealt with it while there was money to be made from that, and moved on as soon as I had the chance. ¯\_(ツ)_/¯