[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Cardinal-dev] RubyInRuby parser/compiler
From: |
Anders Bengtsson |
Subject: |
Re: [Cardinal-dev] RubyInRuby parser/compiler |
Date: |
05 Jan 2003 21:58:00 +0100 |
Dan Sugalski wrote:
> >Don't know about constant folding...
[---]
> This is a common optimization in more static languages, such as C,
> but may not be valid for Ruby.
In general it isn't valid, but in most specific cases in Ruby it
actually is. Most of the time '+' hasn't been changed.
If the runtime system keeps track of which methods are changed and which
are not, it can do a lot of constant folding and other optimizations. It
just has to keep the non-optimized alternative available too, in case
something changes. The Self language took this to extremes and got very
good performance from a purely dynamic language.
/Anders
--
A n d e r s B e n g t s s o n | address@hidden
Stockholm, Sweden |
_____________________________________________________
Gratis e-mail resten av livet på www.yahoo.se/mail
Busenkelt!