diff options
32 files changed, 114 insertions, 66 deletions
diff --git a/documentation/bookmark/database.md b/documentation/bookmark/database.md index e3c5055cf..8441522df 100644 --- a/documentation/bookmark/database.md +++ b/documentation/bookmark/database.md @@ -197,6 +197,7 @@ 1. https://juxt.pro/crux/docs/index.html 1. https://github.com/juxt/crux 1. [The Crux of Bitemporality - Jon Pither](https://www.youtube.com/watch?v=3Stja6YUB94) +1. [Bitemporality: More Than a Design Pattern](https://juxt.pro/blog/bitemporality-more-than-a-design-pattern) ## Column diff --git a/documentation/bookmark/dec64.md b/documentation/bookmark/dec64.md new file mode 100644 index 000000000..3ac7c3eec --- /dev/null +++ b/documentation/bookmark/dec64.md @@ -0,0 +1,4 @@ +# Reference + +1. [DEC64: Decimal Floating Point](https://www.crockford.com/dec64.html) + diff --git a/documentation/bookmark/Graphics.md b/documentation/bookmark/graphics.md index 5438adeff..5a1abe21c 100644 --- a/documentation/bookmark/Graphics.md +++ b/documentation/bookmark/graphics.md @@ -2,4 +2,5 @@ 1. [Einar Høst - Composition by Juxtaposition: A PostScript on Functional Geometry - Lambda Days 2020](https://www.youtube.com/watch?v=GvTh0MmVPQI) 1. [Functional geometry](https://dl.acm.org/doi/10.1145/800068.802148) +1. [Bresenham's Circle Drawing Algorithm](https://funloop.org/post/2021-03-15-bresenham-circle-drawing-algorithm.html) diff --git a/documentation/bookmark/math.md b/documentation/bookmark/math.md index 6f40b8fee..f50c1fc50 100644 --- a/documentation/bookmark/math.md +++ b/documentation/bookmark/math.md @@ -1,3 +1,7 @@ +# Ball arithmetic + +1. [Ball arithmetic](http://www.texmacs.org/joris/ball/ball.html) + # Arithmetic 1. [The Definitive Higher Math Guide on Integer Long Division (and Its Variants)](https://mathvault.ca/long-division/) @@ -327,6 +331,7 @@ # Knot theory +1. [KNOT THEORY and ITS APPLICATIONS](https://www.maths.ed.ac.uk/~v1ranick/papers/murasug3.pdf) 1. [Primes and Knots - Akshay Venkatesh](https://www.youtube.com/watch?v=jvoYgNYKyk0) 1. [The Knot Book](http://math.harvard.edu/~ctm/home/text/books/adams/knot_book/knot_book.pdf) diff --git a/documentation/bookmark/music.md b/documentation/bookmark/music.md new file mode 100644 index 000000000..e4a6124d2 --- /dev/null +++ b/documentation/bookmark/music.md @@ -0,0 +1,4 @@ +# Reference + +1. [Open Music Theory](http://openmusictheory.com/) + diff --git a/documentation/bookmark/Optimization.md b/documentation/bookmark/optimization.md index 289980282..f94497546 100644 --- a/documentation/bookmark/Optimization.md +++ b/documentation/bookmark/optimization.md @@ -12,6 +12,7 @@ # Reference +1. [Inline caching](https://bernsteinbear.com/blog/inline-caching/) 1. [Weird and Wonderful Division Tricks](https://saml98.github.io/jekyll/update/2020/02/21/weird-division.htmls) 1. [Towards a Domain-Extensible Compiler: Optimizingan Image Processing Pipeline on Mobile CPUs](https://thok.eu/publications/2021/cgo.pdf) 1. [Compiler Detection of Function Call Side Effects](https://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=B3D92D05C88C3D9C165785594350C169?doi=10.1.1.70.2096&rep=rep1&type=pdf) @@ -37,4 +38,5 @@ 1. https://nfrechette.github.io/2019/05/08/sign_flip_optimization/ 1. https://grin-tech.github.io/ 1. [Loop Optimizations in LLVM - Michael Kruse](https://www.youtube.com/watch?v=oAPgGYr8T3Y) +1. [Don’t think, just defunctionalize](https://www.joachim-breitner.de/blog/778-Don%E2%80%99t_think%2C_just_defunctionalize) diff --git a/documentation/bookmark/Security.md b/documentation/bookmark/security.md index 4ea9b1b46..6809cd624 100644 --- a/documentation/bookmark/Security.md +++ b/documentation/bookmark/security.md @@ -60,6 +60,8 @@ # Reference +1. https://www.nomoreransom.org/en/index.html +1. [Open Source Security Foundation (OpenSSF)](https://openssf.org/) 1. [Don't get pwned: practicing the principle of least privilege](https://cloud.google.com/blog/products/identity-security/dont-get-pwned-practicing-the-principle-of-least-privilege) 1. [Good Practices for Capability URLs](https://www.w3.org/TR/capability-urls/) 1. [Secure Socket API](https://securesocketapi.org/) diff --git a/documentation/bookmark/text_editor & ide.md b/documentation/bookmark/text_editor & ide.md index 8ffbb5bb9..62e953e7b 100644 --- a/documentation/bookmark/text_editor & ide.md +++ b/documentation/bookmark/text_editor & ide.md @@ -50,6 +50,7 @@ # Reference +1. [Build Your Own Text Editor](https://viewsourcecode.org/snaptoken/kilo/index.html) 1. [On the design of text editors](https://arxiv.org/abs/2008.06030) 1. [The Piece Table - the Unsung Hero of Your Text Editor](https://darrenburns.net/posts/piece-table/) 1. [Build Your Own Text Editor](https://viewsourcecode.org/snaptoken/kilo/) diff --git a/documentation/bookmark/tool/Search.md b/documentation/bookmark/tool/Search.md deleted file mode 100644 index 323f9e8bb..000000000 --- a/documentation/bookmark/tool/Search.md +++ /dev/null @@ -1,4 +0,0 @@ -# Semantic search - -1. https://github.com/returntocorp/semgrep - diff --git a/documentation/bookmark/tool/search.md b/documentation/bookmark/tool/search.md new file mode 100644 index 000000000..edc2a2df6 --- /dev/null +++ b/documentation/bookmark/tool/search.md @@ -0,0 +1,6 @@ +# Semantic search + +1. [The SOUL program query language](http://soft.vub.ac.be/SOUL/) +1. [Git - how do I view the change history of a method/function?](https://stackoverflow.com/questions/4781405/git-how-do-i-view-the-change-history-of-a-method-function) +1. https://github.com/returntocorp/semgrep + diff --git a/documentation/bookmark/Type theory/Cost analysis.md b/documentation/bookmark/type_theory/cost_analysis.md index 6e92c792e..6e92c792e 100644 --- a/documentation/bookmark/Type theory/Cost analysis.md +++ b/documentation/bookmark/type_theory/cost_analysis.md diff --git a/documentation/bookmark/Type theory/Dependent types.md b/documentation/bookmark/type_theory/dependent_types.md index b2afc30bd..68fef10f3 100644 --- a/documentation/bookmark/Type theory/Dependent types.md +++ b/documentation/bookmark/type_theory/dependent_types.md @@ -5,6 +5,8 @@ # Reference +1. [From Scheme to Dependent Types in 100 lines by Gershom Bazerman (Part 1)](https://vimeo.com/134561872) +1. [From Scheme to Dependent Types in 100 Lines by Gershom Bazerman (Part 2)](https://vimeo.com/135746080) 1. [Program = Proof](http://www.lix.polytechnique.fr/Labo/Samuel.Mimram/teaching/INF551/course.pdf) 1. [Multimodal Dependent Type Theory](https://arxiv.org/abs/2011.15021) 1. [Thorsten Altenkirch - The power of Π - Lambda Days 2020](https://www.youtube.com/watch?v=3zT5eVHpQwA) diff --git a/documentation/bookmark/Type theory/Refinement.md b/documentation/bookmark/type_theory/refinement.md index f0d0a1f06..f0d0a1f06 100644 --- a/documentation/bookmark/Type theory/Refinement.md +++ b/documentation/bookmark/type_theory/refinement.md diff --git a/documentation/bookmark/Type theory/Row polymorphism.md b/documentation/bookmark/type_theory/row_polymorphism.md index 3194405ff..3194405ff 100644 --- a/documentation/bookmark/Type theory/Row polymorphism.md +++ b/documentation/bookmark/type_theory/row_polymorphism.md diff --git a/documentation/bookmark/Type theory/Type checking.md b/documentation/bookmark/type_theory/type_checking.md index d26019e88..d26019e88 100644 --- a/documentation/bookmark/Type theory/Type checking.md +++ b/documentation/bookmark/type_theory/type_checking.md diff --git a/stdlib/source/lux/control/concurrency/actor.lux b/stdlib/source/lux/control/concurrency/actor.lux index 584bf614e..f4d63c00f 100644 --- a/stdlib/source/lux/control/concurrency/actor.lux +++ b/stdlib/source/lux/control/concurrency/actor.lux @@ -81,11 +81,12 @@ (All [o s] (-> (Behavior o s) o (IO (Actor s)))) (io (let [[on_init on_mail] behavior self (:share [o s] - {(Behavior o s) - behavior} - {(Actor s) - (:abstraction {#obituary (promise.promise []) - #mailbox (atom (promise.promise []))})}) + (Behavior o s) + behavior + + (Actor s) + (:abstraction {#obituary (promise.promise []) + #mailbox (atom (promise.promise []))})) process (loop [state (on_init init) [|mailbox| _] (io.run (atom.read (get@ #mailbox (:representation self))))] (do {! promise.monad} @@ -159,11 +160,12 @@ (def: (mail message) (All [s o] (-> (Message s o) [(Promise (Try o)) (Mail s)])) (let [[promise resolve] (:share [s o] - {(Message s o) - message} - {[(Promise (Try o)) - (Resolver (Try o))] - (promise.promise [])})] + (Message s o) + message + + [(Promise (Try o)) + (Resolver (Try o))] + (promise.promise []))] [promise (function (_ state self) (do {! promise.monad} diff --git a/stdlib/source/lux/control/concurrency/frp.lux b/stdlib/source/lux/control/concurrency/frp.lux index 0c5303f46..868bc4153 100644 --- a/stdlib/source/lux/control/concurrency/frp.lux +++ b/stdlib/source/lux/control/concurrency/frp.lux @@ -58,11 +58,12 @@ (do {! io.monad} [current (atom.read sink) #let [[next resolve_next] (:share [a] - {(promise.Resolver (Maybe [a (Channel a)])) - current} - {[(Promise (Maybe [a (Channel a)])) - (promise.Resolver (Maybe [a (Channel a)]))] - (promise.promise [])})] + (promise.Resolver (Maybe [a (Channel a)])) + current + + [(Promise (Maybe [a (Channel a)])) + (promise.Resolver (Maybe [a (Channel a)]))] + (promise.promise []))] fed? (current (#.Some [value next]))] (if fed? ## I fed the sink. diff --git a/stdlib/source/lux/control/parser/binary.lux b/stdlib/source/lux/control/parser/binary.lux index 1dcba78cb..423cff74f 100644 --- a/stdlib/source/lux/control/parser/binary.lux +++ b/stdlib/source/lux/control/parser/binary.lux @@ -188,10 +188,11 @@ <bits>)] (loop [index 0 output (:share [v] - {(Parser v) - valueP} - {(Row v) - row.empty})] + (Parser v) + valueP + + (Row v) + row.empty)] (if (n.< count index) (do //.monad [value valueP] diff --git a/stdlib/source/lux/data/collection/queue/priority.lux b/stdlib/source/lux/data/collection/queue/priority.lux index 0f2b1e039..b7f971dd2 100644 --- a/stdlib/source/lux/data/collection/queue/priority.lux +++ b/stdlib/source/lux/data/collection/queue/priority.lux @@ -25,8 +25,9 @@ (def: :@: (:by_example [@] - {(tree.Builder @ Priority) - ..builder} + (tree.Builder @ Priority) + ..builder + @)) (abstract: #export (Queue a) diff --git a/stdlib/source/lux/data/collection/tree/finger.lux b/stdlib/source/lux/data/collection/tree/finger.lux index 96f7af432..ae30c294a 100644 --- a/stdlib/source/lux/data/collection/tree/finger.lux +++ b/stdlib/source/lux/data/collection/tree/finger.lux @@ -6,7 +6,7 @@ [data [collection ["." list ("#\." monoid)]]] - [type (#+ :by_example) + [type [abstract (#+ abstract: :abstraction :representation)]]]) (abstract: #export (Tree @ t v) diff --git a/stdlib/source/lux/data/text/unicode/set.lux b/stdlib/source/lux/data/text/unicode/set.lux index 1ac443d1a..c7b5748e4 100644 --- a/stdlib/source/lux/data/text/unicode/set.lux +++ b/stdlib/source/lux/data/text/unicode/set.lux @@ -20,8 +20,9 @@ (def: :@: (:by_example [@] - {(tree.Builder @ Block) - ..builder} + (tree.Builder @ Block) + ..builder + @)) (abstract: #export Set diff --git a/stdlib/source/lux/math/number/i16.lux b/stdlib/source/lux/math/number/i16.lux index 9168b5925..ba4f9cd02 100644 --- a/stdlib/source/lux/math/number/i16.lux +++ b/stdlib/source/lux/math/number/i16.lux @@ -10,10 +10,12 @@ (def: sub (maybe.assume (i64.sub 16))) -(def: #export I16 (:by_example [size] - {(Sub size) - ..sub} - (I64 size))) +(def: #export I16 + (:by_example [size] + (Sub size) + ..sub + + (I64 size))) (def: #export equivalence (Equivalence I16) (\ ..sub &equivalence)) (def: #export width Nat (\ ..sub width)) diff --git a/stdlib/source/lux/math/number/i32.lux b/stdlib/source/lux/math/number/i32.lux index 3a1811b81..9141c175d 100644 --- a/stdlib/source/lux/math/number/i32.lux +++ b/stdlib/source/lux/math/number/i32.lux @@ -10,10 +10,12 @@ (def: sub (maybe.assume (i64.sub 32))) -(def: #export I32 (:by_example [size] - {(Sub size) - ..sub} - (I64 size))) +(def: #export I32 + (:by_example [size] + (Sub size) + ..sub + + (I64 size))) (def: #export equivalence (Equivalence I32) (\ ..sub &equivalence)) (def: #export width Nat (\ ..sub width)) diff --git a/stdlib/source/lux/math/number/i8.lux b/stdlib/source/lux/math/number/i8.lux index bea35ff22..d6184315c 100644 --- a/stdlib/source/lux/math/number/i8.lux +++ b/stdlib/source/lux/math/number/i8.lux @@ -10,10 +10,12 @@ (def: sub (maybe.assume (i64.sub 8))) -(def: #export I8 (:by_example [size] - {(Sub size) - ..sub} - (I64 size))) +(def: #export I8 + (:by_example [size] + (Sub size) + ..sub + + (I64 size))) (def: #export equivalence (Equivalence I8) (\ ..sub &equivalence)) (def: #export width Nat (\ ..sub width)) diff --git a/stdlib/source/lux/tool/compiler/meta/archive/document.lux b/stdlib/source/lux/tool/compiler/meta/archive/document.lux index a8c656ff9..b60d77246 100644 --- a/stdlib/source/lux/tool/compiler/meta/archive/document.lux +++ b/stdlib/source/lux/tool/compiler/meta/archive/document.lux @@ -6,7 +6,7 @@ ["." try (#+ Try)] ["." exception (#+ exception:)] ["<>" parser - ["<b>" binary (#+ Parser)]]] + [binary (#+ Parser)]]] [data [collection ["." dictionary (#+ Dictionary)]] @@ -35,10 +35,11 @@ (key.signature key) document//signature) (#try.Success (:share [e] - {(Key e) - key} - {e - (:assume document//content)})) + (Key e) + key + + e + (:assume document//content))) (exception.throw ..invalid-signature [(key.signature key) document//signature])))) diff --git a/stdlib/source/lux/type.lux b/stdlib/source/lux/type.lux index 77060876f..72375519d 100644 --- a/stdlib/source/lux/type.lux +++ b/stdlib/source/lux/type.lux @@ -414,7 +414,7 @@ (def: typed (Parser Typed) - (<c>.record (<>.and <c>.any <c>.any))) + (<>.and <c>.any <c>.any)) ## TODO: Make sure the generated code always gets optimized away. (syntax: #export (:share {type_vars ..type_parameters} @@ -433,7 +433,9 @@ {extraction <c>.any}) (wrap (list (` (:of ((~! :share) [(~+ (list\map code.local_identifier type_vars))] - {(~ (get@ #type exemplar)) - (~ (get@ #expression exemplar))} - {(~ extraction) - (:assume [])})))))) + + (~ (get@ #type exemplar)) + (~ (get@ #expression exemplar)) + + (~ extraction) + (:assume []))))))) diff --git a/stdlib/source/lux/type/quotient.lux b/stdlib/source/lux/type/quotient.lux index 8db23a9a2..f85f8b56c 100644 --- a/stdlib/source/lux/type/quotient.lux +++ b/stdlib/source/lux/type/quotient.lux @@ -42,8 +42,10 @@ (with_gensyms [g!t g!c g!%] (wrap (list (` ((~! type.:by_example) [(~ g!t) (~ g!c) (~ g!%)] - {(..Class (~ g!t) (~ g!c) (~ g!%)) - (~ class)} + + (..Class (~ g!t) (~ g!c) (~ g!%)) + (~ class) + (..Quotient (~ g!t) (~ g!c) (~ g!%)))))))) (structure: #export (equivalence super) diff --git a/stdlib/source/lux/type/refinement.lux b/stdlib/source/lux/type/refinement.lux index f99c9216c..5bbc90149 100644 --- a/stdlib/source/lux/type/refinement.lux +++ b/stdlib/source/lux/type/refinement.lux @@ -82,6 +82,7 @@ (syntax: #export (type refiner) (macro.with_gensyms [g!t g!%] (wrap (list (` ((~! type.:by_example) [(~ g!t) (~ g!%)] - {(..Refiner (~ g!t) (~ g!%)) - (~ refiner)} + (..Refiner (~ g!t) (~ g!%)) + (~ refiner) + (..Refined (~ g!t) (~ g!%)))))))) diff --git a/stdlib/source/test/lux/control/region.lux b/stdlib/source/test/lux/control/region.lux index 1023822ea..3fb0d1d82 100644 --- a/stdlib/source/test/lux/control/region.lux +++ b/stdlib/source/test/lux/control/region.lux @@ -59,15 +59,17 @@ (Comparison (All [a] (All [! r] (Region r (Thread !) a)))) (function (_ == left right) (case [(:share [a] - {(Equivalence a) - ==} - {(Try a) - (thread.run (:assume (/.run thread.monad left)))}) + (Equivalence a) + == + + (Try a) + (thread.run (:assume (/.run thread.monad left)))) (:share [a] - {(Equivalence a) - ==} - {(Try a) - (thread.run (:assume (/.run thread.monad right)))})] + (Equivalence a) + == + + (Try a) + (thread.run (:assume (/.run thread.monad right))))] [(#try.Success left) (#try.Success right)] (== left right) diff --git a/stdlib/source/test/lux/data/collection/tree/finger.lux b/stdlib/source/test/lux/data/collection/tree/finger.lux index 33b333396..55c3d9118 100644 --- a/stdlib/source/test/lux/data/collection/tree/finger.lux +++ b/stdlib/source/test/lux/data/collection/tree/finger.lux @@ -21,8 +21,9 @@ (def: :@: (:by_example [@] - {(/.Builder @ Text) - ..builder} + (/.Builder @ Text) + ..builder + @)) (def: #export test diff --git a/stdlib/source/test/lux/data/text/format.lux b/stdlib/source/test/lux/data/text/format.lux index 0f61caa1f..8b1e9a700 100644 --- a/stdlib/source/test/lux/data/text/format.lux +++ b/stdlib/source/test/lux/data/text/format.lux @@ -19,7 +19,7 @@ ["." json]] [collection ["." list ("#\." functor)]]] - [time + ["." time ["." instant] ["." duration] ["." date]] @@ -106,6 +106,7 @@ [/.instant instant.codec random.instant] [/.duration duration.codec random.duration] [/.date date.codec random.date] + [/.time time.codec random.time] [/.nat/2 nat.binary random.nat] [/.nat/8 nat.octal random.nat] diff --git a/stdlib/source/test/lux/type.lux b/stdlib/source/test/lux/type.lux index 0b3f3b4d8..b490469cf 100644 --- a/stdlib/source/test/lux/type.lux +++ b/stdlib/source/test/lux/type.lux @@ -164,7 +164,9 @@ #.None)] (/\= (.type (List Nat)) (/.:by_example [a] - {(Maybe a) example} + (Maybe a) + example + (List a))))) /abstract.test |