[plt-scheme] small question about mzscheme's source

From: ifconfig (nslookupifconfig at hotmail.com)
Date: Tue May 4 04:57:41 EDT 2004

Damn outlook. I wrote this entire message and then outlook crashed, and when
I pasted the message back all of the non-alphanumeric characters got
misplaced or switched :\

> -----Original Message-----
> From: Matthew Flatt [mailto:mflatt at cs.utah.edu]
> Sent: Tuesday, May 04, 2004 4:28 AM
> To: ifconfig
> Cc: plt-scheme at list.cs.brown.edu
> Subject: Re: [plt-scheme] small question about mzscheme's source
> 
> At Tue, 4 May 2004 03:14:40 +0200, "ifconfig" wrote:
> > I was just taking a brief look in mzscheme's src, and I noticed in
> > scheme_bitwise_shift (in /plt/src/mzschme/src/number.c) that you shift
> using
> > bignum calculations if shift is more than MAX_SHIFT_TRY or less than
> > -MAX_SHIFT_EVER. Under 32 bits, MAX_SHIFT_EVER is defined as 32, which
> makes
> > sense. But why is MAX_SHIT_TRY 29? You could shift 30 bits, and ever 31
> > without bignum calculations, couldn't you?
> 
> A MzScheme fixnum is represented using 31-bit two's complement. If you
> shift a 1 left by 30 bits, you get the representation of -2^30 instead
> of 2^31.


If that is the case, why do you shift it 31-bits if it's a rightshift?
(#define MAX_SHIFT_EVER 32)


> [SNIP]
> 
> > And last but not least, are the basics of the compiler put in a
> > specific file?
> 
> The top of eval.c is as much as there is.
> 
> > I'm trying to learn how to make a simple scheme->asm compiler for only
> > basic data types, etc.
> 
> Perhaps this is clear already, but MzScheme doesn't have a Scheme->asm
> compiler --- just a Scheme->bytecode compiler and a bytecode
> interpreter.


Is the bytecode scheme-based or register-machine-based?
In other words, is it a sequencial program bytecode, or a bytecode in which
everything has a value?


> 
> Matthew

Thanks,
ifconfig



Posted on the users mailing list.