From 53704218a3705132dbe807a8ef54f938809f84d5 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 1 Oct 2022 16:33:20 -0400 Subject: New format for extensions [part 0] --- lux-js/source/program.lux | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'lux-js/source/program.lux') 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] -- cgit v1.2.3