aboutsummaryrefslogtreecommitdiff
path: root/lux-lua
diff options
context:
space:
mode:
authorEduardo Julian2022-03-11 05:52:21 -0400
committerEduardo Julian2022-03-11 05:52:21 -0400
commit6766be5427b1788a44e07151e3fabe33ec4f8b37 (patch)
tree8d8aa5c1d8fd4a9f733f82c48080284ecd4ec31a /lux-lua
parentac2c19d93407b00c89513f0f81e9cbbd1425bd9a (diff)
Added an easy way to export Lux functionality to host programs (everywhere else).
Diffstat (limited to 'lux-lua')
-rw-r--r--lux-lua/commands.md1
-rw-r--r--lux-lua/project.lux46
-rw-r--r--lux-lua/source/program.lux8
3 files changed, 32 insertions, 23 deletions
diff --git a/lux-lua/commands.md b/lux-lua/commands.md
index 08fb948a1..6783b7b17 100644
--- a/lux-lua/commands.md
+++ b/lux-lua/commands.md
@@ -9,7 +9,6 @@ cd ~/lux/lux-lua/ && lein clean && lein lux auto test
```
## Develop
-## NOTE: Must set lux/control/concurrency/thread.parallelism = 1 before compiling to make sure Rembulan doesn't cause trouble.
cd ~/lux/lux-lua/ \
&& lux clean \
&& lux auto build
diff --git a/lux-lua/project.lux b/lux-lua/project.lux
index 54739d3e2..f1b9c0c46 100644
--- a/lux-lua/project.lux
+++ b/lux-lua/project.lux
@@ -1,23 +1,33 @@
-{""
- [#identity ["com.github.luxlang" "lux-lua" "0.6.4"]
+[""
+ ["identity" ["com.github.luxlang" "lux-lua" "0.6.6-SNAPSHOT"]
+ "description" "A Lua compiler for Lux."
+ "info" ["url" "https://github.com/LuxLang/lux"
+ "scm" "https://github.com/LuxLang/lux.git"
+ "licenses" [["name" "Lux License v0.1.2"
+ "url" "https://github.com/LuxLang/lux/blob/master/license.txt"
+ "type" "repo"]]
+ "developers" [["name" "Eduardo Julian"
+ "url" "https://github.com/eduardoejp"]]]
- #deploy_repositories {"snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"
- "releases" "https://oss.sonatype.org/service/local/staging/deploy/maven2/"}
+ "deploy_repositories" ["snapshots" "https://oss.sonatype.org/content/repositories/snapshots/"
+ "releases" "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
- #repositories ["https://oss.sonatype.org/content/repositories/snapshots/"
- "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
+ "repositories" ["https://oss.sonatype.org/content/repositories/snapshots/"
+ "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
- #compiler ["com.github.luxlang" "lux-jvm" "0.6.4" "jar"]
- #dependencies [... ["com.github.luxlang" "stdlib" "0.6.4" "tar"]
+ "lux" ["com.github.luxlang" "lux-jvm" "0.6.6-SNAPSHOT" "jar"]
+ "dependencies" [... ["com.github.luxlang" "stdlib" "0.6.5" "tar"]
+ ... ["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"]
- ["org.ow2.asm" "asm-analysis" "5.0.4" "jar"]
- ["org.ow2.asm" "asm-tree" "5.0.4" "jar"]
- ["org.ow2.asm" "asm-util" "5.0.4" "jar"]
-
- ["com.github.luxlang" "rembulan-runtime" "0.1" "jar"]
- ["com.github.luxlang" "rembulan-stdlib" "0.1" "jar"]
- ["com.github.luxlang" "rembulan-compiler" "0.1" "jar"]]
+ ["org.ow2.asm" "asm" "5.0.4" "jar"]
+ ["org.ow2.asm" "asm-commons" "5.0.4" "jar"]
+ ["org.ow2.asm" "asm-analysis" "5.0.4" "jar"]
+ ["org.ow2.asm" "asm-tree" "5.0.4" "jar"]
+ ["org.ow2.asm" "asm-util" "5.0.4" "jar"]
+
+ ["com.github.luxlang" "rembulan-runtime" "0.1" "jar"]
+ ["com.github.luxlang" "rembulan-stdlib" "0.1" "jar"]
+ ["com.github.luxlang" "rembulan-compiler" "0.1" "jar"]]
- #program "program"]}
+ "program" "program"
+ "configuration" ["lua_compiler?" ""]]]
diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux
index f1a759f2d..ae6f3af2f 100644
--- a/lux-lua/source/program.lux
+++ b/lux-lua/source/program.lux
@@ -866,11 +866,11 @@
(async.future (# world/program.default exit +0)))
(def: (lux_compiler it)
- (-> Any compiler.Custom)
+ (-> Any platform.Custom)
(undefined))
(`` (program: [service cli.service]
- (let [extension ".lua"]
+ (let [context (context.lua (cli.target service))]
(do io.monad
[(~~ (for [@.old [baggage platform]
@.jvm [baggage platform]
@@ -878,7 +878,7 @@
..platform]
(exec (do async.monad
[_ (/.compiler ..lux_compiler
- (context.lua (cli.target service))
+ context
(for [@.old (..expander ..to_host baggage)
@.jvm (..expander ..to_host baggage)
@.lua ..expander])
@@ -901,6 +901,6 @@
(format (cli.target service)
(# file.default separator)
"program"
- extension)])]
+ (value@ context.#artifact_extension context))])]
(..declare_success! []))
(io.io []))))))