aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source
diff options
context:
space:
mode:
authorEduardo Julian2017-11-01 00:51:45 -0400
committerEduardo Julian2017-11-01 00:51:45 -0400
commit012f6bd41e527479dddbccbdab10daa78fd9a0fd (patch)
tree621f344a09acd52736f343d94582b3f1a2f0c5f9 /new-luxc/source
parent71d7a4c7206155e09f3e1e1d8699561ea6967382 (diff)
- Re-organized code-generation, and re-named it "translation".
Diffstat (limited to '')
-rw-r--r--new-luxc/source/luxc/eval.lux12
-rw-r--r--new-luxc/source/luxc/host.jvm.lux25
-rw-r--r--new-luxc/source/luxc/lang/analysis/expression.lux8
-rw-r--r--new-luxc/source/luxc/lang/translation.lux (renamed from new-luxc/source/luxc/generator.lux)30
-rw-r--r--new-luxc/source/luxc/lang/translation/case.jvm.lux (renamed from new-luxc/source/luxc/generator/case.jvm.lux)0
-rw-r--r--new-luxc/source/luxc/lang/translation/common.jvm.lux (renamed from new-luxc/source/luxc/generator/common.jvm.lux)0
-rw-r--r--new-luxc/source/luxc/lang/translation/eval.jvm.lux (renamed from new-luxc/source/luxc/generator/eval.jvm.lux)23
-rw-r--r--new-luxc/source/luxc/lang/translation/expression.jvm.lux (renamed from new-luxc/source/luxc/generator/expression.jvm.lux)52
-rw-r--r--new-luxc/source/luxc/lang/translation/function.jvm.lux (renamed from new-luxc/source/luxc/generator/function.jvm.lux)30
-rw-r--r--new-luxc/source/luxc/lang/translation/primitive.jvm.lux (renamed from new-luxc/source/luxc/generator/primitive.jvm.lux)4
-rw-r--r--new-luxc/source/luxc/lang/translation/procedure.jvm.lux (renamed from new-luxc/source/luxc/generator/procedure.jvm.lux)0
-rw-r--r--new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux (renamed from new-luxc/source/luxc/generator/procedure/common.jvm.lux)13
-rw-r--r--new-luxc/source/luxc/lang/translation/procedure/host.jvm.lux (renamed from new-luxc/source/luxc/generator/procedure/host.jvm.lux)4
-rw-r--r--new-luxc/source/luxc/lang/translation/reference.jvm.lux (renamed from new-luxc/source/luxc/generator/reference.jvm.lux)14
-rw-r--r--new-luxc/source/luxc/lang/translation/runtime.jvm.lux (renamed from new-luxc/source/luxc/generator/runtime.jvm.lux)14
-rw-r--r--new-luxc/source/luxc/lang/translation/statement.jvm.lux (renamed from new-luxc/source/luxc/generator/statement.jvm.lux)16
-rw-r--r--new-luxc/source/luxc/lang/translation/structure.jvm.lux (renamed from new-luxc/source/luxc/generator/structure.jvm.lux)4
-rw-r--r--new-luxc/source/program.lux4
18 files changed, 125 insertions, 128 deletions
diff --git a/new-luxc/source/luxc/eval.lux b/new-luxc/source/luxc/eval.lux
index baac56c64..82c355151 100644
--- a/new-luxc/source/luxc/eval.lux
+++ b/new-luxc/source/luxc/eval.lux
@@ -3,10 +3,10 @@
(lux (control [monad #+ do])
[meta])
(luxc (lang (analysis [";A" expression])
- (synthesis [";S" expression])))
- [../base]
- (.. (generator [";G" expression]
- [eval])))
+ (synthesis [";S" expression])
+ (translation [";T" expression]
+ [";T" eval])))
+ [../base])
(def: #export (eval type exprC)
../base;Eval
@@ -14,5 +14,5 @@
[exprA (../base;with-expected-type type
(expressionA;analyser eval exprC))
#let [exprS (expressionS;synthesize exprA)]
- exprI (expressionG;generate exprS)]
- (eval;eval exprI)))
+ exprI (expressionT;generate exprS)]
+ (evalT;eval exprI)))
diff --git a/new-luxc/source/luxc/host.jvm.lux b/new-luxc/source/luxc/host.jvm.lux
index b74c9748c..2cbdf5883 100644
--- a/new-luxc/source/luxc/host.jvm.lux
+++ b/new-luxc/source/luxc/host.jvm.lux
@@ -11,8 +11,7 @@
[host #+ do-to object]
[io])
(luxc ["&" base]
- (generator ["&&;" common])
- ))
+ (lang (translation [";T" common]))))
(host;import java.lang.reflect.AccessibleObject
(setAccessible [boolean] void))
@@ -48,7 +47,7 @@
(error! error)))
(def: (define-class class-name byte-code loader)
- (-> Text &&common;Bytecode ClassLoader (e;Error Object))
+ (-> Text commonT;Bytecode ClassLoader (e;Error Object))
(Method.invoke [loader
(array;from-list (list (:! Object class-name)
(:! Object byte-code)
@@ -57,11 +56,11 @@
ClassLoader::defineClass))
(def: (fetch-byte-code class-name store)
- (-> Text &&common;Class-Store (Maybe &&common;Bytecode))
+ (-> Text commonT;Class-Store (Maybe commonT;Bytecode))
(|> store A;get io;run (dict;get class-name)))
(def: (memory-class-loader store)
- (-> &&common;Class-Store ClassLoader)
+ (-> commonT;Class-Store ClassLoader)
(object ClassLoader []
[]
(ClassLoader (findClass [class-name String]) Class
@@ -79,13 +78,13 @@
(error! (format "Class not found: " class-name))))))
(def: #export init-host
- (io;IO &&common;Host)
- (io;io (let [store (: &&common;Class-Store
+ (io;IO commonT;Host)
+ (io;io (let [store (: commonT;Class-Store
(A;atom (dict;new text;Hash<Text>)))]
- {#&&common;loader (memory-class-loader store)
- #&&common;store store
- #&&common;function-class #;None
- #&&common;artifacts (dict;new text;Hash<Text>)})))
+ {#commonT;loader (memory-class-loader store)
+ #commonT;store store
+ #commonT;function-class #;None
+ #commonT;artifacts (dict;new text;Hash<Text>)})))
(def: #export class-loader
(Meta ClassLoader)
@@ -93,8 +92,8 @@
(#e;Success [compiler
(|> compiler
(get@ #;host)
- (:! &&common;Host)
- (get@ #&&common;loader))])))
+ (:! commonT;Host)
+ (get@ #commonT;loader))])))
(def: #export runtime-class Text "LuxRuntime")
(def: #export function-class Text "LuxFunction")
diff --git a/new-luxc/source/luxc/lang/analysis/expression.lux b/new-luxc/source/luxc/lang/analysis/expression.lux
index e3a623089..de0e49dbc 100644
--- a/new-luxc/source/luxc/lang/analysis/expression.lux
+++ b/new-luxc/source/luxc/lang/analysis/expression.lux
@@ -11,9 +11,9 @@
[host])
(luxc ["&" base]
[";L" host]
- (lang ["la" analysis])
- ["&;" module]
- (generator [";G" common]))
+ (lang ["la" analysis]
+ (translation [";T" common]))
+ ["&;" module])
(.. [";A" common]
[";A" function]
[";A" primitive]
@@ -37,7 +37,7 @@
(def: (call-macro macro inputs)
(-> Macro (List Code) (Meta (List Code)))
(do meta;Monad<Meta>
- [class (commonG;load-class hostL;function-class)]
+ [class (commonT;load-class hostL;function-class)]
(function [compiler]
(do e;Monad<Error>
[apply-method (Class.getMethod ["apply" _apply-args] class)
diff --git a/new-luxc/source/luxc/generator.lux b/new-luxc/source/luxc/lang/translation.lux
index e9b6c4d3f..4fcc3ccb2 100644
--- a/new-luxc/source/luxc/generator.lux
+++ b/new-luxc/source/luxc/lang/translation.lux
@@ -18,12 +18,12 @@
(lang ["&;" syntax]
(analysis [";A" expression]
[";A" common])
- (synthesis [";S" expression]))
- (generator ["&&;" runtime]
- ["&&;" statement]
- ["&&;" common]
- [";G" expression]
- ["&&;" eval])
+ (synthesis [";S" expression])
+ (translation [";T" runtime]
+ [";T" statement]
+ [";T" common]
+ [";T" expression]
+ [";T" eval]))
))
(def: analyse
@@ -41,8 +41,8 @@
[[_ metaA] (&;with-scope
(&;with-expected-type Code
(analyse metaC)))
- metaI (expressionG;generate (expressionS;synthesize metaA))
- metaV (&&eval;eval metaI)
+ metaI (expressionT;generate (expressionS;synthesize metaA))
+ metaV (evalT;eval metaI)
[_ valueT valueA] (&;with-scope
(if (meta;type? (:! Code metaV))
(&;with-expected-type Type
@@ -51,9 +51,9 @@
(wrap [Type valueA])))
(commonA;with-unknown-type
(analyse valueC))))
- valueI (expressionG;generate (expressionS;synthesize valueA))
+ valueI (expressionT;generate (expressionS;synthesize valueA))
_ (&;with-scope
- (&&statement;generate-def def-name valueT valueI metaI (:! Code metaV)))]
+ (statementT;generate-def def-name valueT valueI metaI (:! Code metaV)))]
(wrap []))
(^ [_ (#;Form (list [_ (#;Text "lux program")]
@@ -63,8 +63,8 @@
[[_ programA] (&;with-scope
(&;with-expected-type (type (io;IO Unit))
(analyse programC)))
- programI (expressionG;generate (expressionS;synthesize programA))]
- (&&statement;generate-program program-args programI))
+ programI (expressionT;generate (expressionS;synthesize programA))]
+ (statementT;generate-program program-args programI))
_
(&;fail (format "Unrecognized statement: " (%code code)))))
@@ -106,7 +106,7 @@
(case (meta;run' compiler
(do meta;Monad<Meta>
[[_ artifacts _] (&module;with-module module-hash module-name
- (&&common;with-artifacts
+ (commonT;with-artifacts
(with-active-compilation [module-name
file-name
file-content]
@@ -146,7 +146,7 @@
#;mode #;Build})
(def: #export (init-compiler host)
- (-> &&common;Host Compiler)
+ (-> commonT;Host Compiler)
{#;info init-info
#;source [init-cursor +0 ""]
#;cursor init-cursor
@@ -162,7 +162,7 @@
(def: #export (generate-program program target sources)
(-> Text File (List File) (T;Task Unit))
(do T;Monad<Task>
- [compiler (|> (case (&&runtime;generate (init-compiler (io;run hostL;init-host)))
+ [compiler (|> (case (runtimeT;generate (init-compiler (io;run hostL;init-host)))
(#e;Error error)
(T;fail error)
diff --git a/new-luxc/source/luxc/generator/case.jvm.lux b/new-luxc/source/luxc/lang/translation/case.jvm.lux
index a9ea4482a..a9ea4482a 100644
--- a/new-luxc/source/luxc/generator/case.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/case.jvm.lux
diff --git a/new-luxc/source/luxc/generator/common.jvm.lux b/new-luxc/source/luxc/lang/translation/common.jvm.lux
index 1870530c2..1870530c2 100644
--- a/new-luxc/source/luxc/generator/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/common.jvm.lux
diff --git a/new-luxc/source/luxc/generator/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/eval.jvm.lux
index 2f0ce1c24..9514741f8 100644
--- a/new-luxc/source/luxc/generator/eval.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/eval.jvm.lux
@@ -1,9 +1,8 @@
(;module:
lux
(lux (control monad)
- (data ["R" error]
- text/format)
- [meta #+ Monad<Meta> "Meta/" Monad<Meta>]
+ (data text/format)
+ [meta]
[host #+ do-to])
(luxc ["&" base]
(host ["$" jvm]
@@ -11,8 +10,8 @@
["$d" def]
["$i" inst]))
(lang ["la" analysis]
- ["ls" synthesis])
- (generator ["&;" common])
+ ["ls" synthesis]
+ (translation [";T" common]))
))
(host;import java.lang.Object)
@@ -56,26 +55,26 @@
(def: #export (eval valueI)
(-> $;Inst (Meta Top))
- (do Monad<Meta>
+ (do meta;Monad<Meta>
[class-name (:: @ map %code (meta;gensym "eval"))
#let [writer (|> (do-to (ClassWriter.new ClassWriter.COMPUTE_MAXS)
- (ClassWriter.visit [&common;bytecode-version
+ (ClassWriter.visit [commonT;bytecode-version
(i.+ Opcodes.ACC_PUBLIC Opcodes.ACC_SUPER)
class-name
(host;null)
"java/lang/Object"
(host;null)]))
($d;field #$;Public ($_ $;++F $;finalF $;staticF)
- &common;value-field &common;$Object)
+ commonT;value-field commonT;$Object)
($d;method #$;Public ($_ $;++M $;staticM $;strictM)
"<clinit>"
($t;method (list) #;None (list))
(|>. valueI
- ($i;PUTSTATIC class-name &common;value-field &common;$Object)
+ ($i;PUTSTATIC class-name commonT;value-field commonT;$Object)
$i;RETURN)))
bytecode (ClassWriter.toByteArray [] (do-to writer (ClassWriter.visitEnd [])))]
- _ (&common;store-class class-name bytecode)
- class (&common;load-class class-name)]
+ _ (commonT;store-class class-name bytecode)
+ class (commonT;load-class class-name)]
(wrap (|> class
- (Class.getField [&common;value-field])
+ (Class.getField [commonT;value-field])
(Field.get (host;null))))))
diff --git a/new-luxc/source/luxc/generator/expression.jvm.lux b/new-luxc/source/luxc/lang/translation/expression.jvm.lux
index 798998510..af66d4994 100644
--- a/new-luxc/source/luxc/generator/expression.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/expression.jvm.lux
@@ -10,15 +10,15 @@
(luxc ["&" base]
(host ["$" jvm])
(lang ["ls" synthesis]
- [";L" variable #+ Variable Register])
- (generator ["&;" common]
- ["&;" primitive]
- ["&;" structure]
- ["&;" eval]
- ["&;" procedure]
- ["&;" function]
- ["&;" reference]
- [";G" case])))
+ (translation [";T" common]
+ [";T" primitive]
+ [";T" structure]
+ [";T" eval]
+ [";T" procedure]
+ [";T" function]
+ [";T" reference]
+ [";T" case])
+ [";L" variable #+ Variable Register])))
(exception: #export Unrecognized-Synthesis)
@@ -26,7 +26,7 @@
(-> ls;Synthesis (Meta $;Inst))
(case synthesis
(^code [])
- &primitive;generate-unit
+ primitiveT;generate-unit
(^code [(~ singleton)])
(generate singleton)
@@ -34,42 +34,42 @@
(^template [<tag> <generator>]
[_ (<tag> value)]
(<generator> value))
- ([#;Bool &primitive;generate-bool]
- [#;Nat &primitive;generate-nat]
- [#;Int &primitive;generate-int]
- [#;Deg &primitive;generate-deg]
- [#;Frac &primitive;generate-frac]
- [#;Text &primitive;generate-text])
+ ([#;Bool primitiveT;generate-bool]
+ [#;Nat primitiveT;generate-nat]
+ [#;Int primitiveT;generate-int]
+ [#;Deg primitiveT;generate-deg]
+ [#;Frac primitiveT;generate-frac]
+ [#;Text primitiveT;generate-text])
(^code ((~ [_ (#;Nat tag)]) (~ [_ (#;Bool last?)]) (~ valueS)))
- (&structure;generate-variant generate tag last? valueS)
+ (structureT;generate-variant generate tag last? valueS)
(^code [(~@ members)])
- (&structure;generate-tuple generate members)
+ (structureT;generate-tuple generate members)
(^ [_ (#;Form (list [_ (#;Int var)]))])
(if (variableL;captured? var)
- (&reference;generate-captured var)
- (&reference;generate-variable var))
+ (referenceT;generate-captured var)
+ (referenceT;generate-variable var))
[_ (#;Symbol definition)]
- (&reference;generate-definition definition)
+ (referenceT;generate-definition definition)
(^code ("lux let" (~ [_ (#;Nat register)]) (~ inputS) (~ exprS)))
- (caseG;generate-let generate register inputS exprS)
+ (caseT;generate-let generate register inputS exprS)
(^code ("lux case" (~ inputS) (~ pathPS)))
- (caseG;generate-case generate inputS pathPS)
+ (caseT;generate-case generate inputS pathPS)
(^multi (^code ("lux function" (~ [_ (#;Nat arity)]) [(~@ environment)] (~ bodyS)))
[(s;run environment (p;some s;int)) (#e;Success environment)])
- (&function;generate-function generate environment arity bodyS)
+ (functionT;generate-function generate environment arity bodyS)
(^code ("lux call" (~ functionS) (~@ argsS)))
- (&function;generate-call generate functionS argsS)
+ (functionT;generate-call generate functionS argsS)
(^code ((~ [_ (#;Text procedure)]) (~@ argsS)))
- (&procedure;generate-procedure generate procedure argsS)
+ (procedureT;generate-procedure generate procedure argsS)
_
(&;throw Unrecognized-Synthesis (%code synthesis))
diff --git a/new-luxc/source/luxc/generator/function.jvm.lux b/new-luxc/source/luxc/lang/translation/function.jvm.lux
index 310f4d7a0..35c88e4ed 100644
--- a/new-luxc/source/luxc/generator/function.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/function.jvm.lux
@@ -12,9 +12,9 @@
["$i" inst]))
(lang ["la" analysis]
["ls" synthesis]
- [";L" variable #+ Variable])
- (generator ["&;" common]
- ["&;" runtime])))
+ (translation [";T" common]
+ [";T" runtime])
+ [";L" variable #+ Variable])))
(def: arity-field Text "arity")
@@ -57,7 +57,7 @@
(def: get-amount-of-partialsI
$;Inst
(|>. ($i;ALOAD +0)
- ($i;GETFIELD hostL;function-class &runtime;partials-field $t;int)))
+ ($i;GETFIELD hostL;function-class runtimeT;partials-field $t;int)))
(def: (load-fieldI class field)
(-> Text Text $;Inst)
@@ -72,13 +72,13 @@
(def: (applysI start amount)
(-> $;Register Nat $;Inst)
- (let [max-args (n.min amount &runtime;num-apply-variants)
- later-applysI (if (n.> &runtime;num-apply-variants amount)
- (applysI (n.+ &runtime;num-apply-variants start) (n.- &runtime;num-apply-variants amount))
+ (let [max-args (n.min amount runtimeT;num-apply-variants)
+ later-applysI (if (n.> runtimeT;num-apply-variants amount)
+ (applysI (n.+ runtimeT;num-apply-variants start) (n.- runtimeT;num-apply-variants amount))
id)]
(|>. ($i;CHECKCAST hostL;function-class)
(inputsI start max-args)
- ($i;INVOKEVIRTUAL hostL;function-class &runtime;apply-method (&runtime;apply-signature max-args) false)
+ ($i;INVOKEVIRTUAL hostL;function-class runtimeT;apply-method (runtimeT;apply-signature max-args) false)
later-applysI)))
(def: (inc-intI by)
@@ -256,7 +256,7 @@
$i;ARETURN))
))))
$i;fuse)]
- ($d;method #$;Public $;noneM &runtime;apply-method (&runtime;apply-signature apply-arity)
+ ($d;method #$;Public $;noneM runtimeT;apply-method (runtimeT;apply-signature apply-arity)
(|>. get-amount-of-partialsI
($i;TABLESWITCH 0 (|> num-partials n.dec nat-to-int)
@default @labels)
@@ -272,16 +272,16 @@
(Meta [$;Def $;Inst]))
(do meta;Monad<Meta>
[@begin $i;make-label
- bodyI (&common;with-function class (generate body))
+ bodyI (commonT;with-function class (generate body))
#let [env-size (list;size env)
applyD (: $;Def
(if (poly-arg? arity)
- (|> (n.min arity &runtime;num-apply-variants)
+ (|> (n.min arity runtimeT;num-apply-variants)
(list;n.range +1)
(list/map (with-apply class env arity @begin bodyI))
(list& (with-implementation arity @begin bodyI))
$d;fuse)
- ($d;method #$;Public $;strictM &runtime;apply-method (&runtime;apply-signature +1)
+ ($d;method #$;Public $;strictM runtimeT;apply-method (runtimeT;apply-signature +1)
(|>. ($i;label @begin)
bodyI
$i;ARETURN))))
@@ -302,7 +302,7 @@
(do meta;Monad<Meta>
[function-class (:: @ map %code (meta;gensym "function"))
[functionD instanceI] (with-function generate function-class env arity body)
- _ (&common;store-class function-class
+ _ (commonT;store-class function-class
($d;class #$;V1.6 #$;Public $;finalC
function-class (list)
($;simple-class hostL;function-class) (list)
@@ -323,11 +323,11 @@
(do meta;Monad<Meta>
[functionI (generate functionS)
argsI (monad;map @ generate argsS)
- #let [applyI (|> (segment &runtime;num-apply-variants argsI)
+ #let [applyI (|> (segment runtimeT;num-apply-variants argsI)
(list/map (function [chunkI+]
(|>. ($i;CHECKCAST hostL;function-class)
($i;fuse chunkI+)
- ($i;INVOKEVIRTUAL hostL;function-class &runtime;apply-method (&runtime;apply-signature (list;size chunkI+)) false))))
+ ($i;INVOKEVIRTUAL hostL;function-class runtimeT;apply-method (runtimeT;apply-signature (list;size chunkI+)) false))))
$i;fuse)]]
(wrap (|>. functionI
applyI))))
diff --git a/new-luxc/source/luxc/generator/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/primitive.jvm.lux
index 637f46a85..72b5f4e9d 100644
--- a/new-luxc/source/luxc/generator/primitive.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/primitive.jvm.lux
@@ -9,8 +9,8 @@
(jvm ["$i" inst]
["$t" type]))
(lang ["la" analysis]
- ["ls" synthesis])
- (generator ["&;" common]))
+ ["ls" synthesis]
+ (translation [";T" common])))
[../runtime])
(def: #export generate-unit
diff --git a/new-luxc/source/luxc/generator/procedure.jvm.lux b/new-luxc/source/luxc/lang/translation/procedure.jvm.lux
index 973f0e968..973f0e968 100644
--- a/new-luxc/source/luxc/generator/procedure.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/procedure.jvm.lux
diff --git a/new-luxc/source/luxc/generator/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux
index dffbcb64e..80becb058 100644
--- a/new-luxc/source/luxc/generator/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux
@@ -16,9 +16,8 @@
["$d" def]
["$i" inst]))
(lang ["la" analysis]
- ["ls" synthesis])
- (generator ["&;" common]
- ["&;" runtime])))
+ ["ls" synthesis]
+ (translation [";T" runtime]))))
(host;import java.lang.Long
(#static MIN_VALUE Long)
@@ -193,11 +192,11 @@
$i;AALOAD
$i;DUP
($i;IFNULL @is-null)
- &runtime;someI
+ runtimeT;someI
($i;GOTO @end)
($i;label @is-null)
$i;POP
- &runtime;noneI
+ runtimeT;noneI
($i;label @end))))
(def: (array//put [arrayI idxI elemI])
@@ -400,11 +399,11 @@
($i;int -1)
($i;IF_ICMPEQ @not-found)
lux-intI
- &runtime;someI
+ runtimeT;someI
($i;GOTO @end)
($i;label @not-found)
$i;POP
- &runtime;noneI
+ runtimeT;noneI
($i;label @end))))]
[text//index "indexOf"]
diff --git a/new-luxc/source/luxc/generator/procedure/host.jvm.lux b/new-luxc/source/luxc/lang/translation/procedure/host.jvm.lux
index 9222b2e4a..c222e42cf 100644
--- a/new-luxc/source/luxc/generator/procedure/host.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/procedure/host.jvm.lux
@@ -22,9 +22,7 @@
["$i" inst]))
(lang ["la" analysis]
(analysis (procedure ["&;" host]))
- ["ls" synthesis])
- (generator ["&;" common]
- ["&;" runtime]))
+ ["ls" synthesis]))
["@" ../common])
(do-template [<name> <inst>]
diff --git a/new-luxc/source/luxc/generator/reference.jvm.lux b/new-luxc/source/luxc/lang/translation/reference.jvm.lux
index 9af511167..7c42f9f08 100644
--- a/new-luxc/source/luxc/generator/reference.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/reference.jvm.lux
@@ -8,18 +8,18 @@
(jvm ["$t" type]
["$i" inst]))
(lang ["ls" synthesis]
- [";L" variable #+ Variable])
- (generator [";G" common]
- [";G" function])))
+ [";L" variable #+ Variable]
+ (translation [";T" common]
+ [";T" function]))))
(def: #export (generate-captured variable)
(-> Variable (Meta $;Inst))
(do meta;Monad<Meta>
- [function-class commonG;function]
+ [function-class commonT;function]
(wrap (|>. ($i;ALOAD +0)
($i;GETFIELD function-class
- (|> variable i.inc (i.* -1) int-to-nat functionG;captured)
- commonG;$Object)))))
+ (|> variable i.inc (i.* -1) int-to-nat functionT;captured)
+ commonT;$Object)))))
(def: #export (generate-variable variable)
(-> Variable (Meta $;Inst))
@@ -28,4 +28,4 @@
(def: #export (generate-definition [def-module def-name])
(-> Ident (Meta $;Inst))
(let [bytecode-name (format def-module "/" (&;normalize-name def-name))]
- (meta/wrap ($i;GETSTATIC bytecode-name commonG;value-field commonG;$Object))))
+ (meta/wrap ($i;GETSTATIC bytecode-name commonT;value-field commonT;$Object))))
diff --git a/new-luxc/source/luxc/generator/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/runtime.jvm.lux
index 4b57e802e..e5d237fc7 100644
--- a/new-luxc/source/luxc/generator/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/runtime.jvm.lux
@@ -13,8 +13,8 @@
["$d" def]
["$i" inst]))
(lang ["la" analysis]
- ["ls" synthesis])
- (generator ["&;" common])))
+ ["ls" synthesis]
+ (translation [";T" common]))))
(host;import java.lang.Object)
(host;import java.lang.String)
@@ -556,7 +556,7 @@
)))
(def: generate-runtime
- (Meta &common;Bytecode)
+ (Meta commonT;Bytecode)
(do meta;Monad<Meta>
[_ (wrap [])
#let [bytecode ($d;class #$;V1.6 #$;Public $;finalC hostL;runtime-class (list) ["java.lang.Object" (list)] (list)
@@ -566,11 +566,11 @@
deg-methods
pm-methods
io-methods))]
- _ (&common;store-class hostL;runtime-class bytecode)]
+ _ (commonT;store-class hostL;runtime-class bytecode)]
(wrap bytecode)))
(def: generate-function
- (Meta &common;Bytecode)
+ (Meta commonT;Bytecode)
(do meta;Monad<Meta>
[_ (wrap [])
#let [applyI (|> (list;n.range +2 num-apply-variants)
@@ -597,11 +597,11 @@
($i;PUTFIELD hostL;function-class partials-field $t;int)
$i;RETURN))
applyI))]
- _ (&common;store-class hostL;function-class bytecode)]
+ _ (commonT;store-class hostL;function-class bytecode)]
(wrap bytecode)))
(def: #export generate
- (Meta [&common;Bytecode &common;Bytecode])
+ (Meta [commonT;Bytecode commonT;Bytecode])
(do meta;Monad<Meta>
[runtime-bc generate-runtime
function-bc generate-function]
diff --git a/new-luxc/source/luxc/generator/statement.jvm.lux b/new-luxc/source/luxc/lang/translation/statement.jvm.lux
index e91e99fc9..0234d738c 100644
--- a/new-luxc/source/luxc/generator/statement.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/statement.jvm.lux
@@ -17,8 +17,8 @@
(jvm ["$t" type]
["$d" def]
["$i" inst]))
- (generator ["&;" eval]
- ["&;" common])))
+ (lang (translation [";T" eval]
+ [";T" common]))))
(exception: #export Invalid-Definition-Value)
@@ -44,16 +44,16 @@
bytecode-name
(list) ["java.lang.Object" (list)]
(list)
- (|>. ($d;field #$;Public ($;++F $;finalF $;staticF) &common;value-field &common;$Object)
+ (|>. ($d;field #$;Public ($;++F $;finalF $;staticF) commonT;value-field commonT;$Object)
($d;method #$;Public $;staticM "<clinit>" ($t;method (list) #;None (list))
(|>. valueI
- ($i;PUTSTATIC bytecode-name &common;value-field &common;$Object)
+ ($i;PUTSTATIC bytecode-name commonT;value-field commonT;$Object)
$i;RETURN))))]
- _ (&common;store-class class-name bytecode)
- class (&common;load-class class-name)
+ _ (commonT;store-class class-name bytecode)
+ class (commonT;load-class class-name)
valueV (: (Meta Top)
(case (do e;Monad<Error>
- [field (Class.getField [&common;value-field] class)]
+ [field (Class.getField [commonT;value-field] class)]
(Field.get [#;None] field))
(#e;Success #;None)
(&;throw Invalid-Definition-Value (format current-module ";" def-name))
@@ -73,7 +73,7 @@
(&module;declare-tags tags (meta;export? metaV) (:! Type valueV)))
(wrap []))
#let [_ (log! (format "DEF " current-module ";" def-name))]]
- (&common;record-artifact bytecode-name bytecode)))
+ (commonT;record-artifact bytecode-name bytecode)))
(def: #export (generate-program program-args programI)
(-> Text $;Inst (Meta Unit))
diff --git a/new-luxc/source/luxc/generator/structure.jvm.lux b/new-luxc/source/luxc/lang/translation/structure.jvm.lux
index 96d5767c6..c3e07fd55 100644
--- a/new-luxc/source/luxc/generator/structure.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/structure.jvm.lux
@@ -12,8 +12,8 @@
["$d" def]
["$i" inst]))
(lang ["la" analysis]
- ["ls" synthesis])
- (generator ["&;" common]))
+ ["ls" synthesis]
+ (translation [";T" common])))
[../runtime])
(def: $Object $;Type ($t;class "java.lang.Object" (list)))
diff --git a/new-luxc/source/program.lux b/new-luxc/source/program.lux
index e660b4158..142e8b566 100644
--- a/new-luxc/source/program.lux
+++ b/new-luxc/source/program.lux
@@ -8,7 +8,7 @@
text/format)
[io #- run]
[cli #+ program: CLI])
- (luxc ["&;" generator]))
+ (luxc (lang [";L" translation])))
## (type: Compilation
## {#program &;Path
@@ -53,3 +53,5 @@
(#e;Success output)
(wrap output))))
+
+