blob: 5fc77ce6c4255560472b0aae39b491d307dd4bec (
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
|
(ns lux.compiler
(:refer-clojure :exclude [compile])
(:require clojure.core.match
clojure.core.match.array
(lux [base :as & :refer [|let |do return* return |case]])
(lux.compiler [core :as &&core]
[io :as &&io]
[parallel :as &¶llel]
[jvm :as &&jvm])))
(defn init! [resources-dirs ^String target-dir]
(do (reset! &&core/!output-dir target-dir)
(&¶llel/setup!)
(&&io/init-libs!)
(.mkdirs (new java.io.File target-dir))
(&&jvm/init! resources-dirs target-dir)))
(def all-compilers
&&jvm/all-compilers)
(defn eval! [expr]
(&&jvm/eval! expr))
(defn compile-module [source-dirs name]
(&&jvm/compile-module source-dirs name))
(defn compile-program [mode program-module resources-dir source-dirs target-dir]
(init! resources-dir target-dir)
(&&jvm/compile-program mode program-module resources-dir source-dirs target-dir))
|