1
0
mirror of https://github.com/janet-lang/janet synced 2026-02-11 04:30:19 +00:00
Commit Graph

4843 Commits

Author SHA1 Message Date
Calvin Rose
196f27af3d Update CHANGELOG.md 2026-02-05 20:01:00 -06:00
Calvin Rose
42c0096ce7 Allow simpler loading of modules.
E.g.

(import project/file.janet :as file)
(import ./project/file.janet :as file)
(import /home/me/project/file.janet :as file)

Will now do what you expect. When loading with a file extension, this
will first check directly if the relative (or absolute) path exists.

Also expands `module/find` to be able to show all matches for a given
module name without needing to try and catch import errors. Lastly, one
can also override the module/find functionality by passing `:loader`
directly.

E.g.

(import ./macoslib.dylib :loader :native :as my-thing)

Which will allow easily bypassing all module/find logic;
"./macoslib.dylib" will be passed directly to the :native loader
`(get module/loaders :native)`.

The module system was previously left open to customization but with
defaults to encourage a more typical style. However, these qol
improvements are more than worth it and can in some cases let people
stop fighting the module system.
2026-02-05 19:45:30 -06:00
Calvin Rose
0194115412 Auto-format janet. 2026-02-05 00:33:52 -06:00
Calvin Rose
f33697d6a0 Show accumulation buffer and tagged capture in peg debug rule. 2026-02-04 21:17:08 -06:00
Calvin Rose
b2bf70eace Move peg debug output to stderr in line with other internal debug tools.
Also allow disabling color in the debug output.
2026-02-04 18:52:20 -06:00
Calvin Rose
855d1f2940 Update changelog. 2026-02-04 18:46:09 -06:00
0xbec163
416bba9bd9 Add ??/debug PEG rule (#1710)
* Add debug (short-form ??) PEG rule

* Display capture stack to debug PEG rule

* Revise spec_debug to emit just the rule

* Update to proper indentation

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add a marshal/unmarshal test for ??/debug

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-04 18:44:46 -06:00
Calvin Rose
517e40a17b Speed up symbol resolution.
In my testing of `janet -l spork -e '(os/exit)'`, this speeds up
compilation by ~5%. Allocating and interning symbols from C is often
slow, so avoid it.

Add utility function for looking up keywords in tables more quickly.

More measurement on compiling spork for compilation speed, win
over original code closer to between 1-2% improvement
2026-02-02 21:19:48 -06:00
Calvin Rose
4f9a2af357 Add unmarshal sandbox. 2026-02-02 18:28:08 -06:00
Calvin Rose
a37752708e Add :compile, :asm, and :threads to sandbox flags.
These can be used to limit programs in a very expansive way.
2026-02-02 18:13:46 -06:00
Calvin Rose
5042ad6d4b More tweaks to changelog. 2026-02-01 14:46:20 -06:00
Calvin Rose
643c0b4976 Update CHANGELOG.md 2026-02-01 10:54:31 -06:00
Calvin Rose
ecb72c9c9a Revert changes to peg grammar. 2026-02-01 08:08:50 -06:00
Calvin Rose
a95546ff16 Merge pull request #1703 from amano-kenji/peg
Make peg-grammar available in all threads for peg/compile
2026-02-01 07:42:28 -06:00
Calvin Rose
d47f82713b More tweaks for named arity linting.
Handle more edge cases where &named is combined with &opt
2026-01-31 23:57:08 -06:00
Calvin Rose
497e363401 Make sure named argumnets are compiled before destructured params.
This handles an edge-case when combing destructured and named
parameters that produced spurious and confusing compiler lints.
2026-01-31 19:34:26 -06:00
Calvin Rose
8481da18d0 Add another bounds check for updating labels. Related to #1700 2026-01-31 13:20:45 -06:00
Calvin Rose
8f8382eead Partially address issue #1654 - better linting for named arguments.
While there are still cases that we could improve here, this change will
help in most cases with minimal overhead.
2026-01-31 13:16:02 -06:00
Calvin Rose
8e2ec997f0 Update copyright. 2026-01-31 10:33:57 -06:00
Calvin Rose
ea271b6d6c Update README with more clarification on versions to use for building. 2026-01-30 19:55:39 -06:00
Calvin Rose
e1897e1865 More documentation. 2026-01-29 07:50:23 -06:00
Calvin Rose
0c1585fdfe Preserve tuple type to fix #1709
Macro expansion as done by `macex1` was incorrectly losing the semantic
tuple information inside the `set` form. Since macro expansion is
usually done by the compiler, and `macex1` is mainly used for debugging
and deep transformations inside other macros, this only surfaced with
certain usage of short-fn macro.
2026-01-29 06:52:43 -06:00
Calvin Rose
a5c4e929e8 Merge pull request #1704 from amano-kenji/os/date
Document how to set local timezone for os/date and os/strftime.
2026-01-28 21:37:43 -06:00
Calvin Rose
4c21dc3c06 Merge pull request #1708 from sogaiu/fiber-docstring-tweaks
Tweak some fiber-related docstrings
2026-01-28 21:28:50 -06:00
sogaiu
d67b462023 Tweak some fiber-related docstrings 2026-01-29 11:39:05 +09:00
Calvin Rose
24ca108288 Add some extra checks for marshalling code. 2026-01-28 10:55:00 -06:00
Calvin Rose
7366fbed1f Disallow scheduling already modified fibers.
While not strictly needed for correctness, this discourages misuse of
fibers and mixing both coroutine, error handling, and scheduling
purposes.
2026-01-28 10:55:00 -06:00
Calvin Rose
797643716b Address #1707 - do not schedule non-task fibers. 2026-01-28 10:55:00 -06:00
Calvin Rose
eda2e11d31 MSVC and windows clib does not like fopen(NULL, ...)
We were exploiting this behavior on posix when adding shell history for
the built-in readline functionality.
2026-01-28 10:51:18 -06:00
Calvin Rose
ae0afe6198 Add janet_decref_abstract_maybe_free 2026-01-27 13:28:52 -06:00
Calvin Rose
33f5a0b319 Add test case to help address #1705 2026-01-24 12:23:01 -06:00
Calvin Rose
3ecc9bc543 Small tweaks to boot.janet to improve stack traces. 2026-01-24 12:17:24 -06:00
Calvin Rose
339b0751c8 Address #1705 - ev/close affecting ev/select. 2026-01-24 12:17:02 -06:00
amano.kenji
87b1bf1a66 Document how to set local timezone for os/date and os/strftime 2026-01-24 14:21:33 +00:00
amano.kenji
41354ada96 Make peg-grammar available in all threads for peg/compile 2026-01-24 11:36:49 +00:00
Calvin Rose
ee8d816738 Fix test case. 2026-01-23 08:30:15 -06:00
Calvin Rose
0f285855f0 Address #170 - strchr was not properly checking for 0 byte. 2026-01-23 08:13:15 -06:00
Calvin Rose
c43e06672c Address #1700 and move test cases to suite-compile.janet 2026-01-23 08:01:22 -06:00
Calvin Rose
2fabc80151 Address #1699 and improve test case for #1702 2026-01-23 07:46:31 -06:00
Calvin Rose
4dd08a4cde Address #1702 with extra bounds check.
The buffer overflow happened because we were creating many upvalue
slots in the compiler without using them, along with some faulty logic
that used the wrong length to check for the bitmap's bounds.
2026-01-23 07:33:05 -06:00
Calvin Rose
883dde4fa5 Remove xprintf reference. 2026-01-22 20:14:46 -06:00
Calvin Rose
6111291ede Revert a number of minor, unneeded changes for persistent REPL history. 2026-01-22 20:13:49 -06:00
Calvin Rose
53b8bf2684 Disable persistent REPL history without JANET_HISTFILE. 2026-01-22 19:17:16 -06:00
Calvin Rose
0c402cf3d6 Add persistent repl history. 2026-01-22 19:17:16 -06:00
Calvin Rose
606a1fc11a Merge pull request #1696 from amano-kenji/master
Document empty? more clearly.
2026-01-20 07:59:00 -06:00
amano.kenji
a2db57b9dc Document empty? more clearly. 2026-01-20 12:31:28 +00:00
Calvin Rose
f021bb2839 janet-format boot.janet 2026-01-18 13:05:55 -06:00
Calvin Rose
979233dee5 Update changelog and spelling 2026-01-18 11:09:01 -06:00
Calvin Rose
78a785175a Allow redirecting :err to :out with os/execute, no just os/spawn. 2026-01-17 22:37:35 -06:00
Calvin Rose
268864b072 Don't use new flag on mingw test. 2026-01-17 22:15:03 -06:00