From ab9dc5fd656ef42dbb0192f96d34e1c7b451a430 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Fri, 4 Mar 2022 04:03:55 -0400 Subject: Keeping the JVM interop fixes coming... --- documentation/bookmark/Code mods.md | 9 - documentation/bookmark/analysis/static.md | 5 + documentation/bookmark/code/mod.md | 9 + documentation/bookmark/code/query.md | 5 + documentation/bookmark/concurrency/structured.md | 5 + documentation/bookmark/floating_point.md | 5 + .../bookmark/machine_learning/gradient.md | 4 + documentation/bookmark/operating_system.md | 357 +++++++++++---------- documentation/bookmark/optimization.md | 1 + documentation/bookmark/optimization/memoization.md | 5 + stdlib/source/library/lux/debug.lux | 16 +- .../source/library/lux/target/jvm/reflection.lux | 30 +- .../language/lux/phase/generation/jvm/case.lux | 14 +- .../language/lux/phase/generation/ruby/case.lux | 12 +- .../compiler/language/lux/phase/synthesis/case.lux | 40 ++- .../language/lux/phase/synthesis/variable.lux | 2 +- .../lux/tool/compiler/language/lux/synthesis.lux | 68 ++-- .../compiler/language/lux/synthesis/member.lux | 34 ++ .../lux/tool/compiler/meta/archive/registry.lux | 2 +- stdlib/source/library/lux/world/program.lux | 1 + stdlib/source/test/lux/control/parser.lux | 3 +- stdlib/source/test/lux/meta.lux | 17 +- .../source/test/lux/tool/compiler/meta/cache.lux | 4 +- .../test/lux/tool/compiler/meta/cache/archive.lux | 4 +- .../test/lux/tool/compiler/meta/cache/artifact.lux | 4 +- .../test/lux/tool/compiler/meta/cache/module.lux | 8 +- 26 files changed, 368 insertions(+), 296 deletions(-) delete mode 100644 documentation/bookmark/Code mods.md create mode 100644 documentation/bookmark/analysis/static.md create mode 100644 documentation/bookmark/code/mod.md create mode 100644 documentation/bookmark/code/query.md create mode 100644 documentation/bookmark/concurrency/structured.md create mode 100644 documentation/bookmark/machine_learning/gradient.md create mode 100644 documentation/bookmark/optimization/memoization.md create mode 100644 stdlib/source/library/lux/tool/compiler/language/lux/synthesis/member.lux diff --git a/documentation/bookmark/Code mods.md b/documentation/bookmark/Code mods.md deleted file mode 100644 index 88da7aae5..000000000 --- a/documentation/bookmark/Code mods.md +++ /dev/null @@ -1,9 +0,0 @@ -# Reference - -1. https://comby.dev/ -1. ["Parser Parser Combinators for Program Transformation" by Rijnard van Tonder](https://www.youtube.com/watch?v=JMZLBB_BFNg) -1. [Codemod](https://github.com/facebook/codemod) -1. [jscodeshift](https://github.com/facebook/jscodeshift) -1. [Writing codemods to transform your codebase](https://augustinlf.com/writing-codemods-to-transform-your-codebase/) -1. []() - diff --git a/documentation/bookmark/analysis/static.md b/documentation/bookmark/analysis/static.md new file mode 100644 index 000000000..b70b9f50d --- /dev/null +++ b/documentation/bookmark/analysis/static.md @@ -0,0 +1,5 @@ +# Reference + +0. [Software can literally be perfect](https://www.youtube.com/watch?v=Lf7ML_ErWvQ) +0. [Magmide](https://github.com/magmide/magmide) + diff --git a/documentation/bookmark/code/mod.md b/documentation/bookmark/code/mod.md new file mode 100644 index 000000000..88da7aae5 --- /dev/null +++ b/documentation/bookmark/code/mod.md @@ -0,0 +1,9 @@ +# Reference + +1. https://comby.dev/ +1. ["Parser Parser Combinators for Program Transformation" by Rijnard van Tonder](https://www.youtube.com/watch?v=JMZLBB_BFNg) +1. [Codemod](https://github.com/facebook/codemod) +1. [jscodeshift](https://github.com/facebook/jscodeshift) +1. [Writing codemods to transform your codebase](https://augustinlf.com/writing-codemods-to-transform-your-codebase/) +1. []() + diff --git a/documentation/bookmark/code/query.md b/documentation/bookmark/code/query.md new file mode 100644 index 000000000..4db580b7b --- /dev/null +++ b/documentation/bookmark/code/query.md @@ -0,0 +1,5 @@ +# Reference + +0. [Find bugs in your code with CodeQL](https://www.youtube.com/watch?v=y_-pIbsr7jc) +0. [CodeQL](https://codeql.github.com/) + diff --git a/documentation/bookmark/concurrency/structured.md b/documentation/bookmark/concurrency/structured.md new file mode 100644 index 000000000..0567167c2 --- /dev/null +++ b/documentation/bookmark/concurrency/structured.md @@ -0,0 +1,5 @@ +# Reference + +0. [Seamless, Fearless, and Structured Concurrency](https://verdagon.dev/blog/seamless-fearless-structured-concurrency) +0. [Handling user input with structured concurrency](https://dubroy.com/blog/handling-user-input-with-structured-concurrency/) + diff --git a/documentation/bookmark/floating_point.md b/documentation/bookmark/floating_point.md index 373dc13f9..c18d7fa7e 100644 --- a/documentation/bookmark/floating_point.md +++ b/documentation/bookmark/floating_point.md @@ -1,3 +1,8 @@ +# Parsing + +0. [fast_float number parsing library: 4x faster than strtod](https://github.com/fastfloat/fast_float) +0. [Fast float parsing in practice](https://lemire.me/blog/2020/03/10/fast-float-parsing-in-practice/) + # Precision 0. [Calcium](https://fredrikj.net/calcium/) diff --git a/documentation/bookmark/machine_learning/gradient.md b/documentation/bookmark/machine_learning/gradient.md new file mode 100644 index 000000000..1d1db6ddb --- /dev/null +++ b/documentation/bookmark/machine_learning/gradient.md @@ -0,0 +1,4 @@ +# Reference + +0. [Gradients without Backpropagation](https://arxiv.org/abs/2202.08587) + diff --git a/documentation/bookmark/operating_system.md b/documentation/bookmark/operating_system.md index b1fd5e452..9c96dbc5b 100644 --- a/documentation/bookmark/operating_system.md +++ b/documentation/bookmark/operating_system.md @@ -1,282 +1,283 @@ # Code-generation -1. [It’s Time for a Modern Synthesis Kernel](https://blog.regehr.org/archives/1676) +0. [It’s Time for a Modern Synthesis Kernel](https://blog.regehr.org/archives/1676) # Intepreter -1. [Jitk: A Trustworthy In-Kernel Interpreter Infrastructure](https://css.csail.mit.edu/jitk/) +0. [Jitk: A Trustworthy In-Kernel Interpreter Infrastructure](https://css.csail.mit.edu/jitk/) # Architecture -1. [TabulaROSA: Tabular Operating System Architecture for Massively Parallel Heterogeneous Compute Engines](https://arxiv.org/abs/1807.05308) +0. [TabulaROSA: Tabular Operating System Architecture for Massively Parallel Heterogeneous Compute Engines](https://arxiv.org/abs/1807.05308) # Graphics | Rendering -1. [Text Rendering Hates You](https://gankra.github.io/blah/text-hates-you/) -1. https://fuchsia.googlesource.com/garnet/+/master/docs/ui/scenic.md +0. [Text Rendering Hates You](https://gankra.github.io/blah/text-hates-you/) +0. https://fuchsia.googlesource.com/garnet/+/master/docs/ui/scenic.md # Exemplar ## Operating system -1. [CLOSOS: Specication of a Lisp operating system.](http://metamodular.com/lispos.pdf) -1. [CLOSOS: Specication of a Lisp operating system.](http://metamodular.com/closos.pdf) -1. https://medium.com/@jasonyuan/introducing-mercury-os-f4de45a04289 -1. http://lsneff.me/why-nebulet/ ||| https://github.com/nebulet/nebulet -1. http://exposnitc.github.io/index.html -1. https://www.gocosmos.org/ -1. http://www.microkernel.info/ -1. http://webosose.org/ -1. https://ostree.readthedocs.io/en/latest/manual/introduction/ -1. http://www.helenos.org/ -1. http://nixos.org/ -1. https://github.com/klange/toaruos -1. http://greenteapress.com/thinkos/ -1. http://kolibrios.org/en/ -1. http://menuetos.net/ -1. https://sailfishos.org/ -1. http://www.barrelfish.org/index.html -1. https://samypesse.gitbooks.io/how-to-create-an-operating-system/ -1. https://lumina-desktop.org/ -1. 2015 01 GNU Guix The Emacs of Distros &&& https://www.youtube.com/watch?v=AzebnJkfdvM -1. The Synthesis Kernel &&& https://www.usenix.org/legacy/publications/compsystems/1988/win_pu.pdf -1. http://zoo.cs.yale.edu/classes/cs422/pios -1. https://fuchsia.googlesource.com/docs/+/HEAD/book.md -1. https://externos.io/ -1. http://www.shadowdefender.com/ -1. https://pureos.net/ -1. http://progmp.net/ -1. http://www.uruk.org/emu/Taos.html -1. http://www.dickpountain.co.uk/home/computing/byte-articles/the-taos-operating-system-1991?hn -1. https://www.redox-os.org/ -1. https://system76.com/pop -1. http://habitatchronicles.com/2017/05/what-are-capabilities/ &&& ( Start reading where it says "Embedded systems" ) -1. http://genode.org/documentation/general-overview/index -1. https://camlistore.org/ -1. https://opensource.com/article/17/10/flintos -1. https://sortix.org/ -1. https://www.kickstarter.com/projects/xiki/xikihub-the-social-command-line -1. https://www.tockos.org/ -1. http://hydros-project.org/ -1. Twizzler: An Operating System for Next-Generation Memory Hierarchies &&& https://www.ssrc.ucsc.edu/Papers/ssrctr-17-01.pdf -1. http://www.includeos.org/ -1. https://harvey-os.org/ -1. https://github.com/jvburnes/node9 -1. http://unleashed-os.org/ -1. https://github.com/GreenteaOS/Greentea -1. https://xinu.cs.purdue.edu/ -1. https://browsix.org/ -1. https://github.com/frzb/coinboot -1. http://www.jbox.dk/sanos/index.htm -1. https://www.osrtos.com/ -1. [CLOSOS Specification of a Lisp operating system.](http://metamodular.com/lispos.pdf) -1. http://metamodular.com/Common-Lisp/lispos.html -1. http://riot-os.org/ -1. http://www.scs.stanford.edu/histar/ -1. http://sel4.systems/ +0. [CLOSOS: Specication of a Lisp operating system.](http://metamodular.com/lispos.pdf) +0. [CLOSOS: Specication of a Lisp operating system.](http://metamodular.com/closos.pdf) +0. https://medium.com/@jasonyuan/introducing-mercury-os-f4de45a04289 +0. http://lsneff.me/why-nebulet/ ||| https://github.com/nebulet/nebulet +0. http://exposnitc.github.io/index.html +0. https://www.gocosmos.org/ +0. http://www.microkernel.info/ +0. http://webosose.org/ +0. https://ostree.readthedocs.io/en/latest/manual/introduction/ +0. http://www.helenos.org/ +0. http://nixos.org/ +0. https://github.com/klange/toaruos +0. http://greenteapress.com/thinkos/ +0. http://kolibrios.org/en/ +0. http://menuetos.net/ +0. https://sailfishos.org/ +0. http://www.barrelfish.org/index.html +0. https://samypesse.gitbooks.io/how-to-create-an-operating-system/ +0. https://lumina-desktop.org/ +0. 2015 01 GNU Guix The Emacs of Distros &&& https://www.youtube.com/watch?v=AzebnJkfdvM +0. The Synthesis Kernel &&& https://www.usenix.org/legacy/publications/compsystems/1988/win_pu.pdf +0. http://zoo.cs.yale.edu/classes/cs422/pios +0. https://fuchsia.googlesource.com/docs/+/HEAD/book.md +0. https://externos.io/ +0. http://www.shadowdefender.com/ +0. https://pureos.net/ +0. http://progmp.net/ +0. http://www.uruk.org/emu/Taos.html +0. http://www.dickpountain.co.uk/home/computing/byte-articles/the-taos-operating-system-1991?hn +0. https://www.redox-os.org/ +0. https://system76.com/pop +0. http://habitatchronicles.com/2017/05/what-are-capabilities/ &&& ( Start reading where it says "Embedded systems" ) +0. http://genode.org/documentation/general-overview/index +0. https://camlistore.org/ +0. https://opensource.com/article/17/10/flintos +0. https://sortix.org/ +0. https://www.kickstarter.com/projects/xiki/xikihub-the-social-command-line +0. https://www.tockos.org/ +0. http://hydros-project.org/ +0. Twizzler: An Operating System for Next-Generation Memory Hierarchies &&& https://www.ssrc.ucsc.edu/Papers/ssrctr-17-01.pdf +0. http://www.includeos.org/ +0. https://harvey-os.org/ +0. https://github.com/jvburnes/node9 +0. http://unleashed-os.org/ +0. https://github.com/GreenteaOS/Greentea +0. https://xinu.cs.purdue.edu/ +0. https://browsix.org/ +0. https://github.com/frzb/coinboot +0. http://www.jbox.dk/sanos/index.htm +0. https://www.osrtos.com/ +0. [CLOSOS Specification of a Lisp operating system.](http://metamodular.com/lispos.pdf) +0. http://metamodular.com/Common-Lisp/lispos.html +0. http://riot-os.org/ +0. http://www.scs.stanford.edu/histar/ +0. http://sel4.systems/ ## Unikernel -1. https://hermitcore.org/2018/06/06/A-Rust-based-Unikernel/ -1. http://unikernel.org/ -1. https://xenproject.org/linux-foundation/80-developers/207-unikraft.html -1. https://fourlightyears.blogspot.com/2018/08/what-i-could-not-undiscover-about.html -1. https://mirage.io/ -1. [Unikernels: No Longer an Academic Exercise](http://250bpm.com/blog:138) -1. https://github.com/hermitcore/libhermit-rs -1. https://next.redhat.com/2018/11/14/ukl-a-unikernel-based-on-linux/ -1. https://github.com/joekoolade/JOE -1. https://ssrg-vt.github.io/hermitux/ -1. https://nanovms.com/dev/tutorials/running-forth-unikernels -1. [Unikernels: The Next Stage of Linux’s Dominance](https://www.cs.bu.edu/~jappavoo/Resources/Papers/unikernel-hotos19.pdf) -1. https://grapheneproject.io/ -1. https://ops.city/ +0. [State of the art for Unikernels](https://github.com/seeker89/unikernels) +0. https://hermitcore.org/2018/06/06/A-Rust-based-Unikernel/ +0. http://unikernel.org/ +0. https://xenproject.org/linux-foundation/80-developers/207-unikraft.html +0. https://fourlightyears.blogspot.com/2018/08/what-i-could-not-undiscover-about.html +0. https://mirage.io/ +0. [Unikernels: No Longer an Academic Exercise](http://250bpm.com/blog:138) +0. https://github.com/hermitcore/libhermit-rs +0. https://next.redhat.com/2018/11/14/ukl-a-unikernel-based-on-linux/ +0. https://github.com/joekoolade/JOE +0. https://ssrg-vt.github.io/hermitux/ +0. https://nanovms.com/dev/tutorials/running-forth-unikernels +0. [Unikernels: The Next Stage of Linux’s Dominance](https://www.cs.bu.edu/~jappavoo/Resources/Papers/unikernel-hotos19.pdf) +0. https://grapheneproject.io/ +0. https://ops.city/ ## Microkernel -1. [Snap: a Microkernel Approach to Host Networking](https://storage.googleapis.com/pub-tools-public-publication-data/pdf/36f0f9b41e969a00d75da7693571e988996c9f4c.pdf) +0. [Snap: a Microkernel Approach to Host Networking](https://storage.googleapis.com/pub-tools-public-publication-data/pdf/36f0f9b41e969a00d75da7693571e988996c9f4c.pdf) ## Real-time -1. https://en.wikipedia.org/wiki/VxWorks +0. https://en.wikipedia.org/wiki/VxWorks # Reference -1. [The little book about OS development](http://littleosbook.github.io/) -1. [Rethinking files](https://www.devever.net/~hl/objectworld) -1. [Writing an OS in Rust (Second Edition)](https://os.phil-opp.com/) -1. https://archiveos.org/ -1. https://lwn.net/Articles/615809/ -1. https://www.tweag.io/posts/2018-03-15-bazel-nix.html -1. Type-Safe Operating System Abstractions &&& https://www.cs.dartmouth.edu/~trdata/reports/TR2004-526.pdf -1. https://www.hillelwayne.com/post/nix/ -1. https://github.com/pervognsen/bitwise -1. True parallelism, with no concept of threads - Alfred Bratterud - Meeting C++ 2017 &&& https://www.youtube.com/watch?v=9IXivbSA_5A -1. http://ccl.cse.nd.edu/software/parrot/ -1. http://greenteapress.com/wp/think-os/ -1. https://gustavus.edu/mcs/max/os-book/ -1. https://sywtwaosir.wordpress.com/ -1. https://communityblog.fedoraproject.org/modularity-dead-long-live-modularity/ -1. https://en.wikipedia.org/wiki/WinFS -1. An alternative device-tree source language &&& https://lwn.net/SubscriberLink/730217/556c557e8a3bf0a0/ -1. https://joshondesign.com/2017/08/18/idealos_essay -1. https://tuhdo.github.io/os01/ -1. https://www.usenix.org/legacy/events/usenix03/tech/full_papers/padioleau/padioleau_html/index.html -1. https://medium.com/@ifesdjeen/on-disk-io-part-3-lsm-trees-8b2da218496f -1. https://medium.com/@ifesdjeen/on-disk-storage-part-4-b-trees-30791060741 -1. http://fare.tunes.org/LispM.html -1. http://queue.acm.org/detail.cfm?id=1317400 -1. The Art of Unix Programming &&& http://www.catb.org/esr/writings/taoup/html/index.html -1. https://shivambharuka.wordpress.com/2017/10/25/arrakis-the-operating-system-is-the-control-plane/ -1. [Arrakis: The Operating System is the Control Plane](https://www.usenix.org/system/files/conference/osdi14/osdi14-paper-peter_simon.pdf) -1. https://sortix.org/os-test/ -1. https://existentialtype.wordpress.com/2016/07/11/pclsring-in-semantics/ -1. Database/Operating System Co-Design &&& https://www.research-collection.ethz.ch/handle/20.500.11850/136 -1. YOW! Lambda Jam 2017 Brian McKenna - Nix for Functional Systems &&& https://www.youtube.com/watch?v=mIxtBVKo7JE -1. [Mouse Programming with libgpm](https://www.linuxjournal.com/article/4600) -1. https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/WritingDeviceDriver/CPluPlusRuntime/CPlusPlusRuntime.html -1. https://yarchive.net/comp/linux/everything_is_file.html -1. [Operating Systems: Three Easy Pieces](http://pages.cs.wisc.edu/~remzi/OSTEP/) -1. http://www.drdobbs.com/parallel/booting-an-intel-architecture-system-par/232300699 -1. [The Jury Is In: Monolithic OS Design Is Flawed: Microkernel-based Designs Improve Security](http://ts.data61.csiro.au/publications/csiro_full_text/Biggs_LH_18.pdf) -1. https://medium.com/@enkiv2/composability-homogeneity-and-language-based-systems-fb00e2c2458 -1. [Write your own Operating System](https://www.youtube.com/playlist?list=PLHh55M_Kq4OApWScZyPl5HhgsTJS9MZ6M) -1. [Light-weight Contexts: An OS Abstraction for Safety and Performance](https://people.mpi-sws.org/~druschel/publications/osdi16.pdf) -1. https://augustl.com/blog/2014/an_immutable_operating_system/ +0. [The little book about OS development](http://littleosbook.github.io/) +0. [Rethinking files](https://www.devever.net/~hl/objectworld) +0. [Writing an OS in Rust (Second Edition)](https://os.phil-opp.com/) +0. https://archiveos.org/ +0. https://lwn.net/Articles/615809/ +0. https://www.tweag.io/posts/2018-03-15-bazel-nix.html +0. Type-Safe Operating System Abstractions &&& https://www.cs.dartmouth.edu/~trdata/reports/TR2004-526.pdf +0. https://www.hillelwayne.com/post/nix/ +0. https://github.com/pervognsen/bitwise +0. True parallelism, with no concept of threads - Alfred Bratterud - Meeting C++ 2017 &&& https://www.youtube.com/watch?v=9IXivbSA_5A +0. http://ccl.cse.nd.edu/software/parrot/ +0. http://greenteapress.com/wp/think-os/ +0. https://gustavus.edu/mcs/max/os-book/ +0. https://sywtwaosir.wordpress.com/ +0. https://communityblog.fedoraproject.org/modularity-dead-long-live-modularity/ +0. https://en.wikipedia.org/wiki/WinFS +0. An alternative device-tree source language &&& https://lwn.net/SubscriberLink/730217/556c557e8a3bf0a0/ +0. https://joshondesign.com/2017/08/18/idealos_essay +0. https://tuhdo.github.io/os01/ +0. https://www.usenix.org/legacy/events/usenix03/tech/full_papers/padioleau/padioleau_html/index.html +0. https://medium.com/@ifesdjeen/on-disk-io-part-3-lsm-trees-8b2da218496f +0. https://medium.com/@ifesdjeen/on-disk-storage-part-4-b-trees-30791060741 +0. http://fare.tunes.org/LispM.html +0. http://queue.acm.org/detail.cfm?id=1317400 +0. The Art of Unix Programming &&& http://www.catb.org/esr/writings/taoup/html/index.html +0. https://shivambharuka.wordpress.com/2017/10/25/arrakis-the-operating-system-is-the-control-plane/ +0. [Arrakis: The Operating System is the Control Plane](https://www.usenix.org/system/files/conference/osdi14/osdi14-paper-peter_simon.pdf) +0. https://sortix.org/os-test/ +0. https://existentialtype.wordpress.com/2016/07/11/pclsring-in-semantics/ +0. Database/Operating System Co-Design &&& https://www.research-collection.ethz.ch/handle/20.500.11850/136 +0. YOW! Lambda Jam 2017 Brian McKenna - Nix for Functional Systems &&& https://www.youtube.com/watch?v=mIxtBVKo7JE +0. [Mouse Programming with libgpm](https://www.linuxjournal.com/article/4600) +0. https://developer.apple.com/library/archive/documentation/DeviceDrivers/Conceptual/WritingDeviceDriver/CPluPlusRuntime/CPlusPlusRuntime.html +0. https://yarchive.net/comp/linux/everything_is_file.html +0. [Operating Systems: Three Easy Pieces](http://pages.cs.wisc.edu/~remzi/OSTEP/) +0. http://www.drdobbs.com/parallel/booting-an-intel-architecture-system-par/232300699 +0. [The Jury Is In: Monolithic OS Design Is Flawed: Microkernel-based Designs Improve Security](http://ts.data61.csiro.au/publications/csiro_full_text/Biggs_LH_18.pdf) +0. https://medium.com/@enkiv2/composability-homogeneity-and-language-based-systems-fb00e2c2458 +0. [Write your own Operating System](https://www.youtube.com/playlist?list=PLHh55M_Kq4OApWScZyPl5HhgsTJS9MZ6M) +0. [Light-weight Contexts: An OS Abstraction for Safety and Performance](https://people.mpi-sws.org/~druschel/publications/osdi16.pdf) +0. https://augustl.com/blog/2014/an_immutable_operating_system/ # Higher-Order -1. https://www.yoctoproject.org/ +0. https://www.yoctoproject.org/ # Formats -1. http://iokit.racing/machotricks.pdf +0. http://iokit.racing/machotricks.pdf # Error-handling -1. http://joeduffyblog.com/2016/02/07/the-error-model/ -1. https://code.fb.com/production-engineering/open-sourcing-oomd-a-new-approach-to-handling-ooms/ -1. https://os.phil-opp.com/double-fault-exceptions/ +0. http://joeduffyblog.com/2016/02/07/the-error-model/ +0. https://code.fb.com/production-engineering/open-sourcing-oomd-a-new-approach-to-handling-ooms/ +0. https://os.phil-opp.com/double-fault-exceptions/ # Tools -1. https://osquery.io/ -1. https://github.com/facebook/osquery +0. https://osquery.io/ +0. https://github.com/facebook/osquery # Shell -1. [Magritte: A Language for Pipe-Based Programming](http://files.jneen.net/academic/thesis.pdf) -1. https://latacora.singles/2018/06/21/loud-subshells.html -1. https://github.com/ipetkov/conch-runtime -1. https://www.spinellis.gr/sw/dgsh/ +0. [Magritte: A Language for Pipe-Based Programming](http://files.jneen.net/academic/thesis.pdf) +0. https://latacora.singles/2018/06/21/loud-subshells.html +0. https://github.com/ipetkov/conch-runtime +0. https://www.spinellis.gr/sw/dgsh/ # File-system -1. https://medium.com/@siddontang/use-fuse-to-inject-failure-to-i-o-deb5f2e7800a -1. [Spiffy: Enabling File-System Aware Storage Applications](https://www.usenix.org/conference/fast18/presentation/sun) -1. https://github.com/bindh3x/libnicko -1. https://github.com/floyernick/fleep-py -1. https://brauner.github.io/2018/08/05/unprivileged-file-capabilities.html -1. http://louwrentius.com/the-sorry-state-of-cow-file-systems.html -1. https://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/ -1. https://medium.com/datadriveninvestor/writing-your-own-file-system-is-not-as-hard-as-you-may-think-aa4af09329cd -1. http://www.betrfs.org/ -1. https://docs.microsoft.com/en-us/windows/desktop/projfs/projected-file-system -1. [The Lustre Storage Architecture](https://arxiv.org/abs/1903.01955) +0. https://medium.com/@siddontang/use-fuse-to-inject-failure-to-i-o-deb5f2e7800a +0. [Spiffy: Enabling File-System Aware Storage Applications](https://www.usenix.org/conference/fast18/presentation/sun) +0. https://github.com/bindh3x/libnicko +0. https://github.com/floyernick/fleep-py +0. https://brauner.github.io/2018/08/05/unprivileged-file-capabilities.html +0. http://louwrentius.com/the-sorry-state-of-cow-file-systems.html +0. https://www.notthewizard.com/2014/06/17/are-files-appends-really-atomic/ +0. https://medium.com/datadriveninvestor/writing-your-own-file-system-is-not-as-hard-as-you-may-think-aa4af09329cd +0. http://www.betrfs.org/ +0. https://docs.microsoft.com/en-us/windows/desktop/projfs/projected-file-system +0. [The Lustre Storage Architecture](https://arxiv.org/abs/1903.01955) # Shared libraries | Dynamic Loading -1. https://amir.rachum.com/blog/2016/09/17/shared-libraries/ -1. https://www.kix.in/2008/06/19/an-alternative-to-shared-libraries/ -1. https://www.akkadia.org/drepper/no_static_linking.html -1. https://amir.rachum.com/blog/2016/09/17/shared-libraries/ +0. https://amir.rachum.com/blog/2016/09/17/shared-libraries/ +0. https://www.kix.in/2008/06/19/an-alternative-to-shared-libraries/ +0. https://www.akkadia.org/drepper/no_static_linking.html +0. https://amir.rachum.com/blog/2016/09/17/shared-libraries/ # Packages -1. [Piotr Gaczkowski - Nix -- the functional package manager - Lambda Days 2020](https://www.youtube.com/watch?v=6AvwC25fd_U) -1. https://snapcraft.io/ -1. https://code.fb.com/data-infrastructure/xars-a-more-efficient-open-source-system-for-self-contained-executables/ +0. [Piotr Gaczkowski - Nix -- the functional package manager - Lambda Days 2020](https://www.youtube.com/watch?v=6AvwC25fd_U) +0. https://snapcraft.io/ +0. https://code.fb.com/data-infrastructure/xars-a-more-efficient-open-source-system-for-self-contained-executables/ # System Calls -1. [1001 Ways of Implementing a System Call](https://x86.lol/generic/2019/07/04/kernel-entry.html) -1. https://eli.thegreenplace.net/2018/basics-of-futexes/ -1. [FlexSC: Flexible System Call Scheduling with Exception-Less System Calls](https://www.usenix.org/legacy/event/osdi10/tech/full_papers/Soares.pdf) +0. [1001 Ways of Implementing a System Call](https://x86.lol/generic/2019/07/04/kernel-entry.html) +0. https://eli.thegreenplace.net/2018/basics-of-futexes/ +0. [FlexSC: Flexible System Call Scheduling with Exception-Less System Calls](https://www.usenix.org/legacy/event/osdi10/tech/full_papers/Soares.pdf) # Security -1. https://en.wikipedia.org/wiki/Reference_monitor -1. [FINE-CFI: Fine-grained Control-Flow Integrity for Operating System Kernels](http://www.cs.wayne.edu/fengwei/paper/fine-cfi-tifs18.pdf) -1. https://unsat.cs.washington.edu/projects/hyperkernel/ -1. [Capsicum](https://oshogbo.vexillium.org/blog/57/) -1. [OS-level Attacks and Defenses: from Software to Hardware-based Exploits](http://tuprints.ulb.tu-darmstadt.de/8482/1/gens_diss.pdf) -1. [Time Protection: The Missing OS Abstraction](https://ts.data61.csiro.au/publications/csiro_full_text//Ge_YCH_19.pdf) -1. [Light-weight Contexts: An OS Abstraction for Safety and Performance](https://www.usenix.org/system/files/conference/osdi16/osdi16-litton.pdf) -1. https://natsys-lab.blogspot.com/2019/05/goodbye-fast-system-calls.html +0. https://en.wikipedia.org/wiki/Reference_monitor +0. [FINE-CFI: Fine-grained Control-Flow Integrity for Operating System Kernels](http://www.cs.wayne.edu/fengwei/paper/fine-cfi-tifs18.pdf) +0. https://unsat.cs.washington.edu/projects/hyperkernel/ +0. [Capsicum](https://oshogbo.vexillium.org/blog/57/) +0. [OS-level Attacks and Defenses: from Software to Hardware-based Exploits](http://tuprints.ulb.tu-darmstadt.de/8482/1/gens_diss.pdf) +0. [Time Protection: The Missing OS Abstraction](https://ts.data61.csiro.au/publications/csiro_full_text//Ge_YCH_19.pdf) +0. [Light-weight Contexts: An OS Abstraction for Safety and Performance](https://www.usenix.org/system/files/conference/osdi16/osdi16-litton.pdf) +0. https://natsys-lab.blogspot.com/2019/05/goodbye-fast-system-calls.html # Driver -1. https://blogs.windows.com/buildingapps/2018/08/15/introducing-driver-module-framework/#J6CWEbpcH0OwgWbP.97 -1. [Toward Compositional Verification of Interruptible OS Kernels and Device Drivers](http://flint.cs.yale.edu/flint/publications/device-journal.pdf) -1. [Writing Network Drivers in Haskell](https://www.net.in.tum.de/fileadmin/bibtex/publications/theses/2019-ixy-haskell.pdf) +0. https://blogs.windows.com/buildingapps/2018/08/15/introducing-driver-module-framework/#J6CWEbpcH0OwgWbP.97 +0. [Toward Compositional Verification of Interruptible OS Kernels and Device Drivers](http://flint.cs.yale.edu/flint/publications/device-journal.pdf) +0. [Writing Network Drivers in Haskell](https://www.net.in.tum.de/fileadmin/bibtex/publications/theses/2019-ixy-haskell.pdf) # Networking -1. [Computer Networks: A Systems Approach](https://github.com/SystemsApproach/book) +0. [Computer Networks: A Systems Approach](https://github.com/SystemsApproach/book) # Kernel -1. [A new kernel polling interface](https://lwn.net/Articles/743714/) -1. [Composing Abstractions using the null-Kernel](https://people.mpi-sws.org/~dg/papers/hotosxvii.pdf) +0. [A new kernel polling interface](https://lwn.net/Articles/743714/) +0. [Composing Abstractions using the null-Kernel](https://people.mpi-sws.org/~dg/papers/hotosxvii.pdf) # I/O -1. [The block I/O latency controller](https://lwn.net/Articles/758963/) -1. [I/O Is Faster Than the CPU – Let’s Partition Resources and Eliminate (Most) OS Abstractions](https://penberg.org/parakernel-hotos19.pdf) +0. [The block I/O latency controller](https://lwn.net/Articles/758963/) +0. [I/O Is Faster Than the CPU – Let’s Partition Resources and Eliminate (Most) OS Abstractions](https://penberg.org/parakernel-hotos19.pdf) # Init System -1. https://davmac.wordpress.com/2018/10/26/on-the-vagaries-of-init-systems/ +0. https://davmac.wordpress.com/2018/10/26/on-the-vagaries-of-init-systems/ # Homogeneous Operating Systems -1. https://ecc-comp.blogspot.com/2014/12/homogeneous-operating-systems-are-better.html +0. https://ecc-comp.blogspot.com/2014/12/homogeneous-operating-systems-are-better.html # Update System -1. https://theupdateframework.github.io/overview.html +0. https://theupdateframework.github.io/overview.html # Signal -1. http://delyan.me/code-review-signals/ +0. http://delyan.me/code-review-signals/ # Daemon -1. https://chaoticlab.io/c/c++/unix/2018/10/01/daemonize.html +0. https://chaoticlab.io/c/c++/unix/2018/10/01/daemonize.html # Memory -1. [Memory Systems and Memory-Centric Computing Systems](http://people.inf.ethz.ch/omutlu/acaces2018.html) -1. https://en.wikipedia.org/wiki/Page_replacement_algorithm -1. [Compress Objects, Not Cache Lines:An Object-Based Compressed Memory Hierarchy](https://people.csail.mit.edu/poantsai/papers/2019.zippads.asplos.pdf) +0. [Memory Systems and Memory-Centric Computing Systems](http://people.inf.ethz.ch/omutlu/acaces2018.html) +0. https://en.wikipedia.org/wiki/Page_replacement_algorithm +0. [Compress Objects, Not Cache Lines:An Object-Based Compressed Memory Hierarchy](https://people.csail.mit.edu/poantsai/papers/2019.zippads.asplos.pdf) # Hardware -1. [There's No Such Thing as a General-purpose Processor](https://queue.acm.org/detail.cfm?id=2687011) +0. [There's No Such Thing as a General-purpose Processor](https://queue.acm.org/detail.cfm?id=2687011) # Reliability -1. [CuriOS: Improving Reliability through Operating System Structure](http://people.cs.ksu.edu/~danielwang/Investigation/System_Security/curios.pdf) +0. [CuriOS: Improving Reliability through Operating System Structure](http://people.cs.ksu.edu/~danielwang/Investigation/System_Security/curios.pdf) # Booting | Bootstrapping -1. https://puri.sm/posts/pureboot-the-high-security-boot-process/ +0. https://puri.sm/posts/pureboot-the-high-security-boot-process/ # Virtualization -1. [virtio: Towards a De-Facto Standard For Virtual I/O Devices](https://www.ozlabs.org/~rusty/virtio-spec/virtio-paper.pdf) +0. [virtio: Towards a De-Facto Standard For Virtual I/O Devices](https://www.ozlabs.org/~rusty/virtio-spec/virtio-paper.pdf) # Separation kernel -1. [High-Assurance Separation Kernels: A Survey on Formal Methods](https://arxiv.org/abs/1701.01535) +0. [High-Assurance Separation Kernels: A Survey on Formal Methods](https://arxiv.org/abs/1701.01535) diff --git a/documentation/bookmark/optimization.md b/documentation/bookmark/optimization.md index 3df2cd1ae..b3d61c084 100644 --- a/documentation/bookmark/optimization.md +++ b/documentation/bookmark/optimization.md @@ -31,6 +31,7 @@ # Reference +0. [Algorithms for Modern Hardware](https://en.algorithmica.org/hpc/) 0. [Refterm Lecture Part 1 - Philosophies of Optimization](https://www.youtube.com/watch?v=pgoetgxecw8) 0. [Optimizations enabled by -ffast-math](https://kristerw.github.io/2021/10/19/fast-math/) 0. [Simple Code, High Performance](https://www.youtube.com/watch?v=Ge3aKEmZcqY) diff --git a/documentation/bookmark/optimization/memoization.md b/documentation/bookmark/optimization/memoization.md new file mode 100644 index 000000000..62c0bb9db --- /dev/null +++ b/documentation/bookmark/optimization/memoization.md @@ -0,0 +1,5 @@ +# Reference + +0. [Skip: A programming language to skip the things you have already computed](http://skiplang.com/) +0. https://github.com/skiplang/skip + diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux index 2e4e790fe..6940b2f5e 100644 --- a/stdlib/source/library/lux/debug.lux +++ b/stdlib/source/library/lux/debug.lux @@ -170,7 +170,7 @@ (|> (%.format (%.nat (.nat (ffi.of_long (java/lang/Integer::longValue tag)))) " " (%.bit last?) " " (inspection choice)) - (text.enclosed ["(" ")"]))) + (text.enclosed ["{" "}"]))) _ (tuple_inspection inspection value))) @@ -199,7 +199,7 @@ (|> (%.format (JSON::stringify variant_tag) " " (%.bit (not ("js object null?" variant_flag))) " " (inspection variant_value)) - (text.enclosed ["(" ")"])) + (text.enclosed ["{" "}"])) (not (or ("js object undefined?" ("js object get" "_lux_low" value)) ("js object undefined?" ("js object get" "_lux_high" value)))) @@ -240,7 +240,7 @@ (|> (%.format (|> variant_tag (:as .Nat) %.nat) " " (|> variant_flag "python object none?" not %.bit) " " (inspection variant_value)) - (text.enclosed ["(" ")"])))) + (text.enclosed ["{" "}"])))) _ (..str value))) _ @@ -273,7 +273,7 @@ (|> (%.format (|> variant_tag (:as .Nat) %.nat) " " (%.bit (not ("lua object nil?" variant_flag))) " " (inspection variant_value)) - (text.enclosed ["(" ")"])))) + (text.enclosed ["{" "}"])))) _ (..tostring value)) @@ -311,7 +311,7 @@ (|> (%.format (|> variant_tag (:as .Nat) %.nat) " " (%.bit (not ("ruby object nil?" variant_flag))) " " (inspection variant_value)) - (text.enclosed ["(" ")"])))) + (text.enclosed ["{" "}"])))) (same? (class_of [[] []]) value_class) (tuple_inspection inspection value) @@ -341,7 +341,7 @@ (|> (%.format (|> variant_tag (:as .Nat) %.nat) " " (%.bit (not ("php object null?" variant_flag))) " " (inspection variant_value)) - (text.enclosed ["(" ")"])))) + (text.enclosed ["{" "}"])))) _ (..strval value)) @@ -369,7 +369,7 @@ (|> (%.format (|> variant_tag (:as .Nat) %.nat) " " (%.bit (not ("scheme object nil?" variant_flag))) " " (inspection variant_value)) - (text.enclosed ["(" ")"]))) + (text.enclosed ["{" "}"]))) (..format ["~s" value]))) ... else @@ -463,7 +463,7 @@ _ (undefined)))] - (%.format "(" (%.nat lefts) " " (%.bit right?) " " sub_repr ")")))))) + (%.format "{" (%.nat lefts) " " (%.bit right?) " " sub_repr "}")))))) (def: (tuple_representation representation) (-> (Parser Representation) (Parser Representation)) diff --git a/stdlib/source/library/lux/target/jvm/reflection.lux b/stdlib/source/library/lux/target/jvm/reflection.lux index f8cce5214..6d170ac6b 100644 --- a/stdlib/source/library/lux/target/jvm/reflection.lux +++ b/stdlib/source/library/lux/target/jvm/reflection.lux @@ -6,7 +6,7 @@ [abstract ["[0]" monad {"+" do}]] [control - ["[0]" try {"+" Try}] + ["[0]" try {"+" Try} ("[1]#[0]" functor)] ["[0]" exception {"+" exception:}] [parser ["" text]]] @@ -86,7 +86,9 @@ (getName [] java/lang/String) (isAssignableFrom [(java/lang/Class java/lang/Object)] boolean) (getTypeParameters [] [(java/lang/reflect/TypeVariable (java/lang/Class c))]) - (getDeclaredField [java/lang/String] "try" java/lang/reflect/Field)]) + (getDeclaredField [java/lang/String] "try" java/lang/reflect/Field) + (isArray [] boolean) + (getComponentType [] (java/lang/Class java/lang/Object))]) (exception: .public (unknown_class [class External]) (exception.report @@ -147,18 +149,19 @@ {.#Some reflection} (let [raw (java/lang/reflect/ParameterizedType::getRawType reflection)] (case (ffi.check java/lang/Class raw) - {.#Some raw} + {.#Some raw'} (let [! try.monad] (|> reflection java/lang/reflect/ParameterizedType::getActualTypeArguments (array.list {.#None}) (monad.each ! parameter) - (# ! each (/.class (|> raw + (# ! each (/.class (|> raw' (:as (java/lang/Class java/lang/Object)) - java/lang/Class::getName))))) + java/lang/Class::getName))) + (exception.with ..cannot_convert_to_a_lux_type [reflection]))) _ - (exception.except ..not_a_class [raw]))) + (exception.except ..not_a_class [reflection]))) _) ... else (exception.except ..cannot_convert_to_a_lux_type [reflection]))) @@ -199,6 +202,15 @@ type (# try.monad each /.array)) _) + (case (ffi.check java/lang/Class reflection) + {.#Some class} + (if (java/lang/Class::isArray class) + (|> class + java/lang/Class::getComponentType + type + (try#each /.array)) + (..class' (parameter type) reflection)) + _) (..class' (parameter type) reflection))) (def: .public (type reflection) @@ -272,6 +284,12 @@ (def: .public (correspond class type) (-> (java/lang/Class java/lang/Object) Type (Try Mapping)) (case type + (^ {.#Primitive (static array.type_name) (list :member:)}) + (if (java/lang/Class::isArray class) + (correspond (java/lang/Class::getComponentType class) + :member:) + (exception.except ..cannot_correspond [class type])) + {.#Primitive name params} (let [class_name (java/lang/Class::getName class) class_params (array.list {.#None} (java/lang/Class::getTypeParameters class)) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux index da2a15d70..e2e1df881 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/jvm/case.lux @@ -28,8 +28,9 @@ ["[1][0]" value] ["[1][0]" structure] [//// - ["[0]" synthesis {"+" Path Fork Synthesis}] ["[0]" generation] + ["[0]" synthesis {"+" Path Fork Synthesis} + ["[0]" member {"+" Member}]] [/// ["[0]" phase ("operation#[0]" monad)] [reference @@ -294,16 +295,13 @@ body!)))) (def: .public (get phase archive [path recordS]) - (Generator [(List synthesis.Member) Synthesis]) + (Generator [(List Member) Synthesis]) (do phase.monad [record! (phase archive recordS)] (in (list#mix (function (_ step so_far!) - (.let [next! (.case step - {.#Left lefts} - (..left_projection lefts) - - {.#Right lefts} - (..right_projection lefts))] + (.let [next! (.if (value@ member.#right? step) + (..right_projection (value@ member.#lefts step)) + (..left_projection (value@ member.#lefts step)))] ($_ _.composite so_far! next!))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux index 400e47cfb..f78fb404b 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/generation/ruby/case.lux @@ -27,8 +27,9 @@ [synthesis ["[0]" case]] ["/[1]" // "_" - ["[1][0]" synthesis {"+" Member Synthesis Path}] ["[1][0]" generation] + ["[1][0]" synthesis {"+" Synthesis Path} + ["[0]" member {"+" Member}]] ["//[1]" /// "_" [reference ["[1][0]" variable {"+" Register}]] @@ -109,12 +110,9 @@ (do ///////phase.monad [valueO (expression archive valueS)] (in (list#mix (function (_ side source) - (.let [method (.case side - (^template [ ] - [{ lefts} - ( (_.int (.int lefts)))]) - ([.#Left //runtime.tuple//left] - [.#Right //runtime.tuple//right]))] + (.let [method (.if (value@ member.#right? side) + (//runtime.tuple//right (_.int (.int (value@ member.#lefts side)))) + (//runtime.tuple//left (_.int (.int (value@ member.#lefts side)))))] (method source))) valueO (list.reversed pathP))))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux index 589de1abc..5441ec92f 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/case.lux @@ -25,7 +25,8 @@ ["[2][0]" complex] ["[2][0]" pattern {"+" Pattern}]] ["/" synthesis {"+" Path Synthesis Operation Phase} - ["[1][0]" side]] + ["[1][0]" side] + ["[1][0]" member {"+" Member}]] [/// ["[1]" phase ("[1]#[0]" monad)] ["[1][0]" reference @@ -83,9 +84,10 @@ _ (let [right? (n.= tuple::last tuple::lefts) end?' (and end? right?)] - (<| (///#each (|>> {/.#Seq {/.#Access {/.#Member (if right? - {.#Right (-- tuple::lefts)} - {.#Left tuple::lefts})}}})) + (<| (///#each (|>> {/.#Seq {/.#Access {/.#Member [/member.#lefts (if right? + (-- tuple::lefts) + tuple::lefts) + /member.#right? right?]}}})) (path' tuple::member end?') (when> [(new> (not end?') [])] [(///#each ..clean_up)]) nextC)))) @@ -174,23 +176,17 @@ [/.#F64_Fork frac.equivalence] [/.#Text_Fork text.equivalence]) - (^template [ ] - [[{/.#Access { [/side.#lefts newL /side.#right? ]}} - {/.#Access { [/side.#lefts oldL /side.#right? ]}}] + (^template [ ] + [[{/.#Access { [ newL ]}} + {/.#Access { [ oldL ]}}] (if (n.= newL oldL) old )]) - ([/.#Side #0] - [/.#Side #1]) + ([/.#Side #0 /side.#lefts /side.#right?] + [/.#Side #1 /side.#lefts /side.#right?] - (^template [ ] - [[{/.#Access { { newL}}} - {/.#Access { { oldL}}}] - (if (n.= newL oldL) - old - )]) - ([/.#Member .#Left] - [/.#Member .#Right]) + [/.#Member #0 /member.#lefts /member.#right?] + [/.#Member #1 /member.#lefts /member.#right?]) [{/.#Bind newR} {/.#Bind oldR}] (if (n.= newR oldR) @@ -201,15 +197,17 @@ ))) (def: (get patterns @selection) - (-> (///complex.Tuple Pattern) Register (List /.Member)) + (-> (///complex.Tuple Pattern) Register (List Member)) (loop [lefts 0 patterns patterns] (with_expansions [ (as_is (list)) (as_is (again (++ lefts) tail)) - (as_is (if (list.empty? tail) - {.#Right (-- lefts)} - {.#Left lefts}))] + (as_is (let [right? (list.empty? tail)] + [/member.#lefts (if right? + (-- lefts) + lefts) + /member.#right? right?]))] (case patterns {.#End} diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux index beccd504c..ba6f29f89 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/synthesis/variable.lux @@ -282,7 +282,7 @@ (in [redundancy [else_test else_then]])))) [redundancy elses])] (in [redundancy { [[test then] elses]}]))]) - ([/.#I64_Fork (I64 Any)] + ([/.#I64_Fork I64] [/.#F64_Fork Frac] [/.#Text_Fork Text]) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux index 409e97353..a5767f301 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis.lux @@ -27,6 +27,7 @@ ["[0]" / "_" ["[1][0]" simple {"+" Simple}] ["[1][0]" side {"+" Side}] + ["[1][0]" member {"+" Member}] [// ["[0]" analysis {"+" Environment Analysis} ["[1]/[0]" complex {"+" Complex}]] @@ -56,9 +57,6 @@ [#locals 0 #currying? false]) -(type: .public Member - (Either Nat Nat)) - (type: .public Access (Variant {#Side Side} @@ -73,7 +71,7 @@ {#Bind Register} {#Access Access} {#Bit_Fork Bit (Path' s) (Maybe (Path' s))} - {#I64_Fork (Fork (I64 Any) (Path' s))} + {#I64_Fork (Fork I64 (Path' s))} {#F64_Fork (Fork Frac (Path' s))} {#Text_Fork (Fork Text (Path' s))} {#Seq (Path' s) (Path' s)} @@ -158,29 +156,26 @@ [path/member ..#Member] ) -(template: .public (side lefts right?) - [(.<| {..#Access} - {..#Side} - [/side.#lefts lefts - /side.#right? right?])]) - -(template [ ] - [(template: .public ( lefts) - [(..side lefts )])] +(template [ ] + [(template: .public ( lefts right?) + [(.<| {..#Access} + {} + [ lefts + right?])])] - [#0 side/left] - [#1 side/right] + [side ..#Side /side.#lefts /side.#right?] + [member ..#Member /member.#lefts /member.#right?] ) -(template [ ] - [(template: .public ( content) - [(.<| {..#Access} - {} - {} - content)])] +(template [ ] + [(template: .public ( lefts) + [( lefts )])] + + [..side #0 side/left] + [..side #1 side/right] - [member/left ..#Member .#Left] - [member/right ..#Member .#Right] + [..member #0 member/left] + [..member #1 member/right] ) (template [ ] @@ -313,13 +308,8 @@ {#Side it} (/side.format it) - {#Member member} - (case member - {.#Left lefts} - (format "[" (%.nat lefts) " #0" "]") - - {.#Right lefts} - (format "[" (%.nat lefts) " #1" "]"))) + {#Member it} + (/member.format it)) {#Bind register} (format "(@ " (%.nat register) ")") @@ -426,14 +416,6 @@ (Format Path) (%path' %synthesis)) -(def: member_hash - (Hash Member) - (sum.hash n.hash n.hash)) - -(def: member_equivalence - (Equivalence Member) - (# ..member_hash &equivalence)) - (implementation: .public access_equivalence (Equivalence Access) @@ -443,7 +425,7 @@ [[{ reference} { sample}] (# = reference sample)]) ([#Side /side.equivalence] - [#Member ..member_equivalence]) + [#Member /member.equivalence]) _ false))) @@ -459,7 +441,7 @@ [{ value} (# hash value)]) ([#Side /side.hash] - [#Member ..member_hash])))) + [#Member /member.hash])))) (implementation: .public (path'_equivalence equivalence) (All (_ a) (-> (Equivalence a) (Equivalence (Path' a)))) @@ -481,7 +463,7 @@ (# (list.equivalence (product.equivalence =)) = {.#Item reference_item} {.#Item sample_item})]) - ([#I64_Fork i64.equivalence] + ([#I64_Fork (: (Equivalence I64) i64.equivalence)] [#F64_Fork f.equivalence] [#Text_Fork text.equivalence]) @@ -568,7 +550,7 @@ [{#Get [reference_path reference_record]} {#Get [sample_path sample_record]}] - (and (# (list.equivalence ..member_equivalence) = reference_path sample_path) + (and (# (list.equivalence /member.equivalence) = reference_path sample_path) (#= reference_record sample_record)) [{#Case [reference_input reference_path]} @@ -606,7 +588,7 @@ {#Get [path record]} ($_ n.* 7 - (# (list.hash ..member_hash) hash path) + (# (list.hash /member.hash) hash path) (# super hash record)) {#Case [input path]} diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/synthesis/member.lux b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis/member.lux new file mode 100644 index 000000000..4e1ed910b --- /dev/null +++ b/stdlib/source/library/lux/tool/compiler/language/lux/synthesis/member.lux @@ -0,0 +1,34 @@ +(.using + [library + [lux "*" + [abstract + [equivalence {"+" Equivalence}] + [hash {"+" Hash}]] + [data + ["[0]" product] + ["[0]" bit] + [text + ["%" format]]] + [math + [number + ["[0]" nat]]]]]) + +(type: .public Member + (Record + [#lefts Nat + #right? Bit])) + +(def: .public (format it) + (%.Format Member) + (%.format "[" (%.nat (value@ #lefts it)) " " (%.bit (value@ #right? it)) "]")) + +(def: .public hash + (Hash Member) + ($_ product.hash + nat.hash + bit.hash + )) + +(def: .public equivalence + (Equivalence Member) + (# ..hash &equivalence)) diff --git a/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux b/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux index 02b8e7055..6489b6fb7 100644 --- a/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux +++ b/stdlib/source/library/lux/tool/compiler/meta/archive/registry.lux @@ -68,7 +68,7 @@ //.#category { it} //.#mandatory? mandatory?] dependencies])) - (revised@ #resolver (dictionary.has ( it) [id <+resolver>])) + (revised@ #resolver (dictionary.has ( it) [id (: (Maybe //category.Definition) <+resolver>)])) :abstraction)])) (def: .public ( registry) diff --git a/stdlib/source/library/lux/world/program.lux b/stdlib/source/library/lux/world/program.lux index 2eb9e3f62..95118c399 100644 --- a/stdlib/source/library/lux/world/program.lux +++ b/stdlib/source/library/lux/world/program.lux @@ -310,6 +310,7 @@ java/util/Map::keySet java/util/Set::iterator ..jvm##consume + (list#each (|>> ffi.of_string)) io.io)] (for [@.old @.jvm diff --git a/stdlib/source/test/lux/control/parser.lux b/stdlib/source/test/lux/control/parser.lux index 49e40ab5f..5a76942ed 100644 --- a/stdlib/source/test/lux/control/parser.lux +++ b/stdlib/source/test/lux/control/parser.lux @@ -250,8 +250,7 @@ (_.cover [/.else] (and (|> (/.result (/.else wrong (# /.monad in expected)) (list)) (match actual (n.= expected actual))) - (|> (/.result (/.else expected (: (Parser (List Code) Nat) - (/.failure "yolo"))) + (|> (/.result (/.else expected (/.failure "yolo")) (list)) (match actual (n.= expected actual))) )) diff --git a/stdlib/source/test/lux/meta.lux b/stdlib/source/test/lux/meta.lux index 871cc155c..3aa4fc763 100644 --- a/stdlib/source/test/lux/meta.lux +++ b/stdlib/source/test/lux/meta.lux @@ -52,10 +52,13 @@ expected_seed random.nat expected random.nat dummy (random.only (|>> (n.= expected) not) random.nat) - .let [expected_lux [.#info [.#target target + configuration_feature (random.ascii/upper 1) + configuration_value (random.ascii/upper 1) + .let [configuration (list [configuration_feature configuration_value]) + expected_lux [.#info [.#target target .#version version .#mode {.#Build} - .#configuration (list)] + .#configuration configuration] .#source [location.dummy 0 source_code] .#location location.dummy .#current_module {.#Some expected_current_module} @@ -87,6 +90,16 @@ (/.result expected_lux) (!expect (^multi {try.#Success actual_lux} (same? expected_lux actual_lux))))) + (_.cover [/.version] + (|> /.version + (/.result expected_lux) + (!expect (^multi {try.#Success it} + (same? version it))))) + (_.cover [/.configuration] + (|> /.configuration + (/.result expected_lux) + (!expect (^multi {try.#Success it} + (same? configuration it))))) ))) (def: error_handling diff --git a/stdlib/source/test/lux/tool/compiler/meta/cache.lux b/stdlib/source/test/lux/tool/compiler/meta/cache.lux index c826d030a..66d5cfc9c 100644 --- a/stdlib/source/test/lux/tool/compiler/meta/cache.lux +++ b/stdlib/source/test/lux/tool/compiler/meta/cache.lux @@ -29,10 +29,10 @@ fs (file.mock /)] context $//context.random] ($_ _.and - (in (do async.monad + (in (do [! async.monad] [pre/0 (# fs directory? (/.path fs context)) pre/1 (/.enabled? fs context) - outcome (/.enable! fs context) + outcome (/.enable! ! fs context) post/0 (# fs directory? (/.path fs context)) post/1 (/.enabled? fs context)] (_.cover' [/.path /.enabled? /.enable!] diff --git a/stdlib/source/test/lux/tool/compiler/meta/cache/archive.lux b/stdlib/source/test/lux/tool/compiler/meta/cache/archive.lux index 03a0d376b..34f3693f6 100644 --- a/stdlib/source/test/lux/tool/compiler/meta/cache/archive.lux +++ b/stdlib/source/test/lux/tool/compiler/meta/cache/archive.lux @@ -66,9 +66,9 @@ (in [archive (archive.export ///.version archive)])) try.trusted)]] ($_ _.and - (in (do async.monad + (in (do [! async.monad] [pre/0 (# fs file? (/.descriptor fs context)) - enabled? (//.enable! fs context) + enabled? (//.enable! ! fs context) cached? (/.cache! fs context archive) actual (# fs read (/.descriptor fs context)) post/0 (# fs file? (/.descriptor fs context))] diff --git a/stdlib/source/test/lux/tool/compiler/meta/cache/artifact.lux b/stdlib/source/test/lux/tool/compiler/meta/cache/artifact.lux index d3ba700a2..34aa31b78 100644 --- a/stdlib/source/test/lux/tool/compiler/meta/cache/artifact.lux +++ b/stdlib/source/test/lux/tool/compiler/meta/cache/artifact.lux @@ -35,9 +35,9 @@ @artifact random.nat expected ($binary.random 1)] ($_ _.and - (in (do async.monad + (in (do [! async.monad] [pre (# fs file? (/.path fs context @module @artifact)) - _ (//module.enable! fs context @module) + _ (//module.enable! ! fs context @module) write! (/.cache! fs context @module @artifact expected) post (# fs file? (/.path fs context @module @artifact)) read! (/.cache fs context @module @artifact)] diff --git a/stdlib/source/test/lux/tool/compiler/meta/cache/module.lux b/stdlib/source/test/lux/tool/compiler/meta/cache/module.lux index 98415b367..b73f420aa 100644 --- a/stdlib/source/test/lux/tool/compiler/meta/cache/module.lux +++ b/stdlib/source/test/lux/tool/compiler/meta/cache/module.lux @@ -54,10 +54,10 @@ context $///context.random @module random.nat] ($_ _.and - (in (do async.monad + (in (do [! async.monad] [pre/0 (# fs directory? (/.path fs context @module)) pre/1 (/.enabled? fs context @module) - outcome (/.enable! fs context @module) + outcome (/.enable! ! fs context @module) post/0 (# fs directory? (/.path fs context @module)) post/1 (/.enabled? fs context @module)] (_.cover' [/.path /.enabled? /.enable!] @@ -70,10 +70,10 @@ post/0 post/1)))) - (in (do async.monad + (in (do [! async.monad] [pre/0 (# fs directory? (/.path fs context @module)) pre/1 (/.enabled? fs context @module) - outcome (/.enable! (..bad fs) context @module) + outcome (/.enable! ! (..bad fs) context @module) post/0 (# fs directory? (/.path fs context @module)) post/1 (/.enabled? fs context @module)] (_.cover' [/.cannot_enable] -- cgit v1.2.3