diff options
author | Eduardo Julian | 2018-07-21 02:10:54 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-07-21 02:10:54 -0400 |
commit | 660c7fe6af927c6e668a86e44fd2f0a9b1fb8b8b (patch) | |
tree | 3110462b0bca61fd2f9082b1c352bd5346b11662 | |
parent | 76e97634aaab09c89a895a6f6e863d10479821d1 (diff) |
- Re-named "Compiler" to "Phase".
- Re-structured the compiler infrastructure.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/compiler/default.lux (renamed from stdlib/source/lux/language.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/cache.lux (renamed from stdlib/source/lux/language/compiler/default/cache.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/init.lux (renamed from stdlib/source/lux/language/compiler/init.lux) | 7 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/name.lux (renamed from stdlib/source/lux/language/name.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase.lux (renamed from stdlib/source/lux/language/compiler.lux) | 10 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/analysis.lux (renamed from stdlib/source/lux/language/compiler/analysis.lux) | 34 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/analysis/case.lux (renamed from stdlib/source/lux/language/compiler/analysis/case.lux) | 4 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/analysis/case/coverage.lux (renamed from stdlib/source/lux/language/compiler/analysis/case/coverage.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/analysis/expression.lux (renamed from stdlib/source/lux/language/compiler/analysis/expression.lux) | 12 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/analysis/function.lux (renamed from stdlib/source/lux/language/compiler/analysis/function.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/analysis/inference.lux (renamed from stdlib/source/lux/language/compiler/analysis/inference.lux) | 4 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/analysis/module.lux (renamed from stdlib/source/lux/language/compiler/analysis/module.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/analysis/primitive.lux (renamed from stdlib/source/lux/language/compiler/analysis/primitive.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/analysis/reference.lux (renamed from stdlib/source/lux/language/compiler/analysis/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/analysis/scope.lux (renamed from stdlib/source/lux/language/compiler/analysis/scope.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/analysis/structure.lux (renamed from stdlib/source/lux/language/compiler/analysis/structure.lux) | 12 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/analysis/type.lux (renamed from stdlib/source/lux/language/compiler/analysis/type.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/extension.lux (renamed from stdlib/source/lux/language/compiler/extension.lux) | 14 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/extension/analysis.lux (renamed from stdlib/source/lux/language/compiler/extension/analysis.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/extension/analysis/common.lux (renamed from stdlib/source/lux/language/compiler/extension/analysis/common.lux) | 1 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/extension/analysis/host.jvm.lux (renamed from stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/extension/bundle.lux (renamed from stdlib/source/lux/language/compiler/extension/bundle.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/extension/synthesis.lux (renamed from stdlib/source/lux/language/compiler/extension/synthesis.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/extension/translation.lux (renamed from stdlib/source/lux/language/compiler/extension/translation.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/synthesis.lux (renamed from stdlib/source/lux/language/compiler/synthesis.lux) | 4 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/synthesis/case.lux (renamed from stdlib/source/lux/language/compiler/synthesis/case.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/synthesis/expression.lux (renamed from stdlib/source/lux/language/compiler/synthesis/expression.lux) | 4 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/synthesis/function.lux (renamed from stdlib/source/lux/language/compiler/synthesis/function.lux) | 20 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/synthesis/loop.lux (renamed from stdlib/source/lux/language/compiler/synthesis/loop.lux) | 10 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation.lux (renamed from stdlib/source/lux/language/compiler/translation.lux) | 4 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation/scheme/case.jvm.lux (renamed from stdlib/source/lux/language/compiler/translation/scheme/case.jvm.lux) | 19 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation/scheme/expression.jvm.lux (renamed from stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux) | 4 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation/scheme/extension.jvm.lux (renamed from stdlib/source/lux/language/compiler/translation/scheme/extension.jvm.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation/scheme/extension/common.jvm.lux (renamed from stdlib/source/lux/language/compiler/translation/scheme/extension/common.jvm.lux) | 4 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation/scheme/extension/host.jvm.lux (renamed from stdlib/source/lux/language/compiler/translation/scheme/extension/host.jvm.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation/scheme/function.jvm.lux (renamed from stdlib/source/lux/language/compiler/translation/scheme/function.jvm.lux) | 11 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation/scheme/loop.jvm.lux (renamed from stdlib/source/lux/language/compiler/translation/scheme/loop.jvm.lux) | 8 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation/scheme/primitive.jvm.lux (renamed from stdlib/source/lux/language/compiler/translation/scheme/primitive.jvm.lux) | 13 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation/scheme/reference.jvm.lux (renamed from stdlib/source/lux/language/compiler/translation/scheme/reference.jvm.lux) | 4 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation/scheme/runtime.jvm.lux (renamed from stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux) | 6 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/phase/translation/scheme/structure.jvm.lux (renamed from stdlib/source/lux/language/compiler/translation/scheme/structure.jvm.lux) | 8 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/reference.lux (renamed from stdlib/source/lux/language/reference.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/repl/type.lux (renamed from stdlib/source/lux/language/compiler/default/repl/type.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/default/syntax.lux (renamed from stdlib/source/lux/language/syntax.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/host.lux (renamed from stdlib/source/lux/language/host.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/host/scheme.lux (renamed from stdlib/source/lux/language/host/scheme.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/meta/archive.lux (renamed from stdlib/source/lux/language/compiler/meta/archive.lux) | 5 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/meta/cache.lux (renamed from stdlib/source/lux/language/compiler/meta/cache.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/meta/cache/dependency.lux (renamed from stdlib/source/lux/language/compiler/meta/cache/dependency.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/meta/io.lux (renamed from stdlib/source/lux/language/compiler/meta/io.lux) | 0 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/meta/io/archive.lux (renamed from stdlib/source/lux/language/compiler/meta/io/archive.lux) | 23 | ||||
-rw-r--r-- | stdlib/source/lux/compiler/meta/io/context.lux (renamed from stdlib/source/lux/language/compiler/meta/io/context.lux) | 2 | ||||
-rw-r--r-- | stdlib/source/lux/data/text.lux | 4 | ||||
-rw-r--r-- | stdlib/source/lux/data/text/buffer.lux | 2 | ||||
-rw-r--r-- | stdlib/source/lux/data/text/encoding.lux | 2 | ||||
-rw-r--r-- | stdlib/source/lux/world/file.lux | 5 | ||||
-rw-r--r-- | stdlib/test/test/lux/compiler/default/phase/analysis/case.lux (renamed from stdlib/test/test/lux/language/compiler/analysis/case.lux) | 15 | ||||
-rw-r--r-- | stdlib/test/test/lux/compiler/default/phase/analysis/function.lux (renamed from stdlib/test/test/lux/language/compiler/analysis/function.lux) | 23 | ||||
-rw-r--r-- | stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux (renamed from stdlib/test/test/lux/language/compiler/analysis/primitive.lux) | 19 | ||||
-rw-r--r-- | stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux (renamed from stdlib/test/test/lux/language/compiler/analysis/procedure/common.lux) | 23 | ||||
-rw-r--r-- | stdlib/test/test/lux/compiler/default/phase/analysis/reference.lux (renamed from stdlib/test/test/lux/language/compiler/analysis/reference.lux) | 33 | ||||
-rw-r--r-- | stdlib/test/test/lux/compiler/default/phase/analysis/structure.lux (renamed from stdlib/test/test/lux/language/compiler/analysis/structure.lux) | 47 | ||||
-rw-r--r-- | stdlib/test/test/lux/compiler/default/phase/synthesis/case.lux (renamed from stdlib/test/test/lux/language/compiler/synthesis/case.lux) | 23 | ||||
-rw-r--r-- | stdlib/test/test/lux/compiler/default/phase/synthesis/function.lux (renamed from stdlib/test/test/lux/language/compiler/synthesis/function.lux) | 27 | ||||
-rw-r--r-- | stdlib/test/test/lux/compiler/default/phase/synthesis/primitive.lux (renamed from stdlib/test/test/lux/language/compiler/synthesis/primitive.lux) | 17 | ||||
-rw-r--r-- | stdlib/test/test/lux/compiler/default/phase/synthesis/structure.lux (renamed from stdlib/test/test/lux/language/compiler/synthesis/structure.lux) | 19 | ||||
-rw-r--r-- | stdlib/test/test/lux/compiler/default/syntax.lux (renamed from stdlib/test/test/lux/language/syntax.lux) | 5 | ||||
-rw-r--r-- | stdlib/test/tests.lux | 80 |
68 files changed, 313 insertions, 292 deletions
diff --git a/stdlib/source/lux/language.lux b/stdlib/source/lux/compiler/default.lux index bc6e2c9ec..bc6e2c9ec 100644 --- a/stdlib/source/lux/language.lux +++ b/stdlib/source/lux/compiler/default.lux diff --git a/stdlib/source/lux/language/compiler/default/cache.lux b/stdlib/source/lux/compiler/default/cache.lux index d8f841e13..d8f841e13 100644 --- a/stdlib/source/lux/language/compiler/default/cache.lux +++ b/stdlib/source/lux/compiler/default/cache.lux diff --git a/stdlib/source/lux/language/compiler/init.lux b/stdlib/source/lux/compiler/default/init.lux index 648211ca7..cac69ab89 100644 --- a/stdlib/source/lux/language/compiler/init.lux +++ b/stdlib/source/lux/compiler/default/init.lux @@ -1,7 +1,8 @@ (.module: lux - ["." /// - ["." host]]) + ["." // + [// + ["." host]]]) (def: #export (cursor file) (-> Text Cursor) @@ -32,7 +33,7 @@ (~~ (static host.r)) host.r (~~ (static host.ruby)) host.ruby (~~ (static host.scheme)) host.scheme}) - #.version ///.version + #.version //.version #.mode #.Build})) (def: #export (compiler host) diff --git a/stdlib/source/lux/language/name.lux b/stdlib/source/lux/compiler/default/name.lux index f6489b89c..f6489b89c 100644 --- a/stdlib/source/lux/language/name.lux +++ b/stdlib/source/lux/compiler/default/name.lux diff --git a/stdlib/source/lux/language/compiler.lux b/stdlib/source/lux/compiler/default/phase.lux index 03dd30e2a..24bba1229 100644 --- a/stdlib/source/lux/language/compiler.lux +++ b/stdlib/source/lux/compiler/default/phase.lux @@ -18,7 +18,7 @@ (def: #export Monad<Operation> (state.Monad<State'> error.Monad<Error>)) -(type: #export (Compiler s i o) +(type: #export (Phase s i o) (-> i (Operation s o))) (def: #export (run' state operation) @@ -53,15 +53,15 @@ action)) (def: #export identity - (All [s a] (Compiler s a a)) + (All [s a] (Phase s a a)) (function (_ input state) (#error.Success [state input]))) (def: #export (compose pre post) (All [s0 s1 i t o] - (-> (Compiler s0 i t) - (Compiler s1 t o) - (Compiler [s0 s1] i o))) + (-> (Phase s0 i t) + (Phase s1 t o) + (Phase [s0 s1] i o))) (function (_ input [pre/state post/state]) (do error.Monad<Error> [[pre/state' temp] (pre input pre/state) diff --git a/stdlib/source/lux/language/compiler/analysis.lux b/stdlib/source/lux/compiler/default/phase/analysis.lux index 4b8a19c66..182e3c321 100644 --- a/stdlib/source/lux/language/compiler/analysis.lux +++ b/stdlib/source/lux/compiler/default/phase/analysis.lux @@ -54,8 +54,8 @@ (type: #export Operation (extension.Operation .Lux Code Analysis)) -(type: #export Compiler - (extension.Compiler .Lux Code Analysis)) +(type: #export Phase + (extension.Phase .Lux Code Analysis)) (type: #export Handler (extension.Handler .Lux .Code Analysis)) @@ -226,14 +226,14 @@ (def: #export (with-source-code source action) (All [a] (-> Source (Operation a) (Operation a))) - (function (_ [bundle compiler]) - (let [old-source (get@ #.source compiler)] - (case (action [bundle (set@ #.source source compiler)]) + (function (_ [bundle state]) + (let [old-source (get@ #.source state)] + (case (action [bundle (set@ #.source source state)]) (#error.Error error) (#error.Error error) - (#error.Success [[bundle' compiler'] output]) - (#error.Success [[bundle' (set@ #.source old-source compiler')] + (#error.Success [[bundle' state'] output]) + (#error.Success [[bundle' (set@ #.source old-source state')] output]))))) (def: fresh-bindings @@ -250,15 +250,15 @@ (def: #export (with-scope action) (All [a] (-> (Operation a) (Operation [Scope a]))) - (function (_ [bundle compiler]) - (case (action [bundle (update@ #.scopes (|>> (#.Cons fresh-scope)) compiler)]) - (#error.Success [[bundle' compiler'] output]) - (case (get@ #.scopes compiler') + (function (_ [bundle state]) + (case (action [bundle (update@ #.scopes (|>> (#.Cons fresh-scope)) state)]) + (#error.Success [[bundle' state'] output]) + (case (get@ #.scopes state') #.Nil (#error.Error "Impossible error: Drained scopes!") (#.Cons head tail) - (#error.Success [[bundle' (set@ #.scopes tail compiler')] + (#error.Success [[bundle' (set@ #.scopes tail state')] [head output]])) (#error.Error error) @@ -274,11 +274,11 @@ (All [a] (-> Cursor (Operation a) (Operation a))) (if (text/= "" (product.left cursor)) action - (function (_ [bundle compiler]) - (let [old-cursor (get@ #.cursor compiler)] - (case (action [bundle (set@ #.cursor cursor compiler)]) - (#error.Success [[bundle' compiler'] output]) - (#error.Success [[bundle' (set@ #.cursor old-cursor compiler')] + (function (_ [bundle state]) + (let [old-cursor (get@ #.cursor state)] + (case (action [bundle (set@ #.cursor cursor state)]) + (#error.Success [[bundle' state'] output]) + (#error.Success [[bundle' (set@ #.cursor old-cursor state')] output]) (#error.Error error) diff --git a/stdlib/source/lux/language/compiler/analysis/case.lux b/stdlib/source/lux/compiler/default/phase/analysis/case.lux index 841173629..e523d86a9 100644 --- a/stdlib/source/lux/language/compiler/analysis/case.lux +++ b/stdlib/source/lux/compiler/default/phase/analysis/case.lux @@ -15,7 +15,7 @@ ["." check]] ["." macro ["." code]]] - ["." // (#+ Pattern Analysis Operation Compiler) + ["." // (#+ Pattern Analysis Operation Phase) ["." scope] ["//." type] ["." structure] @@ -270,7 +270,7 @@ )) (def: #export (case analyse inputC branches) - (-> Compiler Code (List [Code Code]) (Operation Analysis)) + (-> Phase Code (List [Code Code]) (Operation Analysis)) (.case branches #.Nil (///.throw cannot-have-empty-branches "") diff --git a/stdlib/source/lux/language/compiler/analysis/case/coverage.lux b/stdlib/source/lux/compiler/default/phase/analysis/case/coverage.lux index 24ded5476..24ded5476 100644 --- a/stdlib/source/lux/language/compiler/analysis/case/coverage.lux +++ b/stdlib/source/lux/compiler/default/phase/analysis/case/coverage.lux diff --git a/stdlib/source/lux/language/compiler/analysis/expression.lux b/stdlib/source/lux/compiler/default/phase/analysis/expression.lux index 1c74499ad..dd27c87e6 100644 --- a/stdlib/source/lux/language/compiler/analysis/expression.lux +++ b/stdlib/source/lux/compiler/default/phase/analysis/expression.lux @@ -8,7 +8,7 @@ [text format]] ["." macro]] - ["." // (#+ Analysis Operation Compiler) + ["." // (#+ Analysis Operation Phase) ["." type] ["." primitive] ["." structure] @@ -31,12 +31,12 @@ ) (def: #export (analyser eval) - (-> Eval Compiler) + (-> Eval Phase) (function (compile code) (do ///.Monad<Operation> [expectedT (extension.lift macro.expected-type)] (let [[cursor code'] code] - ## The cursor must be set in the compiler for the sake + ## The cursor must be set in the state for the sake ## of having useful error messages. (//.with-cursor cursor (case code' @@ -96,10 +96,10 @@ ## (#.Some macro) ## (do @ ## [expansion (: (Operation (List Code)) - ## (function (_ compiler) - ## (case (macroL.expand macro args compiler) + ## (function (_ state) + ## (case (macroL.expand macro args state) ## (#e.Error error) - ## ((///.throw macro-expansion-failed error) compiler) + ## ((///.throw macro-expansion-failed error) state) ## output ## output)))] diff --git a/stdlib/source/lux/language/compiler/analysis/function.lux b/stdlib/source/lux/compiler/default/phase/analysis/function.lux index d12880afa..13a377df3 100644 --- a/stdlib/source/lux/language/compiler/analysis/function.lux +++ b/stdlib/source/lux/compiler/default/phase/analysis/function.lux @@ -12,7 +12,7 @@ ["." type ["." check]] ["." macro]] - ["." // (#+ Analysis Operation Compiler) + ["." // (#+ Analysis Operation Phase) ["." scope] ["//." type] ["." inference] @@ -34,7 +34,7 @@ (text.join-with ""))])) (def: #export (function analyse function-name arg-name body) - (-> Compiler Text Text Code (Operation Analysis)) + (-> Phase Text Text Code (Operation Analysis)) (do ///.Monad<Operation> [functionT (extension.lift macro.expected-type)] (loop [expectedT functionT] @@ -95,7 +95,7 @@ ))))) (def: #export (apply analyse functionT functionA argsC+) - (-> Compiler Type Analysis (List Code) (Operation Analysis)) + (-> Phase Type Analysis (List Code) (Operation Analysis)) (<| (///.with-stack cannot-apply [functionT argsC+]) (do ///.Monad<Operation> [[applyT argsA+] (inference.general analyse functionT argsC+)]) diff --git a/stdlib/source/lux/language/compiler/analysis/inference.lux b/stdlib/source/lux/compiler/default/phase/analysis/inference.lux index 160978d39..91e28a4ca 100644 --- a/stdlib/source/lux/language/compiler/analysis/inference.lux +++ b/stdlib/source/lux/compiler/default/phase/analysis/inference.lux @@ -14,7 +14,7 @@ ["." macro]] ["." /// ("operation/." Monad<Operation>) ["." extension]] - [// (#+ Tag Analysis Operation Compiler)] + [// (#+ Tag Analysis Operation Phase)] ["." //type]) (exception: #export (variant-tag-out-of-bounds {size Nat} {tag Tag} {type Type}) @@ -97,7 +97,7 @@ ## But, so long as the type being used for the inference can be treated ## as a function type, this method of inference should work. (def: #export (general analyse inferT args) - (-> Compiler Type (List Code) (Operation [Type (List Analysis)])) + (-> Phase Type (List Code) (Operation [Type (List Analysis)])) (case args #.Nil (do ///.Monad<Operation> diff --git a/stdlib/source/lux/language/compiler/analysis/module.lux b/stdlib/source/lux/compiler/default/phase/analysis/module.lux index adc442c1f..adc442c1f 100644 --- a/stdlib/source/lux/language/compiler/analysis/module.lux +++ b/stdlib/source/lux/compiler/default/phase/analysis/module.lux diff --git a/stdlib/source/lux/language/compiler/analysis/primitive.lux b/stdlib/source/lux/compiler/default/phase/analysis/primitive.lux index bd42825d3..bd42825d3 100644 --- a/stdlib/source/lux/language/compiler/analysis/primitive.lux +++ b/stdlib/source/lux/compiler/default/phase/analysis/primitive.lux diff --git a/stdlib/source/lux/language/compiler/analysis/reference.lux b/stdlib/source/lux/compiler/default/phase/analysis/reference.lux index bb78a32fb..bb78a32fb 100644 --- a/stdlib/source/lux/language/compiler/analysis/reference.lux +++ b/stdlib/source/lux/compiler/default/phase/analysis/reference.lux diff --git a/stdlib/source/lux/language/compiler/analysis/scope.lux b/stdlib/source/lux/compiler/default/phase/analysis/scope.lux index 108e450e1..a3f7e926c 100644 --- a/stdlib/source/lux/language/compiler/analysis/scope.lux +++ b/stdlib/source/lux/compiler/default/phase/analysis/scope.lux @@ -12,7 +12,7 @@ ["." list ("list/." Functor<List> Fold<List> Monoid<List>)] [dictionary ["." plist]]]]] - [// (#+ Operation Compiler) + [// (#+ Operation Phase) ["/." // ["." extension] [// diff --git a/stdlib/source/lux/language/compiler/analysis/structure.lux b/stdlib/source/lux/compiler/default/phase/analysis/structure.lux index b2eb5dc17..c50383eb8 100644 --- a/stdlib/source/lux/language/compiler/analysis/structure.lux +++ b/stdlib/source/lux/compiler/default/phase/analysis/structure.lux @@ -17,7 +17,7 @@ ["." check]] ["." macro ["." code]]] - ["." // (#+ Tag Analysis Operation Compiler) + ["." // (#+ Tag Analysis Operation Phase) ["//." type] ["." primitive] ["." inference] @@ -80,7 +80,7 @@ code.record))])) (def: #export (sum analyse tag valueC) - (-> Compiler Nat Code (Operation Analysis)) + (-> Phase Nat Code (Operation Analysis)) (do ///.Monad<Operation> [expectedT (extension.lift macro.expected-type)] (///.with-stack cannot-analyse-variant [expectedT tag valueC] @@ -153,7 +153,7 @@ (///.throw invalid-variant-type [expectedT tag valueC]))))) (def: (typed-product analyse membersC+) - (-> Compiler (List Code) (Operation Analysis)) + (-> Phase (List Code) (Operation Analysis)) (do ///.Monad<Operation> [expectedT (extension.lift macro.expected-type)] (loop [expectedT expectedT @@ -192,7 +192,7 @@ (:: @ map (|>> //.no-op))))))) (def: #export (product analyse membersC) - (-> Compiler (List Code) (Operation Analysis)) + (-> Phase (List Code) (Operation Analysis)) (do ///.Monad<Operation> [expectedT (extension.lift macro.expected-type)] (///.with-stack cannot-analyse-tuple [expectedT membersC] @@ -259,7 +259,7 @@ )))) (def: #export (tagged-sum analyse tag valueC) - (-> Compiler Ident Code (Operation Analysis)) + (-> Phase Ident Code (Operation Analysis)) (do ///.Monad<Operation> [tag (extension.lift (macro.normalize tag)) [idx group variantT] (extension.lift (macro.resolve-tag tag)) @@ -335,7 +335,7 @@ )) (def: #export (record analyse members) - (-> Compiler (List [Code Code]) (Operation Analysis)) + (-> Phase (List [Code Code]) (Operation Analysis)) (do ///.Monad<Operation> [members (normalize members) [membersC recordT] (order members)] diff --git a/stdlib/source/lux/language/compiler/analysis/type.lux b/stdlib/source/lux/compiler/default/phase/analysis/type.lux index 3eb574986..3eb574986 100644 --- a/stdlib/source/lux/language/compiler/analysis/type.lux +++ b/stdlib/source/lux/compiler/default/phase/analysis/type.lux diff --git a/stdlib/source/lux/language/compiler/extension.lux b/stdlib/source/lux/compiler/default/phase/extension.lux index 10d2d62ca..a24d72b0c 100644 --- a/stdlib/source/lux/language/compiler/extension.lux +++ b/stdlib/source/lux/compiler/default/phase/extension.lux @@ -17,8 +17,8 @@ (with-expansions [<Bundle> (as-is (Dictionary Text (Handler s i o)))] (type: #export (Handler s i o) (-> Text - (//.Compiler [<Bundle> s] i o) - (//.Compiler [<Bundle> s] (List i) o))) + (//.Phase [<Bundle> s] i o) + (//.Phase [<Bundle> s] (List i) o))) (type: #export (Bundle s i o) <Bundle>)) @@ -26,8 +26,8 @@ (type: #export (Operation s i o v) (//.Operation [(Bundle s i o) s] v)) -(type: #export (Compiler s i o) - (//.Compiler [(Bundle s i o) s] i o)) +(type: #export (Phase s i o) + (//.Phase [(Bundle s i o) s] i o)) (do-template [<name>] [(exception: #export (<name> {name Text}) @@ -46,16 +46,16 @@ (#error.Success [[(dict.put name handler bundle) state] []])))) -(def: #export (apply compiler [name parameters]) +(def: #export (apply phase [name parameters]) (All [s i o] - (-> (Compiler s i o) (Extension i) (Operation s i o o))) + (-> (Phase s i o) (Extension i) (Operation s i o o))) (function (_ (^@ stateE [bundle state])) (case (dict.get name bundle) #.None (ex.throw unknown name) (#.Some handler) - ((handler name compiler) parameters stateE)))) + ((handler name phase) parameters stateE)))) (def: #export (localized get set transform) (All [s s' i o v] diff --git a/stdlib/source/lux/language/compiler/extension/analysis.lux b/stdlib/source/lux/compiler/default/phase/extension/analysis.lux index 4d78ceb43..4d78ceb43 100644 --- a/stdlib/source/lux/language/compiler/extension/analysis.lux +++ b/stdlib/source/lux/compiler/default/phase/extension/analysis.lux diff --git a/stdlib/source/lux/language/compiler/extension/analysis/common.lux b/stdlib/source/lux/compiler/default/phase/extension/analysis/common.lux index 201616ac9..2817fd55d 100644 --- a/stdlib/source/lux/language/compiler/extension/analysis/common.lux +++ b/stdlib/source/lux/compiler/default/phase/extension/analysis/common.lux @@ -15,7 +15,6 @@ ["dict" dictionary (#+ Dictionary)]]] [type ["." check]] - ["." language] [io (#+ IO)]] ["." //// ["." analysis (#+ Analysis Handler Bundle) diff --git a/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux b/stdlib/source/lux/compiler/default/phase/extension/analysis/host.jvm.lux index 0edd20d2b..0edd20d2b 100644 --- a/stdlib/source/lux/language/compiler/extension/analysis/host.jvm.lux +++ b/stdlib/source/lux/compiler/default/phase/extension/analysis/host.jvm.lux diff --git a/stdlib/source/lux/language/compiler/extension/bundle.lux b/stdlib/source/lux/compiler/default/phase/extension/bundle.lux index e2d36fa73..e2d36fa73 100644 --- a/stdlib/source/lux/language/compiler/extension/bundle.lux +++ b/stdlib/source/lux/compiler/default/phase/extension/bundle.lux diff --git a/stdlib/source/lux/language/compiler/extension/synthesis.lux b/stdlib/source/lux/compiler/default/phase/extension/synthesis.lux index d907808a8..d907808a8 100644 --- a/stdlib/source/lux/language/compiler/extension/synthesis.lux +++ b/stdlib/source/lux/compiler/default/phase/extension/synthesis.lux diff --git a/stdlib/source/lux/language/compiler/extension/translation.lux b/stdlib/source/lux/compiler/default/phase/extension/translation.lux index 3a43e0dcb..3a43e0dcb 100644 --- a/stdlib/source/lux/language/compiler/extension/translation.lux +++ b/stdlib/source/lux/compiler/default/phase/extension/translation.lux diff --git a/stdlib/source/lux/language/compiler/synthesis.lux b/stdlib/source/lux/compiler/default/phase/synthesis.lux index 8dd99986b..8deb48ba8 100644 --- a/stdlib/source/lux/language/compiler/synthesis.lux +++ b/stdlib/source/lux/compiler/default/phase/synthesis.lux @@ -101,8 +101,8 @@ (type: #export Operation (extension.Operation ..State Analysis Synthesis)) -(type: #export Compiler - (extension.Compiler ..State Analysis Synthesis)) +(type: #export Phase + (extension.Phase ..State Analysis Synthesis)) (type: #export Path (Path' Synthesis)) diff --git a/stdlib/source/lux/language/compiler/synthesis/case.lux b/stdlib/source/lux/compiler/default/phase/synthesis/case.lux index 2ef9b735e..eaa7621f6 100644 --- a/stdlib/source/lux/language/compiler/synthesis/case.lux +++ b/stdlib/source/lux/compiler/default/phase/synthesis/case.lux @@ -12,7 +12,7 @@ [number ("frac/." Equivalence<Frac>)] [collection ["." list ("list/." Fold<List> Monoid<List>)]]]] - ["." // (#+ Path Synthesis Operation Compiler) + ["." // (#+ Path Synthesis Operation Phase) ["." function] ["/." // ("operation/." Monad<Operation>) ["." analysis (#+ Pattern Match Analysis)] @@ -77,7 +77,7 @@ (list.reverse (list.enumerate tuple))))))) (def: #export (path synthesize pattern bodyA) - (-> Compiler Pattern Analysis (Operation Path)) + (-> Phase Pattern Analysis (Operation Path)) (path' pattern (operation/map (|>> #//.Then) (synthesize bodyA)))) (def: #export (weave leftP rightP) @@ -127,7 +127,7 @@ <default>))) (def: #export (synthesize synthesize^ inputA [headB tailB+]) - (-> Compiler Analysis Match (Operation Synthesis)) + (-> Phase Analysis Match (Operation Synthesis)) (do ///.Monad<Operation> [inputS (synthesize^ inputA)] (with-expansions [<unnecesary-let> diff --git a/stdlib/source/lux/language/compiler/synthesis/expression.lux b/stdlib/source/lux/compiler/default/phase/synthesis/expression.lux index 64f802089..edb2cc034 100644 --- a/stdlib/source/lux/language/compiler/synthesis/expression.lux +++ b/stdlib/source/lux/compiler/default/phase/synthesis/expression.lux @@ -7,7 +7,7 @@ [collection ["." list ("list/." Functor<List>)] ["dict" dictionary (#+ Dictionary)]]]] - ["." // (#+ Synthesis Compiler) + ["." // (#+ Synthesis Phase) ["." function] ["." case] ["/." // ("operation/." Monad<Operation>) @@ -37,7 +37,7 @@ [#analysis.Rev #//.I64]))) (def: #export (synthesize analysis) - Compiler + Phase (case analysis (#analysis.Primitive analysis') (operation/wrap (#//.Primitive (..primitive analysis'))) diff --git a/stdlib/source/lux/language/compiler/synthesis/function.lux b/stdlib/source/lux/compiler/default/phase/synthesis/function.lux index 4e72c022f..397ca2449 100644 --- a/stdlib/source/lux/language/compiler/synthesis/function.lux +++ b/stdlib/source/lux/compiler/default/phase/synthesis/function.lux @@ -11,12 +11,12 @@ [collection ["." list ("list/." Functor<List> Monoid<List> Fold<List>)] ["dict" dictionary (#+ Dictionary)]]]] - ["." // (#+ Synthesis Operation Compiler) + ["." // (#+ Synthesis Operation Phase) ["." loop (#+ Transform)] - [/// - ["." reference (#+ Variable)] - ["." compiler - ["." analysis (#+ Environment Arity Analysis)]]]]) + ["/." // + ["." analysis (#+ Environment Arity Analysis)] + [// + ["." reference (#+ Variable)]]]]) (def: #export nested? (-> Arity Bit) @@ -45,7 +45,7 @@ [apply args]))) (def: #export (apply synthesize) - (-> Compiler Compiler) + (-> Phase Phase) (.function (_ exprA) (let [[funcA argsA] (unfold exprA)] (do (state.Monad<State'> error.Monad<Error>) @@ -77,14 +77,14 @@ (def: return (All [a] (-> (Maybe a) (Operation a))) (|>> (case> (#.Some output) - (:: compiler.Monad<Operation> wrap output) + (:: ///.Monad<Operation> wrap output) #.None - (compiler.throw cannot-prepare-function-body [])))) + (///.throw cannot-prepare-function-body [])))) (def: #export (function synthesize environment body) - (-> Compiler Environment Analysis (Operation Synthesis)) - (do compiler.Monad<Operation> + (-> Phase Environment Analysis (Operation Synthesis)) + (do ///.Monad<Operation> [direct? //.direct? arity //.scope-arity resolver //.resolver diff --git a/stdlib/source/lux/language/compiler/synthesis/loop.lux b/stdlib/source/lux/compiler/default/phase/synthesis/loop.lux index 661d29a83..bfa69c7c6 100644 --- a/stdlib/source/lux/language/compiler/synthesis/loop.lux +++ b/stdlib/source/lux/compiler/default/phase/synthesis/loop.lux @@ -11,11 +11,11 @@ ["." code] ["." syntax]]] ["." // (#+ Path Abstraction Synthesis) - [/// - ["." reference (#+ Register Variable)] - [compiler - ["." analysis (#+ Environment)] - ["." extension]]]]) + [// + ["." analysis (#+ Environment)] + ["." extension] + [// + ["." reference (#+ Register Variable)]]]]) (type: #export (Transform a) (-> a (Maybe a))) diff --git a/stdlib/source/lux/language/compiler/translation.lux b/stdlib/source/lux/compiler/default/phase/translation.lux index 32c8fb601..82e31320a 100644 --- a/stdlib/source/lux/language/compiler/translation.lux +++ b/stdlib/source/lux/compiler/default/phase/translation.lux @@ -62,8 +62,8 @@ (type: #export (Operation anchor expression statement) (extension.Operation (State anchor expression statement) Synthesis expression)) -(type: #export (Compiler anchor expression statement) - (extension.Compiler (State anchor expression statement) Synthesis expression)) +(type: #export (Phase anchor expression statement) + (extension.Phase (State anchor expression statement) Synthesis expression)) (type: #export (Handler anchor expression statement) (extension.Handler (State anchor expression statement) Synthesis expression)) diff --git a/stdlib/source/lux/language/compiler/translation/scheme/case.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/case.jvm.lux index 11c6f3e3d..5ab0c56dd 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/case.jvm.lux +++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/case.jvm.lux @@ -11,17 +11,18 @@ [list ("list/." Functor<List> Fold<List>)] [set (#+ Set)]]]] [// - ["." runtime (#+ Operation Compiler)] + ["." runtime (#+ Operation Phase)] ["." reference] ["/." /// ("operation/." Monad<Operation>) ["." synthesis (#+ Synthesis Path)] [// [reference (#+ Register)] - [host - ["_" scheme (#+ Expression Computation Var)]]]]]) + [// + [host + ["_" scheme (#+ Expression Computation Var)]]]]]]) (def: #export (let translate [valueS register bodyS]) - (-> Compiler [Synthesis Register Synthesis] + (-> Phase [Synthesis Register Synthesis] (Operation Computation)) (do ////.Monad<Operation> [valueO (translate valueS) @@ -30,7 +31,7 @@ bodyO)))) (def: #export (record-get translate valueS pathP) - (-> Compiler Synthesis (List [Nat Bit]) + (-> Phase Synthesis (List [Nat Bit]) (Operation Expression)) (do ////.Monad<Operation> [valueO (translate valueS)] @@ -43,7 +44,7 @@ pathP)))) (def: #export (if translate [testS thenS elseS]) - (-> Compiler [Synthesis Synthesis Synthesis] + (-> Phase [Synthesis Synthesis Synthesis] (Operation Computation)) (do ////.Monad<Operation> [testO (translate testS) @@ -104,7 +105,7 @@ (_.raise/1 $alt_error)))) (def: (pattern-matching' translate pathP) - (-> Compiler Path (Operation Expression)) + (-> Phase Path (Operation Expression)) (.case pathP (^ (synthesis.path/then bodyS)) (translate bodyS) @@ -159,7 +160,7 @@ (////.throw unrecognized-path []))) (def: (pattern-matching translate pathP) - (-> Compiler Path (Operation Computation)) + (-> Phase Path (Operation Computation)) (do ////.Monad<Operation> [pattern-matching! (pattern-matching' translate pathP)] (wrap (_.with-exception-handler @@ -168,7 +169,7 @@ pattern-matching!))))) (def: #export (case translate [valueS pathP]) - (-> Compiler [Synthesis Path] (Operation Computation)) + (-> Phase [Synthesis Path] (Operation Computation)) (do ////.Monad<Operation> [valueO (translate valueS)] (<| (:: @ map (_.let (list [@cursor (_.list/* (list valueO))] diff --git a/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/expression.jvm.lux index 7ff3770ae..53d7bbbcb 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/expression.jvm.lux +++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/expression.jvm.lux @@ -3,7 +3,7 @@ [control [monad (#+ do)]]] [// - [runtime (#+ Compiler)] + [runtime (#+ Phase)] ["." primitive] ["." structure] ["." reference] @@ -15,7 +15,7 @@ ["." extension]]]) (def: #export (translate synthesis) - Compiler + Phase (case synthesis (^template [<tag> <generator>] (^ (<tag> value)) diff --git a/stdlib/source/lux/language/compiler/translation/scheme/extension.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/extension.jvm.lux index a40b4953f..a40b4953f 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/extension.jvm.lux +++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/extension.jvm.lux diff --git a/stdlib/source/lux/language/compiler/translation/scheme/extension/common.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/extension/common.jvm.lux index 786b82280..53fcfbff7 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/extension/common.jvm.lux +++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/extension/common.jvm.lux @@ -17,12 +17,12 @@ ["s" syntax (#+ syntax:)]] [host (#+ import:)]] [/// - ["." runtime (#+ Operation Compiler Handler Bundle)] + ["." runtime (#+ Operation Phase Handler Bundle)] ["//." /// ["." synthesis (#+ Synthesis)] [extension ["." bundle]] - [// + [/// [host ["_" scheme (#+ Expression Computation)]]]]]) diff --git a/stdlib/source/lux/language/compiler/translation/scheme/extension/host.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/extension/host.jvm.lux index b8b2b7612..b8b2b7612 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/extension/host.jvm.lux +++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/extension/host.jvm.lux diff --git a/stdlib/source/lux/language/compiler/translation/scheme/function.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/function.jvm.lux index 17022587c..113f6b325 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/function.jvm.lux +++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/function.jvm.lux @@ -10,7 +10,7 @@ [collection ["." list ("list/." Functor<List>)]]]] [// - ["." runtime (#+ Operation Compiler)] + ["." runtime (#+ Operation Phase)] ["." reference] ["/." // ["//." // ("operation/." Monad<Operation>) @@ -19,11 +19,12 @@ [// [reference (#+ Register Variable)] ["." name] - [host - ["_" scheme (#+ Expression Computation Var)]]]]]]) + [// + [host + ["_" scheme (#+ Expression Computation Var)]]]]]]]) (def: #export (apply translate [functionS argsS+]) - (-> Compiler (Application Synthesis) (Operation Computation)) + (-> Phase (Application Synthesis) (Operation Computation)) (do ////.Monad<Operation> [functionO (translate functionS) argsO+ (monad.map @ translate argsS+)] @@ -52,7 +53,7 @@ (|>> inc reference.local')) (def: #export (function translate [environment arity bodyS]) - (-> Compiler (Abstraction Synthesis) (Operation Computation)) + (-> Phase (Abstraction Synthesis) (Operation Computation)) (do ////.Monad<Operation> [[function-name bodyO] (///.with-context (do @ diff --git a/stdlib/source/lux/language/compiler/translation/scheme/loop.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/loop.jvm.lux index 8c73f77e4..91757d291 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/loop.jvm.lux +++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/loop.jvm.lux @@ -9,19 +9,19 @@ [collection ["." list ("list/." Functor<List>)]]]] [// - [runtime (#+ Operation Compiler)] + [runtime (#+ Operation Phase)] ["." reference] ["/." // ["//." // [synthesis (#+ Scope Synthesis)] - [// + [/// [host ["_" scheme (#+ Computation Var)]]]]]]) (def: @scope (_.var "scope")) (def: #export (scope translate [start initsS+ bodyS]) - (-> Compiler (Scope Synthesis) (Operation Computation)) + (-> Phase (Scope Synthesis) (Operation Computation)) (do ////.Monad<Operation> [initsO+ (monad.map @ translate initsS+) bodyO (///.with-anchor @scope @@ -34,7 +34,7 @@ (_.apply/* @scope initsO+))))) (def: #export (recur translate argsS+) - (-> Compiler (List Synthesis) (Operation Computation)) + (-> Phase (List Synthesis) (Operation Computation)) (do ////.Monad<Operation> [@scope ///.anchor argsO+ (monad.map @ translate argsS+)] diff --git a/stdlib/source/lux/language/compiler/translation/scheme/primitive.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/primitive.jvm.lux index a8fa6326f..c16c696c4 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/primitive.jvm.lux +++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/primitive.jvm.lux @@ -1,11 +1,12 @@ (.module: [lux (#- i64)] - [/// (#+ State)] - [///// - [host - ["_" scheme (#+ Expression)]] - [compiler ("operation/." Monad<Operation>)]] - [//runtime (#+ Operation)]) + [// + [runtime (#+ Operation)] + [// (#+ State) + [// ("operation/." Monad<Operation>) + [/// + [host + ["_" scheme (#+ Expression)]]]]]]) (def: #export bit (-> Bit (Operation Expression)) diff --git a/stdlib/source/lux/language/compiler/translation/scheme/reference.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/reference.jvm.lux index db56d8937..3fca5842f 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/reference.jvm.lux +++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/reference.jvm.lux @@ -13,7 +13,9 @@ [// ["." reference (#+ Register Variable Reference)] ["." name] - [host ["_" scheme (#+ Expression Var)]]]]]) + [// + [host + ["_" scheme (#+ Expression Var)]]]]]]) (do-template [<name> <prefix>] [(def: #export <name> diff --git a/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/runtime.jvm.lux index 565cbeabd..c67c2623f 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/runtime.jvm.lux +++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/runtime.jvm.lux @@ -19,14 +19,16 @@ ["." synthesis] [// ["." name] - [host ["_" scheme (#+ Expression Computation Var)]]]]]) + [// + [host + ["_" scheme (#+ Expression Computation Var)]]]]]]) (do-template [<name> <base>] [(type: #export <name> (<base> Var Expression Expression))] [Operation ///.Operation] - [Compiler ///.Compiler] + [Phase ///.Phase] [Handler ///.Handler] [Bundle ///.Bundle] ) diff --git a/stdlib/source/lux/language/compiler/translation/scheme/structure.jvm.lux b/stdlib/source/lux/compiler/default/phase/translation/scheme/structure.jvm.lux index 1f7f2cf27..3991ea281 100644 --- a/stdlib/source/lux/language/compiler/translation/scheme/structure.jvm.lux +++ b/stdlib/source/lux/compiler/default/phase/translation/scheme/structure.jvm.lux @@ -3,17 +3,17 @@ [control ["." monad (#+ do)]]] [// - ["." runtime (#+ Operation Compiler)] + ["." runtime (#+ Operation Phase)] ["." primitive] ["." /// [analysis (#+ Variant Tuple)] ["." synthesis (#+ Synthesis)] - [// + [/// [host ["_" scheme (#+ Expression)]]]]]) (def: #export (tuple translate elemsS+) - (-> Compiler (Tuple Synthesis) (Operation Expression)) + (-> Phase (Tuple Synthesis) (Operation Expression)) (case elemsS+ #.Nil (primitive.text synthesis.unit) @@ -27,7 +27,7 @@ (wrap (_.vector/* elemsT+))))) (def: #export (variant translate [lefts right? valueS]) - (-> Compiler (Variant Synthesis) (Operation Expression)) + (-> Phase (Variant Synthesis) (Operation Expression)) (do ///.Monad<Operation> [valueT (translate valueS)] (wrap (runtime.variant [lefts right? valueT])))) diff --git a/stdlib/source/lux/language/reference.lux b/stdlib/source/lux/compiler/default/reference.lux index 84b838b3d..84b838b3d 100644 --- a/stdlib/source/lux/language/reference.lux +++ b/stdlib/source/lux/compiler/default/reference.lux diff --git a/stdlib/source/lux/language/compiler/default/repl/type.lux b/stdlib/source/lux/compiler/default/repl/type.lux index 2af590c4b..2af590c4b 100644 --- a/stdlib/source/lux/language/compiler/default/repl/type.lux +++ b/stdlib/source/lux/compiler/default/repl/type.lux diff --git a/stdlib/source/lux/language/syntax.lux b/stdlib/source/lux/compiler/default/syntax.lux index 41c11ee2d..41c11ee2d 100644 --- a/stdlib/source/lux/language/syntax.lux +++ b/stdlib/source/lux/compiler/default/syntax.lux diff --git a/stdlib/source/lux/language/host.lux b/stdlib/source/lux/compiler/host.lux index 218de67a4..218de67a4 100644 --- a/stdlib/source/lux/language/host.lux +++ b/stdlib/source/lux/compiler/host.lux diff --git a/stdlib/source/lux/language/host/scheme.lux b/stdlib/source/lux/compiler/host/scheme.lux index 8d5cbdbcd..8d5cbdbcd 100644 --- a/stdlib/source/lux/language/host/scheme.lux +++ b/stdlib/source/lux/compiler/host/scheme.lux diff --git a/stdlib/source/lux/language/compiler/meta/archive.lux b/stdlib/source/lux/compiler/meta/archive.lux index 9feaf523f..ee31e65d9 100644 --- a/stdlib/source/lux/language/compiler/meta/archive.lux +++ b/stdlib/source/lux/compiler/meta/archive.lux @@ -15,7 +15,8 @@ abstract] [world [file (#+ File)]]] - ["." //// (#+ Version)]) + [/// + ["." default (#+ Version)]]) ## Key (type: #export Signature @@ -43,7 +44,7 @@ (def: #export default (Key Nothing) (:abstraction {#name ["" ""] - #version ////.version})) + #version default.version})) (def: #export signature (-> (Key Any) Signature) diff --git a/stdlib/source/lux/language/compiler/meta/cache.lux b/stdlib/source/lux/compiler/meta/cache.lux index eb702c0da..eb702c0da 100644 --- a/stdlib/source/lux/language/compiler/meta/cache.lux +++ b/stdlib/source/lux/compiler/meta/cache.lux diff --git a/stdlib/source/lux/language/compiler/meta/cache/dependency.lux b/stdlib/source/lux/compiler/meta/cache/dependency.lux index e63fa192b..e63fa192b 100644 --- a/stdlib/source/lux/language/compiler/meta/cache/dependency.lux +++ b/stdlib/source/lux/compiler/meta/cache/dependency.lux diff --git a/stdlib/source/lux/language/compiler/meta/io.lux b/stdlib/source/lux/compiler/meta/io.lux index a46f78d5a..a46f78d5a 100644 --- a/stdlib/source/lux/language/compiler/meta/io.lux +++ b/stdlib/source/lux/compiler/meta/io.lux diff --git a/stdlib/source/lux/language/compiler/meta/io/archive.lux b/stdlib/source/lux/compiler/meta/io/archive.lux index 5a7789a95..1c5924df7 100644 --- a/stdlib/source/lux/language/compiler/meta/io/archive.lux +++ b/stdlib/source/lux/compiler/meta/io/archive.lux @@ -10,8 +10,9 @@ [world ["." file (#+ File System)] [binary (#+ Binary)]]] - ["." /////host] - ["." // (#+ Module)]) + ["." // (#+ Module) + [/// + ["." host]]]) (type: #export Document File) @@ -22,15 +23,15 @@ (def: #export (archive System<m> root) (All [m] (-> (System m) File File)) (<| (format root (:: System<m> separator)) - (`` (for {(~~ (static /////host.common-lisp)) /////host.common-lisp - (~~ (static /////host.js)) /////host.js - (~~ (static /////host.jvm)) /////host.jvm - (~~ (static /////host.lua)) /////host.lua - (~~ (static /////host.php)) /////host.php - (~~ (static /////host.python)) /////host.python - (~~ (static /////host.r)) /////host.r - (~~ (static /////host.ruby)) /////host.ruby - (~~ (static /////host.scheme)) /////host.scheme})))) + (`` (for {(~~ (static host.common-lisp)) host.common-lisp + (~~ (static host.js)) host.js + (~~ (static host.jvm)) host.jvm + (~~ (static host.lua)) host.lua + (~~ (static host.php)) host.php + (~~ (static host.python)) host.python + (~~ (static host.r)) host.r + (~~ (static host.ruby)) host.ruby + (~~ (static host.scheme)) host.scheme})))) (def: #export (document System<m> root module) (All [m] (-> (System m) File Module Document)) diff --git a/stdlib/source/lux/language/compiler/meta/io/context.lux b/stdlib/source/lux/compiler/meta/io/context.lux index 8288718aa..6d90483e2 100644 --- a/stdlib/source/lux/language/compiler/meta/io/context.lux +++ b/stdlib/source/lux/compiler/meta/io/context.lux @@ -12,7 +12,7 @@ ["." file (#+ File System)] [binary (#+ Binary)]]] ["." // (#+ Context Module) - [//// + [/// ["." host]]]) (type: #export Extension Text) diff --git a/stdlib/source/lux/data/text.lux b/stdlib/source/lux/data/text.lux index c29783146..28679b429 100644 --- a/stdlib/source/lux/data/text.lux +++ b/stdlib/source/lux/data/text.lux @@ -4,7 +4,7 @@ [monoid (#+ Monoid)] [equivalence (#+ Equivalence)] [order (#+ Order)] - [monad (#+ do Monad)] + [monad (#+ Monad do)] [codec (#+ Codec)] hash] [data @@ -13,7 +13,7 @@ ["." i64]] [collection ["." list ("list/." Fold<List>)]]] - [language + [compiler ["." host]]]) (def: #export (size x) diff --git a/stdlib/source/lux/data/text/buffer.lux b/stdlib/source/lux/data/text/buffer.lux index a7d3da76a..f8042abc0 100644 --- a/stdlib/source/lux/data/text/buffer.lux +++ b/stdlib/source/lux/data/text/buffer.lux @@ -6,7 +6,7 @@ format] [collection ["." row (#+ Row) ("row/." Fold<Row>)]]] - [language + [compiler ["_" host]] [type abstract] diff --git a/stdlib/source/lux/data/text/encoding.lux b/stdlib/source/lux/data/text/encoding.lux index 661e0bbf9..029505b21 100644 --- a/stdlib/source/lux/data/text/encoding.lux +++ b/stdlib/source/lux/data/text/encoding.lux @@ -4,7 +4,7 @@ ["." error (#+ Error)]] [world [binary (#+ Binary)]] - [language + [compiler ["_" host]] [host (#+ import:)]]) diff --git a/stdlib/source/lux/world/file.lux b/stdlib/source/lux/world/file.lux index 5c359f26b..50d9ec2bc 100644 --- a/stdlib/source/lux/world/file.lux +++ b/stdlib/source/lux/world/file.lux @@ -17,7 +17,8 @@ ["." binary (#+ Binary)]] ["." io (#+ Process)] [host (#+ import:)] - ["." language/host]]) + [compiler + ["." host]]]) (type: #export File Text) @@ -101,7 +102,7 @@ (ex.report ["Instant" (%instant instant)] ["File" file])) -(`` (for {(~~ (static language/host.jvm)) +(`` (for {(~~ (static host.jvm)) (as-is (import: #long java/io/File (new [String]) (exists [] #io #try boolean) diff --git a/stdlib/test/test/lux/language/compiler/analysis/case.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/case.lux index 5956cc48e..fd516d048 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/case.lux +++ b/stdlib/test/test/lux/compiler/default/phase/analysis/case.lux @@ -16,12 +16,13 @@ ["." check]] [macro ["." code]] - [language - ["." compiler - ["." analysis - ["." module] - [".A" type] - ["/" case]]]] + [compiler + [default + ["." phase + ["." analysis + ["." module] + [".A" type] + ["/" case]]]]] test] [// ["_." primitive] @@ -170,7 +171,7 @@ analyse-pm (|>> (/.case _primitive.analyse inputC) (typeA.with-type outputT) analysis.with-scope - (do compiler.Monad<Operation> + (do phase.Monad<Operation> [_ (module.declare-tags variant-tags #0 (#.Named [module-name variant-name] (type.variant primitivesT))) diff --git a/stdlib/test/test/lux/language/compiler/analysis/function.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/function.lux index 22ff04213..b5140f782 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/function.lux +++ b/stdlib/test/test/lux/compiler/default/phase/analysis/function.lux @@ -16,28 +16,29 @@ ["." type] ["." macro ["." code]] - ["." language - ["." reference] - ["." compiler + [compiler + ["." default + ["." reference] ["." init] - ["." analysis (#+ Analysis Operation) - [".A" type] - ["." expression] - ["/" function]] - [extension - [".E" analysis]]]] + ["." phase + ["." analysis (#+ Analysis Operation) + [".A" type] + ["." expression] + ["/" function]] + [extension + [".E" analysis]]]]] test] [// ["_." primitive] ["_." structure]]) -(def: analyse (expression.analyser (:coerce language.Eval []))) +(def: analyse (expression.analyser (:coerce default.Eval []))) (def: (check-apply expectedT num-args analysis) (-> Type Nat (Operation Analysis) Bit) (|> analysis (typeA.with-type expectedT) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success applyA) (let [[funcA argsA] (analysis.application applyA)] (n/= num-args (list.size argsA))) diff --git a/stdlib/test/test/lux/language/compiler/analysis/primitive.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux index adad90f18..ce34ff887 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/primitive.lux +++ b/stdlib/test/test/lux/compiler/default/phase/analysis/primitive.lux @@ -13,17 +13,18 @@ [".L" type ("type/." Equivalence<Type>)] [macro ["." code]] - ["." language - ["." compiler + [compiler + ["." default ["." init] - ["." analysis (#+ Analysis Operation) - [".A" type] - ["." expression]] - [extension - [".E" analysis]]]] + ["." phase + ["." analysis (#+ Analysis Operation) + [".A" type] + ["." expression]] + [extension + [".E" analysis]]]]] test]) -(def: #export analyse (expression.analyser (:coerce language.Eval []))) +(def: #export analyse (expression.analyser (:coerce default.Eval []))) (def: unit (r.Random Code) @@ -52,7 +53,7 @@ (-> Type (Operation Analysis) (e.Error Analysis)) (|> analysis typeA.with-inference - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success [inferred-type output]) (if (is? expected-type inferred-type) (#e.Success output) diff --git a/stdlib/test/test/lux/language/compiler/analysis/procedure/common.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux index 2a5cc2ee3..70679e22a 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/procedure/common.lux +++ b/stdlib/test/test/lux/compiler/default/phase/analysis/procedure/common.lux @@ -16,14 +16,15 @@ [type ("type/." Equivalence<Type>)] [macro ["." code]] - [language - ["." compiler + [compiler + [default ["." init] - [analysis - ["." scope] - [".A" type]] - [extension - [".E" analysis]]]] + ["." phase + [analysis + ["." scope] + [".A" type]] + [extension + [".E" analysis]]]]] test] [/// ["_." primitive]]) @@ -34,7 +35,7 @@ (|> (scope.with-scope "" (typeA.with-type output-type (_primitive.analyse (` ((~ (code.text procedure)) (~+ params)))))) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success _) <success> @@ -183,7 +184,7 @@ (scope.with-local [var-name arrayT] (typeA.with-type output-type (_primitive.analyse code)))) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success _) #1 @@ -253,7 +254,7 @@ (scope.with-local [var-name atomT] (typeA.with-type elemT (_primitive.analyse (` ("lux atom read" (~ (code.symbol ["" var-name])))))))) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success _) #1 @@ -267,7 +268,7 @@ (~ (code.symbol ["" var-name])) (~ elemC) (~ elemC))))))) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success _) #1 diff --git a/stdlib/test/test/lux/language/compiler/analysis/reference.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/reference.lux index 66c990ef4..6a103d155 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/reference.lux +++ b/stdlib/test/test/lux/compiler/default/phase/analysis/reference.lux @@ -12,22 +12,23 @@ [type ("type/." Equivalence<Type>)] [macro ["." code]] - ["." language - ["." reference] - ["." compiler + [compiler + ["." default + ["." reference] ["." init] - ["." analysis - ["." scope] - ["." module] - [".A" type] - ["." expression]] - [extension - [".E" analysis]]]] + ["." phase + ["." analysis + ["." scope] + ["." module] + [".A" type] + ["." expression]] + [extension + [".E" analysis]]]]] test] [// ["_." primitive]]) -(def: analyse (expression.analyser (:coerce language.Eval []))) +(def: analyse (expression.analyser (:coerce default.Eval []))) (type: Check (-> (e.Error Any) Bit)) @@ -46,7 +47,7 @@ (def: (reach-test var-name [export? def-module] [import? dependent-module] check!) (-> Text [Bit Text] [Bit Text] Check Bit) - (|> (do compiler.Monad<Operation> + (|> (do phase.Monad<Operation> [_ (module.with-module +0 def-module (module.define var-name [Any (if export? @@ -60,7 +61,7 @@ (wrap []))] (typeA.with-inference (..analyse (code.symbol [def-module var-name])))))) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) check!)) (context: "References" @@ -78,7 +79,7 @@ (scope.with-local [var-name expectedT] (typeA.with-inference (..analyse (code.local-symbol var-name))))) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (^ (#e.Success [inferredT (#analysis.Reference (reference.local var))])) (and (type/= expectedT inferredT) (n/= +0 var)) @@ -87,12 +88,12 @@ #0))) (test "Can analyse definition (in the same module)." (let [def-name [def-module var-name]] - (|> (do compiler.Monad<Operation> + (|> (do phase.Monad<Operation> [_ (module.define var-name [expectedT (' {}) []])] (typeA.with-inference (..analyse (code.symbol def-name)))) (module.with-module +0 def-module) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (^ (#e.Success [_ inferredT (#analysis.Reference (reference.constant constant-name))])) (and (type/= expectedT inferredT) (ident/= def-name constant-name)) diff --git a/stdlib/test/test/lux/language/compiler/analysis/structure.lux b/stdlib/test/test/lux/compiler/default/phase/analysis/structure.lux index 6dca4fb12..eb517be72 100644 --- a/stdlib/test/test/lux/language/compiler/analysis/structure.lux +++ b/stdlib/test/test/lux/compiler/default/phase/analysis/structure.lux @@ -18,26 +18,27 @@ ["." check]] [macro ["." code]] - ["." language - ["." compiler + [compiler + ["." default ["." init] - ["." analysis (#+ Analysis Variant Tag Operation) - ["." module] - [".A" type] - ["/" structure] - ["." expression]] - [extension - [".E" analysis]]]] + ["." phase + ["." analysis (#+ Analysis Variant Tag Operation) + ["." module] + [".A" type] + ["/" structure] + ["." expression]] + [extension + [".E" analysis]]]]] test] [// ["_." primitive]]) -(def: analyse (expression.analyser (:coerce language.Eval []))) +(def: analyse (expression.analyser (:coerce default.Eval []))) (do-template [<name> <on-success> <on-error>] [(def: #export <name> (All [a] (-> (Operation a) Bit)) - (|>> (compiler.run [analysisE.bundle (init.compiler [])]) + (|>> (phase.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success _) <on-success> @@ -61,7 +62,7 @@ (-> Type Nat Tag (Operation Analysis) Bit) (|> analysis (typeA.with-type type) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (^multi (#e.Success sumA) [(analysis.variant sumA) (#.Some variant)]) @@ -72,7 +73,7 @@ (def: (tagged module tags type) (All [a] (-> Text (List module.Tag) Type (Operation a) (Operation [Module a]))) - (|>> (do compiler.Monad<Operation> + (|>> (do phase.Monad<Operation> [_ (module.declare-tags tags #0 type)]) (module.with-module +0 module))) @@ -81,7 +82,7 @@ (|> analysis (tagged module tags type) (typeA.with-type type) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (^multi (#e.Success [_ sumA]) [(analysis.variant sumA) (#.Some variant)]) @@ -98,7 +99,7 @@ (-> Text (List module.Tag) Type Nat (Operation [Type Analysis]) Bit) (|> analysis (tagged module tags type) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success [_ productT productA]) (and (type/= type productT) (right-size? size productA)) @@ -127,13 +128,13 @@ (check-sum variantT size choice (/.sum ..analyse choice valueC))) (test "Can analyse sum through bound type-vars." - (|> (do compiler.Monad<Operation> + (|> (do phase.Monad<Operation> [[_ varT] (typeA.with-env check.var) _ (typeA.with-env (check.check varT variantT))] (typeA.with-type varT (/.sum ..analyse choice valueC))) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (^multi (#e.Success sumA) [(analysis.variant sumA) (#.Some variant)]) @@ -142,7 +143,7 @@ _ #0))) (test "Cannot analyse sum through unbound type-vars." - (|> (do compiler.Monad<Operation> + (|> (do phase.Monad<Operation> [[_ varT] (typeA.with-env check.var)] (typeA.with-type varT (/.sum ..analyse choice valueC))) @@ -177,7 +178,7 @@ (test "Can analyse product." (|> (typeA.with-type tupleT (/.product ..analyse (list/map product.right primitives))) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success tupleA) (right-size? size tupleA) @@ -186,7 +187,7 @@ (test "Can infer product." (|> (typeA.with-inference (/.product ..analyse (list/map product.right primitives))) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success [_type tupleA]) (and (type/= tupleT _type) (right-size? size tupleA)) @@ -198,13 +199,13 @@ (..analyse (` [(~ singletonC)]))) check-succeeds)) (test "Can analyse product through bound type-vars." - (|> (do compiler.Monad<Operation> + (|> (do phase.Monad<Operation> [[_ varT] (typeA.with-env check.var) _ (typeA.with-env (check.check varT (type.tuple (list/map product.left primitives))))] (typeA.with-type varT (/.product ..analyse (list/map product.right primitives)))) - (compiler.run [analysisE.bundle (init.compiler [])]) + (phase.run [analysisE.bundle (init.compiler [])]) (case> (#e.Success tupleA) (right-size? size tupleA) @@ -290,7 +291,7 @@ (/.record ..analyse recordC)) (check-record-inference module-name tags named-polyT size))) (test "Can specialize generic records." - (|> (do compiler.Monad<Operation> + (|> (do phase.Monad<Operation> [recordA (typeA.with-type tupleT (/.record ..analyse recordC))] (wrap [tupleT recordA])) diff --git a/stdlib/test/test/lux/language/compiler/synthesis/case.lux b/stdlib/test/test/lux/compiler/default/phase/synthesis/case.lux index 70e13af4b..ad0d5c60a 100644 --- a/stdlib/test/test/lux/language/compiler/synthesis/case.lux +++ b/stdlib/test/test/lux/compiler/default/phase/synthesis/case.lux @@ -5,14 +5,15 @@ pipe] [data ["." error ("error/." Functor<Error>)]] - [language - ["." reference] - ["." compiler - ["." analysis (#+ Branch Analysis)] - ["//" synthesis (#+ Synthesis) - ["." expression]] - [extension - ["." bundle]]]] + [compiler + [default + ["." reference] + ["." phase + ["." analysis (#+ Branch Analysis)] + ["//" synthesis (#+ Synthesis) + ["." expression]] + [extension + ["." bundle]]]]] [math ["r" random]] test] @@ -31,7 +32,7 @@ (test "Dummy variables created to mask expressions get eliminated during synthesis." (|> maskA expression.synthesize - (compiler.run [bundle.empty //.init]) + (phase.run [bundle.empty //.init]) (error/map (//primitive.corresponds? maskedA)) (error.default #0)))))) @@ -49,7 +50,7 @@ (test "Can detect and reify simple 'let' expressions." (|> letA expression.synthesize - (compiler.run [bundle.empty //.init]) + (phase.run [bundle.empty //.init]) (case> (^ (#error.Success (//.branch/let [inputS registerS outputS]))) (and (n/= registerA registerS) (//primitive.corresponds? inputA inputS) @@ -77,7 +78,7 @@ (test "Can detect and reify simple 'if' expressions." (|> ifA expression.synthesize - (compiler.run [bundle.empty //.init]) + (phase.run [bundle.empty //.init]) (case> (^ (#error.Success (//.branch/if [inputS thenS elseS]))) (and (//primitive.corresponds? inputA inputS) (//primitive.corresponds? thenA thenS) diff --git a/stdlib/test/test/lux/language/compiler/synthesis/function.lux b/stdlib/test/test/lux/compiler/default/phase/synthesis/function.lux index 62d8c97a0..2249acca1 100644 --- a/stdlib/test/test/lux/language/compiler/synthesis/function.lux +++ b/stdlib/test/test/lux/compiler/default/phase/synthesis/function.lux @@ -14,14 +14,15 @@ ["." list ("list/." Functor<List> Fold<List>)] ["dict" dictionary (#+ Dictionary)] ["." set]]] - [language - ["." reference (#+ Variable) ("variable/." Equivalence<Variable>)] - ["." compiler - ["." analysis (#+ Arity Analysis)] - ["//" synthesis (#+ Synthesis) - ["." expression]] - [extension - ["." bundle]]]] + [compiler + [default + ["." reference (#+ Variable) ("variable/." Equivalence<Variable>)] + ["." phase + ["." analysis (#+ Arity Analysis)] + ["//" synthesis (#+ Synthesis) + ["." expression]] + [extension + ["." bundle]]]]] [math ["r" random]] test] @@ -115,7 +116,7 @@ (test "Nested functions will get folded together." (|> function//constant expression.synthesize - (compiler.run [bundle.empty //.init]) + (phase.run [bundle.empty //.init]) (case> (^ (#error.Success (//.function/abstraction [environment arity output]))) (and (n/= arity//constant arity) (//primitive.corresponds? prediction//constant output)) @@ -125,7 +126,7 @@ (test "Folded functions provide direct access to environment variables." (|> function//environment expression.synthesize - (compiler.run [bundle.empty //.init]) + (phase.run [bundle.empty //.init]) (case> (^ (#error.Success (//.function/abstraction [environment arity (#//.Reference (reference.variable output))]))) (and (n/= arity//environment arity) (variable/= prediction//environment output)) @@ -135,7 +136,7 @@ (test "Folded functions properly offset local variables." (|> function//local expression.synthesize - (compiler.run [bundle.empty //.init]) + (phase.run [bundle.empty //.init]) (case> (^ (#error.Success (//.function/abstraction [environment arity (#//.Reference (reference.variable output))]))) (and (n/= arity//local arity) (variable/= prediction//local output)) @@ -154,7 +155,7 @@ (test "Can synthesize function application." (|> (analysis.apply [funcA argsA]) expression.synthesize - (compiler.run [bundle.empty //.init]) + (phase.run [bundle.empty //.init]) (case> (^ (#error.Success (//.function/apply [funcS argsS]))) (and (//primitive.corresponds? funcA funcS) (list.every? (product.uncurry //primitive.corresponds?) @@ -165,7 +166,7 @@ (test "Function application on no arguments just synthesizes to the function itself." (|> (analysis.apply [funcA (list)]) expression.synthesize - (compiler.run [bundle.empty //.init]) + (phase.run [bundle.empty //.init]) (case> (#error.Success funcS) (//primitive.corresponds? funcA funcS) diff --git a/stdlib/test/test/lux/language/compiler/synthesis/primitive.lux b/stdlib/test/test/lux/compiler/default/phase/synthesis/primitive.lux index c4cc940f1..4312f2bae 100644 --- a/stdlib/test/test/lux/language/compiler/synthesis/primitive.lux +++ b/stdlib/test/test/lux/compiler/default/phase/synthesis/primitive.lux @@ -7,13 +7,14 @@ ["." error] [text format]] - [language - ["." compiler - ["." analysis (#+ Analysis)] - ["//" synthesis (#+ Synthesis) - ["." expression]] - [extension - ["." bundle]]]] + [compiler + [default + ["." phase + ["." analysis (#+ Analysis)] + ["//" synthesis (#+ Synthesis) + ["." expression]] + [extension + ["." bundle]]]]] [math ["r" random]] test]) @@ -80,7 +81,7 @@ [(test (format "Can synthesize " <desc> ".") (|> (#analysis.Primitive (<analysis> <sample>)) expression.synthesize - (compiler.run [bundle.empty //.init]) + (phase.run [bundle.empty //.init]) (case> (#error.Success (#//.Primitive (<synthesis> value))) (is? <sample> value) diff --git a/stdlib/test/test/lux/language/compiler/synthesis/structure.lux b/stdlib/test/test/lux/compiler/default/phase/synthesis/structure.lux index dcec26fb9..924a4126d 100644 --- a/stdlib/test/test/lux/language/compiler/synthesis/structure.lux +++ b/stdlib/test/test/lux/compiler/default/phase/synthesis/structure.lux @@ -9,13 +9,14 @@ ["." error] [collection ["." list]]] - [language - ["." compiler - ["." analysis] - ["//" synthesis (#+ Synthesis) - ["." expression]] - [extension - ["." bundle]]]] + [compiler + [default + ["." phase + ["." analysis] + ["//" synthesis (#+ Synthesis) + ["." expression]] + [extension + ["." bundle]]]]] [math ["r" random]] test] @@ -31,7 +32,7 @@ (test "Can synthesize variants." (|> (analysis.sum-analysis size tagA memberA) expression.synthesize - (compiler.run [bundle.empty //.init]) + (phase.run [bundle.empty //.init]) (case> (#error.Success (#//.Structure (#//.Variant [leftsS right?S valueS]))) (let [tagS (if right?S (inc leftsS) leftsS)] (and (n/= tagA tagS) @@ -51,7 +52,7 @@ (test "Can synthesize tuple." (|> (analysis.product-analysis membersA) expression.synthesize - (compiler.run [bundle.empty //.init]) + (phase.run [bundle.empty //.init]) (case> (#error.Success (#//.Structure (#//.Tuple membersS))) (and (n/= size (list.size membersS)) (list.every? (product.uncurry //primitive.corresponds?) diff --git a/stdlib/test/test/lux/language/syntax.lux b/stdlib/test/test/lux/compiler/default/syntax.lux index 469e07c10..42ae7f379 100644 --- a/stdlib/test/test/lux/language/syntax.lux +++ b/stdlib/test/test/lux/compiler/default/syntax.lux @@ -15,8 +15,9 @@ ["r" random ("r/." Monad<Random>)]] [macro ["." code]] - [language - ["&" syntax]] + [compiler + [default + ["&" syntax]]] test]) (def: default-cursor diff --git a/stdlib/test/tests.lux b/stdlib/test/tests.lux index bdd8ef0ab..e855220dd 100644 --- a/stdlib/test/tests.lux +++ b/stdlib/test/tests.lux @@ -39,32 +39,31 @@ [world ["._" environment] ["._" console]] - [language + [compiler [host [".H" scheme]] - [compiler - ["._" translation - [scheme - ["._scheme" primitive] - ["._scheme" structure] - ["._scheme" reference] - ["._scheme" function] - ["._scheme" loop] - ["._scheme" case] - ["._scheme" extension] - ["._scheme" extension/common] - ["._scheme" expression]]] - [default - [repl - ["._" type]]] - [meta - ["._meta" io - ["._meta_io" context] - ["._meta_io" archive]] - ["._meta" archive] - ["._meta" cache]] - [default - ["._default" cache]]]]] + [default + [phase + ["._" translation + [scheme + ["._scheme" primitive] + ["._scheme" structure] + ["._scheme" reference] + ["._scheme" function] + ["._scheme" loop] + ["._scheme" case] + ["._scheme" extension] + ["._scheme" extension/common] + ["._scheme" expression]]]] + ["._default" cache] + [repl + ["._" type]]] + [meta + ["._meta" io + ["._meta_io" context] + ["._meta_io" archive]] + ["._meta" archive] + ["._meta" cache]]]] [test ["_." lux] [lux @@ -150,22 +149,23 @@ [object ["_." interface] ["_." protocol]]] - [language - ["_language/." syntax] - [compiler - [analysis - ["_.A" primitive] - ["_.A" structure] - ["_.A" reference] - ["_.A" case] - ["_.A" function] - [procedure - ["_.A" common]]] - [synthesis - ["_.S" primitive] - ["_.S" structure] - ["_.S" case] - ["_.S" function]]]] + [compiler + [default + ["_default/." syntax] + [phase + [analysis + ["_.A" primitive] + ["_.A" structure] + ["_.A" reference] + ["_.A" case] + ["_.A" function] + [procedure + ["_.A" common]]] + [synthesis + ["_.S" primitive] + ["_.S" structure] + ["_.S" case] + ["_.S" function]]]]] [world ["_." binary] ## ["_." file] ## TODO: Specially troublesome... |