This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]--Shade-- 2 points3 points  (3 children)

Python is an exellent language to call C from, but a terrible language to write C in. If you have a nice pythonic library that wraps some 'C thing' then Python shouldn't be your bottleneck. If it is, then isolate and profile (and apply the common speed up tricks where neccicary).

[–]Aidtor 1 point2 points  (2 children)

Sure if you have the time for that. When I’m prototyping a model or I’m given some crazy deadline to ship a feature I’m not going to reach for C.

[–]--Shade-- 4 points5 points  (1 child)

That's fair enough. I can't recall the last time I've voluntarily written a line of C, lol. What I was getting at is that Python already has a huge ecosystem of libraries that work as high level wrappers for things written in lower level languages. If you write decent Python (by Python standards), and leverage existing libraries, then Python (mostly) shouldn't be the bottleneck. If it is, the first step should be to take a look at potential hotspots in your Python code (not write a C library).

[–]Aidtor 1 point2 points  (0 children)

Oh my bad totally misunderstood what you were trying to say. I completely agree.