From cfc641a9bb97c94e5993f895a8bcdf24214adc83 Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Mon, 5 Oct 2026 22:40:22 -0300 Subject: journal for the website --- lib/kernel/Source.mli | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/kernel/Source.mli (limited to 'lib/kernel/Source.mli') diff --git a/lib/kernel/Source.mli b/lib/kernel/Source.mli new file mode 100644 index 0000000..1a51da2 --- /dev/null +++ b/lib/kernel/Source.mli @@ -0,0 +1,32 @@ +(** programs as source. A program in any language travels the tree as a + handle carrying [EphemeralRelation.Stored], with its text as the code, + so whoever holds one can run it through the evaluator of its language + without linking that language. *) + +(** a program in [language]. *) +val program : language:string -> string -> Protocols.Handle.t + +(** the language and text a handle carries, if it is a program. *) +val text : Protocols.Handle.t -> (string * string) option + +(** an evaluator for [language]: it runs the text of a program in that + language, and refuses anything else. *) +val evaluator : + language:string -> + (string -> (Protocols.Handle.t, Concepts.Condition.condition) result) -> + Protocols.Handle.t + +(** look up the evaluator of [language] under [root]'s \evaluator and run + [text] with it. *) +val run : + Protocols.Handle.t -> + language:string -> + string -> + (Protocols.Handle.t, Concepts.Condition.condition) result + +(** register [evaluator] as \evaluator\[language] under [root]. *) +val register : + Protocols.Handle.t -> + language:string -> + Protocols.Handle.t -> + (unit, Concepts.Condition.condition) result -- cgit v1.2.3