Re: Dynamic Typing Efficiency

Robert A Duff <>
8 May 2005 22:55:13 -0400

          From comp.compilers

Related articles
Dynamic Typing Efficiency (2005-05-08)
Re: Dynamic Typing Efficiency (Robert A Duff) (2005-05-08)
Re: Dynamic Typing Efficiency (Luke McCarthy) (2005-05-08)
Re: Dynamic Typing Efficiency (glen herrmannsfeldt) (2005-05-08)
Re: Dynamic Typing Efficiency (Yermat) (2005-05-09)
Re: Dynamic Typing Efficiency (Dmitry A. Kazakov) (2005-05-09)
Re: Dynamic Typing Efficiency (Eliot Miranda) (2005-05-09)
Re: Dynamic Typing Efficiency (Jeff Kenton) (2005-05-09)
[6 later articles]
| List of all articles for this month |

From: Robert A Duff <>
Newsgroups: comp.compilers
Date: 8 May 2005 22:55:13 -0400
Organization: The World Public Access UNIX, Brookline, MA
References: 05-05-041
Keywords: types, interpreter
Posted-Date: 08 May 2005 22:55:13 EDT writes:

> The only way to avoid this that I can think of is to create a
> statically typed language. That way I can use instructions like IADD,
> DADD, ILOAD, DLOAD, etc, sort of like the JVM. But I don't want a
> statically typed language!

Well, if you want a dynamically typed language, you're going to pay
some cost, in general.

But you can use all manner of tricks to diminish that cost. For
example, do like many Lisp implmenetations -- represent integers so
that smallish ones can be represented directly. So you can tell the
difference between a "fixnum" (smallish integer) and a
pointer-to-whatever. Pointers are typically aligned, so you can use
the low-order bits for representing various information. So you can
have a quick test for the common case of adding two smallish integers,
followed by more complicated stuff. The "quick tests" need not
reference memory.

- Bob

Post a followup to this message

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