aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Julian2018-08-02 23:23:20 -0400
committerEduardo Julian2018-08-02 23:23:20 -0400
commita8979a7b1ed69740eb6c7c00c934e2fadd129322 (patch)
treea32b39006ed7143c322b2171989850fd1f33499e
parent015134cd44e066e49b3bac56b442a6150c782600 (diff)
Moved statement-state initialization o "lux/compiler/default/init".
-rw-r--r--luxc/src/lux/type.clj4
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/statement.jvm.lux18
-rw-r--r--stdlib/source/lux/compiler/default/init.lux43
-rw-r--r--stdlib/source/lux/compiler/default/phase/statement.lux35
4 files changed, 60 insertions, 40 deletions
diff --git a/luxc/src/lux/type.clj b/luxc/src/lux/type.clj
index 66a072a10..6fe47dbf9 100644
--- a/luxc/src/lux/type.clj
+++ b/luxc/src/lux/type.clj
@@ -21,7 +21,7 @@
_
false))
-(def max-env-size 128)
+(def max-stack-size 256)
(def empty-env &/$Nil)
@@ -753,7 +753,7 @@
[(&/$Apply A F) _]
(let [fp-pair (&/T [expected actual])
- _ (when (> (&/|length fixpoints) max-env-size)
+ _ (when (> (&/|length fixpoints) max-stack-size)
(&/|log! (println-str 'FIXPOINTS (->> (&/|keys fixpoints)
(&/|map (fn [pair]
(|let [[e a] pair]
diff --git a/new-luxc/source/luxc/lang/translation/jvm/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/statement.jvm.lux
index 7461d981f..65ab9d147 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/statement.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/statement.jvm.lux
@@ -20,6 +20,24 @@
(// [".T" common]
[".T" runtime]))
+## (def: (lux//program procedure)
+## (-> Text //.Statement)
+## (function (_ inputsC+)
+## (case inputsC+
+## (^ (list [_ (#.Identifier ["" args])] programC))
+## (do macro.Monad<Meta>
+## [[_ programA] (<| lang.with-scope
+## (scopeL.with-local [args (type (List Text))])
+## (lang.with-type (type (IO Any)))
+## (expressionA.analyser evalL.eval programC))
+## syntheses //.all-syntheses
+## programI (expressionT.translate (expressionS.synthesize syntheses programA))
+## _ (statementT.translate-program programI)]
+## (wrap []))
+
+## _
+## (throw-invalid-statement procedure inputsC+))))
+
(def: #export (translate-program programI)
(-> $.Inst (Meta Any))
(let [nilI runtimeT.noneI
diff --git a/stdlib/source/lux/compiler/default/init.lux b/stdlib/source/lux/compiler/default/init.lux
index 3bfba340b..d768f5f7d 100644
--- a/stdlib/source/lux/compiler/default/init.lux
+++ b/stdlib/source/lux/compiler/default/init.lux
@@ -1,7 +1,20 @@
(.module:
lux
- [///
- ["." host]])
+ [//
+ [phase (#+ Eval)
+ [analysis
+ [".A" expression]]
+ ["." synthesis
+ [".S" expression]]
+ ["." translation (#+ Host)]
+ ["." statement]
+ ["." extension
+ [".E" analysis]
+ [".E" synthesis]
+ [".E" translation]
+ [".E" statement]]]
+ [//
+ ["." host]]])
(type: #export Version Text)
@@ -25,9 +38,9 @@
#.var-counter 0
#.var-bindings (list)})
-(`` (def: #export info
- Info
- {#.target (for {(~~ (static host.common-lisp)) host.common-lisp
+(def: #export info
+ Info
+ {#.target (`` (for {(~~ (static host.common-lisp)) host.common-lisp
(~~ (static host.js)) host.js
(~~ (static host.jvm)) host.jvm
(~~ (static host.lua)) host.lua
@@ -35,9 +48,9 @@
(~~ (static host.python)) host.python
(~~ (static host.r)) host.r
(~~ (static host.ruby)) host.ruby
- (~~ (static host.scheme)) host.scheme})
- #.version ..version
- #.mode #.Build}))
+ (~~ (static host.scheme)) host.scheme}))
+ #.version ..version
+ #.mode #.Build})
(def: #export (compiler host)
(-> Any Lux)
@@ -53,3 +66,17 @@
#.scope-type-vars (list)
#.extensions []
#.host host})
+
+(def: #export (state eval translate host)
+ (All [anchor expression statement]
+ (-> Eval
+ (translation.Phase anchor expression statement)
+ (Host expression statement)
+ (statement.State+ anchor expression statement)))
+ [statementE.bundle
+ {#statement.analysis {#statement.state [analysisE.bundle (..compiler [])]
+ #statement.phase (expressionA.analyser eval)}
+ #statement.synthesis {#statement.state [synthesisE.bundle synthesis.init]
+ #statement.phase expressionS.synthesize}
+ #statement.translation {#statement.state [translationE.bundle (translation.state host)]
+ #statement.phase translate}}])
diff --git a/stdlib/source/lux/compiler/default/phase/statement.lux b/stdlib/source/lux/compiler/default/phase/statement.lux
index 638f29b80..8b0876cdd 100644
--- a/stdlib/source/lux/compiler/default/phase/statement.lux
+++ b/stdlib/source/lux/compiler/default/phase/statement.lux
@@ -1,20 +1,10 @@
(.module:
[lux #*]
- [// (#+ Eval)
- ["." analysis
- [".A" expression]]
- ["." synthesis
- [".S" expression]]
- ["." translation (#+ Host)]
- ["." extension
- ["." bundle]
- [".E" analysis]
- [".E" synthesis]
- [".E" translation]
- ## [".E" statement]
- ]
- [//
- ["." init]]])
+ [//
+ ["." analysis]
+ ["." synthesis]
+ ["." translation]
+ ["." extension]])
(type: #export (Component state phase)
{#state state
@@ -38,18 +28,3 @@
[Handler extension.Handler]
[Bundle extension.Bundle]
)
-
-(def: #export (state eval translate host)
- (All [anchor expression statement]
- (-> Eval
- (translation.Phase anchor expression statement)
- (Host expression statement)
- (..State+ anchor expression statement)))
- [bundle.empty
- ## statementE.bundle
- {#analysis {#state [analysisE.bundle (init.compiler [])]
- #phase (expressionA.analyser eval)}
- #synthesis {#state [synthesisE.bundle synthesis.init]
- #phase expressionS.synthesize}
- #translation {#state [translationE.bundle (translation.state host)]
- #phase translate}}])