LWN.net Logo

New system programming language

New system programming language

Posted Dec 6, 2008 18:18 UTC (Sat) by drag (subscriber, #31333)
In reply to: New system programming language by njs
Parent article: Python 3.0 released

There are module writing languages for python.. I am aware mainly of cython/pyrex. (pyrex being more serious, cython more open to add-ons)

http://en.wikipedia.org/wiki/Pyrex_(programming_language)
http://wiki.cython.org/DynamicMemoryAllocation

The old story for python performance is:
1. write program
2. profile program
3. optimize and redesign in pure python as much as possible
4. if more performance is needed then move the relevant portions of the program out to C and bring it back in as a module. (Cython/Pyrex are trying to make it easier without all the boilerplate.)

This way you get the app rapidly prototyped and written and identify areas were performance and optimization work is actually necessary rather then trying to guess ahead of time.

I don't know particularly how successful this approach is, but it's what is mentioned in the literature and seems to make sense to me.

This way you get to use GC and then also do the manual memory stuff were it matters. Have your cake and eat it, too.


(Log in to post comments)

New system programming language

Posted Dec 7, 2008 0:24 UTC (Sun) by njs (subscriber, #40338) [Link]

Pyrex/Cython are indeed *fantastic*. But they don't really create the kind of system I'm talking about here, because 1) they're usually used to define little self-contained computational cores and simple wrappers around foreign code, so their interaction with overall memory management is minimal (except that they let you temporarily avoid the constant heap allocations that tend to bottleneck pure Python code), 2) they don't provide any tools beyond malloc/free anyway.

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds