aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm
diff options
context:
space:
mode:
authorEduardo Julian2022-01-10 16:41:27 -0400
committerEduardo Julian2022-01-10 16:41:27 -0400
commit0613deddeb934b523dd59ef0a2c6303716883a0c (patch)
tree41e89c8a041fdaef5c8fc3ad8153f553d064d863 /lux-jvm
parentb7873d4b68ffc041f9ff134c52a32b54c20febf9 (diff)
Fixes for the pure-Lux JVM compiler machinery. [Part 5]
Diffstat (limited to 'lux-jvm')
-rw-r--r--lux-jvm/commands.md4
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux18
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux16
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm/primitive.lux2
4 files changed, 17 insertions, 23 deletions
diff --git a/lux-jvm/commands.md b/lux-jvm/commands.md
index a4644f915..aa3299ac9 100644
--- a/lux-jvm/commands.md
+++ b/lux-jvm/commands.md
@@ -32,7 +32,7 @@ cd ~/lux/stdlib/ \
## Use new JVM compiler to compile tests for the Standard Library
cd ~/lux/stdlib/ \
&& lein clean \
-&& java -jar ~/lux/lux-jvm/target/program.jar build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux \
+&& java -jar ~/lux/lux-jvm/target/program.jar build --host_dependency ~/.m2/repository/com/github/luxlang/lux-jvm-function/0.6.5/lux-jvm-function-0.6.5.jar --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux \
&& java -jar ~/lux/stdlib/target/program.jar
```
@@ -40,7 +40,7 @@ cd ~/lux/stdlib/ \
```
cd ~/lux/lux-jvm/ \
-&& mvn install:install-file -Dfile=target/program.jar -DgroupId=com.github.luxlang -DartifactId=lux-jvm -Dversion=0.7.0 -Dpackaging=jar
+&& mvn install:install-file -Dfile=target/program.jar -DgroupId=com.github.luxlang -DartifactId=lux-jvm -Dversion=0.6.6 -Dpackaging=jar
cd ~/lux/lux-jvm/ && mvn deploy:deploy-file \
-Durl=https://USERNAME:PASSWORD@oss.sonatype.org/content/repositories/snapshots/ \
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 888a7a5a5..20f3fdf7a 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/common.lux
@@ -54,11 +54,6 @@
{try.#Failure error}
(phase.except extension.invalid_syntax [extension_name %synthesis input]))))
-(import: java/lang/Double
- ["[1]::[0]"
- ("static" MIN_VALUE java/lang/Double)
- ("static" MAX_VALUE java/lang/Double)])
-
(def: $String (type.class "java.lang.String" (list)))
(def: $CharSequence (type.class "java.lang.CharSequence" (list)))
(def: $System (type.class "java.lang.System" (list)))
@@ -160,16 +155,6 @@
[i64::right_shift _.LUSHR]
)
-(template [<name> <const> <type>]
- [(def: (<name> _)
- (Nullary Inst)
- (|>> <const> (_.wrap <type>)))]
-
- [f64::smallest (_.double (java/lang/Double::MIN_VALUE)) type.double]
- [f64::min (_.double (f.* -1.0 (java/lang/Double::MAX_VALUE))) type.double]
- [f64::max (_.double (java/lang/Double::MAX_VALUE)) type.double]
- )
-
(template [<name> <type> <op>]
[(def: (<name> [paramI subjectI])
(Binary Inst)
@@ -341,9 +326,6 @@
(bundle.install "%" (binary f64::%))
(bundle.install "=" (binary f64::=))
(bundle.install "<" (binary f64::<))
- (bundle.install "smallest" (nullary f64::smallest))
- (bundle.install "min" (nullary f64::min))
- (bundle.install "max" (nullary f64::max))
(bundle.install "i64" (unary f64::i64))
(bundle.install "encode" (unary f64::encode))
(bundle.install "decode" (unary f64::decode)))))
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 17165b434..dc806c8d0 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/extension/host.lux
@@ -130,26 +130,32 @@
[_.D2F conversion::double_to_float]
[_.D2I conversion::double_to_int]
[_.D2L conversion::double_to_long]
+
[_.F2D conversion::float_to_double]
[_.F2I conversion::float_to_int]
[_.F2L conversion::float_to_long]
+
[_.I2B conversion::int_to_byte]
[_.I2C conversion::int_to_char]
[_.I2D conversion::int_to_double]
[_.I2F conversion::int_to_float]
[_.I2L conversion::int_to_long]
[_.I2S conversion::int_to_short]
+
[_.L2D conversion::long_to_double]
[_.L2F conversion::long_to_float]
[_.L2I conversion::long_to_int]
[..L2S conversion::long_to_short]
[..L2B conversion::long_to_byte]
[..L2C conversion::long_to_char]
+
[_.I2B conversion::char_to_byte]
[_.I2S conversion::char_to_short]
[_.NOP conversion::char_to_int]
[_.I2L conversion::char_to_long]
+
[_.I2L conversion::byte_to_long]
+
[_.I2L conversion::short_to_long]
)
@@ -160,33 +166,39 @@
(bundle.install "double-to-float" (unary conversion::double_to_float))
(bundle.install "double-to-int" (unary conversion::double_to_int))
(bundle.install "double-to-long" (unary conversion::double_to_long))
+
(bundle.install "float-to-double" (unary conversion::float_to_double))
(bundle.install "float-to-int" (unary conversion::float_to_int))
(bundle.install "float-to-long" (unary conversion::float_to_long))
+
(bundle.install "int-to-byte" (unary conversion::int_to_byte))
(bundle.install "int-to-char" (unary conversion::int_to_char))
(bundle.install "int-to-double" (unary conversion::int_to_double))
(bundle.install "int-to-float" (unary conversion::int_to_float))
(bundle.install "int-to-long" (unary conversion::int_to_long))
(bundle.install "int-to-short" (unary conversion::int_to_short))
+
(bundle.install "long-to-double" (unary conversion::long_to_double))
(bundle.install "long-to-float" (unary conversion::long_to_float))
(bundle.install "long-to-int" (unary conversion::long_to_int))
(bundle.install "long-to-short" (unary conversion::long_to_short))
(bundle.install "long-to-byte" (unary conversion::long_to_byte))
(bundle.install "long-to-char" (unary conversion::long_to_char))
+
(bundle.install "char-to-byte" (unary conversion::char_to_byte))
(bundle.install "char-to-short" (unary conversion::char_to_short))
(bundle.install "char-to-int" (unary conversion::char_to_int))
(bundle.install "char-to-long" (unary conversion::char_to_long))
+
(bundle.install "byte-to-long" (unary conversion::byte_to_long))
+
(bundle.install "short-to-long" (unary conversion::short_to_long))
)))
(template [<name> <op>]
- [(def: (<name> [parameterI subject1])
+ [(def: (<name> [parameterI subjectI])
(Binary Inst)
- (|>> subject1
+ (|>> subjectI
parameterI
<op>))]
diff --git a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux
index d3e69daec..0f2b64f9f 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm/primitive.lux
@@ -93,7 +93,7 @@
([-1.0 _.ICONST_M1]
... [+0.0 _.ICONST_0]
... [+1.0 _.ICONST_1]
- [+2.0 _.ICONST_2]
+ ... [+2.0 _.ICONST_2]
[+3.0 _.ICONST_3]
[+4.0 _.ICONST_4]
[+5.0 _.ICONST_5])