Commit graph

46 commits

Author SHA1 Message Date
Alex Shinn
a32edf7138 Making port-fileno support non-stream ports. 2013-08-18 18:34:06 +09:00
Alex Shinn
a6e71e47b8 Adding port-fileno. 2013-08-18 17:45:23 +09:00
Alex Shinn
3fe7b71519 CHIBI_MODULE_PATH defaults to ./lib:., but these paths aren't
hardcoded anymore.
2013-07-28 19:09:05 +09:00
Alex Shinn
13b540418e C-level string API redesign with cursor support.
s/sexp_string_length/sexp_string_size/
Make sexp_string_ref/sexp_string_set Unicode aware.
Provide cursor level alternatives for efficiency.
Document all of this.
2013-07-21 14:59:51 +09:00
William Light
34adcd3b19 Implement SEXP_MAX_ANALYZE_DEPTH
This fixes issue #89.
---
 eval.c                   | 90 ++++++++++++++++++++++++++----------------------
 include/chibi/features.h |  4 +++
 2 files changed, 53 insertions(+), 41 deletions(-)
2013-06-17 21:09:05 +09:00
Alex Shinn
83fb186edc Wrapping continuable exceptions in specially tagged exceptions rather than pairs.
This way C functions that check for and print exceptions support them
automatically.  Notably continuable errors in macro expansions, will had
temporarily been suppressed, are printed again.
2013-06-15 17:47:37 +09:00
Alex Shinn
d6b6ce955b Differentiating between analyze_app and the new analyze_list.
The latter is just for any list of ASTs to analyze, whereas the former
checks for lambda applications and fills in names.  Fixes equality
comparisons for procedures, so (equal? (lambda (x) x) (lambda (y) y))
now returns true.
2013-06-08 23:37:12 +09:00
Alex Shinn
1736a8306b Adding set-port-line! and using it in the pure Scheme load to preserve source info. 2013-06-02 10:44:10 +09:00
Alex Shinn
a49f14d011 Adding currently immutable (current-module-path). 2013-05-31 23:39:56 +09:00
Alex Shinn
2b5f8ea007 Adding -s option to escalate warnings to errors.
Fixes issue #107.
2013-05-31 23:31:03 +09:00
Alex Shinn
9ed486dbe3 Adding sexp_maybe_wrap_error utility to pass exceptions from the FFI without raising.
Fixes issue #156.
2013-05-29 23:37:30 +09:00
Alex Shinn
0659ad4484 Need to GC preserve earlier in sexp_sqrt. 2013-04-14 05:01:38 +00:00
Alex Shinn
83f8cfd69b Adding note about the derived syntax definition of quote. It makes
compilation slightly but noticeably slower and is inconvenient, so
leaving as a core form for now.
2013-04-09 21:46:29 +09:00
Alex Shinn
2e63b2be00 Using non-mutating tree of dynamic-wind state for thread safety. 2013-04-07 23:59:41 +09:00
Alex Shinn
63a365f214 Factoring out generate opcode and exporting it. 2013-04-07 20:09:39 +09:00
Alex Shinn
f4b42132a3 Making sexp_env_cell_define available. 2013-04-07 17:08:56 +09:00
Alex Shinn
7c1c40fb07 checking for NULLs before checking exceptions 2013-04-05 19:55:36 +09:00
Alex Shinn
39b67ea455 Reducing primitive errors to warnings.
Should add an option to escalate all warnings to errors.
2013-04-01 22:30:47 +09:00
Alex Shinn
64931197a6 Fixing warnings inside modules with no current-error-port defined. 2013-04-01 21:05:51 +09:00
ashinn
ec8255a27b Fixing sqrt for builds with bignums but no complex. 2013-03-23 21:13:11 +01:00
Alex Shinn
a61cebb1e9 Thread parameters are still needed when threads are disabled. 2013-02-27 09:04:56 +09:00
Alex Shinn
b2caf66dcb Adding a type check on env-exports. 2013-02-14 22:13:30 +09:00
Alex Shinn
a689b1a399 primitive load should use a fresh stack 2013-02-11 15:24:31 +09:00
Alex Shinn
20c62ffe4a The global ABI error object needs to be an immediate, since if
the ABI is incompatible we can't even necessarily refer to a
global from within the bad library.
2013-02-10 16:38:18 +09:00
Alex Shinn
2b68fca125 Raising a friendly error on non-identifier syntax bindings (previously silently a useless operation). 2013-01-08 22:43:25 +09:00
Alex Shinn
df116bb779 Fixing macro environment to be the evaluation, not binding
environment, in let-syntax.  The difference arises when the same
binding is inside and outside the let-syntax.  Patch from Zhang Meng.
2013-01-03 22:34:40 +09:00
Alex Shinn
bd3eec54d7 log should promote to complex logic for negative inputs.
Fixes issue #166.
2012-12-26 07:25:22 +09:00
Alex Shinn
7ae254fc28 More accurate square roots for bignums - compute via iteration rather
than approximation via flonums for very large bignums.
2012-12-22 18:06:22 +09:00
Alex Shinn
2eecec0a4b hard-coding scheme-report-environment version lookup to 7 2012-11-01 23:26:52 +09:00
Alex Shinn
74d0980b82 Adding file-error? and read-error? predicates. 2012-10-14 23:27:16 +09:00
Alex Shinn
2c5522dfff Don't unwrap syntatic closures in top-level defines by default. 2012-10-01 22:56:21 +09:00
Alex Shinn
7b1760ef82 Don't share stack on eval primitive, clean up load.
Fixes issue #148.
2012-09-29 15:38:05 +09:00
Alex Shinn
e562cc0be3 Incorporating Alan Watson's TAI time library. 2012-08-17 10:04:37 +09:00
Alex Shinn
93ba0926a7 Build fixes for plan9. Moving individual object files out of opt/ since plan9 mkfiles have issues with these. 2012-08-16 16:04:02 +09:00
Alex Shinn
57b2bc281d apply opcode is now tail-recursive - calling it in a non-tail position is an error 2012-07-18 21:34:53 +09:00
Alex Shinn
016560e5fe Additional OOM checks - harder but still not impossible to segfault on OOM. 2012-07-17 23:40:16 +09:00
Alex Shinn
6de7d5621d Keeping track of the maximum stack depth a procedure needs for accurate stack checks
(fixes bug #130).  Done in conjunction with code generation refactoring, so that context
objects temporarily use their specific slot instead of having space for useful fields
at runtime.
2012-07-16 16:23:54 +09:00
Alex Shinn
c063dadd2e build fixes for global symbols and vm profiling 2012-07-10 22:42:31 +09:00
Alex Shinn
150cfd0a8b too dangerous to leave bytecode source uninitialized 2012-07-09 20:20:07 +09:00
Alex Shinn
3e79138e21 Various fixes for better debug output.
* Associate file/line source info with corresponding bytecode offset.
  * Fixes for losing source info after macro expansion and simplification.
  * Fix for showing the source info of the calling procedure of an error.
2012-07-07 15:26:08 +09:00
Alex Shinn
d11ededc50 better initialization checks for out of memory 2012-06-24 10:44:34 -07:00
Alex Shinn
3b10f4f748 Don't reset dynamic stack on eval. 2012-06-23 23:37:36 -07:00
Alex Shinn
a18deb68cc Optional code refactoring.
Chibi uses a lot of #if conditioned code so that configuration
management can be done entirely with the C preprocessor.

Originally this also involved conditional includes of .c files
from other source files.  The alterative, which this change
switches to, is to compile and link all files, and for uneeded
files conditionally eliminate their entire bodies so they compile
to empty object files.

Pros for conditionally including all code into one large file:

  * Don't need to declare most functions (keeps .h files small).
  * Can keep most functions static/inlined (keeps objects small).
  * Don't need to even distribute uneeded files with the default
    Makefile (e.g. can prune opt/* from dist for minimal builds).

Pros for linking multiple possibly empty files:

  * Extensions and third-party libs probably want the exported
    declarations anyway.
  * Static analysis tools work better (e.g. flymake on what previously
    was an included file).
  * Can build each file in parallel (i.e. make -j for faster builds).
  * Can build and link in just the changed files, instead of
    having to recompile the whole thing.

For Chibi these are all minor points - it will be small
regardless, and will build fast regardless - but the arguments
for splitting seem stronger.  Note the new shared lib is about
1k larger, but that can be trimmed down later.
2012-06-21 23:04:07 -07:00
Alex Shinn
08e4fead8b small fixes and warning removals for build tests 2012-06-20 21:39:52 -07:00
Alex Shinn
8d5ea4cdf4 making literals embedded in the source immutable 2012-06-10 14:22:22 +09:00
Alex Shinn
85a7efc003 automatically making sockets non-blocking on accept 2012-05-14 08:37:45 -04:00