6 ms·
> The "Unix Philosophy" is intellectually bankrupt. The rest of your post appears to be about shell (presumably Bourne) script, leaving this claim unsupported.
by pdkl95 7y ago
> The "Unix Philosophy" is intellectually bankrupt.
The rest of your post appears to be about shell (presumably Bourne) script, leaving this claim unsupported. "UNIX philosophy" != "writing shell scripts".
> You shouldn't have to fork a process from the shell to multiply two floating point numbers
I can't remember a single time in the >25 years I've been writing Bourne shell (or bash) scripts where I've wanted to "multiply two floating point numbers". I've sent large lists of floating point numbers to various programs for processing, but other languages are far more appropriate for problems that requires any amount of actual calculation (especially floating point calculations). If I did need to multiply two floats for some reason, it would be such a rare event that the few hundred milliseconds "wasted" in spawning bc is utterly irrelevant.
You seem to be complaining about shell by selecting a feature that is not actually needed in common use. What, specifically, were you doing that you needed fast floating point match but needed to use Bourne shell instead of C/Python/whatever?
> fork a process ... do simple string manipulation.
For many types of string manipulation, you don't. Manipulating strings (command lines) is what the shell was designed to do! Sometimes sed/awk/etc is useful for complex tasks, but the shell's variable expansion and other builtins are generally enough for most simple needs.
And if your needs actually are complex, the cost to start another process (which is probably much smaller than you think) is insignificant.
- DonHopkins 7y agoYou're blinded by the limitations of your tools. Of course you wouldn't do something that's impossible with the shell, because you know it's impossible, and would switch to another language if you needed to do that. That doesn't mean that you never need to use floating point numbers. It just means you need to switch languages when you need to use them. Which is my point. And no, the kind of stuff you need to fork sed or awk to do is not "complex". It's simple. It only seems complex because you're writing a shell script, and the backflips you have to do to escape the parameters and fork the processes to do that simple string manipulation is complex, not the string manipulation itself.
- mixmastamyk 7y agoPerhaps you are arguing for a better shell? Which is something I could get behind. bash has always been a bit of a mess. xonsh is one example of a better one, however I am currently using fish. fish has a math and string manipulation builtin. https://fishshell.com/docs/current/commands.html#math https://fishshell.com/docs/current/commands.html#math https://fishshell.com/docs/current/commands.html#string https://fishshell.com/docs/current/commands.html#string https://xon.sh/tutorial.html https://xon.sh/tutorial.html
- DonHopkins 7y agoNope. See above.
- mixmastamyk 7y agoIf you’re not interested in solutions then you’re wasting everyone’s time.
- DonHopkins 7y agoIf you're pushing a solution that's worse than existing practical widely used well supported alternatives, you're wasting everyone's time. I have already proposed an extremely practical, totally open, standards compliant, easily predictable, inevitable solution. What is your response to my posts about pushing something like Electron down to the bare metal? It's not as if there aren't already thousands of extremely talented people across hundreds of different companies and organizations, all working towards towards making that possible and efficient. It's not as if the tooling doesn't already exist and isn't widely supported and rapidly evolving. There is no need for X-Windows, and no need for Wayland, because a web browser running on bare metal could do everything they do, and so much more, in a vastly more flexible, standards compliant, modular, powerful, efficient way. And it would be a much better platform for implementing a shell, user agent, desktop, window manager, and even a visual programming environment than the half-assed mish-mash Turing Tarpit of shell scripting languages Unix has suffered with for so many decades, which themselves don't even adhere to the so-called "Unix Philosophy". https://snap.berkeley.edu/ https://snap.berkeley.edu/ AND it would be truly extensible (even capable of gasp multiplying floating point numbers and doing non-trivial string manipulation without forking heavy weight processes), which X-Windows and Wayland are not, which means it can be fundamentally much more efficient, by downloading code to implement application specific protocols and local interaction, like NeWS did decades ago, but X-Windows and Wayland foolishly and stubbornly refused to do by design. (It's not like the ideas behind NeWS were unknown to the designers of X-Windows and Wayland -- they just chose to ignore them. And now here we are.) You've got JavaScript and WebAssembly for programming, WebGL and <canvas> and <video> and DHTML and CSS for drawing (including low latency rendering with desynchronized canvases), JSON and XML and ArrayBuffer for data representation, HTTP and WebSockets and WebRTC for networking. What is it missing? https://developers.google.com/web/updates/2019/05/desynchronized https://developers.google.com/web/updates/2019/05/desynchron... That design has been well proven and is widely used throughout the industry. It's not a new idea, but kids these days refer to it as "AJAX". There's no need for a bunch of useless layers underneath the web browser any more. It's time for X-Windows and Wayland to fade away into the depths of history.
- DonHopkins 7y ago>I can't remember a single time in the >25 years I've been writing Bourne shell (or bash) scripts where I've wanted to "multiply two floating point numbers". Your attitude about not being able to imagine any reason why you'd ever need to use floating point reminds me of the HP technical support person that Steve Strassmann quoted in his email to the Unix-Haters mailing list on Apr 10, 1991: https://medium.com/@donhopkins/the-x-windows-disaster-128d398ebd47#40a1 https://medium.com/@donhopkins/the-x-windows-disaster-128d39... >My super 3D graphics, then, runs only on /dev/crt1, and X windows runs only on /dev/crt0. Of course, this means I cannot move my mouse over to the 3d graphics display, but as the HP technical support person said “Why would you ever need to point to something that you’ve drawn in 3D?”