Kurt Stephens

Nerd Up!

Some tradeoffs involved


OCaml uses a similar type tagging system as Ruby, in that it also sets the lower bit to 1 on Fixnum-like values.
However, on modern CPU’s; this doesn’t slow math down that much as you don’t really need to do the bit shifting,
as you can read in the link below:

http://rwmj.wordpress.com/2009/08/04/ocaml-internals/

Your approach does speed up integer caluclations a bit, but is also slows down pointer access, because now pointers cannot be used “as is” anymore. For an OOP language that usually uses heaps of references between objects, I think that may be a more serious problem. Also, how would you go at encoding Symbols?

Reply

Please solve the math problem above and type in the result. e.g. for 1+1, type 2
The content of this field is kept private and will not be shown publicly.

Primary links

Syndicate

Syndicate content

Browse archives

« February 2012  
Mo Tu We Th Fr Sa Su
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29