Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"it's slow"

"just write a C extension"

"but then why use Python?"



    "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.


Because 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.


Because 90% of the runtime is spent in 10% of the code.


Because beautiful control structures and a REPL ?


I'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.


There are many languages that offer that alongside an AOT compiler to native code.


Well 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: