Commit Graph
4976 Commits
Author SHA1 Message Date
sogaiuandsogaiu eb1a7e2b20 Add tests for interpose (#1813)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-18 08:14:47 -05:00
sogaiuandsogaiu 04b48de8b4 Align find* and index-of details (#1811)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-17 20:24:24 -05:00
Calvin Rose c4b2278602 Update CHANGELOG 2026-08-17 20:21:58 -05:00
Calvin Rose b09aec83a2 Add t-switch to allow easily using libraries as CLI tools.
Rather than needing to create wrapper scripts for utilities, `janet -t
mylib <args...>` can be a simple, if somewhat awkward, alternative for
portable command line tooling. Also use spork/fmt on boot.janet.
2026-08-17 15:43:38 -05:00
Calvin Rose 65745d0237 Fix some fuzzing bugs and add asserts.
Passing in the wrong number of keyword arguments could be problematic
and cause compialtion issues. Handle that more gracefully and at least
be clean in valgrind.
2026-08-17 11:05:18 -05:00
Calvin Rose 073a036b16 Update CHANGELOG.md 2026-08-17 07:57:53 -05:00
sogaiuandsogaiu 3d03d083c7 Improve index-of docstring (#1809)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-17 07:56:24 -05:00
sogaiuandsogaiu c6ca76044d Add tests for find (#1808)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-17 07:55:40 -05:00
sogaiuandsogaiu 82b2bdc8e2 Add tests for find-index (#1807)
Co-authored-by: sogaiu <983021772@users.noreply.github.com>
2026-08-16 20:49:01 -05:00
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