Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I learnt that memory model of python interpreter is dictionaries of dictionaries, where each module is a dictionary. Let me elaborate more on this with an example,

After i run >>> python hog.py(say), all name-value bindings written in hog.py file are part of __main__ module. name is part of current module will point to value(everything is an object) sitting in heap.

Every module has global frame and local frame`.

In hog.py file, When i say,

from dice import four_sided_dice, six_sided_dice, make_test_dice

from ucb import main, trace, log_current_line, interact

These aforementioned functions will execute in the scope of module ucb or dice module respectively but not in the scope of __main__ module.

In above syntax, imports with names are like pointers to functions in the module outside __main__ module. This can be verified using the value of global variable __name__.

=======================

Javascript engine sits in the browser.

How does memory model of Java script engine work?

share|improve this question
    
This article describes Javascript's memory model in detail. –  Robert Harvey Apr 25 at 19:51
    
@RobertHarvey memg mgmt is different topic. I mean, like in, python has module with one global frame and multiple local frames. Each frame has name-value bindings. values are all objects sitting in heap. So, my query is about memory layout(model). –  overexchange Apr 26 at 12:13
    
I would imagine that every Javascript engine is going to be a little bit different. Most language specifications don't care how you layout memory underneath. Is it reasonable to expect Javascript programmers to know these kinds of details? –  Robert Harvey Apr 26 at 14:13
    
Also, your question could be a bit more specific. "How does memory model of Java script engine work" is a bit broad. –  Robert Harvey Apr 26 at 14:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.