aboutsummaryrefslogtreecommitdiff
path: root/lux-python/source
diff options
context:
space:
mode:
authorEduardo Julian2022-02-28 04:57:40 -0400
committerEduardo Julian2022-02-28 04:57:40 -0400
commit62436b809630ecd3e40bd6e2b45a8870a2866934 (patch)
tree00a10d36b76e154cdd04d4e7bb8bf63379489992 /lux-python/source
parent4167849041d7635a0fc2e81fc2bebae3fa0bb3d9 (diff)
Optimizations for the pure-Lux JVM compiler. [Part 4]
Diffstat (limited to 'lux-python/source')
-rw-r--r--lux-python/source/program.lux25
1 files changed, 15 insertions, 10 deletions
diff --git a/lux-python/source/program.lux b/lux-python/source/program.lux
index bd2e74788..e93019e32 100644
--- a/lux-python/source/program.lux
+++ b/lux-python/source/program.lux
@@ -37,7 +37,7 @@
["@" target
["_" python]]
[tool
- [compiler
+ ["[0]" compiler
["[0]" phase {"+" Operation Phase} ("[1]#[0]" monad)]
[reference
[variable {"+" Register}]]
@@ -529,13 +529,13 @@
($_ _.then
(_.import "sys")
(_.when (_.= (_.string "__main__") (_.var "__name__"))
- (_.statement (_.apply/2 program
- (|> (_.var "sys") (_.the "argv")
- ... The first entry in the list will be the program.py file itself
- ... so, it must be removed so only the program's arguments are left.
- (_.slice_from (_.int +1))
- runtime.lux::program_args)
- _.none)))))
+ (_.statement (_.apply/* (list (|> (_.var "sys") (_.the "argv")
+ ... The first entry in the list will be the program.py file itself
+ ... so, it must be removed so only the program's arguments are left.
+ (_.slice_from (_.int +1))
+ runtime.lux::program_args)
+ _.none)
+ program)))))
(def: (declare_success! _)
(-> Any (Async Any))
@@ -551,14 +551,19 @@
(; (|> (_.__import__/1 (_.unicode "sys"))
(_.do "setrecursionlimit" (list max_recursion))))
(_.def @program (list) body)
- (; (_.apply/* @program (list)))
+ (; (_.apply/* (list) @program))
))))
+(def: (lux_compiler it)
+ (-> Any compiler.Custom)
+ (undefined))
+
(program: [service cli.service]
(let [extension ".py"]
(exec
(do async.monad
- [_ (/.compiler (context.python (cli.target service))
+ [_ (/.compiler ..lux_compiler
+ (context.python (cli.target service))
..expander
analysis.bundle
..platform