Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Manual/Runtime.lean
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,8 @@ To run this code (e.g. with {keywordOf Lean.Parser.Command.eval}`#eval`), the fo
1. The module containing the declaration and its dependencies must be compiled into a shared library
1. This shared library should be provided to `lean --load-dynlib=` to run code that imports the module.

The `precompileModules` {ref "lake-config"}[configuration option] instructs Lake to do the above automatically.

It is not sufficient to load the foreign library containing the external symbol because the interpreter depends on code that is emitted for each {attr}`extern` declaration.
Thus it is not possible to interpret an {attr}`extern` declaration in the same file.
The Lean source repository contains an example of this usage in [`tests/compiler/foreign`](https://github.com/leanprover/lean4/tree/master/tests/compiler/foreign/).
Loading