aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang
diff options
context:
space:
mode:
authorEduardo Julian2019-10-27 01:10:13 -0400
committerEduardo Julian2019-10-27 01:10:13 -0400
commitaab604028e117e505bc408f69dc416fe6d9f46a7 (patch)
tree5184e162e8524ea687d5567656029197742b9302 /new-luxc/source/luxc/lang
parent87a9d756a9e94fb81fc14fea39df3e20d394afdb (diff)
Almost completely ported JVM runtime generation to the new JVM bytecode machinery.
Diffstat (limited to 'new-luxc/source/luxc/lang')
-rw-r--r--new-luxc/source/luxc/lang/packager.lux8
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/runtime.lux11
2 files changed, 7 insertions, 12 deletions
diff --git a/new-luxc/source/luxc/lang/packager.lux b/new-luxc/source/luxc/lang/packager.lux
index f18055b18..d72506da2 100644
--- a/new-luxc/source/luxc/lang/packager.lux
+++ b/new-luxc/source/luxc/lang/packager.lux
@@ -65,8 +65,10 @@
(putNextEntry [java/util/zip/ZipEntry] void))
(def: byte 1)
-(def: kilo-byte (n.* 1,000 byte))
-(def: mega-byte (n.* 1,000 kilo-byte))
+## https://en.wikipedia.org/wiki/Kibibyte
+(def: kibi-byte (n.* 1,024 byte))
+## https://en.wikipedia.org/wiki/Mebibyte
+(def: mebi-byte (n.* 1,024 kibi-byte))
(def: manifest-version "1.0")
@@ -99,7 +101,7 @@
(def: #export (package program-class outputs)
(-> External (Output Definition) Binary)
- (let [buffer (java/io/ByteArrayOutputStream::new (.int mega-byte))
+ (let [buffer (java/io/ByteArrayOutputStream::new (.int ..mebi-byte))
sink (java/util/jar/JarOutputStream::new buffer (manifest program-class))]
(exec (|> outputs
row.to-list
diff --git a/new-luxc/source/luxc/lang/translation/jvm/runtime.lux b/new-luxc/source/luxc/lang/translation/jvm/runtime.lux
index ce271c4c9..78467022e 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/runtime.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/runtime.lux
@@ -95,10 +95,6 @@
noneI
_.ARETURN)))
-(def: #export string-concatI
- Inst
- (_.INVOKEVIRTUAL $Text "concat" (type.method [(list $Text) $Text (list)])))
-
(def: #export partials-field Text "partials")
(def: #export apply-method Text "apply")
(def: #export num-apply-variants Nat 8)
@@ -121,8 +117,6 @@
store-valueI
_.ARETURN)))))
-(def: frac-shiftI Inst (_.double (math.pow +32.0 +2.0)))
-
(def: frac-methods
Def
(|>> ($d.method #$.Public $.staticM "decode_frac" (type.method [(list $Text) //.$Variant (list)])
@@ -360,6 +354,5 @@
(def: #export translate
(Operation Any)
(do phase.monad
- [runtime-bc translate-runtime
- function-bc translate-function]
- (wrap [])))
+ [_ translate-runtime]
+ translate-function))