aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorEduardo Julian2021-06-08 13:26:10 -0400
committerEduardo Julian2021-06-08 13:26:10 -0400
commit512d7feeb915376c090aedaf64e8209689becd2a (patch)
tree065f4706fd9ab47de59fb2fb009a28aaaa508c91 /stdlib
parent52ee6639be048621776527380a1fe7eb51c055ab (diff)
Added type information when logging compiled definitions.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/source/lux/control/concurrency/thread.lux14
-rw-r--r--stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux8
-rw-r--r--stdlib/source/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux10
-rw-r--r--stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux5
4 files changed, 23 insertions, 14 deletions
diff --git a/stdlib/source/lux/control/concurrency/thread.lux b/stdlib/source/lux/control/concurrency/thread.lux
index 4afa4dde3..daeb38a63 100644
--- a/stdlib/source/lux/control/concurrency/thread.lux
+++ b/stdlib/source/lux/control/concurrency/thread.lux
@@ -13,7 +13,9 @@
[math
[number
["n" nat]
- ["f" frac]]]]
+ ["f" frac]]]
+ [time
+ ["." instant]]]
[//
["." atom (#+ Atom)]])
@@ -117,7 +119,10 @@
## Default
(do io.monad
- [_ (atom.update (|>> (#.Cons {#creation (.nat ("lux io current-time"))
+ [_ (atom.update (|>> (#.Cons {#creation (|> instant.now
+ io.run
+ instant.to_millis
+ .nat)
#delay milli_seconds
#action action}))
..runner)]
@@ -143,7 +148,10 @@
_
(do !
- [#let [now (.nat ("lux io current-time"))
+ [#let [now (|> instant.now
+ io.run
+ instant.to_millis
+ .nat)
[ready pending] (list.partition (function (_ thread)
(|> (get@ #creation thread)
(n.+ (get@ #delay thread))
diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux
index 603abc6ec..19aea38fa 100644
--- a/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux
+++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/analysis/php.lux
@@ -1,6 +1,6 @@
(.module:
[lux #*
- ["." host]
+ ["." ffi]
[abstract
["." monad (#+ do)]]
[control
@@ -107,15 +107,15 @@
)))
(def: Null
- (for {@.php host.Null}
+ (for {@.php ffi.Null}
Any))
(def: Object
- (for {@.php (type (host.Object Any))}
+ (for {@.php (type (ffi.Object Any))}
Any))
(def: Function
- (for {@.php host.Function}
+ (for {@.php ffi.Function}
Any))
(def: object::new
diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux
index 458b6bcd5..265b0aef5 100644
--- a/stdlib/source/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux
+++ b/stdlib/source/lux/tool/compiler/language/lux/phase/extension/directive/lux.lux
@@ -209,11 +209,11 @@
[(///analysis.bundle eval host_analysis)]))
state)])))
-(def: (announce_definition! name)
+(def: (announce_definition! name type)
(All [anchor expression directive]
- (-> Name (Operation anchor expression directive Any)))
+ (-> Name Type (Operation anchor expression directive Any)))
(/////directive.lift_generation
- (/////generation.log! (format "Definition " (%.name name)))))
+ (/////generation.log! (format "Definition " (%.name name) " : " (%.type type)))))
(def: (lux::def expander host_analysis)
(-> Expander /////analysis.Bundle Handler)
@@ -229,7 +229,7 @@
_ (/////directive.lift_analysis
(module.define short_name (#.Right [exported? type (:coerce Code annotations) value])))
_ (..refresh expander host_analysis)
- _ (..announce_definition! full_name)]
+ _ (..announce_definition! full_name type)]
(wrap /////directive.no_requirements))
_
@@ -252,7 +252,7 @@
[_ (module.define short_name (#.Right [exported? type annotations value]))]
(module.declare_tags tags exported? (:coerce Type value))))
_ (..refresh expander host_analysis)
- _ (..announce_definition! full_name)]
+ _ (..announce_definition! full_name type)]
(wrap /////directive.no_requirements)))]))
(def: imports
diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux
index d5e831e09..304b79bdb 100644
--- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux
+++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/php/runtime.lux
@@ -11,7 +11,8 @@
["." product]
["." text ("#\." hash)
["%" format (#+ format)]
- ["." encoding]]
+ [encoding
+ ["." utf8]]]
[collection
["." list ("#\." functor)]
["." row]]]
@@ -605,4 +606,4 @@
(row.row [(%.nat ..module_id)
(|> ..runtime
_.code
- (\ encoding.utf8 encode))])])))
+ (\ utf8.codec encode))])])))