aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm/source/luxc/lang/translation
diff options
context:
space:
mode:
Diffstat (limited to 'lux-jvm/source/luxc/lang/translation')
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm.lux2
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux4
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux4
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/function.lux2
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/primitive.lux2
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/runtime.lux22
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/structure.lux2
7 files changed, 22 insertions, 16 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm.lux b/lux-jvm/source/luxc/lang/translation/jvm.lux
index 84eff942e..fe651adac 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm.lux
@@ -1,6 +1,6 @@
(.module:
[lux (#- Module Definition)
- ["." host (#+ import: do_to object)]
+ ["." ffi (#+ import: do_to object)]
[abstract
[monad (#+ do)]]
[control
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
index c9eed9489..c15d1ffcf 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
@@ -1,5 +1,6 @@
(.module:
[lux (#- Type)
+ [ffi (#+ import:)]
[abstract
["." monad (#+ do)]]
[control
@@ -30,8 +31,7 @@
[extension (#+ Nullary Unary Binary Trinary Variadic
nullary unary binary trinary variadic)]]
["." extension
- ["." bundle]]]]]]]
- [host (#+ import:)]]
+ ["." bundle]]]]]]]]
[luxc
[lang
[host
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 c3c522bfa..dc579c970 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
@@ -1,6 +1,6 @@
(.module:
[lux (#- Type primitive int char type)
- [host (#+ import:)]
+ [ffi (#+ import:)]
[abstract
["." monad (#+ do)]]
[control
@@ -1048,7 +1048,7 @@
(..with_anonymous_init class total_environment super_class inputsTI)
method_definitions))]]
_ (generation.execute! directive)
- _ (generation.save! (%.nat artifact_id) directive)]
+ _ (generation.save! artifact_id directive)]
(..anonymous_instance generate archive class total_environment)))]))
(def: bundle::class
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/function.lux b/lux-jvm/source/luxc/lang/translation/jvm/function.lux
index 6c03bd482..0b441c92f 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/function.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/function.lux
@@ -316,7 +316,7 @@
//.$Function (list)
functionD)]]
_ (generation.execute! directive)
- _ (generation.save! (%.nat (product.right function_context)) directive)]
+ _ (generation.save! (product.right function_context) directive)]
(wrap instanceI)))
(def: #export (call generate archive [functionS argsS])
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux
index b42f63c4d..3383e3856 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux
@@ -1,6 +1,6 @@
(.module:
[lux (#- i64)
- ["." host (#+ import:)]
+ ["." ffi (#+ import:)]
[math
[number
["i" int]]]
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux
index 782187339..95cfd9e5a 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/runtime.lux
@@ -20,7 +20,7 @@
["." category (#+ Void Value' Value Return' Return Primitive Object Class Array Var Parameter Method)]
["." reflection]]]]
[tool
- [compiler (#+ Output)
+ [compiler
[arity (#+ Arity)]
["." phase]
[language
@@ -28,7 +28,7 @@
["." synthesis]
["." generation]]]
[meta
- [archive
+ [archive (#+ Output)
["." artifact (#+ Registry)]]]]]]
[luxc
[lang
@@ -334,8 +334,11 @@
(-> (Type (<| Return' Value' category)) Text))
(|>> type.reflection reflection.reflection))
+(def: runtime_id
+ 0)
+
(def: translate_runtime
- (Operation [Text Binary])
+ (Operation [artifact.ID Binary])
(let [runtime_class (..reflection //.$Runtime)
bytecode ($d.class #$.V1_6 #$.Public $.finalC runtime_class (list) (type.class "java.lang.Object" (list)) (list)
(|>> adt_methods
@@ -345,11 +348,14 @@
directive [runtime_class bytecode]]
(do phase.monad
[_ (generation.execute! directive)
- _ (generation.save! "0" directive)]
- (wrap ["0" bytecode]))))
+ _ (generation.save! ..runtime_id directive)]
+ (wrap [..runtime_id bytecode]))))
+
+(def: function_id
+ 1)
(def: translate_function
- (Operation [Text Binary])
+ (Operation [artifact.ID Binary])
(let [applyI (|> (enum.range n.enum 2 num_apply_variants)
(list@map (function (_ arity)
($d.method #$.Public $.noneM apply_method (apply_signature arity)
@@ -379,8 +385,8 @@
directive [function_class bytecode]]
(do phase.monad
[_ (generation.execute! directive)
- _ (generation.save! "1" directive)]
- (wrap ["1" bytecode]))))
+ _ (generation.save! ..function_id directive)]
+ (wrap [..function_id bytecode]))))
(def: #export translate
(Operation [Registry Output])
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux
index b3daed102..100bce9d9 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/structure.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/structure.lux
@@ -1,6 +1,6 @@
(.module:
[lux (#- Type)
- ["." host (#+ import:)]
+ ["." ffi (#+ import:)]
[abstract
["." monad (#+ do)]]
[control