aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/Source.mli
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-10-05 22:40:22 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-10-05 22:40:22 -0300
commitcfc641a9bb97c94e5993f895a8bcdf24214adc83 (patch)
treec793f068df0ff588565b5819b27018b616b87109 /lib/kernel/Source.mli
parent32e663591a84d095723e62ef934a0bc6e1470b52 (diff)
downloadRNT-cfc641a9bb97c94e5993f895a8bcdf24214adc83.tar.gz
RNT-cfc641a9bb97c94e5993f895a8bcdf24214adc83.zip
journal for the websitejournal
Diffstat (limited to '')
-rw-r--r--lib/kernel/Source.mli32
1 files changed, 32 insertions, 0 deletions
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