Commit Graph

444 Commits

Author SHA1 Message Date
Mark Thom
daaab1cb37 Merge pull request #3331 from adri326/rawblock-safety
Prove safety of RawBlock and support multi-threaded usages
2026-06-11 00:38:04 -07:00
Skgland
a236d00d7d fix lint warnings 2026-06-05 20:45:18 +02:00
Skgland
bb5a59170a cleanup after msrv bump 2026-06-05 20:44:38 +02:00
Danil Platonov
bcb9dd0860 handle interrupts for tcp server 2026-06-04 02:41:11 -07:00
Danil Platonov
732f3ae10a use Notify instead of Sender 2026-06-02 00:49:00 -07:00
Danil Platonov
304cf424ed unused code for unimplemented shutdown on timeout feature 2026-05-30 15:59:16 -07:00
Danil Platonov
3cd40419eb cargo fmt 2026-05-30 15:56:18 -07:00
Danil Platonov
f8f7b3b7e2 allow to stop and start http server at will with SIGINT, stop the server on uncaught throws, display timing info for each request, use setup_call_cleanup in more places to avoid potential leaks, when handler for a path doesn't have a matching case, throw a detailed error instead of silently continuing 2026-05-30 15:47:50 -07:00
Alexander McLin
533594b6b6 Fixes issue 3264 by adding a fallback read mode when reading from non-tty stdin on Windows 2026-05-25 18:13:01 -04:00
Skgland
bdba7ba0f5 merge crypto-impure feature into feature crypto-full 2026-05-25 19:07:20 +02:00
Skgland
61ebcdb56e fix spelling 2026-05-24 23:55:19 +02:00
Skgland
f2195c2362 cleanup
- fix some warnings and mark others as expected
- make use of the msrv bump to 1.93.1 and cleanup compat and workarounds
2026-05-24 23:29:23 +02:00
Skgland
938f588769 make crypto depending on ring optional 2026-05-24 23:00:27 +02:00
Dmitry Shlagoff
2bbb6487ec remove redundant closure 2026-05-12 16:12:33 +02:00
Dmitry Shlagoff
095fa1227a replace lazy_static macro with std::sync::LazyLock 2026-05-12 15:40:38 +02:00
Emilie Burgun
898b6b2b25 RawBlock: seal base and add Stack::index_dangling_or_frame
Direct accesses to `base` are replaced with dedicated methods with
explicit safety requirements.
2026-05-10 22:36:11 +02:00
Mark Thom
3e2f3ecfdb Merge pull request #3273 from no382001/issue2914
fix panic in current_prolog_flag/2 when arguments are the same variable
2026-04-04 13:06:11 -06:00
no382001
6a10c6d6a5 fix panic in current_prolog_flag/2 when arguments are the same variable 2026-03-31 12:01:00 +02:00
Skgland
8aab887388 switch from Integer to u128
- u128 is only 16 bytes instead of 24
- incrementing u128 does not involve heap allocations
- u128 should be sufficent
 it would take more than 2 sextilion years to overflow if we would be incrementing it every tick at 5GHz
   i.e. 2^128-1 / 5 GHz / 60 / 60 / 24 / 356 > 2 sextilion

before this ~3.2% of the execution time of the program in https://github.com/mthom/scryer-prolog/issues/3265#issuecomment-4103176469 was spend in the increment_call_count function, after this change it's down to 0.3%
2026-03-21 13:36:40 +01:00
Mark Thom
b0b89a0aca Merge pull request #3258 from no382001/fix_load_xml/3
load_xml was returning a single term instead of a list of nodes
2026-03-14 22:46:03 -07:00
no382001
025da8315b load_xml was returning a single term instead of a list of nodes 2026-03-10 12:20:34 +01:00
Mark Thom
02c927bb83 Merge pull request #3241 from Skgland/parse-error-improvements
change `ParserError` type
2026-03-09 22:07:03 -07:00
Mark Thom
4a8388a6e9 Merge pull request #3189 from Skgland/fix-function_casts_as_integer
fix `function_casts_as_integer` warning
2026-03-09 22:06:33 -07:00
Thierry Marianne
4bd0ff0fcb cargo fmt fixes
Signed-off-by: Thierry Marianne <thierry@marianne.io>
2026-03-04 14:04:47 +01:00
Thierry Marianne
ed59aa05b0 apply suggestion
Signed-off-by: Thierry Marianne <thierry@marianne.io>
2026-03-04 14:01:17 +01:00
Thierry M.
fa21ff4813 use CStr .to_str() method
Co-authored-by: Bennet Bleßmann <3877590+Skgland@users.noreply.github.com>
2026-03-04 14:00:44 +01:00
Thierry Marianne
fae9ca1bb9 fix utf-8 panic
Signed-off-by: Thierry Marianne <thierry@marianne.io>
2026-03-04 12:45:58 +01:00
Skgland
18b476af28 make ParserError a struct with an enum kind field 2026-01-24 04:08:40 +01:00
Skgland
3343188756 replace pairs of usize with location struct 2026-01-24 04:08:40 +01:00
Mark Thom
69a367d1c9 do not retain attributes in solutions of findall (#3020) 2026-01-14 20:39:48 -08:00
Mark Thom
6284aa3a3f add variant_hash and is_non_variant to fix setof/3, bagof/3 2026-01-14 20:39:48 -08:00
Mark Thom
29cd80510b replace compare_term_test with parallel iterator, add is_not_variant 2026-01-14 20:39:45 -08:00
Skgland
5064760b1e fix spelling 2026-01-10 18:13:59 +01:00
Skgland
129cca53ed throw error(resource_error(memory), []) when the list length exceeds usize. 2025-12-10 00:04:24 +01:00
Skgland
797a8f8611 fix function_casts_as_integer warning
Comparing addresses of function pointers is brittle.

Functions may be duplicated resulting in function pointers to the same function to compare !=.
Functions may be merged/de-duplicated resulting in function pointers to different function to compare ==.

The later shouldn't be relevant here as the function differ in behavior, but mentioning it for completeness.
2025-12-04 23:35:23 +01:00
Mark Thom
96a9dfcc1b Merge pull request #3185 from mthom/install_verify_attr_opt
Optimize `verify_attr` by removing the need to scan instructions
2025-12-03 19:10:46 -07:00
Mark Thom
4bd16b8a2e revise InstallVerifyAttrs to remove need for predicate scanning (#3175) 2025-11-25 23:17:51 -08:00
Skgland
e9e97fe82a handle machine heap/stack allocation error 2025-11-19 22:17:24 +01:00
Skgland
248b05c992 use as_bytes().to_vec() instead of bytes().collect()
copying a slice into a vec should be easier to optimize by the complier than collecting a byte iteration into a vec
2025-11-19 19:23:41 +01:00
Thierry Marianne
042631cb4c run rustfmt
Signed-off-by: Thierry Marianne <thierry@marianne.io>
2025-09-21 22:52:12 +02:00
Thierry Marianne
32b6458deb dereferencing registers to access stack variables
deref register to access stack variable for `directory_exists/1`
deref register to access stack variable for `directory_files/2`
deref register to access stack variable for `delete_directory/1`
deref register to access stack variable for `delete_file/1`
deref registers to access stack variable for `file_copy/2`
deref register to access stack variable for `file_exists/1`
deref register to access stack variable for `file_size/2`
deref register to access stack variable from `file_time` function
deref register to access stack variable for `make_directory/1`
deref register to access stack variable for `make_directory_path/1`
deref register to access stack variable for `path_canonical/2`
deref registers to access stack variables for `rename_file/2`

Signed-off-by: Thierry Marianne <thierry@marianne.io>
2025-09-21 22:52:12 +02:00
Mark Thom
e9ff1348b1 Merge pull request #3084 from thierrymarianne/set_stream
Prevent top-level from panicking when calling  `set_input/1` with `Stream` variants.
2025-09-17 22:20:10 -07:00
Mark Thom
72cdba82f5 implement unify_ginteger to address FIXME in skip_max_list_cycle 2025-09-15 21:58:38 -07:00
Mark Thom
24f431e2ca fix off-by-one lam loop (#3081) 2025-09-15 21:52:43 -07:00
Thierry Marianne
1ece558a71 match against Stream HttpRead(), InputFile(_) and NamedTcp(_) variants in read_term_from_user_input
Signed-off-by: Thierry Marianne <thierry@marianne.io>
2025-09-14 19:19:26 +02:00
Thierry Marianne
be18eda696 do not reset user input Stream of kind different from Readline(_), Byte(_)
Signed-off-by: Thierry Marianne <thierry@marianne.io>
2025-09-14 19:19:21 +02:00
Mark Thom
ffea37d899 fix f64 indexing, introduce bespoke F64Table type (#3065) 2025-09-11 23:58:36 -07:00
Mark Thom
368c9fd9dd Merge pull request #3063 from Skgland/ffi++
ffi API extension and fixes
2025-08-28 20:49:41 -07:00
Skgland
78c08b87b6 cleanup ffi error handling and use Atom instead of &str in appropriate places 2025-08-26 00:01:35 +02:00
Skgland
6f3f66c407 fix builds without ffi feature 2025-08-24 21:08:52 +02:00