4 ms·
You're still making a false equivalence and a bad analogy, whatevers. So I'll make an analogy too: A turtle -vs- a snail are the same order of magnitude slow.
by DonHopkins 8y ago
You're still making a false equivalence and a bad analogy, whatevers.
So I'll make an analogy too: A turtle -vs- a snail are the same order of magnitude slow. The Nazis -vs- the protesters are not of the same order of magnitude evil in Charlottesville, just like forking a new process -vs- dynamically dispatching to a function in the same process are not of the same order of magnitude slow in Unix.
And I'll reiterate:
With Python (and JavaScript) it's POSSIBLE and even NORMAL for a JIT compiler to optimize the code to call mul instructions directly. PyPy is a thing, it's free, and it works just fine, thank you:
https://pypy.org/ https://pypy.org/
But it's IMPOSSIBLE to implement a bash JIT compiler (or even AOT compiler) that optimizes out the millions of instructions that are required to make a system call to fork "bc" to call that same "mul" instruction. In Linux, you simply can't optimize out system calls. (Unless Alexia Massalin's Synthesis kernel is giving you a free piggy back ride ;).
https://en.wikipedia.org/wiki/Alexia_Massalin https://en.wikipedia.org/wiki/Alexia_Massalin
http://infolab.stanford.edu/~manku/quals/summaries/gribble-synthesis.htm http://infolab.stanford.edu/~manku/quals/summaries/gribble-s...
And no, integrating "bc" into bash isn't a valid solution, or they would have done it ages ago. How about integrating the canvas API into bash too, while you're at it? Tell me when you convince them to accept your pull request!
- civility 8y ago> The Nazis and the Anti-Nazi protesters were not of the same order of magnitude of evil in Charlottesville Are you intentionally invoking Godwin's law because you know your argument is untenable? > PyPy is a thing, and it works just fine, you know I like PyPy. It's not perfect, but it's pretty good. Maybe you should recommend that in the first place next time. > But it's IMPOSSIBLE to implement a bash JIT compiler [...] to fork "bc" Never say never. Before V8, everyone thought JavaScript had to be as slow as Python too. Now we have PyPy and LuaJIT, which I would've thought were impossible. > And no, integrating "bc" into bash isn't a valid solution, or they would have done it ages ago You seem really hung up on "bc". You do realize that "echo" wasn't always a builtin, and that they added it for performance reasons, right? If anyone cared enough, they could add "bc" as a builtin. Hell, the expression evaluator for integers is well on it's way. You're right that probably nobody cares enough to build in "bc", but I wouldn't be surprised to see a triple paren or square bracket math interpreter with floating point support in bash someday. Heh, maybe they'll even add complex numbers. And a bash JIT is exactly the kind of thing some grad student would do for the absurdity of it all.
- DonHopkins 8y agoEven Michael Godwin says there are times when it's acceptable to compare shitheads to Nazis. https://www.thestranger.com/slog/2018/06/19/27874178/godwins-law-suspended-by-godwin https://www.thestranger.com/slog/2018/06/19/27874178/godwins... https://twitter.com/sfmnemonic/status/896884949634232320 https://twitter.com/sfmnemonic/status/896884949634232320 >Maybe you should recommend that in the first place next time. For the third or so time, Python is not the point. I'm not recommending any particular language (or I would have mentioned Lua and Lisp), I'm dis-recommending bash, and merely using Python and JavaScript as widely known and well understood counter-examples. And I say impossible because of the insurmountable social resistance you would encounter from the bash developers who were not insane, if you actually tried to integrate "bc" into bash. You admit floating point math in bash would be a good idea, and you seem to think integrating in a way that's compatible with bc's and bash's wonderful mish-mash syntax (the same way bash integrated "echo"), (((or worse yet adding even more mish-mash syntax to bash))), instead of simply building floating point and a library with sin and cos into the language itself is a good idea, so tell me why it hasn't already happened in all these years? >And a bash JIT is exactly the kind of thing some grad student would do for the absurdity of it all. That was exactly my point in mentioning the Synthesis Kernel. As brilliant as it was, who's actually running it now? Just because a genius grad student comes up with something brilliant and groundbreaking and beautiful like that, doesn't mean it's practical in the real world. Seriously, you should read about it -- it's a classic paper from 1988 Usenix: https://www.usenix.org/legacy/publications/compsystems/1988/win_pu.pdf https://www.usenix.org/legacy/publications/compsystems/1988/... But PyPy and V8 are here today, run everywhere, behave identically across all platforms including the most popular one Windows, work just great, are well supported and going places fast, and they're both perfectly capable of calling the mul and cos instruction directly and even drawing pie charts. While you're farting bubbles in the bathtub about integrating "bc" into bash, and haven't even proposed how you'll integrate the canvas api yet.
- civility 8y ago> Even Michael Godwin says there are times when it's acceptable to compare shitheads to Nazis I wonder if we were in our early 20s during Nazi Germany if either of us would have the wherewithal to reject being a Nazi. I suspect we're all shitheads depending on the context. > I'm dis-recommnending bash. Yeah, I got that. I just thought it was absurd for you to only aim for a few orders of magnitude speed improvement when you could've easily gotten several more by arguing for something faster than Python. > You admit floating point math in bash would be a good idea, and you seem to think [...] You're doing that thing again where you try to represent my argument for me. This time instead of telling me what I might say, you're telling me what I think. You're wrong again, and it's still a poor argument strategy. I'm not defending or advocating bash. I'm certainly not recommending any improvements to it - I only said they were possible. I am however calling you out for recommending Python in any case where performance matters.