From 7db42ab1b9d3c764772ca63c74bf44bb2b8b8325 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 9 Jul 2022 14:35:38 -0400 Subject: First-class programs instead of having a "lux program" extension. --- stdlib/source/program/compositor.lux | 37 ++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) (limited to 'stdlib/source/program/compositor.lux') diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux index 3b5150c7e..3f3009b67 100644 --- a/stdlib/source/program/compositor.lux +++ b/stdlib/source/program/compositor.lux @@ -133,7 +133,7 @@ (with_expansions [ (these anchor expression artifact)] (def .public (compiler lux_compiler file_context - expander host_analysis platform generation_bundle host_declaration_bundle program anchorT,expressionT,declarationT extender + expander host_analysis platform generation_bundle host_declaration_bundle program global anchorT,expressionT,declarationT extender service packager,package) (All (_ ) @@ -144,7 +144,7 @@ (IO (Platform )) (generation.Bundle ) (-> phase.Wrapper (declaration.Bundle )) - (Program expression artifact) + (Program expression artifact) (-> Archive Symbol (generation.Operation expression)) [Type Type Type] (-> phase.Wrapper Extender) Service @@ -157,23 +157,44 @@ (<| (or_crash! "Compilation failed:") ..timed (do (try.with async.monad) - [.let [[compilation_host_dependencies compilation_libraries compilation_compilers compilation_sources compilation_target compilation_module compilation_configuration] compilation] - import (import.import (the platform.#file_system platform) compilation_libraries) + [import (import.import (the platform.#file_system platform) (the cli.#libraries compilation)) [state archive phase_wrapper] (sharing [] (is (Platform ) platform) (is (Async (Try [(declaration.State+ ) Archive phase.Wrapper])) - (as_expected (platform.initialize file_context compilation_module expander host_analysis platform generation_bundle host_declaration_bundle program anchorT,expressionT,declarationT extender - import compilation_sources compilation_configuration)))) + (as_expected (platform.initialize file_context + (the cli.#module compilation) + expander + host_analysis + platform + generation_bundle + host_declaration_bundle + program + anchorT,expressionT,declarationT + extender + import + (the cli.#sources compilation) + (the cli.#configuration compilation))))) [archive state] (sharing [] (is (Platform ) platform) (is (Async (Try [Archive (declaration.State+ )])) - (as_expected (platform.compile lux_compiler phase_wrapper import file_context expander platform compilation [archive state])))) + (as_expected (platform.compile program + global + lux_compiler + phase_wrapper + import + file_context + expander + platform + compilation + [archive state])))) _ (cache.cache! (the platform.#file_system platform) file_context archive) - host_dependencies (..load_host_dependencies (the platform.#file_system platform) compilation_host_dependencies) + host_dependencies (..load_host_dependencies (the platform.#file_system platform) + (the cli.#host_dependencies compilation)) + _ (..package! (for @.old (file.async file.default) @.jvm (file.async file.default) ... TODO: Handle this in a safer manner. -- cgit v1.2.3