{"id":1012,"date":"2009-10-07T16:00:26","date_gmt":"2009-10-07T23:00:26","guid":{"rendered":"https:\/\/www.reenigne.org\/blog\/?p=1012"},"modified":"2012-02-22T16:01:16","modified_gmt":"2012-02-23T00:01:16","slug":"memory-handling-in-high-level-and-low-level-languages","status":"publish","type":"post","link":"https:\/\/www.reenigne.org\/blog\/memory-handling-in-high-level-and-low-level-languages\/","title":{"rendered":"Memory handling in high-level and low-level languages"},"content":{"rendered":"<p>The usual distinction between high-level and low-level languages is that high-level languages provide more abstractions. Assembly language is clearly a low-level language, and provides few very abstractions over the raw binary format consumed by the processor. Javascript is very high-level because it abstracts away almost all the details about the particular machine and operating system that it runs on, making it much easier to write actual end-user applications in (but impossible to write, for example, device drivers in).<\/p>\n<p>One particular place where the distinction is particularly obvious is how different languages handle memory. There seem to be three basic strategies for handling memory:<\/p>\n<ol>\n<li>Implicit or explicit memory management (assembly language, C, C++) - calls to malloc() and free() (or equivalent) are inserted into the code by the programmer or by the compiler.<\/li>\n<li>Garbage collection with explicit state (C#, Java, Python, millions more) - no malloc() or free() are possible - all memory is \"owned\" by the garbage collector. Memory management is abstracted away.<\/li>\n<li>Referential transparency (Haskell) - there is no state, the concept of memory itself is abstracted away.<\/li>\n<\/ol>\n<p>The boundaries can blur a little - you can plug a garbage collector into C++ for example, and high-level languages often provide \"unsafe\" functionality that allows one to escape to lower-level features.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The usual distinction between high-level and low-level languages is that high-level languages provide more abstractions. Assembly language is clearly a low-level language, and provides few very abstractions over the raw binary format consumed by the processor. Javascript is very high-level because it abstracts away almost all the details about the particular machine and operating system [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1012","post","type-post","status-publish","format-standard","hentry","category-computer"],"_links":{"self":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts\/1012","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/comments?post=1012"}],"version-history":[{"count":3,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts\/1012\/revisions"}],"predecessor-version":[{"id":1643,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/posts\/1012\/revisions\/1643"}],"wp:attachment":[{"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/media?parent=1012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/categories?post=1012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.reenigne.org\/blog\/wp-json\/wp\/v2\/tags?post=1012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}