How Inception is like metaprogramming

The dreams-within-dreams concept from the movie Inception is being compared by programmers to a recursive function. A parallel exists between dreams-within-dreams and programs-within-programs. As you're watching the movie,especially in the later sequences,you are watching it on four and even five levels. The events that occur on each level have consequences for those levels below it. When the dreaming is over, the lower levels get to return the favor,having consequences on the levels above them by how they changed the dreamers themselves. To follow the movie you need to have an understanding of what is going on at each level. Similarly in metaprograaming, you need an awareness of what level you are operating on at any given time as well as some knowledge of when and how to mix in elements from other levels.
Metaprogramming is the writing of computer programs that write or manipulate other programs (or themselves) as their data, or that do part of the work at compile time that would otherwise be done at runtime. In many cases, this allows programmers to get more done in the same amount of time as they would take to write all the code manually, or it gives programs greater flexibility to efficiently handle new situations without recompilation.(Definition Source : wiki )
Study More.
0 comments:
Post a Comment