aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/runtime.lux
blob: f600a87f50fba0a6cce1c6f636026541ca3ecf07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
(.module:
  [library
   [lux {"-" [for]}
    [abstract
     [equivalence {"+" [Equivalence]}]]
    [data
     ["[0]" product]
     ["[0]" text
      ["%" format {"+" [format]}]]
     [collection
      ["[0]" list ("[1]\[0]" monoid)]]]
    [macro
     ["[0]" template]]
    [world
     ["[0]" file]]]])

(type: .public Runtime
  (Record
   [#program Text
    #parameters (List Text)]))

(def: .public equivalence
  (Equivalence Runtime)
  (product.equivalence
   text.equivalence
   (list.equivalence text.equivalence)))

(template [<name> <command> <parameters>]
  [(def: .public <name>
     Runtime
     [#program <command>
      #parameters (`` (list (~~ (template.spliced <parameters>))))])]

  [default_java "java" ["-jar"]]
  [default_js "node" ["--stack_size=8192"]]
  [default_python "python3" []]
  [default_lua "lua" []]
  ... [default_ruby "RUBY_THREAD_VM_STACK_SIZE=15700000 ruby" []]
  [default_ruby "ruby" []]
  )

(def: .public (for runtime path)
  (-> Runtime file.Path Runtime)
  (revised@ #parameters
            (function (_ parameters)
              (list\composite parameters (list path)))
            runtime))