Memories of memory

One of the limitations (or benefits if you look at it another way) of contemporary programming languages is that they deal with memory management so you don’t have to. Programmers don’t have to worry about stacks and heaps – they are hidden away in the dark recesses of the machine. C uses stacks and heaps, but the reality is that in most cases when a modern language talks about the stack, what it’s really referring to is the heap. It’s using the heap – and most programmers have no clue.

Python, for instance is implementation dependent in how it manages memory, although in most cases it is handled internally by some form of memory manager. For example Cpython uses a private heap containing all Python objects and data structures.

Does it really matter? In some cases no, not at all. There are situations when I don’t really care where or how something is stored. But there are other situations, such as embedded applications, where knowledge of memory management is paramount (hence the use of C-like languages on embedded systems).

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s