aboutsummaryrefslogtreecommitdiff
path: root/lux-js/source
diff options
context:
space:
mode:
authorEduardo Julian2022-10-01 16:33:20 -0400
committerEduardo Julian2022-10-01 16:33:20 -0400
commit53704218a3705132dbe807a8ef54f938809f84d5 (patch)
tree44d03d90f4f6f8055fba226e23755edbb3c55318 /lux-js/source
parent1f4557bf0d904231b3b8d2b2bf73c35e9caead48 (diff)
New format for extensions [part 0]
Diffstat (limited to 'lux-js/source')
-rw-r--r--lux-js/source/program.lux33
1 files changed, 15 insertions, 18 deletions
diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux
index 665b4e8aa..ad7ee51f7 100644
--- a/lux-js/source/program.lux
+++ b/lux-js/source/program.lux
@@ -627,21 +627,18 @@
(..evaluate! context (_.var (reference.artifact context)))))))))
))
-(def (phase_wrapper archive)
- (-> Archive (runtime.Operation phase.Wrapper))
- (do phase.monad
- []
- (in (as phase.Wrapper
- (for @.jvm
- ... The implementation for @.jvm is technically incorrect.
- ... However, the JS compiler runs fast enough on Node to be fully hosted there.
- ... And running the JS compiler on the JVM (on top of Nashorn) is impractically slow.
- ... This means that in practice, only the @.js implementation matters.
- ... And since no cross-language boundary needs to be handled, it's a correct implementation.
- (|>>)
-
- @.js
- (|>>))))))
+(def phase_wrapper
+ phase.Wrapper
+ (for @.jvm
+ ... The implementation for @.jvm is technically incorrect.
+ ... However, the JS compiler runs fast enough on Node to be fully hosted there.
+ ... And running the JS compiler on the JVM (on top of Nashorn) is impractically slow.
+ ... This means that in practice, only the @.js implementation matters.
+ ... And since no cross-language boundary needs to be handled, it's a correct implementation.
+ (|>>)
+
+ @.js
+ (|>>)))
(def platform
(IO (Platform [Register Text] _.Expression _.Statement))
@@ -676,8 +673,8 @@
(_.string "")))))
(for @.jvm
- (def (extender phase_wrapper)
- (-> phase.Wrapper Extender)
+ (def extender
+ Extender
... TODO: Stop relying on coercions ASAP.
(<| (as Extender)
(function (@self handler))
@@ -735,7 +732,7 @@
analysis.bundle
(io.io platform)
generation.bundle
- (function.constant extension/bundle.empty)
+ extension/bundle.empty
..lux_program
(reference.constant js/reference.system)
[(And Register Text) _.Expression _.Statement]