aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm
diff options
context:
space:
mode:
authorEduardo Julian2022-07-09 14:35:38 -0400
committerEduardo Julian2022-07-09 14:35:38 -0400
commit7db42ab1b9d3c764772ca63c74bf44bb2b8b8325 (patch)
treebd1c865dea0902790f3e462cec4f9bc8d8ae428f /lux-jvm
parentfc2737b5226eda69c12bc593e83e22ed54e4d3af (diff)
First-class programs instead of having a "lux program" extension.
Diffstat (limited to '')
-rw-r--r--lux-jvm/project.clj4
-rw-r--r--lux-jvm/source/program.lux52
2 files changed, 29 insertions, 27 deletions
diff --git a/lux-jvm/project.clj b/lux-jvm/project.clj
index fa6ce9dff..38e56ffdb 100644
--- a/lux-jvm/project.clj
+++ b/lux-jvm/project.clj
@@ -26,6 +26,6 @@
:manifest {"lux" ~version}
:source-paths ["source"]
- :lux {:program "program"
- :test "test/program"}
+ :lux {:program ["program" "_"]
+ :test ["test/program" "_"]}
)
diff --git a/lux-jvm/source/program.lux b/lux-jvm/source/program.lux
index 217218e2e..17fe054ef 100644
--- a/lux-jvm/source/program.lux
+++ b/lux-jvm/source/program.lux
@@ -1,7 +1,7 @@
(.require
[library
[lux (.except Definition)
- [program (.only program:)]
+ [program (.only program)]
["[0]" ffi (.only import)]
[abstract
[monad (.only do)]]
@@ -49,7 +49,8 @@
["/" jvm (.only)
["[1][0]" runtime (.only Anchor Definition)]
["[1][0]" host]
- ["[1][0]" program]]]]]]]]
+ ["[1][0]" program]
+ ["[1][0]" reference]]]]]]]]
["[0]" world
["[0]" file]
["[1]/[0]" environment]]]]
@@ -159,27 +160,28 @@
(-> Any (Async Any))
(async.future (at world/environment.default exit +0)))
-(def (lux_compiler it)
+(def lux_compiler
(-> Any platform.Custom)
- (as_expected it))
-
-(program: [service cli.service]
- (let [context (context.jvm (cli.target service))]
- (exec (do async.monad
- [[loader host platform] (async.future ..platform)
- _ (compositor.compiler
- ..lux_compiler
- context
- ..expander
- (analysis.bundle loader host)
- (io.io platform)
- generation.bundle
- (|>> ..extender (declaration.bundle loader))
- (/program.program /runtime.class_name)
- [Anchor (type_literal (Bytecode Any)) Definition]
- ..extender
- service
- [(packager.package context)
- (format (cli.target service) (at file.default separator) "program.jar")])]
- (..declare_success! []))
- (io.io []))))
+ (|>> as_expected))
+
+(def _
+ (program [service cli.service]
+ (let [context (context.jvm (cli.target service))]
+ (exec (do async.monad
+ [[loader host platform] (async.future ..platform)
+ _ (compositor.compiler
+ ..lux_compiler
+ context
+ ..expander
+ (analysis.bundle loader host)
+ (io.io platform)
+ generation.bundle
+ (|>> ..extender (declaration.bundle loader))
+ (/program.program /runtime.class_name) /reference.constant
+ [Anchor (type_literal (Bytecode Any)) Definition]
+ ..extender
+ service
+ [(packager.package context)
+ (format (cli.target service) (at file.default separator) "program.jar")])]
+ (..declare_success! []))
+ (io.io [])))))