title: In JavaScript, what are the performance costs of boxing every number and string on objects?
body: <p>I am programming a Lisp like language on JavaScript for learning purposes. Every object is part of a tree so it must keep track of its parent. The only problems are numbers and strings:</p>
  
  <pre><code>foo = {};
  var a = 1;
  a.parent = foo;
  </code></pre>
  
  <p>This will not work. I have to do this instead:</p>
  
  <pre><code>foo = {};
  var a = {type:'number',value:1,parent:foo}
  </code></pre>
  
  <p>So I would have to box every number and string on my language in a hash like that. I pretend to do some extensive matrix math on said language, so I am worried. Would this approach be a hit on performance?</p>