3 ms·
"So then I had to rewrite critical sections of the Python in C" I think that's kinda the point; rewriting critical sections in C is pretty much Working As Inte
by nostrademons 14y ago
"So then I had to rewrite critical sections of the Python in C"
I think that's kinda the point; rewriting critical sections in C is pretty much Working As Intended. That's why it's a scripting language. The point is that you didn't have to write the whole thing in C.
- fauigerzigerk 14y agoDo you think that most Python developers can write safe C code? I doubt it but I have no data on it either.
- nilliams 14y agoA fairly moot point. Do you think most C developers can write safe C code? The 2 I've encountered in my short career basically have no idea what they're doing (which I suspect is partly why they stuck with C instead of exploring alternative languages).
- fauigerzigerk 14y agoIf that were the case it would make the situation even worse. It means the whole "write performance critical parts in C" argument is bogus.
- nostrademons 14y agoTo answer your original question - no, but there's less C code than the equivalent C-only program, so you're still better off. Or if your argument is that C is a security nightmare (which you won't find much argument from me on), replace C/CPython with Java/Jython.
- pcwalton 14y agoYou could write performance critical parts in a safer language, though, such as Rust (disclaimer: I work on Rust). C isn't the only option here.
- coldtea 14y ago>I think that's kinda the point; rewriting critical sections in C is pretty much Working As Intended. That's why it's a scripting language. No, it's pretty much not "Working As Intended". It's just "Working as we have been used to, because, well, what can you do?". As V8, IonMonkey, Dart, Smalltalk VMs, LuaJIT, even PyPy etc have showed, nothing prevents Python from being an order of magnitude faster (and sometimes up to two), while remaining just as dynamic. Rewriting parts of a Python program in C is not a technical necessity due to some (unsurmountable) theoretical limit. It's a technical necessity because of a non optimal interpreter implementation.
- pekk 14y agoIt isn't a necessity at all. It's an available option. How would you write PyPy to be "an order of magnitude faster"?