aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/program/aedifex/command/build.lux1
-rw-r--r--stdlib/source/program/compositor.lux24
2 files changed, 17 insertions, 8 deletions
diff --git a/stdlib/source/program/aedifex/command/build.lux b/stdlib/source/program/aedifex/command/build.lux
index 15a671615..ba461d461 100644
--- a/stdlib/source/program/aedifex/command/build.lux
+++ b/stdlib/source/program/aedifex/command/build.lux
@@ -202,6 +202,7 @@
... But it's written this way because the more straightforward way (i.e. by using (try.with async.monad))
... eventually led to the function hanging/freezing.
... I'm not sure why it happened, but I got this weirder implementation to work.
+ ... TODO: Improve this implementation.
(let [[read! write!] (: [(Async (Try Any))
(async.Resolver (Try Any))]
(async.async []))
diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux
index 54fc903ad..2b6850cf8 100644
--- a/stdlib/source/program/compositor.lux
+++ b/stdlib/source/program/compositor.lux
@@ -22,9 +22,8 @@
["[0]" instant]]
["[0]" world "_"
["[0]" file]
- ["[1]/[0]" program]
- ... ["[0]" console]
- ]
+ ["[0]" console]
+ ["[1]/[0]" program]]
[tool
[compiler
["[0]" phase]
@@ -59,14 +58,23 @@
(def: (or_crash! failure_description action)
(All (_ a)
(-> Text (Async (Try a)) (Async a)))
- (do async.monad
+ (do [! async.monad]
[?output action]
(case ?output
{try.#Failure error}
- (exec (debug.log! (format text.new_line
- failure_description text.new_line
- error text.new_line))
- (io.run! (# world/program.default exit +1)))
+ (let [report (format text.new_line
+ failure_description text.new_line
+ error text.new_line)]
+ (do !
+ [_ (with_expansions [<else> (in (debug.log! report))]
+ (for [@.js (case console.default
+ {.#None}
+ <else>
+
+ {.#Some console}
+ (console.write_line report console))]
+ <else>))]
+ (io.run! (# world/program.default exit +1))))
{try.#Success output}
(in output))))