Commit graph

19 commits

Author SHA1 Message Date
Alex Shinn
9ed0d705c6 adding type checking to disasm
Fixes issue #8:
http://code.google.com/p/chibi-scheme/issues/detail?id=8

Note disasm is likely to be moved out of the core soon.
2009-12-05 18:13:01 +09:00
Alex Shinn
353594a028 fixing some 64-bit bignum arithmetic cases 2009-11-28 16:05:59 +09:00
Alex Shinn
8481f543a9 cleanup, making infinities optional, fixing build for plan9 2009-11-23 01:54:22 +09:00
Alex Shinn
66bd9a52bb no more globals!
Each contexts keep a link to the heap which it is a part
of (when using the native GC), as well as a vector of
special globals that it needs quick access to (e.g. the
`quote' and `quasiquote', etc. symbols.  You can use this
to manage multiple completely unrelated VMs in the same
application, and everything will be thread-safe.

The old behavior is still available by editing config.h,
which now includes somewhat better descriptions of all
the settings.
2009-11-23 01:13:42 +09:00
Alex Shinn
3a55e2b6f3 moving debug.c to opt/ dir 2009-11-22 18:20:24 +09:00
Alex Shinn
f53e4df208 adding support for runtime definition of new types 2009-11-10 21:50:59 +09:00
Alex Shinn
c4625e1c86 fixnum/integer naming cleanup
Replacing sexp_make_integer, sexp_integerp, etc. with sexp_make_fixnum,
sexp_fixnump, etc.  Defining the old names as variants handling either
fixnums or bignums, or just as aliases for the new terms when compiled
without bignum support.  sexp_make_integer needs to take a context now
in case it generates a bignum.
2009-11-02 23:39:42 +09:00
Alex Shinn
576a20b3bc simplifying gc variable preservation
Adding sexp_gc_var1..6 and corresponding _preserve/release1..6
referring to fixed preservation variable names, to substantially
reduce the boilerplate on C functions which produce temporary sexp
values.  The fixed variable names are safe because we never nest
them within the same C function.  The original macros are still
available for manual naming, block local variables and cases of
more than 6 gc vars.

Consider combining var+preserve into a single macro, since splitting
them is rare.
2009-11-01 19:48:30 +09:00
Alex Shinn
62c390d68e initial module system 2009-10-13 18:29:18 +09:00
Alex Shinn
386a1cdb0a working on 9p support 2009-08-24 22:41:54 +09:00
Alex Shinn
d36e70f6bf fixing various numeric operations 2009-08-24 22:41:33 +09:00
Alex Shinn
df5b916640 adding initial 9p interface 2009-08-11 01:15:29 +09:00
Alex Shinn
1de49b46ce initial plan9 extensions 2009-07-17 01:58:04 +09:00
Alex Shinn
9951c8e921 adding extended numeric tests and fixes for the bignum bugs it turned up 2009-07-15 23:56:51 +09:00
Alex Shinn
5d94079e4a more cleanup and portability fixes
Using <u.h> and <libc.h> for plan9, no need for separate .i file
construction.  Also mkfile now simplified and using /sys/src/cmd/mkone
(thanks to Charles Forsyth).
2009-07-14 00:34:23 +09:00
Alex Shinn
6d709264bd Cleanup for more pedantic C.
Notably no longer converting from function pointers <-> void*.

Remaining --pedantic warnings:

  * ISO C90 does not support 'long long'
  * ISO C90 does not support the 'z' printf length modifier
  * ISO C90 does not support flexible array members
  * ISO C90 forbids mixed declarations and code
  * ISO C90 forbids specifying subobject to initialize
  * anonymous variadic macros were introduced in C99
  * invalid use of structure with flexible array member

The first one is only used when optional bignums are enabled,
and I have no intention of supporting bignums on systems w/o
long long (although it's not guaranteed two words fit in a
long long - I need to fix this).

The 'z' modifier is necessary for long types (you'd get
warnings the other way without it).

The next 4 are intentional - they make the code cleaner,
and all of these extensions are supported by Plan 9.

The last one is tricky.  I think it refers to the fact
that not only am I using flexible array members, but I'm
using them as non-final alternates in a union.  I'll have
to double check the semantics of this.
2009-07-12 23:46:27 +09:00
Alex Shinn
f2e79c3028 off by one error in sexp_bignum_mul
need an extra digit to fit carries
2009-07-12 19:06:38 +09:00
Alex Shinn
821546244a plan9 fixes - can't use #if preprocessor statements inside macros.
also, no log2() by default, defining it in terms of log().
2009-07-12 18:36:37 +09:00
Alex Shinn
b1c0ea895b committing initial bignum support, still needs more thorough testing.
can disable with USE_BIGNUMS=0 - the interactions between this and
USE_FLONUMS are messy, so they will likely be merged into a single
option in the near future (i.e. you either have only fixnums, or a
full range of numeric types).
adding rationals based on this would be easy and is a likely future
feature.  adding native support for complex numbers is unlikely.
2009-07-07 19:16:23 +09:00