diff options
author | Eduardo Julian | 2020-05-09 02:12:56 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-05-09 02:12:56 -0400 |
commit | 8d9fd8b34f8716be7fa1059eb9761330d9667753 (patch) | |
tree | aacc3fef52551c6b02f66435dedd5a0e5bfc18bc /new-luxc/source/luxc/lang | |
parent | 3e524725cfb47cb56466a08ac290ed5a389748be (diff) |
Including runtime machinery in the cache.
Diffstat (limited to 'new-luxc/source/luxc/lang')
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm.lux | 4 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/translation/jvm/runtime.lux | 45 |
2 files changed, 33 insertions, 16 deletions
diff --git a/new-luxc/source/luxc/lang/translation/jvm.lux b/new-luxc/source/luxc/lang/translation/jvm.lux index 12bf96631..59d722233 100644 --- a/new-luxc/source/luxc/lang/translation/jvm.lux +++ b/new-luxc/source/luxc/lang/translation/jvm.lux @@ -175,5 +175,5 @@ (def: #export $Variant (type.array ..$Value)) (def: #export $Tuple (type.array ..$Value)) -(def: #export $Function (type.class "LuxFunction" (list))) -(def: #export $Runtime (type.class "LuxRuntime" (list))) +(def: #export $Runtime (type.class (..class-name [0 0]) (list))) +(def: #export $Function (type.class (..class-name [0 1]) (list))) diff --git a/new-luxc/source/luxc/lang/translation/jvm/runtime.lux b/new-luxc/source/luxc/lang/translation/jvm/runtime.lux index 55c0aaab1..a657a7a38 100644 --- a/new-luxc/source/luxc/lang/translation/jvm/runtime.lux +++ b/new-luxc/source/luxc/lang/translation/jvm/runtime.lux @@ -3,10 +3,13 @@ [abstract [monad (#+ do)]] [data + [binary (#+ Binary)] + ["." product] [text ["%" format (#+ format)]] [collection - ["." list ("#@." functor)]]] + ["." list ("#@." functor)] + ["." row]]] ["." math] [target [jvm @@ -14,13 +17,16 @@ ["." category (#+ Void Value' Value Return' Return Primitive Object Class Array Var Parameter Method)] ["." reflection]]]] [tool - [compiler + [compiler (#+ Output) [arity (#+ Arity)] ["." phase] [language [lux ["." synthesis] - ["." generation]]]]]] + ["." generation]]] + [meta + [archive + ["." artifact (#+ Registry)]]]]]] [luxc [lang [host @@ -320,19 +326,21 @@ (|>> type.reflection reflection.reflection)) (def: translate-runtime - (Operation Any) + (Operation [Text 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 frac-methods pm-methods - io-methods))] + io-methods)) + payload ["0" bytecode]] (do phase.monad - [_ (generation.execute! runtime-class [runtime-class bytecode])] - (generation.save! false ["" runtime-class] [runtime-class bytecode])))) + [_ (generation.execute! runtime-class [runtime-class bytecode]) + _ (generation.save! false ["" "0"] payload)] + (wrap payload)))) (def: translate-function - (Operation Any) + (Operation [Text Binary]) (let [applyI (|> (list.n/range 2 num-apply-variants) (list@map (function (_ arity) ($d.method #$.Public $.noneM apply-method (apply-signature arity) @@ -358,13 +366,22 @@ (_.ILOAD 1) (_.PUTFIELD //.$Function partials-field type.int) _.RETURN)) - applyI))] + applyI)) + payload ["1" bytecode]] (do phase.monad - [_ (generation.execute! function-class [function-class bytecode])] - (generation.save! false ["" function-class] [function-class bytecode])))) + [_ (generation.execute! function-class [function-class bytecode]) + _ (generation.save! false ["" "1"] payload)] + (wrap payload)))) (def: #export translate - (Operation Any) + (Operation [Registry Output]) (do phase.monad - [_ translate-runtime] - translate-function)) + [runtime-payload ..translate-runtime + function-payload ..translate-function] + (wrap [(|> artifact.empty + artifact.resource + product.right + artifact.resource + product.right) + (row.row runtime-payload + function-payload)]))) |