5067 Commits
Author SHA1 Message Date
sogaiuandsogaiu 5229244a1b Improve completeness of *-in docstrings (#1805)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-16 14:12:26 -05:00
sogaiuandsogaiu 5b438d9440 Tweak frequencies and group-by (#1806)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-16 14:12:18 -05:00
sogaiuandsogaiu 4aa21c0591 Tweak flatten* docstrings (#1804)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-16 09:22:16 -05:00
sogaiuandsogaiu 66be6fbf2b Tweak type docstring (#1802)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-16 09:22:03 -05:00
sogaiuandsogaiu 291e2222bb Improve clarity of some docstrings (#1800)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-15 14:38:33 -05:00
sogaiuandsogaiu f6fd6bdc29 Improve completeness of sort* docstrings (#1798)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-15 12:27:36 -05:00
sogaiuandsogaiu 1e91591c19 Improve completeness of some docstrings (#1791)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-15 12:06:05 -05:00
sogaiuandsogaiu 3f1b31a528 Improve consistency of some docstrings (#1794)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-15 12:05:39 -05:00
0888a6dfb0 Add tests for partition-by (#1795)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
Co-authored-by: Calvin Rose <calsrose@gmail.com>
2026-08-15 12:05:01 -05:00
ffb6648742 Add tests for update (#1796)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
Co-authored-by: Calvin Rose <calsrose@gmail.com>
2026-08-15 12:04:18 -05:00
Dmitry Solomennikov 23e4ad4bd3 Add int8_t, uint8_t and float getters for consistency (#1799)
Signed-off-by: Dmitry Solomennikov <dmitrys99@mail.ru>
2026-08-15 11:55:09 -05:00
Calvin Rose e3c6893080 whitespace 2026-08-15 11:36:34 -05:00
Calvin Rose 27000deed5 Address #1790 - limit number of automatic parameters.
This also improves the error behavior of malformed automatic parameters
so that the error conditions are better defined. Previously, large
indices like 88888888888888 would actually simply be converted to
symbols and fail later. This change puts strict limitations on this
conversion process - If a symbol is of the form "$<str>" and
(scan-number str) returns non-nil, the result must be a valid index. In
this way, symbols like `$1.1` will result in an immediate macro expansion error
rather than (usually) and unknown binding error.
2026-08-15 11:35:15 -05:00
sogaiuandsogaiu e5e13489c2 Add tests for distinct (#1801)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-15 08:38:43 -05:00
Calvin Rose ef69c89221 Initial support for GNU Hurd.
Simply stubs out the operating system keywords. Many ifdefs for Linux
can likely be adapted for GNU Hurd.
2026-08-14 08:35:23 -05:00
Calvin Rose 4370ae8acc Address #1792 - Allow janet_collect to be called outside interpreter
loop.
2026-08-08 09:32:26 -05:00
sogaiuandsogaiu 331e8544bc Simplify frequencies implementation (#1793)
* Add tests for frequencies

* Simplify frequencies implementation

---------

Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-08 09:30:20 -05:00
sogaiuandsogaiu f362e8f0fa Improve comprehensiveness of first docstring (#1789)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-02 16:56:20 -05:00
Samuel Martineau c0b32d4e37 Possible fix for #1772 (#1773) 2026-07-01 08:44:11 -05:00
Calvin Rose b070f95180 Fix poll implementation. 2026-06-28 16:58:49 -05:00
Calvin Rose 9eae852ab6 Add JANET_STREAM_NODUPS optimization for net code.
Saves a lot of syscalls in most cases. Also, remove janet_panic call
from inside ev code.
2026-06-28 16:38:35 -05:00
Calvin Rose cbb6a912d1 Avoid panics in thread setup.
Move validation to the parent thread as much as possible.
2026-06-28 15:49:55 -05:00
Calvin Rose 604545a198 Try tweaks to go_thread_subr for mingw 2026-06-28 15:49:55 -05:00
Samuel Martineau 0773444faa Unregister stream from EV upon closure (#1770)
* Prototype fix for #1769

* Add fix for kqueue

* Refactor to fix compilation error on macOS/BSD
2026-06-28 15:44:55 -05:00
Jacob Mealey 54411dc536 Fix typos in boot.janet (#1774) 2026-06-28 08:51:27 -05:00
Calvin Rose 8dbe828504 Add casts to u32 before left shifts to address ubsan edge cases.
Common idiom that wasn't always applied, especially in emit.c and
cfuns.c
2026-06-27 14:26:57 -05:00
Calvin Rose 88c42fff48 Address fuzzer issue with undefined behavior on memory overflow. 2026-06-27 14:00:07 -05:00
Arthur Chan 0e0cbc3ab0 OSS-Fuzz: Add fuzzer targets compile process (#1767)
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
2026-06-25 21:13:02 -05:00
Calvin Rose c6e163b07e Remove read after janet_deinit 2026-06-21 12:54:41 -05:00
Calvin Rose 7cf9bd9524 Add checks for bytecode jumps in compilers.
In the case where we have long jumps, emit a compiler error instead of
silently miscompiling.
2026-06-21 12:50:41 -05:00
Calvin Rose ffb83301c5 Handle bad ev/thread construction better.
We were incorrectly handling bad arguments to create a new thread
resulting in corruption.
2026-06-21 11:46:57 -05:00
Calvin Rose de3bb4ceb2 Add oob read checks in peg bytecode unmarshal.
These checks run before any references to rule[x] to avoid reading
beyond the end of the buffer. This needs to happen inline, not only at
the end of the loop where we check if we landed on the correct ending
index.
2026-06-18 20:16:38 -05:00
Arthur Chan f2f77a4bd5 OSS-Fuzz: Add fuzzer targets dobytes function (#1765)
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
2026-06-18 18:53:11 -05:00
Calvin Rose fa4058cdfc Avoid undefined behavior with signed left-shift in unmarshal.
Can trigger ubsan on bad input.
2026-06-18 11:07:49 -05:00
Calvin Rose 0d3635f9f4 Format. 2026-06-10 17:22:22 -05:00
Greg Slepak 004c0b0b4c Fix documentation for os_stat function (#1760)
* Fix documentation for os_stat function

* Refactor os_stat documentation for clarity
2026-06-10 17:16:55 -05:00
Arthur Chan 8b883d1304 OSS-Fuzz: Add new fuzzer targets unmarshal (#1762)
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
2026-06-10 17:16:37 -05:00
pixelherodevandNoam Preil ceb569782b plan9 port maintenance (#1756)
* plan9: fix regressions

* plan9: unopaque struct pointer

---------

Co-authored-by: Noam Preil <noam@pixelhero.dev>
2026-06-09 08:22:22 -05:00
Calvin Rose 6292a69aac Fix #1752 - add sandbox flag :exit
This change makes it so top level signals in the main thread will result
in expected error codes. For spawned threads, we will default to
pthread_exit or ExitThread(-1) on Windows after a top level signal.

Using `(sandbox :exit)` will restore the old behavior where a top level
signal will just print an error and call pthread_exit leaving other
thread untouched.
2026-05-23 06:35:30 -05:00
Rybnikov Alex 2814fc53c2 Add bash, zsh, and fish shell completions for janet (#1753)
Adds completion scripts for the janet interpreter covering all
flags documented in the man page: -h -v -s -e -E -d -n -N -r -R
-p -q -k -i -m -c -l -w -x --.

Flag-aware completions: -m completes directories, -c/-l complete
.janet files, -w/-x complete linting levels.

Closes #1567
2026-05-19 07:51:14 -05:00
Khang Nguyen Duy e663aa9ad2 Hide JanetMarshalContext implementation details (#1747)
This hides JanetMarshalContext behind an opaque pointer. User of this
struct should use the public API instead of using those internal
implementation details.
2026-05-16 09:12:38 -05:00
Khang Nguyen Duy 4413d43b7a Fix stale fiber stack pointers across realloc (#1751)
Those cached pointers are not safe to use across Janet fiber operations,
which may reallocate and invalidate those pointers.

Use the fields directly.
2026-05-14 18:52:24 -05:00
Calvin Rose bef6cb5d74 Address issue #1746
This will have the side effect of breaking loading image dicts from
older Janet versions with these contents.
2026-05-08 18:42:50 -05:00
jsks 27807d4456 Fix mmap return value check (#1745) 2026-05-01 17:49:49 -05:00
Calvin Rose d9b1d711ea Add fix for #1744
Usually, we try to pre-allocate a few extra stack values for
convenience, but we don't actually need to. Avoid a buffer overflow in
the case where this "extra" was causing us to go over INT32_MAX.
2026-04-26 13:23:03 -05:00
Calvin Rose ed17dd2c59 Add runtime checks for bug #1743
This also expands janet_verify to check slotmapping (debuginfo) in
function definitions.
2026-04-26 08:53:06 -05:00
Calvin Rose fcf3186c7d Add missing offset to temp registers. 2026-04-23 05:20:14 -05:00
Calvin Rose e118f57220 Add conservative checks large registers in emit.c
We make some assumptions about the index range of slots in emit.c that
is not tracked by the C type system, so add some asserts and conversions
to be safe.
2026-04-22 20:01:18 -05:00
sarna 5b5844b469 Try to use clearer language in buffer docs (#1738)
* Clarify buffer limits in docs

* Wording
2026-04-20 08:31:55 -05:00
Calvin Rose c6b802b082 Add #1737
Add some test cases and asserts for new pretty printing - we were not
properly handing the case when print formatter was not at the start of
the buffer.

A simple fix is to add a lookback_barrier, which is an index into the
buffer that backtracking print formatter can't go past. This ensures
that, whatever newlines are replace with spaces, we don't mess with any
explicit newlines that should be printed.

Also some tweaks to logic to try an make invariants more obvious and
simplify looping and indexing.
2026-04-03 08:38:12 -05:00