Re: Dynamic Typing Efficiency

Robert A Duff <bobduff@shell01.TheWorld.com>
8 May 2005 22:55:13 -0400

          From comp.compilers

Related articles
Dynamic Typing Efficiency clearm@comcast.net (2005-05-08)
Re: Dynamic Typing Efficiency bobduff@shell01.TheWorld.com (Robert A Duff) (2005-05-08)
Re: Dynamic Typing Efficiency luke@iogopro.co.uk (Luke McCarthy) (2005-05-08)
Re: Dynamic Typing Efficiency gah@ugcs.caltech.edu (glen herrmannsfeldt) (2005-05-08)
Re: Dynamic Typing Efficiency loic@fejoz.net (Yermat) (2005-05-09)
Re: Dynamic Typing Efficiency mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2005-05-09)
Re: Dynamic Typing Efficiency eliotm@pacbell.net (Eliot Miranda) (2005-05-09)
Re: Dynamic Typing Efficiency jeffrey.kenton@comcast.net (Jeff Kenton) (2005-05-09)
[6 later articles]
| List of all articles for this month |
From: Robert A Duff <bobduff@shell01.TheWorld.com>
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

clearm@comcast.net 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.