diff options
author | Eduardo Julian | 2022-02-08 19:34:35 -0400 |
---|---|---|
committer | Eduardo Julian | 2022-02-08 19:34:35 -0400 |
commit | 2ea0bda182d76015df4f53ed82efd6f37e93cba6 (patch) | |
tree | be6b84b9316fe8b91bc6b99284978e60ad4b758e /stdlib/source/program | |
parent | 0755768bb993cfb3924986eeb0486204a90bfeee (diff) |
Optimized integer addition for Lux/Ruby in MRuby.
Diffstat (limited to 'stdlib/source/program')
-rw-r--r-- | stdlib/source/program/compositor.lux | 8 | ||||
-rw-r--r-- | stdlib/source/program/compositor/export.lux | 71 |
2 files changed, 4 insertions, 75 deletions
diff --git a/stdlib/source/program/compositor.lux b/stdlib/source/program/compositor.lux index b2a5f4d15..55da4161b 100644 --- a/stdlib/source/program/compositor.lux +++ b/stdlib/source/program/compositor.lux @@ -40,8 +40,9 @@ [phase [extension {"+" Extender}]]]] [meta - ["[0]" cli {"+" Service}] [packager {"+" Packager}] + ["[0]" cli {"+" Service}] + ["[0]" export] [archive {"+" Archive} ["[0]" unit] [module @@ -52,7 +53,6 @@ ]]] ["[0]" / "_" ["[1][0]" static {"+" Static}] - ["[1][0]" export] ["[1][0]" import]]) (def: (or_crash! failure_description action) @@ -185,8 +185,8 @@ {cli.#Export export} (<| (or_crash! "Export failed:") (do (try.with async.monad) - [_ (/export.export (value@ platform.#&file_system platform) - export)] + [_ (export.export (value@ platform.#&file_system platform) + export)] (in (debug.log! "Export complete!")))) {cli.#Interpretation interpretation} diff --git a/stdlib/source/program/compositor/export.lux b/stdlib/source/program/compositor/export.lux deleted file mode 100644 index 4ac08f423..000000000 --- a/stdlib/source/program/compositor/export.lux +++ /dev/null @@ -1,71 +0,0 @@ -(.using - [library - [lux {"-" Source} - [abstract - ["[0]" monad {"+" do}]] - [control - ["[0]" try {"+" Try}] - [concurrency - ["[0]" async {"+" Async}]]] - [data - ["[0]" text - ["%" format {"+" format}]] - [collection - ["[0]" dictionary] - ["[0]" sequence]] - [format - ["[0]" binary] - ["[0]" tar]]] - [time - ["[0]" instant]] - [tool - [compiler - [meta - [cli {"+" Source Export}] - ["[0]" io "_" - ["[1]" context {"+" Extension}]]]]] - [world - ["[0]" file]]]]) - -(def: file - "library.tar") - -(def: no_ownership - tar.Ownership - (let [commons (: tar.Owner - [tar.#name tar.anonymous - tar.#id tar.no_id])] - [tar.#user commons - tar.#group commons])) - -(def: .public (library fs sources) - (-> (file.System Async) (List Source) (Async (Try tar.Tar))) - (do (try.with async.monad) - [files (io.listing fs sources)] - (|> (dictionary.entries files) - (monad.each try.monad - (function (_ [path source_code]) - (do try.monad - [path (|> path - (text.replaced (# fs separator) .module_separator) - tar.path) - source_code (tar.content source_code)] - (in {tar.#Normal [path - (instant.of_millis +0) - ($_ tar.and - tar.read_by_owner tar.write_by_owner - tar.read_by_group tar.write_by_group - tar.read_by_other) - ..no_ownership - source_code]})))) - (# try.monad each sequence.of_list) - (# async.monad in)))) - -(def: .public (export fs [sources target]) - (-> (file.System Async) Export (Async (Try Any))) - (do [! (try.with async.monad)] - [tar (# ! each (binary.result tar.writer) - (..library fs sources))] - (|> ..file - (format target (# fs separator)) - (# fs write tar)))) |