Re: How to implement dynamic typing?

Tony Finch <dot@dotat.at>
14 Apr 2010 17:55:11 +0100 (BST)

          From comp.compilers

Related articles
[12 earlier articles]
Re: How to implement dynamic typing? bartc@freeuk.com (bartc) (2010-04-11)
Re: How to implement dynamic typing? harold.aptroot@gmail.com (Harold Aptroot) (2010-04-11)
Re: How to implement dynamic typing? cr88192@hotmail.com (BGB / cr88192) (2010-04-11)
Re: How to implement dynamic typing? cr88192@hotmail.com (BGB / cr88192) (2010-04-12)
Re: How to implement dynamic typing? gneuner2@comcast.net (George Neuner) (2010-04-13)
Re: How to implement dynamic typing? bartc@freeuk.com (bartc) (2010-04-14)
Re: How to implement dynamic typing? dot@dotat.at (Tony Finch) (2010-04-14)
Re: How to implement dynamic typing? cr88192@hotmail.com (BGB / cr88192) (2010-04-16)
Re: How to implement dynamic typing? gneuner2@comcast.net (George Neuner) (2010-04-18)
Re: How to implement dynamic typing? bartc@freeuk.com (bartc) (2010-04-18)
Re: How to implement dynamic typing? gneuner2@comcast.net (George Neuner) (2010-04-20)
Re: How to implement dynamic typing? mikelu-1004cc@mike.de (Mike Pall) (2010-04-21)
Re: How to implement dynamic typing? bartc@freeuk.com (bartc) (2010-04-21)
[6 later articles]
| List of all articles for this month |

From: Tony Finch <dot@dotat.at>
Newsgroups: comp.compilers
Date: 14 Apr 2010 17:55:11 +0100 (BST)
Organization: dotat labs
References: 10-04-009 10-04-028 10-04-031 10-04-036
Keywords: types
Posted-Date: 16 Apr 2010 01:49:45 EDT

George Neuner <gneuner2@comcast.net> wrote:
>
>At first glance it seems that having the descriptor together with the
>pointer saves time, extra fetching, cache pollution, etc. for
>"frequent" operations like bounds checking, object length/size
>retrieval, etc. But, in fact, studies of real programs have shown
>that descriptor accesses occur much less frequently than simple type
>checks, identity checks (comparing pointers), data accesses and object
>referrals (storing an object reference). Even in OO languages, method
>calls are less frequent than data accesses. YMMV, but most language
>implementors have decided that it is worthwhile to trade indirect
>descriptors for register-sized pointers.


LuaJIT takes an interesting approach. Its only numeric type is the
double precision floating point number. It uses different kinds of NAN
as tags for the other types, with the pointer embedded in the
mantissa.


http://article.gmane.org/gmane.comp.lang.lua.general/44823


Regarding typed word-sized pointers, see for instance
http://www.haskell.org/~simonmar/papers/ptr-tagging.pdf


Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.