aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm/source/luxc/lang/translation/jvm
diff options
context:
space:
mode:
authorEduardo Julian2022-02-03 05:55:42 -0400
committerEduardo Julian2022-02-03 05:55:42 -0400
commite4bc4d0e2cd14a955530160c4fc7859e6c46874e (patch)
tree946e713bdf44e63d67fbaca8c778a9a7faba3592 /lux-jvm/source/luxc/lang/translation/jvm
parentd432d4fc3990a073e8df091962ac1f39c9745803 (diff)
Fixes for the pure-Lux JVM compiler machinery. [Part 13 / Done!]
Diffstat (limited to 'lux-jvm/source/luxc/lang/translation/jvm')
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux4
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/function.lux7
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/program.lux50
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/runtime.lux87
4 files changed, 76 insertions, 72 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
index 28a5c34bc..ee6f243f2 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
@@ -40,7 +40,7 @@
["[0]" variable {"+" Variable Register}]]
[meta
[archive {"+" Archive}
- ["[0]" artifact]]
+ ["[0]" unit]]
["[0]" cache "_"
["[1]" artifact]]]
[language
@@ -1127,7 +1127,7 @@
(unwrap_primitive _.DRETURN type.double)))))))
(def: (method_dependencies archive method)
- (-> Archive (/.Overriden_Method Synthesis) (Operation (Set artifact.Dependency)))
+ (-> Archive (/.Overriden_Method Synthesis) (Operation (Set unit.ID)))
(let [[_super _name _strict_fp? _annotations
_t_vars _this _arguments _return _exceptions
bodyS] method]
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/function.lux b/lux-jvm/source/luxc/lang/translation/jvm/function.lux
index 2eb1894da..6c0e29730 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/function.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/function.lux
@@ -31,9 +31,10 @@
[lux
[analysis {"+" Environment}]
[synthesis {"+" Synthesis Abstraction Apply}]
- ["[0]" generation {"+" Context}]]]
+ ["[0]" generation]]]
[meta
- [archive {"+" Archive}]
+ [archive {"+" Archive}
+ ["[0]" unit]]
["[0]" cache "_"
["[1]" artifact]]]]]]]
[luxc
@@ -306,7 +307,7 @@
(in [functionD instanceI]))))
(def: .public (function' forced_context generate archive [env arity bodyS])
- (-> (Maybe Context) (Generator Abstraction))
+ (-> (Maybe unit.ID) (Generator Abstraction))
(do [! phase.monad]
[@begin _.make_label
dependencies (cache.dependencies archive bodyS)
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/program.lux b/lux-jvm/source/luxc/lang/translation/jvm/program.lux
index 7e408ecc4..4efe0fd3d 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/program.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/program.lux
@@ -1,32 +1,34 @@
(.using
- [library
- [lux "*"
- [data
- [text
- ["%" format {"+" format}]]]
- [target
- [jvm
- ["$t" type]]]
- [tool
- [compiler
- [language
- [lux
- [generation {"+" Context}]
- [program {"+" Program}]]]]]]]
- [luxc
- [lang
- [host
- ["_" jvm
- ["$d" def]
- ["$i" inst]]]
- [translation
- ["[0]" jvm
- ["[0]" runtime]]]]])
+ [library
+ [lux "*"
+ [data
+ [text
+ ["%" format {"+" format}]]]
+ [target
+ [jvm
+ ["$t" type]]]
+ [tool
+ [compiler
+ [language
+ [lux
+ [program {"+" Program}]]]
+ [meta
+ [archive
+ ["[0]" unit]]]]]]]
+ [luxc
+ [lang
+ [host
+ ["_" jvm
+ ["$d" def]
+ ["$i" inst]]]
+ [translation
+ ["[0]" jvm
+ ["[0]" runtime]]]]])
(def: ^Object ($t.class "java.lang.Object" (list)))
(def: .public (program artifact_name context programI)
- (-> (-> Context Text) (Program _.Inst _.Definition))
+ (-> (-> unit.ID Text) (Program _.Inst _.Definition))
(let [nilI runtime.noneI
num_inputsI (|>> ($i.ALOAD 0) $i.ARRAYLENGTH)
--I (|>> ($i.int +1) $i.ISUB)
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux
index cec04d529..ee3e16ed8 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux
@@ -1,45 +1,46 @@
(.using
- [library
- [lux {"-" Type Label Primitive try}
- [abstract
- [monad {"+" do}]
- ["[0]" enum]]
- [data
- [binary {"+" Binary}]
- ["[0]" product]
- [text
- ["%" format {"+" format}]]
- [collection
- ["[0]" list ("[1]@[0]" functor)]
- ["[0]" sequence]
- ["[0]" set]]]
- ["[0]" math
- [number
- ["n" nat]]]
- [target
- [jvm
- ["[0]" type {"+" Type}
- ["[0]" category {"+" Void Value' Value Return' Return Primitive Object Class Array Var Parameter Method}]
- ["[0]" reflection]]]]
- [tool
- [compiler
- [arity {"+" Arity}]
- ["[0]" phase]
- [language
- [lux
- ["[0]" synthesis]
- ["[0]" generation]]]
- [meta
- [archive {"+" Output}
- ["[0]" artifact]
- ["[0]" registry {"+" Registry}]]]]]]]
- [luxc
- [lang
- [host
- ["$" jvm {"+" Label Inst Def Operation}
- ["$d" def]
- ["_" inst]]]]]
- ["[0]" // {"+" ByteCode}])
+ [library
+ [lux {"-" Type Label Primitive try}
+ [abstract
+ [monad {"+" do}]
+ ["[0]" enum]]
+ [data
+ [binary {"+" Binary}]
+ ["[0]" product]
+ [text
+ ["%" format {"+" format}]]
+ [collection
+ ["[0]" list ("[1]@[0]" functor)]
+ ["[0]" sequence]
+ ["[0]" set]]]
+ ["[0]" math
+ [number
+ ["n" nat]]]
+ [target
+ [jvm
+ ["[0]" type {"+" Type}
+ ["[0]" category {"+" Void Value' Value Return' Return Primitive Object Class Array Var Parameter Method}]
+ ["[0]" reflection]]]]
+ [tool
+ [compiler
+ [arity {"+" Arity}]
+ ["[0]" phase]
+ [language
+ [lux
+ ["[0]" synthesis]
+ ["[0]" generation]]]
+ [meta
+ [archive {"+" Output}
+ ["[0]" artifact]
+ ["[0]" registry {"+" Registry}]
+ ["[0]" unit]]]]]]]
+ [luxc
+ [lang
+ [host
+ ["$" jvm {"+" Label Inst Def Operation}
+ ["$d" def]
+ ["_" inst]]]]]
+ ["[0]" // {"+" ByteCode}])
(def: $Text (type.class "java.lang.String" (list)))
(def: .public $Lefts type.int)
@@ -414,9 +415,9 @@
... function_payload ..translate_function
]
(in [(|> registry.empty
- (registry.resource true artifact.no_dependencies)
+ (registry.resource true unit.none)
product.right
- ... (registry.resource true artifact.no_dependencies)
+ ... (registry.resource true unit.none)
... product.right
)
(sequence.sequence runtime_payload