[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

RE: gEDA-user: How I'd write a netlister in Scheme... Was: Introduction and some questions/thoughts on gEDA/gaf...



> -----Original Message-----
> From: owner-geda-user@xxxxxxxx 
> [mailto:owner-geda-user@xxxxxxxx] On Behalf Of Dan McMahill
> Sent: 25 September 2005 18:13
> To: geda-user@xxxxxxxx
> Subject: Re: gEDA-user: How I'd write a netlister in 
> Scheme... Was: Introduction and some questions/thoughts on gEDA/gaf...
> 
> Karel Kulhavy wrote:
> > On Sun, Sep 25, 2005 at 12:07:43PM -0400, Dan McMahill wrote:
> > 
> >>Ales Hvezda wrote:
> >>
> >>>[snip]
> >>>
> >>>
> >>>>	For a while now, tinyscheme has been on my guile 
> replacement list, 
> >>>>but it too, isn't really maintained anymore.  It isn't as full 
> >>>>featured as guile, but it seems to provide the bare basics.
> >>>
> >>>
> >>>	Another possibility is scheme 48:
> >>>
> >>>http://www.s48.org/
> >>>
> >>>						-Ales
> >>>
> >>
> >>That one has major problems on my alpha.  Produced lots and lots of 
> >>unaligned accesses followed by a segfault on the alpha.  On 
> i386 and 
> >>sparc (in 32 bit mode), it built with one warning about 
> 'comparison is 
> >>always false due to limited range of data type' but was able to 
> >>execute
> >>(* 3 4).
> > 
> > 
> > Isn't 48 in the name of s48 the problem? Maybe you need s64 
> for alpha.
> > 48 is not a multiple of 64.
> 
> since 48 is the number of hours taken to write the first 
> version scheme48, maybe '48' is the problem ;)
> 
> Seriously though, I think the moral of the story is that the 
> development of a compiler or even a scheme interpreter that 
> has wide cross platform support is not as trivial as one 
> might think.

One of the problems with implementing scheme is implementing the type
tags.  A lisp object can hold any type, it has a tag saying what type it
holds.  Often it holds a pointer to the rest of the data, which contains
yet more type tags.

Eg, something like this for the least significant 3 bits

XX0 =  integer
001 =  char
011 =  cons pair
101 =  string
111 =  everything else

All this tends to be highly unportable.

BTW.  I think Scheme48 is written to look as though it could have been
written in 48 hours, I don't think even the first version was.