From 23f6d4d19c7f5d1f5b4f6db8a72cf52388689357 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 19 Feb 2022 08:03:44 -0400 Subject: Optimizations for the pure-Lux JVM compiler. [Part 3] --- lux-js/source/program.lux | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) (limited to 'lux-js/source') diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux index 36e2fd023..b670da4fa 100644 --- a/lux-js/source/program.lux +++ b/lux-js/source/program.lux @@ -60,13 +60,13 @@ ["[0]" platform {"+" Platform}]] [meta ["[0]" cli] + ["[0]" context] [archive {"+" Archive} ["[0]" unit]] ["[0]" packager "_" ["[1]" script]]]]]]] [program - ["/" compositor - ["[1][0]" static]]]) + ["/" compositor]]) (exception: (null_has_no_lux_representation [code (Maybe _.Expression)]) (case code @@ -671,26 +671,24 @@ (list)))) (program: [service cli.service] - (let [extension ".js"] - (exec (do async.monad - [platform (async.future ..platform) - _ (/.compiler [/static.#host @.js - /static.#host_module_extension extension - /static.#target (cli.target service) - /static.#artifact_extension extension] - ..expander - analysis.bundle - (io.io platform) - generation.bundle - (function.constant extension/bundle.empty) - ..program - [(And Register Text) _.Expression _.Statement] - ..extender - service - [(packager.package _.use_strict _.code _.then ..scope) - (format (cli.target service) - (# (value@ platform.#&file_system platform) separator) - "program" - extension)])] - (..declare_success! [])) + (let [context (context.js (cli.target service))] + (exec + (do async.monad + [platform (async.future ..platform) + _ (/.compiler context + ..expander + analysis.bundle + (io.io platform) + generation.bundle + (function.constant extension/bundle.empty) + ..program + [(And Register Text) _.Expression _.Statement] + ..extender + service + [(packager.package _.use_strict _.code _.then ..scope) + (format (cli.target service) + (# (value@ platform.#&file_system platform) separator) + "program" + (value@ context.#artifact_extension context))])] + (..declare_success! [])) (io.io [])))) -- cgit v1.2.3