aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/tool/compiler
diff options
context:
space:
mode:
authorEduardo Julian2022-04-05 18:32:42 -0400
committerEduardo Julian2022-04-05 18:32:42 -0400
commit60daee098f92a44c3b404a9f5801f2e8126ad650 (patch)
tree7b58d0f6f937b8be5dcb46eaf0411f7961907c8a /stdlib/source/library/lux/tool/compiler
parenta2d994a3f7a39964452df7523f69e16b10b266f9 (diff)
No longer depending on the ASM library for JVM bytecode generation.
Diffstat (limited to 'stdlib/source/library/lux/tool/compiler')
-rw-r--r--stdlib/source/library/lux/tool/compiler/default/platform.lux22
-rw-r--r--stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux40
2 files changed, 34 insertions, 28 deletions
diff --git a/stdlib/source/library/lux/tool/compiler/default/platform.lux b/stdlib/source/library/lux/tool/compiler/default/platform.lux
index 1facd15f6..9201b9cc2 100644
--- a/stdlib/source/library/lux/tool/compiler/default/platform.lux
+++ b/stdlib/source/library/lux/tool/compiler/default/platform.lux
@@ -115,10 +115,8 @@
(let [system (the #&file_system platform)
write_artifact! (is (-> [artifact.ID (Maybe Text) Binary] (Action Any))
(function (_ [artifact_id custom content])
- (with_expansions [<it> (cache/artifact.cache! system context @module artifact_id content)]
- (for @.old (as (Async (Try Any))
- <it>)
- <it>))))]
+ (is (Async (Try Any))
+ (cache/artifact.cache! system context @module artifact_id content))))]
(do [! ..monad]
[_ (is (Async (Try Any))
(cache/module.enable! async.monad system context @module))
@@ -135,15 +133,13 @@
(is (Action (List Any)))))
document (# async.monad in
(document.marked? key (the [archive.#module module.#document] entry)))]
- (with_expansions [<it> (|> [(|> entry
- (the archive.#module)
- (has module.#document document))
- (the archive.#registry entry)]
- (_.result (..writer format))
- (cache/module.cache! system context @module))]
- (for @.old (as (Async (Try Any))
- <it>)
- <it>)))))
+ (is (Async (Try Any))
+ (|> [(|> entry
+ (the archive.#module)
+ (has module.#document document))
+ (the archive.#registry entry)]
+ (_.result (..writer format))
+ (cache/module.cache! system context @module))))))
... TODO: Inline ASAP
(def: initialize_buffer!
diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux
index f07d818d5..fa87792da 100644
--- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux
+++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/python.lux
@@ -9,7 +9,7 @@
["<[0]>" code {"+" Parser}]]]
[data
[collection
- ["[0]" array {"+" Array}]
+ ["[0]" array]
["[0]" dictionary]
["[0]" list]]]
["[0]" type
@@ -32,11 +32,13 @@
[<code>.any
(function (_ extension phase archive lengthC)
(<| analysis/type.with_var
- (function (_ [@var :var:]))
+ (function (_ [@read :read:]))
+ analysis/type.with_var
+ (function (_ [@write :write:]))
(do phase.monad
[lengthA (analysis/type.expecting Nat
(phase archive lengthC))
- _ (analysis/type.inference (type (Array :var:)))]
+ _ (analysis/type.inference (type (array.Array' :read: :write:)))]
(in {analysis.#Extension extension (list lengthA)}))))]))
(def: array::length
@@ -45,9 +47,11 @@
[<code>.any
(function (_ extension phase archive arrayC)
(<| analysis/type.with_var
- (function (_ [@var :var:]))
+ (function (_ [@read :read:]))
+ analysis/type.with_var
+ (function (_ [@write :write:]))
(do phase.monad
- [arrayA (analysis/type.expecting (type (Array :var:))
+ [arrayA (analysis/type.expecting (type (array.Array' :read: :write:))
(phase archive arrayC))
_ (analysis/type.inference Nat)]
(in {analysis.#Extension extension (list arrayA)}))))]))
@@ -58,13 +62,15 @@
[(<>.and <code>.any <code>.any)
(function (_ extension phase archive [indexC arrayC])
(<| analysis/type.with_var
- (function (_ [@var :var:]))
+ (function (_ [@read :read:]))
+ analysis/type.with_var
+ (function (_ [@write :write:]))
(do phase.monad
[indexA (analysis/type.expecting Nat
(phase archive indexC))
- arrayA (analysis/type.expecting (type (Array :var:))
+ arrayA (analysis/type.expecting (type (array.Array' :read: :write:))
(phase archive arrayC))
- _ (analysis/type.inference :var:)]
+ _ (analysis/type.inference :read:)]
(in {analysis.#Extension extension (list indexA arrayA)}))))]))
(def: array::write
@@ -73,15 +79,17 @@
[($_ <>.and <code>.any <code>.any <code>.any)
(function (_ extension phase archive [indexC valueC arrayC])
(<| analysis/type.with_var
- (function (_ [@var :var:]))
+ (function (_ [@read :read:]))
+ analysis/type.with_var
+ (function (_ [@write :write:]))
(do phase.monad
[indexA (analysis/type.expecting Nat
(phase archive indexC))
- valueA (analysis/type.expecting :var:
+ valueA (analysis/type.expecting :write:
(phase archive valueC))
- arrayA (analysis/type.expecting (type (Array :var:))
+ arrayA (analysis/type.expecting (type (array.Array' :read: :write:))
(phase archive arrayC))
- _ (analysis/type.inference (type (Array :var:)))]
+ _ (analysis/type.inference (type (array.Array' :read: :write:)))]
(in {analysis.#Extension extension (list indexA valueA arrayA)}))))]))
(def: array::delete
@@ -90,13 +98,15 @@
[($_ <>.and <code>.any <code>.any)
(function (_ extension phase archive [indexC arrayC])
(<| analysis/type.with_var
- (function (_ [@var :var:]))
+ (function (_ [@read :read:]))
+ analysis/type.with_var
+ (function (_ [@write :write:]))
(do phase.monad
[indexA (analysis/type.expecting Nat
(phase archive indexC))
- arrayA (analysis/type.expecting (type (Array :var:))
+ arrayA (analysis/type.expecting (type (array.Array' :read: :write:))
(phase archive arrayC))
- _ (analysis/type.inference (type (Array :var:)))]
+ _ (analysis/type.inference (type (array.Array' :read: :write:)))]
(in {analysis.#Extension extension (list indexA arrayA)}))))]))
(def: bundle::array