[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Luerl
- From: Axel Kittenberger <axkibe@...>
- Date: Tue, 21 Feb 2012 11:28:09 +0100
> And getting performance out of immutable data requires very clever
It seems to be brake intially, but one the other hand it opens up a
large amount of optimizations, and that is what I'm aiming at. It
makes coding complex programms easier, if you have to worry less about
structures changing as some side-effect to what you are doing, while
you are looping through them.
to create a new table that is an extension to an existing table.
Say for example, one optimization is this variable caching we do
manually can be automated
local a = b.c.d.e.f.g.h;
for ... :
Once you know b.c.d.e.f.g and h are immutable, you can write this
directly into the loop, and the compiler would only have to check if b
changed, to know h is still the same.
Also I suppose the hash/array-tables could be arranged more
compact/efficient if it would be assured they wouldn't change.
And yes this makes multithreading easy. you only need to atomize
access to globals. However, thats not what I'm aiming at, it has IMHO
value enough even without.