diff options
author | Eduardo Julian | 2022-10-01 16:33:20 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-10-01 16:33:20 -0400 |
commit | 53704218a3705132dbe807a8ef54f938809f84d5 (patch) | |
tree | 44d03d90f4f6f8055fba226e23755edbb3c55318 /lux-js/source/program.lux | |
parent | 1f4557bf0d904231b3b8d2b2bf73c35e9caead48 (diff) |
New format for extensions [part 0]
Diffstat (limited to '')
-rw-r--r-- | lux-js/source/program.lux | 33 |
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] |