Re: goo and fixnums (fwd)

Ben <[email protected]> Tue, 20 Jul 2004 13:31:11 -0400 (EDT)
Newsgroups gmane.comp.lang.goo.general
Message-ID <[email protected]>
forwarded for archival purposes.

---------- Forwarded message ----------
Date: Tue, 20 Jul 2004 12:19:51 -0400
From: Jonathan Bachrach <[email protected]>
To: Ben <[email protected]>
Subject: Re: goo and fixnums

thanks for your questions.

On Jul 19, 2004, at 6:26 PM, Ben wrote:

> some questions about goo:
> 
> 1) what happened to <int> being a 30-bit fixnum?
> 
> goo/user 0<= (isa? 100000000000000000000000000000000000000000 <int>)
> goo/user 0=> #t

there is now a <fixnum> class.  (isa? <fixnum> <int>) => #t

> goo/user 0<= (DF square (x|<int> => <int>) (* x x))
> goo/user 0=> #{Met square ((x <int>) => <int>)}
> goo/user 0<= (square 10000000000000000000000000000)
> goo/user 0=> 100000000000000000000000000000000000000000000000000000000
> 
> it would be nice (for the c interface, for example) to have control
> over fixnums.  (there's no <fixnum> type, right?)

see above.

> 2) getting segfaults (on freebsd) from the listener, using C stuff at
> the top-level:

c stuff at top level is a bit fragile.  it's understandable as you can't just 
convert tagged goo instances to raw seething bits and expect it to work. 
perhaps this is a design flaw but the idea is to make it dead easy to insert c 
within goo and vice versa at the expense of safety.  you're responsible for 
doing the right thing.

> goo/user 0<= #ei{ 1 }
> Segmentation fault (core dumped)

this probably should work, but the following shouldn't as you're converting goo 
to raw c at top level.

> goo/user 0<= (to-c 1)
> goo/user 0=> 0
> 
> works, but
> 
> goo/user 0<= (to-c 100)
> Segmentation fault (core dumped)
> 
> 3) how would one speed up the startup time for the listener?

the easy way is to save an initialized executable image.  this should be 
documented in the manual and should work on freebsd.

> 4) should i post this to the mailing list?

sure.