1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-18 11:19:56 +00:00
Commit Graph

2352 Commits

Author SHA1 Message Date
Calvin Rose
73c4289792 Fix define check. 2022-06-11 21:50:34 -05:00
Calvin Rose
ea45d7ee47 Convert to one big blob of assembly for sysv cc.
Also begin working on win64 calling convention.
2022-06-11 21:43:35 -05:00
Calvin Rose
6d970725e7 Update boot.janet for typos. 2022-06-11 21:19:42 -05:00
Calvin Rose
458c2c6d88 Make calling convention optional for trampoline 2022-06-11 15:47:51 -05:00
Calvin Rose
0cc53a8964 Get a GTK example working. Good proof of concept. 2022-06-11 14:47:35 -05:00
Calvin Rose
0bc96304a9 Add r32 and r64 aliases for real numbers in ffi types. 2022-06-11 09:40:37 -05:00
Calvin Rose
c75b088ff8 Format boot.janet with janet-format. 2022-06-10 19:13:23 -05:00
Calvin Rose
181f0341f5 Add :pack and :pack-all keywords to allow for struct packing.
Syntax may need some work but covers both fully packed structs
as well as packing of individual members.
2022-06-10 18:53:22 -05:00
Calvin Rose
33bb08d53b Merge branch 'master' into ffi 2022-06-10 16:24:55 -05:00
Calvin Rose
6d188f6e44 Improve .ppasm function. 2022-06-10 16:24:40 -05:00
Calvin Rose
c3648331f1 Expose an easy to use debugger function. 2022-06-10 15:39:29 -05:00
Calvin Rose
a5b66029d3 Expose the built-in debugger in more places. 2022-06-10 15:23:15 -05:00
Calvin Rose
49bfe80191 Make sure void return types work as expected. 2022-06-10 12:33:01 -05:00
Calvin Rose
a5def77bfe Add support for struct return values. 2022-06-10 12:25:08 -05:00
Calvin Rose
9ecb5b4791 Add native-read function as inverse to native-write. 2022-06-10 09:38:52 -05:00
Calvin Rose
1cc48a370a Add native-write, which will write structs to buffers.
Useful for testing as well as useful in its own right. Begs
for an inverse, native-read which would convert byte data
to native structs.
2022-06-10 08:46:20 -05:00
Calvin Rose
f1ec8d1e11 Beginning of struct support.
TODO:
- struct return values
- support for unions in signatures
- more testing
- complex types
- packed structs
- writing structs to buffers (useful and we have most of the machinery).
2022-06-09 20:27:56 -05:00
Calvin Rose
6f90df26a5 Alloca included by default on some OS, but not all.
Do explcitly include alloca on non-msvc compilers.
2022-06-08 10:01:19 -05:00
Calvin Rose
9d9cb378ff Don't include alloca.h, not in MSVC. 2022-06-08 09:59:13 -05:00
Calvin Rose
f92aac14aa Only enable FFI on x86-64, non-windows OSes. 2022-06-08 09:50:31 -05:00
Calvin Rose
3f27d78ab5 Add some FFI testing and more improvements to sysv abi.
Add support for integer return and floating point return variants, as
well as arguments on the stack. Start flushing out struct arguments.

Still needed:
- structs (packed and unpacked)
- complex numbers
- long doubles
- MASM alternative for windows (you can technically use sysv abi on
  windows)
- more calling conventions.
2022-06-08 09:44:49 -05:00
Calvin Rose
282d1ba22f Implement sys v abi on x64 partially. 2022-06-06 18:54:17 -05:00
Calvin Rose
94c19575b1 Fix when clib is not pointer type. 2022-06-06 13:37:07 -05:00
Calvin Rose
e3e485285b Prevent double usage of native objects after closing. 2022-06-06 13:36:03 -05:00
Calvin Rose
986e36720e Update windows builds for raw-natives. 2022-06-06 13:08:12 -05:00
Calvin Rose
74348ab6c2 Fix symbol lookup when symbol isn't found. 2022-06-06 10:53:00 -05:00
Calvin Rose
8d1ad99f42 Add stubs that are precursor to FFI.
FFI may be best implemented as an external library
(libffi has incompatible license to Janet) or as code
that takes void * and wraps then into Janet C functions
given a function signature. Either way, we need to some way
to load symbols from arbitrary dynamic libraries.
2022-06-06 10:49:30 -05:00
Calvin Rose
c9f33bbde0 Add rwlocks. 2022-06-05 16:42:18 -05:00
Calvin Rose
9c9f9d4fa6 Add some thread coordination primitives.
Due to the nature of event loops, it is a bit difficult to integrate
lock and other primitives such that they don't block fibers on the same
thread.
2022-06-05 15:24:34 -05:00
Calvin Rose
2f64a6b0cb Add parse-all function as a natural extension to the parse function. 2022-05-28 19:02:17 -05:00
Calvin Rose
dfa78ad3c6 typo 2022-05-28 12:23:28 -05:00
Calvin Rose
6ada2a458f Fixes on bsd for os/cpu-count. 2022-05-28 12:21:44 -05:00
Calvin Rose
8145f3b68d On linux, available CPUs is more useful information. 2022-05-28 12:19:25 -05:00
Calvin Rose
48289acee6 Add os/cpu-count functionality. 2022-05-28 12:01:23 -05:00
Calvin Rose
395ca7feea Fix meson.build for older versions of meson. 2022-05-14 10:27:28 -05:00
bakpakin
e0b7533c39 Add toggle macro. 2022-05-12 15:36:29 -05:00
bakpakin
5b2a402930 Fix version bump. 2022-05-09 10:28:09 -05:00
Calvin Rose
487d333024 Add module/value function to make grabbing bindings out module tables. 2022-05-05 19:24:44 -05:00
Calvin Rose
fe7d35171f Remove file/popen - address #974 2022-05-05 18:33:34 -05:00
Calvin Rose
b3aed13567 Use janet_getnat when non-negative integer needed. 2022-05-05 18:27:29 -05:00
rick2600
1ff521683f Fix #975 - null ptr dereference when a table is created with negative capacity 2022-05-05 02:11:43 -03:00
rick2600
7fda7709ff fix negative count passed to cfun_array_new_filled 2022-05-02 12:57:47 -03:00
John Gabriele
473eec26c1
os.c doc formatting typo 2022-04-29 23:57:37 -04:00
Calvin Rose
9fa945ad93 Don't include captures of last match from to combinator. 2022-04-29 19:21:10 -05:00
Calvin Rose
a895219d2f Fix #971 - remove to rule optimization
For to and thru, we need to restore eveytime through the loop since rules need
run with the right captures on the stack, especially if they have any
sort of backrefs.
2022-04-29 19:15:56 -05:00
bakpakin
427f7c362e Fix os/execute regression. 2022-04-27 22:59:27 -05:00
Calvin Rose
73f5c41fae Address #968 Ignore :pipe arguments in os/execute.
They are only useful in os/spawn. Also update docstrings.
2022-04-27 20:13:10 -05:00
Calvin Rose
b4ec168401 Address #950 - add defn suggestion on bad def.
While generally we are not in the business of making a very chatty
compiler, this is a simple improvement that involves compiling
metadata before the binding, as well as adding a suggestion for `defn`
in case the compiler encounters an unexpected tuple.
2022-04-23 22:27:34 -05:00
John Gabriele
471204b163
boot.janet docstrings (part 3, last part)
Added some backticks around code in docstrings to distinguish them from prose.

Also some light editing.
2022-04-20 18:31:06 -04:00
John Gabriele
9287b26042
boot.janet docstrings (part 2)
Added some backticks around code in docstrings to distinguish them from prose.

Also some light editing.
2022-04-19 01:55:37 -04:00
Calvin Rose
e22936fbf8
Merge pull request #964 from uvtc/patch-9
tuple.c docstrings
2022-04-18 14:07:41 -05:00
Calvin Rose
04ace9fc16
Merge pull request #963 from uvtc/patch-8
table.c docstrings
2022-04-18 14:07:26 -05:00
John Gabriele
96602612ba
boot.janet
Added some backticks around code in docstrings to distinguish them from prose.
2022-04-17 22:35:04 -04:00
John Gabriele
690b98bff9
tuple.c docstrings
Added some backticks around code in docstrings to distinguish them from prose.
2022-04-17 21:26:53 -04:00
John Gabriele
8329131bfe
table.c docstrings
Added some backticks around code in docstrings to distinguish them from prose.

Light editing to `table/raw-get`. Is my change there correct? (t --> the key)
2022-04-17 21:21:01 -04:00
Calvin Rose
9986aab326
Merge pull request #960 from uvtc/patch-5
math.c
2022-04-17 20:03:25 -05:00
Calvin Rose
0b105bc535
Merge pull request #959 from uvtc/patch-4
io.c docstrings
2022-04-17 20:03:11 -05:00
Calvin Rose
51ac9c9506
Merge pull request #961 from uvtc/patch-6
os.c docstrings
2022-04-17 20:02:56 -05:00
Calvin Rose
0310176696
Merge pull request #962 from uvtc/patch-7
parse.c docstrings
2022-04-17 20:02:26 -05:00
Calvin Rose
84a7a2bc3e
Merge pull request #958 from uvtc/patch-3
buffer.c docstrings
2022-04-17 20:01:57 -05:00
John Gabriele
2bffb9d682
parse.c docstrings
Added some backticks around code in docstrings to distinguish them from prose.
2022-04-17 20:53:36 -04:00
John Gabriele
811125a760
os.c docstrings
Some code backticks in docstrings where useful. Also some light editing of punctuation, etc.
2022-04-17 20:42:32 -04:00
John Gabriele
0dd91082a1
math.c
Fix typo, and backticks around one word.
2022-04-17 20:15:41 -04:00
John Gabriele
c80587868e
io.c docstrings
Added some backticks around code in docstrings to distinguish them from prose.
2022-04-17 20:07:05 -04:00
John Gabriele
8c52dc86c7
buffer.c docstrings
Added backticks around code in docstrings to distinguish from prose.
2022-04-17 19:49:29 -04:00
John Gabriele
be24592bc3
array.c docstrings
Added some backticks around code in docstrings to distinguish from prose.
2022-04-17 19:35:57 -04:00
John Gabriele
181d883a1d
string.c docstrings
Add backticks around code values to distinguish them from prose.
2022-04-17 12:08:26 -04:00
Calvin Rose
e01b65fd3d Fix some printing issues for docs. 2022-04-16 11:40:33 -05:00
rick2600
d5a5c49357 #951 - fix unchecked count in cfun_buffer_new_filled 2022-04-14 16:20:04 -03:00
Calvin Rose
a964b164a6 Merge branch 'master' of github.com:janet-lang/janet 2022-04-13 17:20:49 -05:00
Calvin Rose
1aac0489d7 Add a number of defs for used dynamic bindings. 2022-04-13 17:20:33 -05:00
sogaiu
bf9a60f70d Use defdyn for syspath in boot.janet 2022-04-13 19:39:41 +09:00
Calvin Rose
2a950e4ce9 Fix patch release - (version info) 2022-04-01 21:59:01 -05:00
Calvin Rose
7491421c31 Release patch relase due to bad version bumping. 2022-03-27 11:21:24 -05:00
Calvin Rose
9d0da74347
Merge pull request #937 from cellularmitosis/clock1012
Mac clock shim not needed after 10.12
2022-03-23 13:02:03 -05:00
Jason Pepas
e9870b293f Remove unneeded includes 2022-03-21 21:28:13 -05:00
Jason Pepas
ab910d060b Move AvailabilityMacros.h import into util.c 2022-03-21 21:23:09 -05:00
Calvin Rose
b60ef68ac6 Prepare for 1.21.0 Release. 2022-03-21 20:30:32 -05:00
Jason Pepas
c9986936ed Mac clock shim not needed until 10.12 2022-03-21 20:20:20 -05:00
Calvin Rose
d77be46644 Fix master - check last change with stackn 2022-03-21 19:41:06 -05:00
Calvin Rose
3715d7a184 Auto update copyright date. 2022-03-21 18:22:59 -05:00
Calvin Rose
1c96c7163a Address #926 - enter the event loop from janet_dobytes or
janet_dostring.
2022-03-21 18:06:14 -05:00
Jason Pepas
f270739f9f Refactor __MACH__ to JANET_APPLE 2022-03-17 01:20:55 -05:00
Calvin Rose
c815185574
Merge pull request #931 from saikyun/norm-neg
normalize zero without branching
2022-03-07 09:18:22 -06:00
Calvin Rose
8045e29a52
Merge pull request #932 from ishehadeh/feature/int-to-bytes
Add int/to-bytes: Serialize int/[su]64 to a buffer
2022-03-06 13:11:08 -06:00
Ian Shehadeh
bbb3e16fd1 int/to-bytes: return a buffer instead of a tuple
Buffers make more sense for this function because one of their primary
use cases is working with bytes.
The tuple implementation was an array of floats,  which is less
performant and ergonomic for common operations. (i.e: bit manipulation)

Buffers also have the advantage they are mutable, meaning the user
can write ints to an existing buffer.
2022-03-05 08:21:53 -05:00
Jona Ekenberg
3cd1657387 normalize zero without branching 2022-03-05 09:58:00 +01:00
Calvin Rose
d7ea122cf7 Fix #928 - Fix hashing of negative 0. 2022-03-04 21:20:20 -06:00
Ian Shehadeh
6aea7c7f70 add int/to-bytes
int/to-bytes unpacks the bytes of a 64-bit integer into a tuple.
2022-03-04 08:48:54 -05:00
Calvin Rose
56ba1d9cd3 Formatting cleanup. 2022-02-24 18:07:22 -06:00
Calvin Rose
408b03ae0d
Merge pull request #924 from uvtc/patch-2
Update docs for `describe`
2022-02-24 18:04:51 -06:00
John Gabriele
dbd1316d1e
Update docs for describe
closes #524
2022-02-23 00:36:24 -05:00
Ian Shehadeh
75845c0283 int/to-number: restrict input to JANET_INTMAX/MIN
Previously int/to-number would fail if the input was outside
the range of an int32.
Because Janet numbers are doubles,
they can safely store larger ints than an int32.
This commit updates int/to-number to restrict the
value to the range of integers a double can hold, instead of an int32.
2022-02-21 12:54:38 -05:00
Ian Shehadeh
88db9751d7 add int/to-number: converts s64 and u64 to numbers
(int/to-number value) converts an s64 or u64 to a number.
It restricts the value to the int32 range,
so that `int32?` will always suceeded when called on the result.
2022-02-20 16:16:52 -05:00
Calvin Rose
4e31d85349 Address #804 - save and restore module cache when flychecking.
Calling flychecking cannot change the module cache.
2022-02-12 10:36:45 -06:00
Calvin Rose
de542a81c0 Merge branch 'master' of github.com:janet-lang/janet 2022-02-11 20:38:10 -06:00
Calvin Rose
461576e7a2 Add defdyn macro to allow docs and checking for dyns.
Using keywords for the names of dynamic bindings emphasized their
dynamic nature and how they actually work, but is opaque when it comes
to documentation and error detection. Janet uses early binding for name
resolution by default in most places, dyns should be no different.

The `defdyn` macro allows one to create aliases for keywords that can
have docstrings, be imported and exported, etc. The aliases _must_
follow the usual lisp convention of earmuffs - this is not
restricting since the underlying keyword lookup mechanism is still
completely accessible to users.

Example:

(defdyn *my-dynamic-binding* "Sends the plumbus to the thingamizer when
 enabled")

The above creates a normal binding (as created with `def`) for
`*my-dynamic-binding*` that is bound to the keyword
`:my-dynamic-binding`.

There is an optional prefix for defdyns that can be used to avoid name
collisions - *defdyn-prefix*

Example:

(setdyn *defdyn-prefix* "mylib/")
(defdyn *my-dynamic-binding* "Plumbus thingamizer")
(pp *my-dynamic-binding*)

> :mylib/my-dynamic-binding
2022-02-11 20:37:52 -06:00
paulsnar
838cd1157c
ev: Fix timeout pruning logic 2022-02-11 09:25:23 +02:00
Calvin Rose
2f068b91d8 Mark a fiber as a root fiber during scheduling, not resumption.
This is more intuitive and avoids the possibilty of strange code
to resume or cancel a fiber after it was scheduled but before it was
entered for the first time.
2022-02-10 17:40:08 -06:00
Calvin Rose
aba87bf1bd MSVC unwilling to concatenate strings across preprocessor directives. 2022-02-09 22:36:37 -06:00
Calvin Rose
e64da8ede4 Update CHANGELOG.md 2022-02-09 22:31:27 -06:00
Calvin Rose
a9f38dfce4 Address #920 - fiber cancellation can hang event loop.
The main issue was cancellation of fiber using `cancel` rather than
`ev/cancel` could cause issues with the event loop internal ref count.
Since this is almost certainly bad usage (and is not something I want to
encourage or support), we will warn against trying to resume or error
fibers that have already been suspended or scheduled on the event loop.
The distinction between "task" fibers and normal fibers is now kept by a
flag that is set when a fiber is resumed - if it is the outermost fiber
on the stack, it is considered a root fiber. All fibers scheduled with
ev/go or by the event loop are root fibers, and thus cannot be cancelled
or resumed with `cancel` or `resume` - instead, use `ev/cancel` or
`ev/go`.
2022-02-09 22:16:49 -06:00
Calvin Rose
a097537a03 Fix #919 - strange quasiquote behavior.
Nested expression in the quasiquote were being compiled with the "hint"
flag passed to the expression compilation, essentially telling the
compiler to put intermediates into the final slot, possibly overwriting
other intermediate values. This fix removes that flags on any recursive
calls to quasiquote.
2022-02-09 20:31:10 -06:00
paulsnar
06f2e81dd5
shell: Handle EINTR on long reads
Many system I/O operations can fail due to being interrupted by a
signal. In the REPL's case, this poses a problem because in most cases
it's assumed that a read error is not recoverable and is equivalent to
EOF. This, however, is not the case for EINTR, in which case the I/O
should be tried again.

This commit fixes the most egregious violations of this, notably the
line getters, which would otherwise make the REPL exit on any signal,
even if the signal was caught and processed outside the REPL's purview.
2022-02-04 02:31:40 +02:00
Calvin Rose
40ae2e812f Prepare for 1.20.0 release. 2022-01-27 21:38:07 -06:00
Calvin Rose
06f613e40b Update signature of :missing-symbol hook.
don't take env table as explicit argument - it is already available
as the env table of the fiber.
2022-01-27 21:24:01 -06:00
Calvin Rose
61c8c1e8d2
Merge pull request #914 from pyrmont/feature.missing-symbols
Support looking up missing symbols during compilation
2022-01-24 18:16:53 -06:00
Michael Camilleri
ee924ee310
Fix declaration error in switch statement 2022-01-24 11:16:35 +09:00
Michael Camilleri
fad0ce3ced
Move missing symbol lookup to compiler 2022-01-24 11:08:33 +09:00
Michael Camilleri
d396180939
Avoid panicking when calling :missing-symbol lookup function 2022-01-23 17:29:52 +09:00
Michael Camilleri
ed5c1dfc3c
Remove :modules dynamic binding 2022-01-23 01:54:58 +09:00
Calvin Rose
6b949a7375 Merge branch 'master' of github.com:janet-lang/janet 2022-01-21 17:16:29 -06:00
Calvin Rose
3028e2908f Avoid possible infinite loop in rest destructuring. 2022-01-21 17:16:06 -06:00
Calvin Rose
578803b01f
Merge pull request #915 from AlbertoGP/master
Add ppc64 to os/arch
2022-01-21 16:44:59 -06:00
Calvin Rose
46738825c0 Fix formating on master. 2022-01-21 16:44:11 -06:00
Alberto González Palomo
fe8e718183 Add ppc64 to os/arch
Same as #431 (Add ppc to os/arch) but for the 64-bit version.
This is tested on a Power9 CPU in Little-Endian mode, on Linux.
2022-01-21 23:08:57 +01:00
Michael Camilleri
1eb34989d4
Support looking up missing symbols during compilation 2022-01-21 13:07:11 +09:00
Ian Shehadeh
6412768000 Add match documentation for & rest pattern 2022-01-20 09:19:21 -05:00
Ian Shehadeh
82688b9a44 add checks to & _ pattern in match macro
This commit adds 2 checks for & rest pattern in the match macro:
- & is followed by exactly 1 item
- & is followed by a symbol
2022-01-20 09:16:02 -05:00
Ian Shehadeh
4118d581af error if '& is followed by 2+ items in destructure
The current destructure pattern ends when '& is encountered.
This commit adds an error if it is followed by more than
a symbol to bind the array to.

Although its not critical since the extra items can be ignored,
they're a sign of some kind of mistake so its best to complain.
2022-01-20 08:52:37 -05:00
Ian Shehadeh
62608bec03 use janet_checktype over janet_type and ==
In destructure janet_type(_) == JANET_SYMBOL was used to check if a
value was a symbol.
This commit replaces that with the janet_checktype function,
because that function is used for the same purpose in other places.
2022-01-20 08:12:05 -05:00
Ian Shehadeh
a8e49d084b add checks for & _ destructuring pattern
This commit adds three checks to ensure & rest patterns are valid:
1. When checking for '& ensure the value is a symbol before unwrapping
2. Make sure '& is followed by a value
3. Make sure the value following '& is a symbol
2022-01-19 13:55:05 -05:00
Ian Shehadeh
db631097b1 add support for & _ to match macro
This commit adds support for using & _ syntax to bind the remaining
values in an array in the match macro.

The commit also adds a few tests for the new syntax in suite0008
2022-01-19 13:29:34 -05:00
Ian Shehadeh
cb5af974a4 POC "rest" pattern in destructuring
Add support for using [& rest] to match the remaining values
in an array or tuple when destructuring.

the rest pattern is implemented by pushing remaining values in the
rhs to the stack once & is found on the lhs.
Then tuple is called and the result is assigned
to the next symbol on the lhs.

This commit DOES NOT implement handling for malformed patterns.
2022-01-15 14:51:44 -05:00
Michael Camilleri
413c46e2ee
Fix redefinable macros 2022-01-14 17:15:42 +09:00
Ian Shehadeh
4931e2aee2 correct stack frame table keys in debug/stack doc
doc for debug/stack listed :column and :line as keys in the frame table.
But doframe actually sets :source-column and :source-line.
2022-01-08 16:25:43 -05:00
Calvin Rose
ffadf673cf Merge branch 'master' of github.com:janet-lang/janet 2022-01-08 11:27:48 -06:00
Calvin Rose
5b5a7e5a24 Make top level vars reuse ref cell when redefined at the top level.
This improves the repl experience while not messing with existing code
very much, if at all.
2022-01-08 11:27:08 -06:00
Ian Shehadeh
60378ff941 windows: fix ev/read hang when called on fs stream
handles returned by CreateFileA and FILE_FLAG_OVERLAPPED
support reading from arbitrary offsets.
The offset is passed to ReadFile in through the OVERLAPPED structure.
Since state->overlapped is zeroed ev_machine_read
ReadFile would always read from the start of the file and never finish

This commit changes ev_machine_read to update the offset to
the number of bytes read before calling ReadFile.
2022-01-07 16:32:39 -05:00
Calvin Rose
a37dc1af9d Merge branch 'redefs-work'
- Change the global binding name from :redefs to :redef
- Simplify internal representation of "redefinable bindings"
- Store "redefinable bindings in :ref rather than :value inside the
  environment entries. This makes such bindings more like vars that
  can't be set rather than defs.
2022-01-06 20:45:20 -06:00
Calvin Rose
03458df140
Merge pull request #898 from pyrmont/feature.redefs
Support redefinable `def` and `defmacro` bindings using `:redef`
2022-01-06 20:44:18 -06:00
Calvin Rose
99cfbaa63b Tweaks on redef feature branch. 2022-01-06 20:38:15 -06:00
Ian Shehadeh
938c5013c9 fix typo in janet_epoll_sync_callback
JANET_ASYNC_LISTEN_WRITE was checked instead of JANET_ASYNC_EVENT_READ.
This caused ev/read to hang if it was called on a normal fd.
2022-01-06 19:33:34 -05:00
Michael Camilleri
ea9d5ec793
Change metadata keyword back to :redef 2022-01-02 12:35:22 +09:00
Michael Camilleri
ec65f038a8
Support :dynamic-defs dynamic binding 2021-12-29 16:39:00 +09:00
sogaiu
1326ded048 Tweak match docstring 2021-12-25 16:56:10 +09:00
Michael Camilleri
8347439644
Support redefinable bindings 2021-12-18 13:05:16 +09:00
Michael Camilleri
97a8938407
Ensure value is of specified type or panic 2021-12-15 12:17:35 +09:00
Michael Camilleri
939d1dcae9
Only set :current-file in run-context if source is a path 2021-12-13 12:06:58 +09:00
Calvin Rose
9d5cc5c11f Proper locking on select. 2021-12-09 18:59:59 -06:00
Calvin Rose
d998f24d26 Merge branch 'master' of github.com:janet-lang/janet 2021-12-09 18:47:36 -06:00
Calvin Rose
d543f8857b Fix #892 - Remove racy ref counts for channels
Rather than manual reference counting for suspended fibers, we
automate the process by incrementing "extra_listeners" every time
we suspend a fiber in the event loop, and decrement when that fiber
is resumed. In this manner, we keep track of the number of suspending
fibers in a simpler, more correct way.
2021-12-09 18:44:55 -06:00
Michael Camilleri
bf29a54272
Clarify nested loop behaviour in loop macro 2021-12-09 10:41:56 +09:00
Calvin Rose
6d9286a202 Add some more changes to hashing to improve pointer hashing. 2021-12-07 08:36:08 -06:00
Calvin Rose
92fdd07ca3 Address #889 - Switch high and low bits of part of number hash (Knuth's multiplicative hash)
Also make sure we weren't throwing away 3 bits of entropy.
2021-12-07 08:24:04 -06:00
Calvin Rose
1c937ad960 Prepare for 1.19.2 release. Update CHANGELOG.md 2021-12-06 17:27:09 -06:00
Calvin Rose
f9891a5c04 More improvements to hashing for #889 2021-12-06 17:23:00 -06:00
Calvin Rose
e8ad311d84 Don't use janet_stacktrace anymore.
Behavior of janet_stacktrace_ext is more consistent.
2021-12-06 08:51:40 -06:00
Calvin Rose
545c09e202 Update hash mixing behavior - address #889
Try to have better behavior when mixing sub-hashes that are not uniform and
randomly distributed. Premultiply by a large prime before mixing to
"spread entropy" if it is concentrated in a certain subset of bits.
2021-12-05 16:34:26 -06:00
Calvin Rose
4dc281a05f Prepare for 1.19.1 release. 2021-12-04 13:34:41 -06:00