[Push] division and tangent instructions

PerPlex Ed edperplex at yahoo.com
Wed Jun 30 03:52:58 EDT 2010


Lee said:
>My own preference would be to start with a single integer type that acts as close to mathematical integers as possible, which I guess means that it auto-promotes to BigInts, and to use this type for all things that 
need integers (unless there's a good reason to create another integer 
type for a specific application).
Ok. Then just use that BigInts and write it in the language specification.
One thing I don't understand. If you don't care about the bit representation and performance, why do you care about auto-promotion? For performance reasons?
If I don't care about a performance penalty and want integers that work as mathematical integers, I just use BigInts and that's all. Some BigInts implementations may be optimized to be almost as fast as normals ints for "small" values. If I'm lucky, I'll be using one of those, otherwise... didn't we said we can accept a performance penalty if we get mathematical integers? Auto-promotion itself has a performance penalty, I presume.


> ((code.nth) code.atom)
>I'm sure one could express (and evolve) solutions in the context of 
other schemes for representing integers, even if "addressing" and 
"arithmetic" uses are separated into two different types. But this 
elegant little program presumably wouldn't work.

I guess a solution of that kind has a value but only in few contexts.
Every language that one can use for genetic programming has its peculiarities that can be - and, because of the very nature of genetic programming, will be exploited sooner of later.

If your experience tells you that there are many cases where it's worth running or even only testing programs and evolution using a single arbitrary size integer type for both addressing and computations, then demand that all 100% conformant Push implementations should allow you to switch between 32bit(, 64bit) and BigInts as the underlying representation of the main Integer Push type.

That would be a setting to be choosen before the interpreter is initialized, of course.


      



More information about the Push mailing list