On 05/16/2013 11:37 PM, Alex McDonald wrote:
> A sizable chunk of the resulting language is very Forth-like.
> Thoughts?
>
Yes: that is the direction I'm going with my next-generation Reva
(called "sheminit", or "8th").
It makes sense to me to "do the right thing" where possible, e.g "+"
should concatenate strings if the objects on the stack are strings, and
do addition if they are numbers. It becomes a bit less clear what to do
if the objects are mixed, and that is where excellent documentation (and
example code) will be most useful.
I'm also eliminating the distinction between normal integers, doubles
and floating point. One set of words for them all, and the 'number'
object will use the most precise but smallest representation it can.
The progression (for integer numbers) would be "32bit" -> "64bit" ->
"128bit" -> "bigint". So while the math would get slower, one wouldn't
have to be concerned with overflow and such things. If, for example,
attempting to calculate the US debt...
I'm not certain what representation to use for "real" numbers. Since I
expect to run on Intel and ARM as well (my target platforms are
Windows/Mac/Linux and Android/iOS, at first) and perhaps other, unknown
CPUs, I don't know if using the IEEE fp formats is supported across the
board, though it probably doesn't make a difference except when
transferring data from one to another (and that would potentially affect
integer data as well, so ...)