aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/tool
diff options
context:
space:
mode:
authorEduardo Julian2020-05-12 20:23:24 -0400
committerEduardo Julian2020-05-12 20:23:24 -0400
commitf605537d91450b347ce70eb2c5edff9674e72044 (patch)
treef05a8c50f9db34d889a353951ebaa96761d96918 /stdlib/source/lux/tool
parent33090b088deb20180108e6713309e0dfc627c6e5 (diff)
Compiler versions are now natural numbers, and are included as part of the names/paths of artifacts.
Diffstat (limited to 'stdlib/source/lux/tool')
-rw-r--r--stdlib/source/lux/tool/compiler/language/lux/analysis.lux5
-rw-r--r--stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux7
-rw-r--r--stdlib/source/lux/tool/compiler/language/lux/version.lux4
-rw-r--r--stdlib/source/lux/tool/compiler/meta.lux4
-rw-r--r--stdlib/source/lux/tool/compiler/meta/archive.lux14
-rw-r--r--stdlib/source/lux/tool/compiler/meta/archive/signature.lux12
-rw-r--r--stdlib/source/lux/tool/compiler/meta/io/archive.lux17
-rw-r--r--stdlib/source/lux/tool/compiler/version.lux3
8 files changed, 42 insertions, 24 deletions
diff --git a/stdlib/source/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/lux/tool/compiler/language/lux/analysis.lux
index 59a1cf2eb..27bc09652 100644
--- a/stdlib/source/lux/tool/compiler/language/lux/analysis.lux
+++ b/stdlib/source/lux/tool/compiler/language/lux/analysis.lux
@@ -20,6 +20,7 @@
["." extension (#+ Extension)]]
[///
[arity (#+ Arity)]
+ [version (#+ Version)]
["." reference (#+ Register Variable Reference)]
["." phase]]])
@@ -387,9 +388,9 @@
#.var-bindings (list)})
(def: #export (info version host)
- (-> Text Text Info)
+ (-> Version Text Info)
{#.target host
- #.version version
+ #.version (%.nat version)
#.mode #.Build})
(def: #export (state info)
diff --git a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux
index e08a6219f..304629c6f 100644
--- a/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux
+++ b/stdlib/source/lux/tool/compiler/language/lux/phase/generation/jvm/runtime.lux
@@ -51,7 +51,7 @@
["#" phase]
[arity (#+ Arity)]
[reference (#+ Register)]
- [meta
+ ["." meta
[io (#+ lux-context)]
[archive (#+ Archive)]]]]]])
@@ -79,7 +79,10 @@
(def: #export (class-name [module id])
(-> generation.Context Text)
- (format lux-context "/" (%.nat module) "/" (%.nat id)))
+ (format lux-context
+ "/" (%.nat meta.version)
+ "/" (%.nat module)
+ "/" (%.nat id)))
(def: #export class (type.class "LuxRuntime" (list)))
diff --git a/stdlib/source/lux/tool/compiler/language/lux/version.lux b/stdlib/source/lux/tool/compiler/language/lux/version.lux
index 013cdc72e..53b3424ae 100644
--- a/stdlib/source/lux/tool/compiler/language/lux/version.lux
+++ b/stdlib/source/lux/tool/compiler/language/lux/version.lux
@@ -3,4 +3,6 @@
[////
[version (#+ Version)]])
-(def: #export version Version "0.6.0")
+(def: #export version
+ Version
+ 00,06,00)
diff --git a/stdlib/source/lux/tool/compiler/meta.lux b/stdlib/source/lux/tool/compiler/meta.lux
index dfa57dd4c..df3eb31a7 100644
--- a/stdlib/source/lux/tool/compiler/meta.lux
+++ b/stdlib/source/lux/tool/compiler/meta.lux
@@ -3,4 +3,6 @@
[//
[version (#+ Version)]])
-(def: #export version Version "0.1.0")
+(def: #export version
+ Version
+ 00,01,00)
diff --git a/stdlib/source/lux/tool/compiler/meta/archive.lux b/stdlib/source/lux/tool/compiler/meta/archive.lux
index f95d713a4..37b47777d 100644
--- a/stdlib/source/lux/tool/compiler/meta/archive.lux
+++ b/stdlib/source/lux/tool/compiler/meta/archive.lux
@@ -13,12 +13,12 @@
[binary (#+ Binary)]
["." product]
["." name]
- ["." text ("#@." equivalence)
+ ["." text
["%" format (#+ format)]]
[format
["." binary (#+ Writer)]]
[number
- ["n" nat]]
+ ["n" nat ("#@." equivalence)]]
[collection
["." list ("#@." functor fold)]
["." dictionary (#+ Dictionary)]
@@ -196,14 +196,14 @@
(def: reader
(Parser ..Frozen)
($_ <>.and
- <b>.text
+ <b>.nat
<b>.nat
(<b>.list (<>.and <b>.text <b>.nat))))
(def: writer
(Writer ..Frozen)
($_ binary.and
- binary.text
+ binary.nat
binary.nat
(binary.list (binary.and binary.text binary.nat))))
@@ -221,8 +221,8 @@
(exception: #export (version-mismatch {expected Version} {actual Version})
(exception.report
- ["Expected" (%.text expected)]
- ["Actual" (%.text actual)]))
+ ["Expected" (%.nat expected)]
+ ["Actual" (%.nat actual)]))
(exception: #export corrupt-data)
@@ -252,7 +252,7 @@
(do try.monad
[[actual next reservations] (<b>.run ..reader binary)
_ (exception.assert ..version-mismatch [expected actual]
- (text@= expected actual))
+ (n@= expected actual))
_ (exception.assert ..corrupt-data []
(correct-reservations? reservations))]
(wrap (:abstraction
diff --git a/stdlib/source/lux/tool/compiler/meta/archive/signature.lux b/stdlib/source/lux/tool/compiler/meta/archive/signature.lux
index 3d795ff50..95bfc166b 100644
--- a/stdlib/source/lux/tool/compiler/meta/archive/signature.lux
+++ b/stdlib/source/lux/tool/compiler/meta/archive/signature.lux
@@ -10,7 +10,9 @@
["." text
["%" format (#+ format)]]
[format
- ["." binary (#+ Writer)]]]]
+ ["." binary (#+ Writer)]]
+ [number
+ ["." nat]]]]
[////
[version (#+ Version)]])
@@ -20,18 +22,18 @@
(def: #export equivalence
(Equivalence Signature)
- (equivalence.product name.equivalence text.equivalence))
+ (equivalence.product name.equivalence nat.equivalence))
(def: #export (description signature)
(-> Signature Text)
- (format (%.name (get@ #name signature)) " " (get@ #version signature)))
+ (format (%.name (get@ #name signature)) " " (%.nat (get@ #version signature))))
(def: #export writer
(Writer Signature)
(binary.and (binary.and binary.text binary.text)
- binary.text))
+ binary.nat))
(def: #export parser
(Parser Signature)
(<>.and (<>.and <b>.text <b>.text)
- <b>.text))
+ <b>.nat))
diff --git a/stdlib/source/lux/tool/compiler/meta/io/archive.lux b/stdlib/source/lux/tool/compiler/meta/io/archive.lux
index 3cf3ed4c4..ef73d321d 100644
--- a/stdlib/source/lux/tool/compiler/meta/io/archive.lux
+++ b/stdlib/source/lux/tool/compiler/meta/io/archive.lux
@@ -48,23 +48,29 @@
["Module ID" (%.nat module-id)]
["Error" error]))
-(def: #export (archive system host root)
+(def: (archive system host root)
(-> (file.System Promise) Host Path Path)
(format root (:: system separator) host))
-(def: #export (lux-archive system host root)
+(def: (unversioned-lux-archive system host root)
(-> (file.System Promise) Host Path Path)
(format (..archive system host root)
(:: system separator)
//.lux-context))
+(def: (versioned-lux-archive system host root)
+ (-> (file.System Promise) Host Path Path)
+ (format (..unversioned-lux-archive system host root)
+ (:: system separator)
+ (%.nat ///.version)))
+
(def: (module system host root module-id)
(-> (file.System Promise) Host Path archive.ID Path)
- (format (..lux-archive system host root)
+ (format (..versioned-lux-archive system host root)
(:: system separator)
(%.nat module-id)))
-(def: #export (artifact system host root module-id name extension)
+(def: (artifact system host root module-id name extension)
(-> (file.System Promise) Host Path archive.ID Text Text Path)
(format (..module system host root module-id)
(:: system separator)
@@ -79,7 +85,8 @@
(if module-exists?
(wrap (#try.Success []))
(do @
- [_ (file.get-directory @ system (..lux-archive system host root))
+ [_ (file.get-directory @ system (..unversioned-lux-archive system host root))
+ _ (file.get-directory @ system (..versioned-lux-archive system host root))
outcome (!.use (:: system create-directory) module)]
(case outcome
(#try.Success output)
diff --git a/stdlib/source/lux/tool/compiler/version.lux b/stdlib/source/lux/tool/compiler/version.lux
index d2c14c50b..3965b9b28 100644
--- a/stdlib/source/lux/tool/compiler/version.lux
+++ b/stdlib/source/lux/tool/compiler/version.lux
@@ -1,4 +1,5 @@
(.module:
[lux #*])
-(type: #export Version Text)
+(type: #export Version
+ Nat)