Skip to content

Commit

Permalink
RefMan: document that the FFI expects pure functions (#1558)
Browse files Browse the repository at this point in the history
This is a disclaimer that while you _can_ use impure functions in the Cryptol
FFI, we make no guarantees about the precise behavior of the side effects that
they functions may perform.

Fixes #1554.
  • Loading branch information
RyanGlScott authored Jul 31, 2023
1 parent 9de24f5 commit 6acbd46
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/RefMan/FFI.rst
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,14 @@ Evaluation

All Cryptol arguments are fully evaluated when a foreign function is called.

The FFI is intended to be used with pure functions that do not perform side
effects such as mutating global state, printing to the screen, interacting with
the file system, etc. Cryptol does not enforce this convention, however, so it
is possible to use impure functions from the FFI if you wish. Cryptol does not
make any guarantees about the order in which side effects will be executed, nor
does it make any guarantees about preserving any global state between
invocations of impure FFI functions.

Example
-------

Expand Down

0 comments on commit 6acbd46

Please sign in to comment.