3 ms·
"it's slow" "just write a C extension" "but then why use Python?"
by slantedview 12y ago
"it's slow"
"just write a C extension"
"but then why use Python?"
- nightcracker 12y agoBecause 90% of the runtime is spent in 10% of the code.
- bch 12y agoBecause beautiful control structures and a REPL ?
- pjmlp 12y agoThere are many languages that offer that alongside an AOT compiler to native code.
- bch 12y agoWell sure -- but I guess considering Python at all suggests you want or need to. Python control and the REPL are _fine_ reasons to use it. To be clear though, I'm a Tcl-er, but I use it in exactly this context. I meant my comment to stand along the other sibling comments.
- slantedview 12y agoI'm not sure that these are compelling reasons to use Python, given the alternatives. Squeezing performance out of Python often involves dropping down to C. This isn't the case with the competition.
- AlexeyBrin 12y ago"it's slow" "just write a C extension" "but then why use Python?" Because you typically need to write a C extension for like 2% or your code, while you could keep the remaining 98% in an easier to write (and more compact) language.
- deleted 12y ago[deleted]
- bsder 12y agoBecause the C extension you need has probably already been written. This is the same kind of network effect that drove Perl usage for some many years. CPAN had it. Even if I didn't want to use Perl, CPAN was overwhelmingly compelling. Python has since taken on that mantle.