aboutsummaryrefslogtreecommitdiff
path: root/lux-lua
diff options
context:
space:
mode:
authorEduardo Julian2022-04-06 21:52:30 -0400
committerEduardo Julian2022-04-06 21:52:30 -0400
commitb0d725f24335e82eefc77175efc0a5282951316e (patch)
tree18a5cc4b318776250442311636a415a5cc2c1f20 /lux-lua
parenta0ed5fd377daf5754697636504de8e180abf9ec0 (diff)
More efficient binary formatting.
Diffstat (limited to 'lux-lua')
-rw-r--r--lux-lua/commands.md10
-rw-r--r--lux-lua/project.lux6
-rw-r--r--lux-lua/source/program.lux40
3 files changed, 32 insertions, 24 deletions
diff --git a/lux-lua/commands.md b/lux-lua/commands.md
index 6783b7b17..d09567831 100644
--- a/lux-lua/commands.md
+++ b/lux-lua/commands.md
@@ -28,6 +28,14 @@ cd ~/lux/stdlib/ \
```
cd ~/lux/lux-lua/ \
-&& mvn install:install-file -Dfile=target/program.jar -DgroupId=com.github.luxlang -DartifactId=lux-lua -Dversion=0.6.6-SNAPSHOT -Dpackaging=jar
+&& mvn install:install-file -Dfile=target/program.jar -DgroupId=com.github.luxlang -DartifactId=lux-lua -Dversion=0.7.0-SNAPSHOT -Dpackaging=jar
+
+cd ~/lux/lux-lua/ && mvn deploy:deploy-file \
+-Durl=https://$NEXUS_USERNAME:$NEXUS_PASSWORD@oss.sonatype.org/content/repositories/snapshots/ \
+-Dfile=target/program.jar \
+-DgroupId=com.github.luxlang \
+-DartifactId=lux-python \
+-Dversion=0.7.0-SNAPSHOT \
+-Dpackaging=jar
```
diff --git a/lux-lua/project.lux b/lux-lua/project.lux
index f1b9c0c46..1e54cef63 100644
--- a/lux-lua/project.lux
+++ b/lux-lua/project.lux
@@ -1,5 +1,5 @@
[""
- ["identity" ["com.github.luxlang" "lux-lua" "0.6.6-SNAPSHOT"]
+ ["identity" ["com.github.luxlang" "lux-lua" "0.7.0-SNAPSHOT"]
"description" "A Lua compiler for Lux."
"info" ["url" "https://github.com/LuxLang/lux"
"scm" "https://github.com/LuxLang/lux.git"
@@ -15,9 +15,9 @@
"repositories" ["https://oss.sonatype.org/content/repositories/snapshots/"
"https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
- "lux" ["com.github.luxlang" "lux-jvm" "0.6.6-SNAPSHOT" "jar"]
+ "lux" ["com.github.luxlang" "lux-jvm" "0.7.0-SNAPSHOT" "jar"]
"dependencies" [... ["com.github.luxlang" "stdlib" "0.6.5" "tar"]
- ... ["com.github.luxlang" "lux-jvm-function" "0.6.5" "jar"]
+ ["com.github.luxlang" "lux-jvm-function" "0.6.5" "jar"]
["org.ow2.asm" "asm" "5.0.4" "jar"]
["org.ow2.asm" "asm-commons" "5.0.4" "jar"]
diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux
index fbe24bba8..1d4a2518b 100644
--- a/lux-lua/source/program.lux
+++ b/lux-lua/source/program.lux
@@ -218,7 +218,7 @@
{.#Some member}
(case (read member)
{try.#Success parsed_member}
- (again num_keys (++ idx) (array.write! idx (as java/lang/Object parsed_member) output))
+ (again num_keys (++ idx) (array.has! idx (as java/lang/Object parsed_member) output))
{try.#Failure error}
{try.#Failure error}))
@@ -387,7 +387,7 @@
(net/sandius/rembulan/impl/DefaultTable
[] (rawget self [idx long]) java/lang/Object
(|> value
- (array.read! (|> idx ffi.of_long .nat --))
+ (array.item (|> idx ffi.of_long .nat --))
maybe.trusted
to_host))
@@ -398,7 +398,7 @@
{.#Some field}
(case (ffi.of_string (net/sandius/rembulan/ByteString::decode field))
(pattern (static runtime.variant_tag_field))
- (case (array.read! 0 value)
+ (case (array.item 0 value)
{.#Some it}
(|> it
(as java/lang/Integer)
@@ -408,7 +408,7 @@
(undefined))
(pattern (static runtime.variant_flag_field))
- (case (array.read! 1 value)
+ (case (array.item 1 value)
{.#Some _}
(as java/lang/Object "")
@@ -417,7 +417,7 @@
(pattern (static runtime.variant_value_field))
(|> value
- (array.read! 2)
+ (array.item 2)
maybe.trusted
to_host)
@@ -434,7 +434,7 @@
{.#None}
(case (ffi.as java/lang/Long field)
{.#Some idx}
- (case (array.read! (|> idx ffi.of_long .nat --) value)
+ (case (array.item (|> idx ffi.of_long .nat --) value)
{.#Some it}
(to_host it)
@@ -463,15 +463,15 @@
(do try.monad
[.let [inputs (is (ffi.type [java/lang/Object])
(|> (array.empty 2)
- (array.write! 0 ... (as java/lang/Object inputs)
- ... (net/sandius/rembulan/impl/ImmutableTable$Builder::build (net/sandius/rembulan/impl/ImmutableTable$Builder::new))
- (as java/lang/Object (lux_structure to_host (as (Array java/lang/Object) inputs))))
- (array.write! 1 ... (as java/lang/Object lux)
- ... (net/sandius/rembulan/impl/ImmutableTable$Builder::build (net/sandius/rembulan/impl/ImmutableTable$Builder::new))
- (as java/lang/Object (lux_structure to_host (as (Array java/lang/Object) lux))))))]
+ (array.has! 0 ... (as java/lang/Object inputs)
+ ... (net/sandius/rembulan/impl/ImmutableTable$Builder::build (net/sandius/rembulan/impl/ImmutableTable$Builder::new))
+ (as java/lang/Object (lux_structure to_host (as (Array java/lang/Object) inputs))))
+ (array.has! 1 ... (as java/lang/Object lux)
+ ... (net/sandius/rembulan/impl/ImmutableTable$Builder::build (net/sandius/rembulan/impl/ImmutableTable$Builder::new))
+ (as java/lang/Object (lux_structure to_host (as (Array java/lang/Object) lux))))))]
output (net/sandius/rembulan/exec/DirectCallExecutor::call state_context (as java/lang/Object macro) inputs executor)]
(|> output
- (array.read! 0)
+ (array.item 0)
maybe.trusted
(as java/lang/Object)
..read)))
@@ -703,7 +703,7 @@
[lua_function (net/sandius/rembulan/load/ChunkLoader::loadTextChunk variable (ffi.as_string "lux compilation") (ffi.as_string (_.code code)) loader)
output (net/sandius/rembulan/exec/DirectCallExecutor::call state_context (as java/lang/Object lua_function) (array.empty 0)
executor)]
- (case (array.read! 0 output)
+ (case (array.item 0 output)
{.#None}
(in [])
@@ -816,14 +816,14 @@
output (net/sandius/rembulan/exec/DirectCallExecutor::call state_context
(as java/lang/Object handler)
(|> (array.empty 5)
- (array.write! 0 name)
- (array.write! 1 (as java/lang/Object (phase_wrapper phase)))
- (array.write! 2 (..to_host archive))
- (array.write! 3 (..to_host parameters))
- (array.write! 4 (..to_host state)))
+ (array.has! 0 name)
+ (array.has! 1 (as java/lang/Object (phase_wrapper phase)))
+ (array.has! 2 (..to_host archive))
+ (array.has! 3 (..to_host parameters))
+ (array.has! 4 (..to_host state)))
executor)]
(|> output
- (array.read! 0)
+ (array.item 0)
maybe.trusted
(as java/lang/Object)
..read)))))]