Implementing
Pointers  into JavaScript
//! READ THIS:
//! Due to this post's publicity and the number of people asking if this is satire, or saying
//! that this is an awful idea, I feel the need to clarify. This was **never** intended to
//! actually be used, nor was it satirical. It was intended as a proof of concept to show what
//! Javascript is capable of.
var uid;
(function() {
 var lastId = 0;
 uid = function() {
  return lastId++;
 };
}());
global.$ = function(val) {
 var id = uid();
 global.$[id] = val;
 Object.defineProperty(global.$, id, {
  get: function() {
   return val;
  },
  set: function(newVal) {
   val = newVal;
   return newVal;
  },
  enumerable: false
 })
 return id;
};
global.$.free = function(ptr) {
 delete global.$[ptr];
};