4 ms·
> Thanks for illustrating how some people still completely miss the point. You're being feisty, whatever. > We are discussing the overhead of forking processe
by civility 7y ago
> Thanks for illustrating how some people still completely miss the point.
You're being feisty, whatever.
> We are discussing the overhead of forking processes to do math, which Python doesn't have to do.
Python uses dynamic dispatch on boxed types for every single operation. You're right this /only/ takes hundreds of instructions, but that just shows my analogy is appropriate. That's the turtle, in case you didn't understand it. I think it's silly for you to say this is "tolerably slow" for anyone but yourself. For other people, a fork per operation is completely tolerable. (I'm not one of those people...)
> [...] explain how a bash JIT compiler could optimize out all the instructions necessary to fork "bc" to call the cos instruction.
If anyone cared, bash could implement "bc" as a builtin the same way it does "echo". That'd be ugly, but it seems like the kind of thing the GNU folks would do if it was a common enough use case.
- DonHopkins 7y agoYou'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 7y 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 7y 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.