Commit graph

132 commits

Author SHA1 Message Date
Alex Shinn
72ec53ca26 More thorough checks for SEXP_MIN_FIXNUM/-1.
Closes #1006.
2025-01-30 11:44:23 +09:00
Alex Shinn
a844854536 Don't allow mixing rational and floating point syntax.
Closes #1014.
2025-01-03 23:07:18 +09:00
Alex Shinn
d4028f953b Tentatively manually encoding non-finite f16 values.
Issue #988.
2024-06-02 22:31:25 +09:00
Alex Shinn
b1a370b218 add link to paper for single/half float conversions 2024-06-01 22:18:16 +09:00
Alex Shinn
f60298b707 Initial half and quarter precision uniform vectors.
Quarter precision is 1.5.2 format.
Used to implement f16-storage-class and f8-storage-class.
Can be disabled at compile time.
2024-05-24 19:04:44 +09:00
Alex Shinn
720ec69489 Adding a chibi-<version> feature.
Issue #955.
2024-05-20 22:03:41 +09:00
Alex Shinn
3b6be9d60c Fix cmake build. 2024-05-18 05:45:45 +09:00
Alex Shinn
017e4b6990 Add feature for architecture.
Issue #955.
2024-05-16 23:28:29 +09:00
KOGURO, Naoki
35281cf28e Fix bug: sexp_read_number can't parse a/b@c-style number correctly. 2023-02-25 11:26:51 +09:00
Alex Shinn
d67fa42d0c
Merge pull request #793 from dpk/string-ref-cache
Add a feature to cache the most recent string index->cursor result
2022-10-19 17:59:08 +09:00
Alex Shinn
701cf1d169 no more flexible arrays (issue #842) 2022-07-04 22:30:49 +09:00
Alex Shinn
09200ae13c fix locale-dependent decimal separators (issue #829) 2022-05-12 18:10:38 +09:00
Alex Shinn
9d2875b05e
Merge branch 'master' into identifier-macros 2022-03-15 19:47:40 +09:00
Daphne Preston-Kendal
476ae194a3 Indentation fix
[skip ci]
2022-03-03 18:59:04 +01:00
Alex Shinn
fae48a3790 properly handling negation of complex numbers with ratio parts (fixes issue #815) 2022-02-22 17:55:54 +09:00
Alex Shinn
07358ff8b7 don't allow trailing data after the number in string->number, even if a valid delimiter (fixes issue #811) 2022-02-04 12:34:55 +09:00
Daphne Preston-Kendal
d17764be29 Add variable transformers 2021-12-30 10:34:54 +01:00
Alex Shinn
b769a318ef use unsigned char* in sexp_update_string_index_lookup (fixes issue #804) 2021-12-29 11:55:58 +09:00
Alex Shinn
92499731bc show procedure arity in primitive write 2021-12-28 08:26:20 +09:00
Daphne Preston-Kendal
a746370431 Make the string cursor able to run backwards as well as forwards 2021-12-11 11:43:23 +01:00
Daphne Preston-Kendal
4e0f10ad21 Use the cursor cache to speed up string-cursor->index as well 2021-12-11 10:44:26 +01:00
Daphne Preston-Kendal
c09897c449 Add a feature to cache the most recent string index->cursor result
This is lighter-weight than building a full index->cursor table for
the string, adding a constant two words to the memory required to
store a string, as opposed to one word for every n characters. The
cached cursor is used for any string-ref operation requesting an index
after the most-recently-requested index, making potentially quadratic
repeated string-ref procedures run in linear time. In theory, it could
also use a heuristic to speed up moving backwards through the string
when it thinks that moving the old cursor backwards would be faster
than starting again at the start of the string. In practice, my
logging of when the cached cursor is actually reused during the Chibi
compilation and startup process shows that the most common case of
moving backwards is going back to the start of the string anyway.

Benchmarks to follow.
2021-12-10 21:24:05 +01:00
Lassi Kortela
3a5f884144 Simplify snprintf usage
snprintf(buf, sizeof(buf), ...) is the canonical idiom.
2021-08-07 23:17:38 +03:00
Alex Shinn
d11106b2f7 Fix upper bounds checks in u64vectors. 2021-04-30 14:02:29 +09:00
Alex Shinn
bf03c1cfa1 restore sexp_make_ephemeron even when not unifying filenos 2021-04-27 19:11:36 +09:00
Alex Shinn
4d22949f71 disable fileno unification by default 2021-04-27 18:30:43 +09:00
Alex Shinn
3cf62f033a store stack traces directly in top-level exceptions to more consistently be able to report them from C 2021-04-26 21:40:39 +09:00
Alex Shinn
ade90906f9 only reify a fileno from an integer if the fileno is still open 2021-04-18 07:01:10 +09:00
Alex Shinn
af43c3214f add sexp_user_exception_ls variadic convenience 2021-04-16 10:06:03 +09:00
Alex Shinn
7ea15f3810 check for wrapping to negative in hash lookup of cell (issue #735)
Without this chibi can crash after 129 open file descriptors.

Note the bug referenced would also indirectly be fixed if
process->string-list properly closed its ports, but we
shouldn't rely on that.
2021-03-31 06:43:27 +09:00
Alex Shinn
1828ef068e fix env size (issue #453) 2020-12-28 12:07:54 +09:00
Alex Shinn
54f55569e2 document sexp_lookup_type (issue #718) 2020-11-25 14:36:54 +09:00
Alex Shinn
77aab98784 Merge branch 'master' of github.com:ashinn/chibi-scheme 2020-09-22 17:37:33 +09:00
Alex Shinn
4ef6c57d3e propagating #i prefix across radix prefixes (issue #706) 2020-09-22 17:37:22 +09:00
Ben Davenport-Ray
9278222396 Prevent crashing from arithmetic exception when spawning lots of commands
This fix is rather dumb, but it prevents things from crashing when
forking a lot and creating file handles. I assume that this is where
the filehandles go, but I don't have a good guess.
2020-09-18 17:08:25 -04:00
Alex Shinn
9793fa0edf inc fileno count on sexp_make_input_port (issue #690) 2020-08-27 10:23:56 +09:00
Alex Shinn
60c4007e6f adding thread-interrupt! so that (chibi repl) can preserve continuations (issue #686) 2020-08-25 14:09:29 +09:00
Alex Shinn
0f6e0f56e0 assume polar tail for inexact complex following / (issue #333) 2020-08-20 10:30:23 +09:00
Alex Shinn
287753f2e3 fix inexact polar notation (issue #333) 2020-08-20 09:54:09 +09:00
Alex Shinn
60ee6d70d0 move remaining fields to start of types 2020-07-30 00:19:21 +09:00
Alex Shinn
23e62275df fixing scheme bytevector for 32bit arch 2020-07-28 15:09:40 +09:00
Alex Shinn
edcddd7299 fixing 64-bit uvectors 2020-07-27 16:08:24 +09:00
Alex Shinn
983829cab1 better inexact computation for ratios which overflow double (issue #671) 2020-07-15 16:38:56 +09:00
Alex Shinn
2bdaebe8c7 wrap uncaught non-exceptions (issue #664) 2020-07-06 16:20:40 +09:00
Alex Shinn
2b82ef68d4 fix placement of dl in context (issue #657) 2020-06-09 01:13:28 +09:00
Alex Shinn
4ec2167f62 making the abi a little more stable by default 2020-06-08 00:54:36 +09:00
Alex Shinn
6caca77426 adding (scheme bytevector) 2020-05-31 23:24:51 +09:00
Alex Shinn
95310e5823 no more strcpy/sprintf (issue #653) 2020-05-27 18:35:18 +09:00
Alex Shinn
61f2983fad apply an explicit max vector length check (issue #636) 2020-05-22 14:13:48 +09:00
Vitaliy Mysak
5726c2e490 Prevent stack overflow in sexp_mark_one (issue #601)
Replace explicit recursion by heap allocations
in sexp_mark_one code.
This prevents crashes caused by stack overflow.
In particular, fixes issue #601.

As an optimization, allocate a fixed sized stack buffer first,
which should be enough for "normal" uses.
When that stack overflows, switch to heap.

Also, store "ranges" on the stack, instead of the actual sexp's,
using the fact that sexp's of a single parent are continous in memory.

This patch doesn't remove recursion on the context saves
because it didn't seem like they overflow in practice.
But changing that is simple having the stack interface.
2020-05-15 20:11:50 +02:00