From feacd79496ae9c76492d5a12d30b78724b642654 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 26 Jul 2022 18:08:04 -0400 Subject: Made inlined functions into first-class macros. --- .../bookmark/abi__application_binary_interface.md | 8 + .../bookmark/application_binary_interface.md | 6 - .../differentiable_programming.md | 3 + documentation/bookmark/back_end/Godot.md | 4 - documentation/bookmark/back_end/JavaScript.md | 9 - documentation/bookmark/back_end/c++.md | 67 --- documentation/bookmark/back_end/c.md | 9 - documentation/bookmark/back_end/go.md | 4 - documentation/bookmark/back_end/graal.md | 4 - documentation/bookmark/back_end/haskell.md | 9 - documentation/bookmark/back_end/haxe.md | 5 - documentation/bookmark/back_end/llvm.md | 4 - .../bookmark/back_end/micro_controller.md | 4 - documentation/bookmark/back_end/native.md | 133 ----- documentation/bookmark/back_end/python.md | 5 - documentation/bookmark/back_end/rust.md | 5 - documentation/bookmark/back_end/scopes.md | 4 - documentation/bookmark/back_end/wasm.md | 52 -- documentation/bookmark/back_end/wren.md | 4 - documentation/bookmark/business/leadership.md | 2 + documentation/bookmark/business/management.md | 1 + documentation/bookmark/cloud.md | 5 + documentation/bookmark/compilation/target/c++.md | 93 +++ documentation/bookmark/compilation/target/c.md | 13 + documentation/bookmark/compilation/target/clr.md | 5 + documentation/bookmark/compilation/target/go.md | 4 + documentation/bookmark/compilation/target/godot.md | 4 + documentation/bookmark/compilation/target/graal.md | 4 + .../bookmark/compilation/target/haskell.md | 9 + documentation/bookmark/compilation/target/haxe.md | 5 + documentation/bookmark/compilation/target/js.md | 5 - .../bookmark/compilation/target/js__javascript.md | 14 + documentation/bookmark/compilation/target/llvm.md | 4 + .../compilation/target/micro_controller.md | 4 + .../bookmark/compilation/target/native.md | 133 +++++ .../bookmark/compilation/target/python.md | 5 + documentation/bookmark/compilation/target/rust.md | 5 + .../bookmark/compilation/target/scopes.md | 4 + documentation/bookmark/compilation/target/wasm.md | 58 ++ documentation/bookmark/compilation/target/wren.md | 4 + documentation/bookmark/concurrency/actor.md | 3 + documentation/bookmark/cooling.md | 5 + .../bookmark/data/structure/probabilistic.md | 4 + documentation/bookmark/database.md | 2 + documentation/bookmark/design/system.md | 5 + documentation/bookmark/distributed_programming.md | 148 ++--- documentation/bookmark/documentation.md | 1 + documentation/bookmark/floating_point.md | 14 + documentation/bookmark/fluidics.md | 6 + documentation/bookmark/game/balance.md | 6 + documentation/bookmark/game/mechanic/enemy.md | 2 + documentation/bookmark/game/speedrun.md | 5 + documentation/bookmark/game/storytelling.md | 1 + documentation/bookmark/graphic/3d/shading.md | 5 + documentation/bookmark/investing.md | 1 + documentation/bookmark/license.md | 5 + documentation/bookmark/math.md | 1 + .../memory_management/garbage_collection.md | 2 + documentation/bookmark/microprogramming.md | 5 + documentation/bookmark/open_source.md | 2 + .../bookmark/open_source/commercialization.md | 5 + documentation/bookmark/optics.md | 5 +- documentation/bookmark/optimization.md | 9 + documentation/bookmark/optimization/compiler.md | 6 + documentation/bookmark/recycling.md | 6 + documentation/bookmark/security/authentication.md | 2 + .../bookmark/software/engineering/alert.md | 5 + documentation/bookmark/testing.md | 13 + documentation/bookmark/testing/metamorphic.md | 5 + .../bookmark/user_interface/a11y__accessibility.md | 9 + .../bookmark/user_interface/accessibility.md | 7 - lux-js/commands.md | 7 +- lux-js/project.lux | 11 +- lux-js/source/program.lux | 102 ++-- lux-jvm/commands.md | 6 +- lux-jvm/source/program.lux | 28 +- lux-lua/commands.md | 2 +- lux-lua/project.lux | 2 +- lux-lua/source/program.lux | 16 +- lux-mode/lux-mode.el | 7 +- lux-python/commands.md | 2 +- lux-python/project.lux | 2 +- lux-python/source/program.lux | 16 +- lux-ruby/commands.md | 2 +- lux-ruby/project.lux | 4 +- lux-ruby/source/program.lux | 28 +- stdlib/commands.md | 2 +- stdlib/source/documentation/lux.lux | 2 +- stdlib/source/documentation/lux/ffi.js.lux | 10 +- stdlib/source/documentation/lux/ffi.py.lux | 8 +- stdlib/source/documentation/lux/meta/macro.lux | 101 ++-- stdlib/source/library/lux.lux | 621 +++++++++------------ .../source/library/lux/control/function/inline.lux | 63 ++- stdlib/source/library/lux/debug.lux | 8 +- stdlib/source/library/lux/ffi/export.js.lux | 7 +- stdlib/source/library/lux/ffi/export.lua.lux | 7 +- stdlib/source/library/lux/ffi/export.py.lux | 7 +- stdlib/source/library/lux/ffi/export.rb.lux | 7 +- stdlib/source/library/lux/ffi/node_js.js.lux | 2 +- .../language/lux/phase/extension/analysis/jvm.lux | 120 ++-- .../language/lux/phase/generation/js/runtime.lux | 8 +- .../language/lux/phase/generation/lua/runtime.lux | 8 +- .../language/lux/phase/generation/ruby/runtime.lux | 10 +- stdlib/source/library/lux/meta/macro/pattern.lux | 110 ++-- stdlib/source/test/lux/control/function/inline.lux | 7 +- stdlib/source/test/lux/meta/extension.lux | 8 +- stdlib/source/test/lux/meta/target/js.lux | 8 +- stdlib/source/unsafe/lux/data/binary.lux | 56 +- 108 files changed, 1304 insertions(+), 1126 deletions(-) create mode 100644 documentation/bookmark/abi__application_binary_interface.md delete mode 100644 documentation/bookmark/application_binary_interface.md delete mode 100644 documentation/bookmark/back_end/Godot.md delete mode 100644 documentation/bookmark/back_end/JavaScript.md delete mode 100644 documentation/bookmark/back_end/c++.md delete mode 100644 documentation/bookmark/back_end/c.md delete mode 100644 documentation/bookmark/back_end/go.md delete mode 100644 documentation/bookmark/back_end/graal.md delete mode 100644 documentation/bookmark/back_end/haskell.md delete mode 100644 documentation/bookmark/back_end/haxe.md delete mode 100644 documentation/bookmark/back_end/llvm.md delete mode 100644 documentation/bookmark/back_end/micro_controller.md delete mode 100644 documentation/bookmark/back_end/native.md delete mode 100644 documentation/bookmark/back_end/python.md delete mode 100644 documentation/bookmark/back_end/rust.md delete mode 100644 documentation/bookmark/back_end/scopes.md delete mode 100644 documentation/bookmark/back_end/wasm.md delete mode 100644 documentation/bookmark/back_end/wren.md create mode 100644 documentation/bookmark/cloud.md create mode 100644 documentation/bookmark/compilation/target/c.md create mode 100644 documentation/bookmark/compilation/target/clr.md create mode 100644 documentation/bookmark/compilation/target/go.md create mode 100644 documentation/bookmark/compilation/target/godot.md create mode 100644 documentation/bookmark/compilation/target/graal.md create mode 100644 documentation/bookmark/compilation/target/haskell.md create mode 100644 documentation/bookmark/compilation/target/haxe.md delete mode 100644 documentation/bookmark/compilation/target/js.md create mode 100644 documentation/bookmark/compilation/target/js__javascript.md create mode 100644 documentation/bookmark/compilation/target/llvm.md create mode 100644 documentation/bookmark/compilation/target/micro_controller.md create mode 100644 documentation/bookmark/compilation/target/native.md create mode 100644 documentation/bookmark/compilation/target/python.md create mode 100644 documentation/bookmark/compilation/target/rust.md create mode 100644 documentation/bookmark/compilation/target/scopes.md create mode 100644 documentation/bookmark/compilation/target/wasm.md create mode 100644 documentation/bookmark/compilation/target/wren.md create mode 100644 documentation/bookmark/cooling.md create mode 100644 documentation/bookmark/design/system.md create mode 100644 documentation/bookmark/fluidics.md create mode 100644 documentation/bookmark/game/balance.md create mode 100644 documentation/bookmark/game/speedrun.md create mode 100644 documentation/bookmark/graphic/3d/shading.md create mode 100644 documentation/bookmark/license.md create mode 100644 documentation/bookmark/microprogramming.md create mode 100644 documentation/bookmark/open_source/commercialization.md create mode 100644 documentation/bookmark/optimization/compiler.md create mode 100644 documentation/bookmark/recycling.md create mode 100644 documentation/bookmark/software/engineering/alert.md create mode 100644 documentation/bookmark/testing/metamorphic.md create mode 100644 documentation/bookmark/user_interface/a11y__accessibility.md delete mode 100644 documentation/bookmark/user_interface/accessibility.md diff --git a/documentation/bookmark/abi__application_binary_interface.md b/documentation/bookmark/abi__application_binary_interface.md new file mode 100644 index 000000000..6b49b61f6 --- /dev/null +++ b/documentation/bookmark/abi__application_binary_interface.md @@ -0,0 +1,8 @@ +# Reference + +0. []() +0. [How Swift Achieved Dynamic Linking Where Rust Couldn't](https://gankra.github.io/blah/swift-abi/) +0. [Interface method calls with the Go register ABI](https://eli.thegreenplace.net/2022/interface-method-calls-with-the-go-register-abi/) +0. [To Save C, We Must Save ABI](https://thephd.dev/to-save-c-we-must-save-abi-fixing-c-function-abi) +0. [Making Libraries Consumable for Non-C++ Developers - Aaron R Robinson - CppCon 2021](https://www.youtube.com/watch?v=4r09pv9v1w0) + diff --git a/documentation/bookmark/application_binary_interface.md b/documentation/bookmark/application_binary_interface.md deleted file mode 100644 index 0cde5cb58..000000000 --- a/documentation/bookmark/application_binary_interface.md +++ /dev/null @@ -1,6 +0,0 @@ -# Reference - -0. [Interface method calls with the Go register ABI](https://eli.thegreenplace.net/2022/interface-method-calls-with-the-go-register-abi/) -0. [To Save C, We Must Save ABI](https://thephd.dev/to-save-c-we-must-save-abi-fixing-c-function-abi) -0. [Making Libraries Consumable for Non-C++ Developers - Aaron R Robinson - CppCon 2021](https://www.youtube.com/watch?v=4r09pv9v1w0) - diff --git a/documentation/bookmark/artificial_intelligence/differentiable_programming.md b/documentation/bookmark/artificial_intelligence/differentiable_programming.md index 69adc6a2f..96ba976cf 100644 --- a/documentation/bookmark/artificial_intelligence/differentiable_programming.md +++ b/documentation/bookmark/artificial_intelligence/differentiable_programming.md @@ -1,9 +1,12 @@ # Programming language +0. []() 0. [Myia](https://github.com/mila-iqia/myia) # Reference +0. []() +0. [The simple essence of automatic differentiation](http://conal.net/papers/essence-of-ad/) 0. [Provably Correct, Asymptotically Efficient, Higher-Order Reverse-Mode Automatic Differentiation](https://www.cl.cam.ac.uk/~nk480/higher-order-ad.pdf) 0. [Differentiable Programming in C++ - Vassil Vassilev & William Moses - CppCon 2021](https://www.youtube.com/watch?v=1QQj1mAV-eY) 0. [Demystifying Differentiable Programming: Shift/Reset the Penultimate Backpropagator](https://arxiv.org/abs/1803.10228) diff --git a/documentation/bookmark/back_end/Godot.md b/documentation/bookmark/back_end/Godot.md deleted file mode 100644 index 354e87e96..000000000 --- a/documentation/bookmark/back_end/Godot.md +++ /dev/null @@ -1,4 +0,0 @@ -# Reference - -1. [GDLisp](https://github.com/Mercerenies/gdlisp) - diff --git a/documentation/bookmark/back_end/JavaScript.md b/documentation/bookmark/back_end/JavaScript.md deleted file mode 100644 index f3c57b57f..000000000 --- a/documentation/bookmark/back_end/JavaScript.md +++ /dev/null @@ -1,9 +0,0 @@ -# Debugging - -1. [The JavaScript Self-Profiling API](https://addyosmani.com/blog/js-self-profiling/) - -# Number - -1. [BigInt: arbitrary-precision integers in JavaScript](https://v8.dev/features/bigint) -1. [WebAssembly integration with JavaScript BigInt](https://v8.dev/features/wasm-bigint) - diff --git a/documentation/bookmark/back_end/c++.md b/documentation/bookmark/back_end/c++.md deleted file mode 100644 index b1ee86bb3..000000000 --- a/documentation/bookmark/back_end/c++.md +++ /dev/null @@ -1,67 +0,0 @@ -# Optimization - -0. [C and C++ coding style for best performance](https://www.ibm.com/docs/en/aix/7.1?topic=implementation-c-c-coding-style-best-performance) - -# Reference - -0. [Constant references are not always your friends](https://belaycpp.com/2022/02/15/constant-references-are-not-always-your-friends/) -0. [Unionizing for Profit: How to Exploit the Power of Unions in C++](https://dev-discuss.pytorch.org/t/unionizing-for-profit-how-to-exploit-the-power-of-unions-in-c/444) -0. [std::any: How, when, and why](https://devblogs.microsoft.com/cppblog/stdany-how-when-and-why/) -0. [Using C Libraries in your Modern C++ Embedded Project - Michael Caisse - CppCon 2021](https://www.youtube.com/watch?v=Ototzy-nP4M) -0. [In-memory and Persistent Representations of C++ - Gabriel Dos Reis - CppCon 2021](https://www.youtube.com/watch?v=39wlNRk-nAg) -0. [Back to Basics: const and constexpr - Rainer Grimm - CppCon 2021](https://www.youtube.com/watch?v=tA6LbPyYdco) -0. [Misra Parallelism Safety-critical Guidelines for C++11, 17, Then C++20, 23 - CppCon 2021](https://www.youtube.com/watch?v=hVv7Nc3f4Jo) -0. [Back to Basics: Move Semantics - Nicolai Josuttis - CppCon 2021](https://www.youtube.com/watch?v=Bt3zcJZIalk) -0. [Type-and-resource Safety in Modern C++ - Bjarne Stroustrup - CppCon 2021](https://www.youtube.com/watch?v=l3rvjWfBzZI) -0. [Exceptional C++ - Victor Ciura - CppCon 2021](https://www.youtube.com/watch?v=SjlfhyZn2yA) - -# Undefined behavior - -0. [INT32-C. Ensure that operations on signed integers do not result in overflow](https://wiki.sei.cmu.edu/confluence/display/c/INT32-C.+Ensure+that+operations+on+signed+integers+do+not+result+in+overflow) -0. [Integer overflow](https://en.wikipedia.org/wiki/Integer_overflow#Handling) -0. [Back To Basics: Undefined Behavior - Ansel Sermersheim & Barbara Geller - CppCon 2021](https://www.youtube.com/watch?v=NpL9YnxnOqM) - -# Dependency management - -0. [vcpkg](https://vcpkg.io/en/index.html) - -# constexpr - -0. [Your New Mental Model of constexpr - Jason Turner - CppCon 2021](https://www.youtube.com/watch?v=MdrfPSUtMVM) - -# String - -0. [CsString (intro to unicode)](https://www.youtube.com/watch?v=nYzi0-VAXQM) -0. [CsString (library design)](https://www.youtube.com/watch?v=w_kD-qAkoH0) -0. [char8_t](https://www.youtube.com/watch?v=vOOLXvu-xtU) -0. [std::u32string](https://www.cplusplus.com/reference/string/u32string/) - -# Variadic functions - -0. [Variadic functions](https://en.cppreference.com/w/cpp/utility/variadic) -0. [Parameter pack](https://en.cppreference.com/w/cpp/language/parameter_pack) -0. [va_start](https://www.cplusplus.com/reference/cstdarg/va_start/) - -# Multi-threading - -0. [std::thread](https://en.cppreference.com/w/cpp/thread/thread) -0. [std::thread::hardware_concurrency](https://en.cppreference.com/w/cpp/thread/thread/hardware_concurrency) -0. [std::atomic](https://en.cppreference.com/w/cpp/atomic/atomic) -0. [std::atomic::compare_exchange_strong](https://www.cplusplus.com/reference/atomic/atomic/compare_exchange_strong/) - -# Interpreter - -0. [Clasp — Bringing Common Lisp and C++ Together](https://github.com/clasp-developers/clasp) -0. [Cling](https://root.cern/cling/) -0. [Interactive C++ with Cling](https://blog.llvm.org/posts/2020-11-30-interactive-cpp-with-cling/) -0. [Cling Transitions to LLVM's Clang-Repl](https://root.cern/blog/cling-in-llvm/) -0. [cppyy: Automatic Python-C++ bindings](https://cppyy.readthedocs.io/en/latest/index.html) - -# Cross-compilation - -0. [Cross compiling Windows binaries from Linux](https://jake-shadle.github.io/xwin/) -0. [Clang C++ Cross Compiler - Generating Windows Executable from Mac OS X](https://stackoverflow.com/questions/23248989/clang-c-cross-compiler-generating-windows-executable-from-mac-os-x) -0. [The Clang Universal Driver Project](https://clang.llvm.org/UniversalDriver.html) -0. [Cross-compilation using Clang](https://clang.llvm.org/docs/CrossCompilation.html) -0. [Wclang: Cross compile source code easily for Windows with clang on Linux/Unix](https://github.com/tpoechtrager/wclang) - diff --git a/documentation/bookmark/back_end/c.md b/documentation/bookmark/back_end/c.md deleted file mode 100644 index 73383e848..000000000 --- a/documentation/bookmark/back_end/c.md +++ /dev/null @@ -1,9 +0,0 @@ -# Reference - -0. [Quirks of C](https://gist.github.com/fay59/5ccbe684e6e56a7df8815c3486568f01) -0. [C Isn't A Programming Language Anymore](https://gankra.github.io/blah/c-isnt-a-language/) -0. [Functional C](https://ris.utwente.nl/ws/portalfiles/portal/5128727/book.pdf) -0. [Cello: High Level C](https://libcello.org/) -0. [C as a scripting language thanks to TinyCC](https://ciesie.com/post/tinycc_dynamic_compilation/) -0. [mlibc: Portable C standard library](https://github.com/managarm/mlibc) - diff --git a/documentation/bookmark/back_end/go.md b/documentation/bookmark/back_end/go.md deleted file mode 100644 index 6d25fd45d..000000000 --- a/documentation/bookmark/back_end/go.md +++ /dev/null @@ -1,4 +0,0 @@ -# Reference - -0. [Interface method calls with the Go register ABI](https://eli.thegreenplace.net/2022/interface-method-calls-with-the-go-register-abi/) - diff --git a/documentation/bookmark/back_end/graal.md b/documentation/bookmark/back_end/graal.md deleted file mode 100644 index bd91d9218..000000000 --- a/documentation/bookmark/back_end/graal.md +++ /dev/null @@ -1,4 +0,0 @@ -# Reference - -1. [Anybody know how the graal project ties in with all of this? Is oracle effective... | Hacker News](https://news.ycombinator.com/item?id=19435964) - diff --git a/documentation/bookmark/back_end/haskell.md b/documentation/bookmark/back_end/haskell.md deleted file mode 100644 index b54c23945..000000000 --- a/documentation/bookmark/back_end/haskell.md +++ /dev/null @@ -1,9 +0,0 @@ -# Language - -0. [Finkel](https://github.com/finkel-lang/finkel) -0. [Eta - Modern Haskell on the JVM](https://github.com/typelead/eta) - -# Reference - -0. [Thunks, Sharing, Laziness: The Haskell Heap Visualized – Joachim Breitner](https://www.youtube.com/watch?v=I4lnCG18TaY) - diff --git a/documentation/bookmark/back_end/haxe.md b/documentation/bookmark/back_end/haxe.md deleted file mode 100644 index d9aa29d2d..000000000 --- a/documentation/bookmark/back_end/haxe.md +++ /dev/null @@ -1,5 +0,0 @@ -# Reference - -0. [How to use the interpreter mode?](https://community.haxe.org/t/how-to-use-the-interpreter-mode/2642) -0. [Eval - The new Haxe macro interpreter](https://haxe.org/blog/eval/) - diff --git a/documentation/bookmark/back_end/llvm.md b/documentation/bookmark/back_end/llvm.md deleted file mode 100644 index 55a99f6e8..000000000 --- a/documentation/bookmark/back_end/llvm.md +++ /dev/null @@ -1,4 +0,0 @@ -# Reference - -0. [Taming Undefined Behavior in LLVM](https://www.cs.utah.edu/~regehr/papers/undef-pldi17.pdf) - diff --git a/documentation/bookmark/back_end/micro_controller.md b/documentation/bookmark/back_end/micro_controller.md deleted file mode 100644 index 2681cbf67..000000000 --- a/documentation/bookmark/back_end/micro_controller.md +++ /dev/null @@ -1,4 +0,0 @@ -# Reference - -1. [HaikuVM](http://haiku-vm.sourceforge.net/) - diff --git a/documentation/bookmark/back_end/native.md b/documentation/bookmark/back_end/native.md deleted file mode 100644 index 32da388c9..000000000 --- a/documentation/bookmark/back_end/native.md +++ /dev/null @@ -1,133 +0,0 @@ -# Java - -1. [Java Grinder](https://www.mikekohn.net/micro/java_grinder.php) - -# Register allocation - -1. [A Quick Introduction to Register Allocation](https://hassamuddin.com/blog/reg-alloc/) - -# Call stack - -1. http://stffrdhrn.github.io/software/embedded/openrisc/2018/06/08/gcc_stack_frames.html -1. https://yurichev.com/blog/reg_alloc/ - -# Unicode - -1. http://manishearth.github.io/blog/2017/01/14/stop-ascribing-meaning-to-unicode-code-points/ -1. https://garbagecollected.org/2013/03/15/reverse-strings-like-a-pro/ -1. http://reedbeta.com/blog/programmers-intro-to-unicode/ -1. https://mathiasbynens.be/notes/javascript-unicode -1. http://www.daemonology.net/blog/2008-06-05-faster-utf8-strlen.html -1. https://haxe.org/blog/unicode/ -1. http://justinblank.com/notebooks/stringrepresentationsandstringapis.html - -# Shell - -1. https://github.com/dylanaraps/pure-bash-bible - -# Platforms - -1. https://github.com/neutralinojs/neutralinojs - -# Concurrency - -1. https://github.com/hnes/libaco - -# Numeric operation - -1. https://github.com/ridiculousfish/libdivide -1. https://lemire.me/blog/2019/02/08/faster-remainders-when-the-divisor-is-a-constant-beating-compilers-and-libdivide/ - -# Optimization - -1. http://ssw.jku.at/General/Staff/Leopoldseder/manlang2018-fast_path_unrolling_authorpreprint.pdf - -# Foreign function interface (FFI) - -1. https://github.com/swig/swig -1. http://www.swig.org/ -1. http://www.swig.org/Doc2.0/Go.html -1. https://begriffs.com/posts/2019-01-19-inside-c-standard-lib.html -1. https://www.amazon.com/Standard-C-Library-P-J-Plauger/dp/0131315099 - -# Graal - -1. https://www.newtv.co.th/video/video.php?v=topKYJgv6qA - -# Floating point arithmetic - -1. [Accurate Differences of Products with Kahan's Algorithm](https://pharr.org/matt/blog/2019/11/03/difference-of-floats.html) -1. https://floating-point-gui.de/ -1. [Faster floating point arithmetic with Exclusive OR](http://nfrechette.github.io/2019/10/22/float_xor_optimization/) -1. https://oded.ninja/2017/05/01/floating-point/ -1. [What Every Computer Scientist Should Know About Floating-Point Arithmetic](http://www.lsi.upc.edu/~robert/teaching/master/material/p5-goldberg.pdf) -1. https://lemire.me/blog/2017/11/16/fast-exact-integer-divisions-using-floating-point-operations/ - -# Reference - -1. [Executables - Linking and Loading](https://github.com/MattPD/cpplinks/blob/master/executables.linking_loading.md) -1. http://luajit.org/ -1. http://luajit.org/ext_ffi.html -1. http://luajit.org/dynasm.html -1. [The Standard C Library](https://www.amazon.com/Standard-C-Library-P-J-Plauger/dp/0131315099) -1. [C Is Not a Low-level Language: Your computer is not a fast PDP-11.](https://queue.acm.org/detail.cfm?id=3212479) -1. http://www.ffconsultancy.com/ocaml/hlvm/ -1. https://nullprogram.com/blog/2018/05/27/ -1. https://github.com/dyu/ffi-overhead -1. https://ivorylang.org/ivory-introduction.html -1. http://blog.llvm.org/2018/03/dragonffi-ffijit-for-c-language-using.html -1. https://internals.rust-lang.org/t/refactoring-std-for-ultimate-portability/4301 -1. https://blog.plan99.net/kotlin-native-310ffac94af2 -1. https://blog.jetbrains.com/kotlin/2017/12/kotlinnative-v0-5-released-calling-kotlin-from-swift-and-c-llvm-5-and-more/ -1. https://readytalk.github.io/avian/ -1. https://medium.com/@octskyward/kotlin-native-310ffac94af2#.xbcxqlm1w -1. https://www.infoq.com/presentations/clojure-scheme -1. https://github.com/ollef/sixten -1. https://software.intel.com/sites/landingpage/IntrinsicsGuide/ -1. https://llvllatrix.wordpress.com/2016/12/31/system-calls-for-developers/ -1. http://www.cipht.net/2017/10/03/are-jump-tables-always-fastest.html -1. https://github.com/libuv/libuv -1. https://www.threadingbuildingblocks.org/ -1. https://cafbit.com/post/tokio_internals/ -1. https://medium.com/@unmeshvjoshi/how-java-thread-maps-to-os-thread-e280a9fb2e06 -1. http://pixielang.org/ -1. https://github.com/pixie-lang/pixie -1. https://github.com/rust-lang/rust -1. http://ziglang.org/# -1. http://www.mpfr.org/ -1. http://www.mpfr.org/algorithms.pdf -1. http://wilsonminesco.com/16bitMathTables/ -1. http://blog.veitheller.de/Fixed_Point_Division.html -1. http://libdivide.com/ -1. [Modern Computer Arithmetic](https://members.loria.fr/PZimmermann/mca/mca-cup-0.5.9.pdf) -1. [Division by Invariant Integers using Multiplication](https://gmplib.org/~tege/divcnst-pldi94.pdf) -1. https://lion137.blogspot.com/2019/02/borneo-language-102.html -1. https://www.youtube.com/watch?v=N0JTvyCxiv8 -1. http://robert.ocallahan.org/2017/02/what-rust-can-do-that-other-languages.html -1. https://github.com/graalvm/truffleruby/blob/master/doc/user/svm.md -1. http://bellard.org/libbf/ -1. http://paulcavallaro.com/blog/hashed-and-hierarchical-timing-wheels/ -1. http://speleotrove.com/decimal/ -1. http://eli.thegreenplace.net/2013/07/09/library-order-in-static-linking -1. [Skip the FFI!](http://llvm.org/devmtg/2014-10/Slides/Skip%20the%20FFI.pdf) -1. http://www.infoworld.com/article/3187370/application-development/kotlin-compiles-directly-to-native-code-via-llvm.html -1. https://blog.jetbrains.com/kotlin/2017/04/kotlinnative-tech-preview-kotlin-without-a-vm/ -1. https://github.com/bugvm/bugvm -1. https://github.com/rampantpixels/rpmalloc -1. https://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Data/endian.html -1. http://web.stanford.edu/group/sequoia/ -1. https://hackernoon.com/experimenting-with-small-buffer-optimization-for-c-lambdas-d5b703fb47e4 -1. https://www.microsoft.com/en-us/research/wp-content/uploads/2017/03/kedia2017mem.pdf -1. https://github.com/tomhrr/dale -1. [Fast String Searching](https://pdfs.semanticscholar.org/d991/2ea262986794e29e3f15e5f8930d42f2ced4.pdf) -1. https://github.com/apple/swift/blob/master/docs/StringManifesto.md -1. http://home.pipeline.com/~hbaker1/CheneyMTA.html -1. [Position: Lightweight static resources 0Sexy types for embedded and systems programming](https://pdfs.semanticscholar.org/2368/ccf8c62ab981e2426cd698ba2229f3eca311.pdf?_ga=2.228359389.1990612643.1507689838-1658669397.1507689838) -1. http://homes.soic.indiana.edu/ccshan/tfp2007/talk.pdf -1. http://www.catb.org/esr/structure-packing/ -1. [Ahead Of Time (AOT) Internals](https://www.youtube.com/watch?v=n5DCg6M2MDM) -1. [Polyglot Native: Java, Scala, Kotlin, & JVM languages](https://www.youtube.com/watch?v=5BMHIeMXTqA) -1. https://ziviani.net/2017/functions-in-assembly -1. https://ziviani.net/2017/functions-in-assembly-ii -1. [Hashed and Hierarchical Timing Wheels: Data Structures for the Efficient Implementation of a Timer Facility](http://www.cs.columbia.edu/~nahum/w6998/papers/sosp87-timing-wheels.pdf) - diff --git a/documentation/bookmark/back_end/python.md b/documentation/bookmark/back_end/python.md deleted file mode 100644 index 5113bb712..000000000 --- a/documentation/bookmark/back_end/python.md +++ /dev/null @@ -1,5 +0,0 @@ -# Platform - -0. [nanobind — Seamless operability between C++17 and Python](https://github.com/wjakob/nanobind) -0. [BeeWare: Write once. Deploy everywhere.](https://beeware.org/) - diff --git a/documentation/bookmark/back_end/rust.md b/documentation/bookmark/back_end/rust.md deleted file mode 100644 index f38b36966..000000000 --- a/documentation/bookmark/back_end/rust.md +++ /dev/null @@ -1,5 +0,0 @@ -# Reference - -0. [Rust's Rules Are Made to Be Broken](https://blog.warp.dev/rules-are-made-to-be-broken/) -0. [CXX — safe interop between Rust and C++](https://cxx.rs/) - diff --git a/documentation/bookmark/back_end/scopes.md b/documentation/bookmark/back_end/scopes.md deleted file mode 100644 index cd938a3ad..000000000 --- a/documentation/bookmark/back_end/scopes.md +++ /dev/null @@ -1,4 +0,0 @@ -# Reference - -0. [The Scopes Programming Language & Compiler Infrastructure](https://hg.sr.ht/~duangle/scopes) - diff --git a/documentation/bookmark/back_end/wasm.md b/documentation/bookmark/back_end/wasm.md deleted file mode 100644 index 4ad7a40e9..000000000 --- a/documentation/bookmark/back_end/wasm.md +++ /dev/null @@ -1,52 +0,0 @@ -# Interoperability - -0. [How to Extend WebAssembly with Host Functions](https://www.secondstate.io/articles/extend-webassembly/) -0. [js-wasm: JavaScript and WebAssembly should be a joy to use together.](https://wasm.js.org/) - -# Concurrency - -0. [Wasm threads are now available in all browsers](https://old.reddit.com/r/WebAssembly/comments/rk83mr/wasm_threads_are_now_available_in_all_browsers/) - -# Platform - -0. [Wasmer Java](https://github.com/wasmerio/wasmer-java) -0. [WAVM: WAVM is a WebAssembly virtual machine, designed for use in non-web applications.](https://wavm.github.io/) - -# Exemplar - -0. [Announcing GraalWasm — a WebAssembly engine in GraalVM](https://medium.com/graalvm/announcing-graalwasm-a-webassembly-engine-in-graalvm-25cd0400a7f2) -0. [Towards a WebAssembly standalone runtime on GraalVM](https://dl.acm.org/citation.cfm?id=3362780) -0. https://github.com/vvanders/wasm_lua -0. https://github.com/AppCypher/webassemblylanguages -0. https://medium.com/perlin-network/life-a-secure-blazing-fast-cross-platform-webassembly-vm-in-go-ea3b31fa6e09 - -# Reference - -0. [Recommendations when publishing a Wasm library](https://nickb.dev/blog/recommendations-when-publishing-a-wasm-library) -0. [Building host implementations for WebAssembly interfaces](https://radu-matei.com/blog/wasm-components-host-implementations/) -0. [WebAssembly Techniques to Speed Up Matrix Multiplication by 120x](https://jott.live/markdown/mm_wasm) -0. [Chasing Memory Bugs through V8 and WebAssembly](https://blog.stackblitz.com/posts/debugging-v8-webassembly/) -0. [Wasm needs a better memory management story](https://github.com/WebAssembly/design/issues/1397) -0. https://bytecodealliance.org/ -0. [Faster Fractals with Multi-Threaded WebAssembly](https://blog.scottlogic.com/2019/07/15/multithreaded-webassembly.html) -0. https://blog.scottlogic.com/2018/07/20/wasm-future.html -0. http://fitzgeraldnick.com/2018/04/26/how-does-dynamic-dispatch-work-in-wasm.html -0. https://hacks.mozilla.org/2018/03/making-webassembly-better-for-rust-for-all-languages/ -0. https://webassembly.github.io/ -0. https://github.com/WebAssembly/spec/blob/md-proto/md-proto/WebAssembly.md -0. https://github.com/WebAssembly/binaryen -0. [NYLUG Presents: Luke Wagner -on- WebAssembly: A New Compiler Target For The Web](https://www.youtube.com/watch?v=RByPdCN1RQ4) -0. https://binji.github.io/2017/03/05/webassembly-type-checking.html -0. https://github.com/WebAssembly/spec/tree/master/interpreter -0. https://mbebenita.github.io//WasmExplorer/ -0. http://thecodebarbarian.com/getting-started-with-webassembly-in-node.js.html -0. http://blog.seraum.com/compiling-javascript-to-webassembly-wasm-or-asm-js-with-nectarjs -0. https://hacks.mozilla.org/2017/07/memory-in-webassembly-and-why-its-safer-than-you-think/ -0. [Using WebAssembly and Threads (Chrome Dev Summit 2018)](https://www.youtube.com/watch?v=zgOGZgAPUjQ) -0. https://github.com/wasmerio/wasmer -0. https://www.fastly.com/blog/announcing-lucet-fastly-native-webassembly-compiler-runtime -0. https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ -0. https://cybernetist.com/2019/04/25/wasm-universal-application-runtime/ -0. https://github.com/intel/wasm-micro-runtime -0. https://medium.com/wasmer/running-webassembly-on-the-kernel-8e04761f1d8e - diff --git a/documentation/bookmark/back_end/wren.md b/documentation/bookmark/back_end/wren.md deleted file mode 100644 index 8649c720b..000000000 --- a/documentation/bookmark/back_end/wren.md +++ /dev/null @@ -1,4 +0,0 @@ -# Reference - -0. [Meta Class](https://wren.io/modules/meta/meta.html) - diff --git a/documentation/bookmark/business/leadership.md b/documentation/bookmark/business/leadership.md index 1d453f73d..f2d633bc6 100644 --- a/documentation/bookmark/business/leadership.md +++ b/documentation/bookmark/business/leadership.md @@ -1,5 +1,7 @@ # Reference +0. []() +0. [Why You Should Create a “Shadow Board” of Younger Employees](https://hbr.org/2019/06/why-you-should-create-a-shadow-board-of-younger-employees) 0. [There’s No Such Thing as Constructive Criticism](https://hbr.org/2011/11/theres-no-such-thing-as-constr.html) 0. [How Patience Pays Off](https://www.permanentequity.com/writings/how-patience-pays-off) 0. [Why Agile Turns into Micromanagement](https://age-of-product.com/agile-micromanagement/) diff --git a/documentation/bookmark/business/management.md b/documentation/bookmark/business/management.md index f6ce4e385..fe1b947d6 100644 --- a/documentation/bookmark/business/management.md +++ b/documentation/bookmark/business/management.md @@ -1,6 +1,7 @@ # Reference 0. []() +0. [Scrum Teams are often Coached to Death, while the Problems are With Management](https://medium.com/serious-scrum/scrum-teams-are-often-coached-to-death-while-the-problems-are-with-management-60ac93bb0c1c) 0. [Monitoring Employees Makes Them More Likely to Break Rules](https://hbr.org/2022/06/monitoring-employees-makes-them-more-likely-to-break-rules) 0. [Why criticism lasts longer than praise](https://www.bbc.com/future/article/20220624-why-criticism-lasts-longer-than-praise) 0. [What Engineering Managers Should Do (and Why We Don’t) • Lena Reinhard • GOTO 2019](https://www.youtube.com/watch?v=Q_bJVokYLRI) diff --git a/documentation/bookmark/cloud.md b/documentation/bookmark/cloud.md new file mode 100644 index 000000000..3405f0166 --- /dev/null +++ b/documentation/bookmark/cloud.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [LocalStack: A fully functional local cloud stack](https://localstack.cloud/) + diff --git a/documentation/bookmark/compilation/target/c++.md b/documentation/bookmark/compilation/target/c++.md index d62ed0141..40625b60e 100644 --- a/documentation/bookmark/compilation/target/c++.md +++ b/documentation/bookmark/compilation/target/c++.md @@ -1,5 +1,98 @@ +# Memory management + +0. []() +0. [Memory and Performance Overhead of Smart Pointers](https://www.modernescpp.com/index.php/memory-and-performance-overhead-of-smart-pointer) +0. [](https://coderedirect.com/questions/464444/c-atomic-cascompare-and-swap-operation-does-not-change-value) +0. [C++ Shared_Ptr implementation](https://codereview.stackexchange.com/questions/254279/c-shared-ptr-implementation) +0. [C++: shared_ptr and how to write your own](https://medium.com/analytics-vidhya/c-shared-ptr-and-how-to-write-your-own-d0d385c118ad) +0. [How to implement user defined Shared Pointers in C++](https://www.geeksforgeeks.org/how-to-implement-user-defined-shared-pointers-in-c/) +0. [](https://en.cppreference.com/w/cpp/memory/shared_ptr) +0. [smart pointers](https://en.cppreference.com/book/intro/smart_pointers) +0. [](https://en.cppreference.com/w/cpp/numeric/bit_cast) +0. [reinterpret_cast conversion](https://en.cppreference.com/w/cpp/language/reinterpret_cast) +0. [Alternatives to std::atomic_ref](https://stackoverflow.com/questions/67620813/alternatives-to-stdatomic-ref) +0. [std::atomic_ref is awesome](https://www.reddit.com/r/cpp/comments/i8ckxr/stdatomic_ref_is_awesome/) +0. [](https://en.cppreference.com/w/cpp/atomic/atomic_ref) + +# Optimization + +0. []() +0. [Copy Elision](https://www.youtube.com/watch?v=_zZWUZEwXk8) +0. [C and C++ coding style for best performance](https://www.ibm.com/docs/en/aix/7.1?topic=implementation-c-c-coding-style-best-performance) + # Reference 0. []() +0. [C++ keywords: noexcept (since C++11)](https://en.cppreference.com/w/cpp/keyword/noexcept) +0. [alignas specifier (since C++11)](https://en.cppreference.com/w/cpp/language/alignas) +0. [Perfect Forwarding](https://www.modernescpp.com/index.php/perfect-forwarding) 0. [C++ Tips of the Week](https://abseil.io/tips/) +0. [Constant references are not always your friends](https://belaycpp.com/2022/02/15/constant-references-are-not-always-your-friends/) +0. [Unionizing for Profit: How to Exploit the Power of Unions in C++](https://dev-discuss.pytorch.org/t/unionizing-for-profit-how-to-exploit-the-power-of-unions-in-c/444) +0. [std::any: How, when, and why](https://devblogs.microsoft.com/cppblog/stdany-how-when-and-why/) +0. [Using C Libraries in your Modern C++ Embedded Project - Michael Caisse - CppCon 2021](https://www.youtube.com/watch?v=Ototzy-nP4M) +0. [In-memory and Persistent Representations of C++ - Gabriel Dos Reis - CppCon 2021](https://www.youtube.com/watch?v=39wlNRk-nAg) +0. [Back to Basics: const and constexpr - Rainer Grimm - CppCon 2021](https://www.youtube.com/watch?v=tA6LbPyYdco) +0. [Misra Parallelism Safety-critical Guidelines for C++11, 17, Then C++20, 23 - CppCon 2021](https://www.youtube.com/watch?v=hVv7Nc3f4Jo) +0. [Back to Basics: Move Semantics - Nicolai Josuttis - CppCon 2021](https://www.youtube.com/watch?v=Bt3zcJZIalk) +0. [Type-and-resource Safety in Modern C++ - Bjarne Stroustrup - CppCon 2021](https://www.youtube.com/watch?v=l3rvjWfBzZI) +0. [Exceptional C++ - Victor Ciura - CppCon 2021](https://www.youtube.com/watch?v=SjlfhyZn2yA) + +# Undefined behavior + +0. []() +0. [INT32-C. Ensure that operations on signed integers do not result in overflow](https://wiki.sei.cmu.edu/confluence/display/c/INT32-C.+Ensure+that+operations+on+signed+integers+do+not+result+in+overflow) +0. [Integer overflow](https://en.wikipedia.org/wiki/Integer_overflow#Handling) +0. [Back To Basics: Undefined Behavior - Ansel Sermersheim & Barbara Geller - CppCon 2021](https://www.youtube.com/watch?v=NpL9YnxnOqM) + +# Dependency management + +0. []() +0. [vcpkg](https://vcpkg.io/en/index.html) + +# constexpr + +0. []() +0. [Your New Mental Model of constexpr - Jason Turner - CppCon 2021](https://www.youtube.com/watch?v=MdrfPSUtMVM) + +# String + +0. []() +0. [CsString (intro to unicode)](https://www.youtube.com/watch?v=nYzi0-VAXQM) +0. [CsString (library design)](https://www.youtube.com/watch?v=w_kD-qAkoH0) +0. [char8_t](https://www.youtube.com/watch?v=vOOLXvu-xtU) +0. [std::u32string](https://www.cplusplus.com/reference/string/u32string/) + +# Variadic functions + +0. []() +0. [Variadic functions](https://en.cppreference.com/w/cpp/utility/variadic) +0. [Parameter pack](https://en.cppreference.com/w/cpp/language/parameter_pack) +0. [va_start](https://www.cplusplus.com/reference/cstdarg/va_start/) + +# Multi-threading + +0. []() +0. [std::thread](https://en.cppreference.com/w/cpp/thread/thread) +0. [std::thread::hardware_concurrency](https://en.cppreference.com/w/cpp/thread/thread/hardware_concurrency) +0. [std::atomic](https://en.cppreference.com/w/cpp/atomic/atomic) +0. [std::atomic::compare_exchange_strong](https://www.cplusplus.com/reference/atomic/atomic/compare_exchange_strong/) + +# Interpreter + +0. []() +0. [Clasp — Bringing Common Lisp and C++ Together](https://github.com/clasp-developers/clasp) +0. [Cling](https://root.cern/cling/) +0. [Interactive C++ with Cling](https://blog.llvm.org/posts/2020-11-30-interactive-cpp-with-cling/) +0. [Cling Transitions to LLVM's Clang-Repl](https://root.cern/blog/cling-in-llvm/) +0. [cppyy: Automatic Python-C++ bindings](https://cppyy.readthedocs.io/en/latest/index.html) + +# Cross-compilation + +0. []() +0. [Cross compiling Windows binaries from Linux](https://jake-shadle.github.io/xwin/) +0. [Clang C++ Cross Compiler - Generating Windows Executable from Mac OS X](https://stackoverflow.com/questions/23248989/clang-c-cross-compiler-generating-windows-executable-from-mac-os-x) +0. [The Clang Universal Driver Project](https://clang.llvm.org/UniversalDriver.html) +0. [Cross-compilation using Clang](https://clang.llvm.org/docs/CrossCompilation.html) +0. [Wclang: Cross compile source code easily for Windows with clang on Linux/Unix](https://github.com/tpoechtrager/wclang) diff --git a/documentation/bookmark/compilation/target/c.md b/documentation/bookmark/compilation/target/c.md new file mode 100644 index 000000000..81fc2960d --- /dev/null +++ b/documentation/bookmark/compilation/target/c.md @@ -0,0 +1,13 @@ +# Reference + +0. []() +0. [](https://github.com/MichaelMiR01/tcc4tcl) + 0. [](https://github.com/tcllab/tcc4tcl) + 0. [](https://github.com/cyanogilvie/tcc4tcl) +0. [Quirks of C](https://gist.github.com/fay59/5ccbe684e6e56a7df8815c3486568f01) +0. [C Isn't A Programming Language Anymore](https://gankra.github.io/blah/c-isnt-a-language/) +0. [Functional C](https://ris.utwente.nl/ws/portalfiles/portal/5128727/book.pdf) +0. [Cello: High Level C](https://libcello.org/) +0. [C as a scripting language thanks to TinyCC](https://ciesie.com/post/tinycc_dynamic_compilation/) +0. [mlibc: Portable C standard library](https://github.com/managarm/mlibc) + diff --git a/documentation/bookmark/compilation/target/clr.md b/documentation/bookmark/compilation/target/clr.md new file mode 100644 index 000000000..f6e244f9a --- /dev/null +++ b/documentation/bookmark/compilation/target/clr.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Turbocharged: Writing High-Performance C# and .NET Code](https://www.youtube.com/watch?v=bhq1dzQzJ0E) + diff --git a/documentation/bookmark/compilation/target/go.md b/documentation/bookmark/compilation/target/go.md new file mode 100644 index 000000000..6d25fd45d --- /dev/null +++ b/documentation/bookmark/compilation/target/go.md @@ -0,0 +1,4 @@ +# Reference + +0. [Interface method calls with the Go register ABI](https://eli.thegreenplace.net/2022/interface-method-calls-with-the-go-register-abi/) + diff --git a/documentation/bookmark/compilation/target/godot.md b/documentation/bookmark/compilation/target/godot.md new file mode 100644 index 000000000..354e87e96 --- /dev/null +++ b/documentation/bookmark/compilation/target/godot.md @@ -0,0 +1,4 @@ +# Reference + +1. [GDLisp](https://github.com/Mercerenies/gdlisp) + diff --git a/documentation/bookmark/compilation/target/graal.md b/documentation/bookmark/compilation/target/graal.md new file mode 100644 index 000000000..bd91d9218 --- /dev/null +++ b/documentation/bookmark/compilation/target/graal.md @@ -0,0 +1,4 @@ +# Reference + +1. [Anybody know how the graal project ties in with all of this? Is oracle effective... | Hacker News](https://news.ycombinator.com/item?id=19435964) + diff --git a/documentation/bookmark/compilation/target/haskell.md b/documentation/bookmark/compilation/target/haskell.md new file mode 100644 index 000000000..b54c23945 --- /dev/null +++ b/documentation/bookmark/compilation/target/haskell.md @@ -0,0 +1,9 @@ +# Language + +0. [Finkel](https://github.com/finkel-lang/finkel) +0. [Eta - Modern Haskell on the JVM](https://github.com/typelead/eta) + +# Reference + +0. [Thunks, Sharing, Laziness: The Haskell Heap Visualized – Joachim Breitner](https://www.youtube.com/watch?v=I4lnCG18TaY) + diff --git a/documentation/bookmark/compilation/target/haxe.md b/documentation/bookmark/compilation/target/haxe.md new file mode 100644 index 000000000..d9aa29d2d --- /dev/null +++ b/documentation/bookmark/compilation/target/haxe.md @@ -0,0 +1,5 @@ +# Reference + +0. [How to use the interpreter mode?](https://community.haxe.org/t/how-to-use-the-interpreter-mode/2642) +0. [Eval - The new Haxe macro interpreter](https://haxe.org/blog/eval/) + diff --git a/documentation/bookmark/compilation/target/js.md b/documentation/bookmark/compilation/target/js.md deleted file mode 100644 index b6ea6916e..000000000 --- a/documentation/bookmark/compilation/target/js.md +++ /dev/null @@ -1,5 +0,0 @@ -# Reference - -0. [How JavaScript Array Works Internally?](https://blog.gauravthakur.in/how-javascript-array-works-internally) -0. [Maybe you don't need Rust and WASM to speed up your JS ](https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-speed-up-your-js.html) - diff --git a/documentation/bookmark/compilation/target/js__javascript.md b/documentation/bookmark/compilation/target/js__javascript.md new file mode 100644 index 000000000..e345bf4c4 --- /dev/null +++ b/documentation/bookmark/compilation/target/js__javascript.md @@ -0,0 +1,14 @@ +# Reference + +0. [How JavaScript Array Works Internally?](https://blog.gauravthakur.in/how-javascript-array-works-internally) +0. [Maybe you don't need Rust and WASM to speed up your JS ](https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-speed-up-your-js.html) + +# Debugging + +0. [The JavaScript Self-Profiling API](https://addyosmani.com/blog/js-self-profiling/) + +# Number + +0. [BigInt: arbitrary-precision integers in JavaScript](https://v8.dev/features/bigint) +0. [WebAssembly integration with JavaScript BigInt](https://v8.dev/features/wasm-bigint) + diff --git a/documentation/bookmark/compilation/target/llvm.md b/documentation/bookmark/compilation/target/llvm.md new file mode 100644 index 000000000..55a99f6e8 --- /dev/null +++ b/documentation/bookmark/compilation/target/llvm.md @@ -0,0 +1,4 @@ +# Reference + +0. [Taming Undefined Behavior in LLVM](https://www.cs.utah.edu/~regehr/papers/undef-pldi17.pdf) + diff --git a/documentation/bookmark/compilation/target/micro_controller.md b/documentation/bookmark/compilation/target/micro_controller.md new file mode 100644 index 000000000..2681cbf67 --- /dev/null +++ b/documentation/bookmark/compilation/target/micro_controller.md @@ -0,0 +1,4 @@ +# Reference + +1. [HaikuVM](http://haiku-vm.sourceforge.net/) + diff --git a/documentation/bookmark/compilation/target/native.md b/documentation/bookmark/compilation/target/native.md new file mode 100644 index 000000000..32da388c9 --- /dev/null +++ b/documentation/bookmark/compilation/target/native.md @@ -0,0 +1,133 @@ +# Java + +1. [Java Grinder](https://www.mikekohn.net/micro/java_grinder.php) + +# Register allocation + +1. [A Quick Introduction to Register Allocation](https://hassamuddin.com/blog/reg-alloc/) + +# Call stack + +1. http://stffrdhrn.github.io/software/embedded/openrisc/2018/06/08/gcc_stack_frames.html +1. https://yurichev.com/blog/reg_alloc/ + +# Unicode + +1. http://manishearth.github.io/blog/2017/01/14/stop-ascribing-meaning-to-unicode-code-points/ +1. https://garbagecollected.org/2013/03/15/reverse-strings-like-a-pro/ +1. http://reedbeta.com/blog/programmers-intro-to-unicode/ +1. https://mathiasbynens.be/notes/javascript-unicode +1. http://www.daemonology.net/blog/2008-06-05-faster-utf8-strlen.html +1. https://haxe.org/blog/unicode/ +1. http://justinblank.com/notebooks/stringrepresentationsandstringapis.html + +# Shell + +1. https://github.com/dylanaraps/pure-bash-bible + +# Platforms + +1. https://github.com/neutralinojs/neutralinojs + +# Concurrency + +1. https://github.com/hnes/libaco + +# Numeric operation + +1. https://github.com/ridiculousfish/libdivide +1. https://lemire.me/blog/2019/02/08/faster-remainders-when-the-divisor-is-a-constant-beating-compilers-and-libdivide/ + +# Optimization + +1. http://ssw.jku.at/General/Staff/Leopoldseder/manlang2018-fast_path_unrolling_authorpreprint.pdf + +# Foreign function interface (FFI) + +1. https://github.com/swig/swig +1. http://www.swig.org/ +1. http://www.swig.org/Doc2.0/Go.html +1. https://begriffs.com/posts/2019-01-19-inside-c-standard-lib.html +1. https://www.amazon.com/Standard-C-Library-P-J-Plauger/dp/0131315099 + +# Graal + +1. https://www.newtv.co.th/video/video.php?v=topKYJgv6qA + +# Floating point arithmetic + +1. [Accurate Differences of Products with Kahan's Algorithm](https://pharr.org/matt/blog/2019/11/03/difference-of-floats.html) +1. https://floating-point-gui.de/ +1. [Faster floating point arithmetic with Exclusive OR](http://nfrechette.github.io/2019/10/22/float_xor_optimization/) +1. https://oded.ninja/2017/05/01/floating-point/ +1. [What Every Computer Scientist Should Know About Floating-Point Arithmetic](http://www.lsi.upc.edu/~robert/teaching/master/material/p5-goldberg.pdf) +1. https://lemire.me/blog/2017/11/16/fast-exact-integer-divisions-using-floating-point-operations/ + +# Reference + +1. [Executables - Linking and Loading](https://github.com/MattPD/cpplinks/blob/master/executables.linking_loading.md) +1. http://luajit.org/ +1. http://luajit.org/ext_ffi.html +1. http://luajit.org/dynasm.html +1. [The Standard C Library](https://www.amazon.com/Standard-C-Library-P-J-Plauger/dp/0131315099) +1. [C Is Not a Low-level Language: Your computer is not a fast PDP-11.](https://queue.acm.org/detail.cfm?id=3212479) +1. http://www.ffconsultancy.com/ocaml/hlvm/ +1. https://nullprogram.com/blog/2018/05/27/ +1. https://github.com/dyu/ffi-overhead +1. https://ivorylang.org/ivory-introduction.html +1. http://blog.llvm.org/2018/03/dragonffi-ffijit-for-c-language-using.html +1. https://internals.rust-lang.org/t/refactoring-std-for-ultimate-portability/4301 +1. https://blog.plan99.net/kotlin-native-310ffac94af2 +1. https://blog.jetbrains.com/kotlin/2017/12/kotlinnative-v0-5-released-calling-kotlin-from-swift-and-c-llvm-5-and-more/ +1. https://readytalk.github.io/avian/ +1. https://medium.com/@octskyward/kotlin-native-310ffac94af2#.xbcxqlm1w +1. https://www.infoq.com/presentations/clojure-scheme +1. https://github.com/ollef/sixten +1. https://software.intel.com/sites/landingpage/IntrinsicsGuide/ +1. https://llvllatrix.wordpress.com/2016/12/31/system-calls-for-developers/ +1. http://www.cipht.net/2017/10/03/are-jump-tables-always-fastest.html +1. https://github.com/libuv/libuv +1. https://www.threadingbuildingblocks.org/ +1. https://cafbit.com/post/tokio_internals/ +1. https://medium.com/@unmeshvjoshi/how-java-thread-maps-to-os-thread-e280a9fb2e06 +1. http://pixielang.org/ +1. https://github.com/pixie-lang/pixie +1. https://github.com/rust-lang/rust +1. http://ziglang.org/# +1. http://www.mpfr.org/ +1. http://www.mpfr.org/algorithms.pdf +1. http://wilsonminesco.com/16bitMathTables/ +1. http://blog.veitheller.de/Fixed_Point_Division.html +1. http://libdivide.com/ +1. [Modern Computer Arithmetic](https://members.loria.fr/PZimmermann/mca/mca-cup-0.5.9.pdf) +1. [Division by Invariant Integers using Multiplication](https://gmplib.org/~tege/divcnst-pldi94.pdf) +1. https://lion137.blogspot.com/2019/02/borneo-language-102.html +1. https://www.youtube.com/watch?v=N0JTvyCxiv8 +1. http://robert.ocallahan.org/2017/02/what-rust-can-do-that-other-languages.html +1. https://github.com/graalvm/truffleruby/blob/master/doc/user/svm.md +1. http://bellard.org/libbf/ +1. http://paulcavallaro.com/blog/hashed-and-hierarchical-timing-wheels/ +1. http://speleotrove.com/decimal/ +1. http://eli.thegreenplace.net/2013/07/09/library-order-in-static-linking +1. [Skip the FFI!](http://llvm.org/devmtg/2014-10/Slides/Skip%20the%20FFI.pdf) +1. http://www.infoworld.com/article/3187370/application-development/kotlin-compiles-directly-to-native-code-via-llvm.html +1. https://blog.jetbrains.com/kotlin/2017/04/kotlinnative-tech-preview-kotlin-without-a-vm/ +1. https://github.com/bugvm/bugvm +1. https://github.com/rampantpixels/rpmalloc +1. https://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Data/endian.html +1. http://web.stanford.edu/group/sequoia/ +1. https://hackernoon.com/experimenting-with-small-buffer-optimization-for-c-lambdas-d5b703fb47e4 +1. https://www.microsoft.com/en-us/research/wp-content/uploads/2017/03/kedia2017mem.pdf +1. https://github.com/tomhrr/dale +1. [Fast String Searching](https://pdfs.semanticscholar.org/d991/2ea262986794e29e3f15e5f8930d42f2ced4.pdf) +1. https://github.com/apple/swift/blob/master/docs/StringManifesto.md +1. http://home.pipeline.com/~hbaker1/CheneyMTA.html +1. [Position: Lightweight static resources 0Sexy types for embedded and systems programming](https://pdfs.semanticscholar.org/2368/ccf8c62ab981e2426cd698ba2229f3eca311.pdf?_ga=2.228359389.1990612643.1507689838-1658669397.1507689838) +1. http://homes.soic.indiana.edu/ccshan/tfp2007/talk.pdf +1. http://www.catb.org/esr/structure-packing/ +1. [Ahead Of Time (AOT) Internals](https://www.youtube.com/watch?v=n5DCg6M2MDM) +1. [Polyglot Native: Java, Scala, Kotlin, & JVM languages](https://www.youtube.com/watch?v=5BMHIeMXTqA) +1. https://ziviani.net/2017/functions-in-assembly +1. https://ziviani.net/2017/functions-in-assembly-ii +1. [Hashed and Hierarchical Timing Wheels: Data Structures for the Efficient Implementation of a Timer Facility](http://www.cs.columbia.edu/~nahum/w6998/papers/sosp87-timing-wheels.pdf) + diff --git a/documentation/bookmark/compilation/target/python.md b/documentation/bookmark/compilation/target/python.md new file mode 100644 index 000000000..5113bb712 --- /dev/null +++ b/documentation/bookmark/compilation/target/python.md @@ -0,0 +1,5 @@ +# Platform + +0. [nanobind — Seamless operability between C++17 and Python](https://github.com/wjakob/nanobind) +0. [BeeWare: Write once. Deploy everywhere.](https://beeware.org/) + diff --git a/documentation/bookmark/compilation/target/rust.md b/documentation/bookmark/compilation/target/rust.md new file mode 100644 index 000000000..f38b36966 --- /dev/null +++ b/documentation/bookmark/compilation/target/rust.md @@ -0,0 +1,5 @@ +# Reference + +0. [Rust's Rules Are Made to Be Broken](https://blog.warp.dev/rules-are-made-to-be-broken/) +0. [CXX — safe interop between Rust and C++](https://cxx.rs/) + diff --git a/documentation/bookmark/compilation/target/scopes.md b/documentation/bookmark/compilation/target/scopes.md new file mode 100644 index 000000000..cd938a3ad --- /dev/null +++ b/documentation/bookmark/compilation/target/scopes.md @@ -0,0 +1,4 @@ +# Reference + +0. [The Scopes Programming Language & Compiler Infrastructure](https://hg.sr.ht/~duangle/scopes) + diff --git a/documentation/bookmark/compilation/target/wasm.md b/documentation/bookmark/compilation/target/wasm.md new file mode 100644 index 000000000..e90bcd654 --- /dev/null +++ b/documentation/bookmark/compilation/target/wasm.md @@ -0,0 +1,58 @@ +# Interoperability + +0. []() +0. [How to Extend WebAssembly with Host Functions](https://www.secondstate.io/articles/extend-webassembly/) +0. [js-wasm: JavaScript and WebAssembly should be a joy to use together.](https://wasm.js.org/) + +# Concurrency + +0. []() +0. [Wasm threads are now available in all browsers](https://old.reddit.com/r/WebAssembly/comments/rk83mr/wasm_threads_are_now_available_in_all_browsers/) + +# Platform + +0. []() +0. [Wasmer Java](https://github.com/wasmerio/wasmer-java) +0. [WAVM: WAVM is a WebAssembly virtual machine, designed for use in non-web applications.](https://wavm.github.io/) + +# Exemplar + +0. []() +0. [Announcing GraalWasm — a WebAssembly engine in GraalVM](https://medium.com/graalvm/announcing-graalwasm-a-webassembly-engine-in-graalvm-25cd0400a7f2) +0. [Towards a WebAssembly standalone runtime on GraalVM](https://dl.acm.org/citation.cfm?id=3362780) +0. https://github.com/vvanders/wasm_lua +0. https://github.com/AppCypher/webassemblylanguages +0. https://medium.com/perlin-network/life-a-secure-blazing-fast-cross-platform-webassembly-vm-in-go-ea3b31fa6e09 + +# Reference + +0. []() +0. [TeaVM: Build Fast, Modern Web Apps in Java](https://teavm.org/) +0. [Recommendations when publishing a Wasm library](https://nickb.dev/blog/recommendations-when-publishing-a-wasm-library) +0. [Building host implementations for WebAssembly interfaces](https://radu-matei.com/blog/wasm-components-host-implementations/) +0. [WebAssembly Techniques to Speed Up Matrix Multiplication by 120x](https://jott.live/markdown/mm_wasm) +0. [Chasing Memory Bugs through V8 and WebAssembly](https://blog.stackblitz.com/posts/debugging-v8-webassembly/) +0. [Wasm needs a better memory management story](https://github.com/WebAssembly/design/issues/1397) +0. https://bytecodealliance.org/ +0. [Faster Fractals with Multi-Threaded WebAssembly](https://blog.scottlogic.com/2019/07/15/multithreaded-webassembly.html) +0. https://blog.scottlogic.com/2018/07/20/wasm-future.html +0. http://fitzgeraldnick.com/2018/04/26/how-does-dynamic-dispatch-work-in-wasm.html +0. https://hacks.mozilla.org/2018/03/making-webassembly-better-for-rust-for-all-languages/ +0. https://webassembly.github.io/ +0. https://github.com/WebAssembly/spec/blob/md-proto/md-proto/WebAssembly.md +0. https://github.com/WebAssembly/binaryen +0. [NYLUG Presents: Luke Wagner -on- WebAssembly: A New Compiler Target For The Web](https://www.youtube.com/watch?v=RByPdCN1RQ4) +0. https://binji.github.io/2017/03/05/webassembly-type-checking.html +0. https://github.com/WebAssembly/spec/tree/master/interpreter +0. https://mbebenita.github.io//WasmExplorer/ +0. http://thecodebarbarian.com/getting-started-with-webassembly-in-node.js.html +0. http://blog.seraum.com/compiling-javascript-to-webassembly-wasm-or-asm-js-with-nectarjs +0. https://hacks.mozilla.org/2017/07/memory-in-webassembly-and-why-its-safer-than-you-think/ +0. [Using WebAssembly and Threads (Chrome Dev Summit 2018)](https://www.youtube.com/watch?v=zgOGZgAPUjQ) +0. https://github.com/wasmerio/wasmer +0. https://www.fastly.com/blog/announcing-lucet-fastly-native-webassembly-compiler-runtime +0. https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ +0. https://cybernetist.com/2019/04/25/wasm-universal-application-runtime/ +0. https://github.com/intel/wasm-micro-runtime +0. https://medium.com/wasmer/running-webassembly-on-the-kernel-8e04761f1d8e + diff --git a/documentation/bookmark/compilation/target/wren.md b/documentation/bookmark/compilation/target/wren.md new file mode 100644 index 000000000..8649c720b --- /dev/null +++ b/documentation/bookmark/compilation/target/wren.md @@ -0,0 +1,4 @@ +# Reference + +0. [Meta Class](https://wren.io/modules/meta/meta.html) + diff --git a/documentation/bookmark/concurrency/actor.md b/documentation/bookmark/concurrency/actor.md index 0d4019add..42f86a5f1 100644 --- a/documentation/bookmark/concurrency/actor.md +++ b/documentation/bookmark/concurrency/actor.md @@ -1,5 +1,8 @@ # Reference +0. []() +0. [syn: A scalable global Process Registry and Process Group manager for Erlang and Elixir.](https://github.com/ostinelli/syn) +0. [Syndicated Actor model](https://syndicate-lang.org/) 0. [proto.actor](https://proto.actor/) 0. [otplike – Erlang/OTP processes and behaviours for Clojure - Alexey Aristov](https://www.youtube.com/watch?v=nHvRbZZhUDQ) diff --git a/documentation/bookmark/cooling.md b/documentation/bookmark/cooling.md new file mode 100644 index 000000000..aacf704c3 --- /dev/null +++ b/documentation/bookmark/cooling.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Forget Heat Pumps - This House Cools Itself With NO Electricity!](https://www.youtube.com/watch?v=UB_ima2t_xU) + diff --git a/documentation/bookmark/data/structure/probabilistic.md b/documentation/bookmark/data/structure/probabilistic.md index dd769409d..f070cc423 100644 --- a/documentation/bookmark/data/structure/probabilistic.md +++ b/documentation/bookmark/data/structure/probabilistic.md @@ -1,10 +1,13 @@ # Hash function +0. []() 0. http://fastcompression.blogspot.com/2019/03/presenting-xxh3.html 0. http://cyan4973.github.io/xxHash/ # Reference +0. []() +0. [HyperLogLog in Presto: A significantly faster way to handle cardinality estimation](https://engineering.fb.com/2018/12/13/data-infrastructure/hyperloglog/) 0. [Ribbon Filter](http://rocksdb.org/blog/2021/12/29/ribbon-filter.html) 0. [Binary Fuse Filters: Fast and Smaller Than Xor Filters](https://arxiv.org/abs/2201.01174) 0. [Ribbon filter: practically smaller than Bloom and Xor](https://arxiv.org/abs/2103.02515) @@ -32,6 +35,7 @@ ## Bloom filter +0. []() 0. [Sliding Bloom Filter](https://programming.guide/sliding-bloom-filter.html) 0. [Word-aligned Bloom filters](https://lemire.me/blog/2021/10/03/word-aligned-bloom-filters/) 0. [Bloom Filters by Example](https://llimllib.github.io/bloomfilter-tutorial/) diff --git a/documentation/bookmark/database.md b/documentation/bookmark/database.md index b2fb5591e..56bd1fdc6 100644 --- a/documentation/bookmark/database.md +++ b/documentation/bookmark/database.md @@ -132,6 +132,8 @@ ## General +0. []() +0. [Skytable](https://skytable.io/) 0. https://github.com/Workiva/eva/ 0. https://learndb.net/ 0. http://orientdb.com/ diff --git a/documentation/bookmark/design/system.md b/documentation/bookmark/design/system.md new file mode 100644 index 000000000..6f825ace3 --- /dev/null +++ b/documentation/bookmark/design/system.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Naming conventions for design systems](https://backlight.dev/blog/naming-conventions-for-design-systems) + diff --git a/documentation/bookmark/distributed_programming.md b/documentation/bookmark/distributed_programming.md index c3b6edf46..1bcff95f2 100644 --- a/documentation/bookmark/distributed_programming.md +++ b/documentation/bookmark/distributed_programming.md @@ -1,106 +1,120 @@ # Microservices -1. [The seven deceptions of microservices](https://scottrogowski.com/the-seven-deceptions-of-microservices.html) +0. []() +0. [The seven deceptions of microservices](https://scottrogowski.com/the-seven-deceptions-of-microservices.html) # Synchronization -1. [Braid: Synchronization for HTTP](https://braid.news/) -1. [The Braid Protocol: Synchronization for HTTP](https://tools.ietf.org/html/draft-toomim-braid-00) +0. []() +0. [Braid: Synchronization for HTTP](https://braid.news/) +0. [The Braid Protocol: Synchronization for HTTP](https://tools.ietf.org/html/draft-toomim-braid-00) # Reference -1. [No more DSLs: Implement and deploy a distributed system with a single program](http://catern.com/integration.html) -1. [Ambients: Peer-to-Peer Programs and Data](https://ipfs.io/ipfs/QmPhPJE55GvqSz7Pwvkc8n9dbKmqGw6tUGTE1MgfNQvzsf) -1. [Bastion: Highly-available Distributed Fault-tolerant Runtime](https://bastion.rs/) -1. [DDD and Messaging Architectures: An overview of my different series on patterns in distributed systems.](http://verraes.net/2019/05/ddd-msg-arch/) -1. https://replicated.cc/ -1. http://www.the-paper-trail.org/post/2014-08-09-distributed-systems-theory-for-the-distributed-systems-engineer/ -1. https://courses.engr.illinois.edu/cs525/sp2018/index.html -1. https://arxiv.org/abs/1701.07615 -1. http://proto.actor/ -1. https://blog.acolyer.org/2015/10/15/ironfleet-proving-practical-distributed-systems-correc/ -1. http://pythonsweetness.tumblr.com/post/165366346547/mitogen-an-infrastructure-code-baseline-that -1. https://github.com/heathermiller/dist-prog-book -1. https://lasp-lang.readme.io/ -1. https://speakerdeck.com/cmeiklejohn/practical-evaluation-of-the-lasp-programming-model-at-scale -1. http://bloom-lang.net/ -1. https://www.oreilly.com/ideas/scaling-a-startup-with-a-21st-century-language -1. https://github.com/grailbio/reflow -1. https://github.com/reactors-io/reactors -1. http://funcool.github.io/urania/latest/ -1. https://raft.github.io/ -1. https://github.com/ashwin153/caustic -1. http://prl.ccs.neu.edu/blog/2017/10/22/monotonicity-types-towards-a-type-system-for-eventual-consistency/ -1. http://www.swirlds.com/ -1. [Whip: Higher-Order Contracts for Modern Services](https://people.seas.harvard.edu/~chong/pubs/icfp17-whip.pdf &&& https://www.youtube.com/watch?v=phHrSC6pkXU) -1. https://channel9.msdn.com/Shows/On-NET/Orleans-onNET -1. [A Meta-EDSL for Distributed Web Applications](https://www.youtube.com/watch?v=Xzv6CfyXUdM) -1. https://en.wikipedia.org/wiki/Petriscript -1. [Fallacies of Distributed Computing Explained](http://www.rgoarchitects.com/Files/fallacies.pdf) -1. https://abhishek-tiwari.com/friends-dont-let-friends-build-data-pipelines/ -1. [Differential Synchronization](https://neil.fraser.name/writing/sync/) -1. https://medium.com/@mycoralhealth/why-blockchains-dont-suck-and-the-perils-of-distributed-databases-1a522cc7cfe1 -1. [The Remote Monad](http://www.ittc.ku.edu/research/thesis/documents/justin_dawson_thesis.pdf) -1. https://blog.acolyer.org/2017/08/17/on-the-design-of-distributed-programming-models/ -1. https://twitter.com/ifesdjeen/status/1024775959961128961 -1. https://sekniqi.com/blog/a-distributed-systems-primer-for-non-experts.html -1. [numpywren: serverless linear algebra](https://arxiv.org/abs/1810.09679) -1. https://hackernoon.com/a-thorough-introduction-to-distributed-systems-3b91562c9b3c -1. ["Towards Language Support for Distributed Systems" by Heather Miller](https://www.youtube.com/watch?v=IeBbiQZYmuY) -1. http://jepsen.io/ -1. [Think Local: Reducing Coordination and Improving Performance when Designing around Distributed State](https://vimeo.com/304106598) -1. [Introducing AMBROSIA: a new platform for reliable distributed applications without all the hassle](https://cloudblogs.microsoft.com/opensource/2018/12/13/introducing-ambrosia-new-platform-distributed-applications/) -1. https://distributedobjectprotocol.org/ -1. https://medium.com/bitfinex/introducing-svc-js-a-framework-for-grenache-7119f2d7769e -1. http://dbmsmusings.blogspot.com/2019/01/its-time-to-move-on-from-two-phase.html +0. []() +0. [The Art of Immutable Architecture](https://www.immutablearchitecture.com/) +0. [No more DSLs: Implement and deploy a distributed system with a single program](http://catern.com/integration.html) +0. [Ambients: Peer-to-Peer Programs and Data](https://ipfs.io/ipfs/QmPhPJE55GvqSz7Pwvkc8n9dbKmqGw6tUGTE1MgfNQvzsf) +0. [Bastion: Highly-available Distributed Fault-tolerant Runtime](https://bastion.rs/) +0. [DDD and Messaging Architectures: An overview of my different series on patterns in distributed systems.](http://verraes.net/2019/05/ddd-msg-arch/) +0. https://replicated.cc/ +0. http://www.the-paper-trail.org/post/2014-08-09-distributed-systems-theory-for-the-distributed-systems-engineer/ +0. https://courses.engr.illinois.edu/cs525/sp2018/index.html +0. https://arxiv.org/abs/1701.07615 +0. http://proto.actor/ +0. https://blog.acolyer.org/2015/10/15/ironfleet-proving-practical-distributed-systems-correc/ +0. http://pythonsweetness.tumblr.com/post/165366346547/mitogen-an-infrastructure-code-baseline-that +0. https://github.com/heathermiller/dist-prog-book +0. https://lasp-lang.readme.io/ +0. https://speakerdeck.com/cmeiklejohn/practical-evaluation-of-the-lasp-programming-model-at-scale +0. http://bloom-lang.net/ +0. https://www.oreilly.com/ideas/scaling-a-startup-with-a-21st-century-language +0. https://github.com/grailbio/reflow +0. https://github.com/reactors-io/reactors +0. http://funcool.github.io/urania/latest/ +0. https://raft.github.io/ +0. https://github.com/ashwin153/caustic +0. http://prl.ccs.neu.edu/blog/2017/10/22/monotonicity-types-towards-a-type-system-for-eventual-consistency/ +0. http://www.swirlds.com/ +0. [Whip: Higher-Order Contracts for Modern Services](https://people.seas.harvard.edu/~chong/pubs/icfp17-whip.pdf &&& https://www.youtube.com/watch?v=phHrSC6pkXU) +0. https://channel9.msdn.com/Shows/On-NET/Orleans-onNET +0. [A Meta-EDSL for Distributed Web Applications](https://www.youtube.com/watch?v=Xzv6CfyXUdM) +0. https://en.wikipedia.org/wiki/Petriscript +0. [Fallacies of Distributed Computing Explained](http://www.rgoarchitects.com/Files/fallacies.pdf) +0. https://abhishek-tiwari.com/friends-dont-let-friends-build-data-pipelines/ +0. [Differential Synchronization](https://neil.fraser.name/writing/sync/) +0. https://medium.com/@mycoralhealth/why-blockchains-dont-suck-and-the-perils-of-distributed-databases-1a522cc7cfe1 +0. [The Remote Monad](http://www.ittc.ku.edu/research/thesis/documents/justin_dawson_thesis.pdf) +0. https://blog.acolyer.org/2017/08/17/on-the-design-of-distributed-programming-models/ +0. https://twitter.com/ifesdjeen/status/1024775959961128961 +0. https://sekniqi.com/blog/a-distributed-systems-primer-for-non-experts.html +0. [numpywren: serverless linear algebra](https://arxiv.org/abs/1810.09679) +0. https://hackernoon.com/a-thorough-introduction-to-distributed-systems-3b91562c9b3c +0. ["Towards Language Support for Distributed Systems" by Heather Miller](https://www.youtube.com/watch?v=IeBbiQZYmuY) +0. http://jepsen.io/ +0. [Think Local: Reducing Coordination and Improving Performance when Designing around Distributed State](https://vimeo.com/304106598) +0. [Introducing AMBROSIA: a new platform for reliable distributed applications without all the hassle](https://cloudblogs.microsoft.com/opensource/2018/12/13/introducing-ambrosia-new-platform-distributed-applications/) +0. https://distributedobjectprotocol.org/ +0. https://medium.com/bitfinex/introducing-svc-js-a-framework-for-grenache-7119f2d7769e +0. http://dbmsmusings.blogspot.com/2019/01/its-time-to-move-on-from-two-phase.html # Rate limiting -1. https://blog.ably.io/how-adopting-a-distributed-rate-limiting-helps-scale-your-platform-1afdf3944b5a +0. []() +0. https://blog.ably.io/how-adopting-a-distributed-rate-limiting-helps-scale-your-platform-1afdf3944b5a # Programming language -1. [Choral: a choreographic programming language](https://www.choral-lang.org/) -1. ["Unison: a new distributed programming language" by Paul Chiusano](https://www.youtube.com/watch?v=gCWtkvDQ2ZI) -1. http://radicle.xyz/ -1. [Lambda World 2018 - Introduction to the Unison programming language - Rúnar Bjarnason](https://www.youtube.com/watch?v=rp_Eild1aq8) -1. https://www.infoq.com/presentations/language-design-process +0. []() +0. [Choral: a choreographic programming language](https://www.choral-lang.org/) +0. ["Unison: a new distributed programming language" by Paul Chiusano](https://www.youtube.com/watch?v=gCWtkvDQ2ZI) +0. http://radicle.xyz/ +0. [Lambda World 2018 - Introduction to the Unison programming language - Rúnar Bjarnason](https://www.youtube.com/watch?v=rp_Eild1aq8) +0. https://www.infoq.com/presentations/language-design-process # Parallel commit -1. [Parallel Commits: An Atomic Commit Protocol For Globally Distributed Transactions](https://www.cockroachlabs.com/blog/parallel-commits) +0. []() +0. [Parallel Commits: An Atomic Commit Protocol For Globally Distributed Transactions](https://www.cockroachlabs.com/blog/parallel-commits) # Two-phase commit -1. https://shekhargulati.com/2018/09/05/two-phase-commit-protocol/ +0. []() +0. https://shekhargulati.com/2018/09/05/two-phase-commit-protocol/ # Linearizability -1. https://ristret.com/s/uqin9q/mild_generalization_linearizability -1. https://en.wikipedia.org/wiki/Vector_clock +0. []() +0. https://ristret.com/s/uqin9q/mild_generalization_linearizability +0. https://en.wikipedia.org/wiki/Vector_clock # Exemplar -1. http://meshbird.com/ +0. []() +0. http://meshbird.com/ # Logical clock -1. [Interval Tree Clocks](https://ferd.ca/interval-tree-clocks.html) -1. [Version Vectors are not Vector Clocks](https://haslab.wordpress.com/2011/07/08/version-vectors-are-not-vector-clocks/) -1. [Distributed Systems: Physical, Logical, and Vector Clocks](https://levelup.gitconnected.com/distributed-systems-physical-logical-and-vector-clocks-7ca989f5f780) -1. [The Bloom Clock](https://arxiv.org/pdf/1905.13064.pdf) -1. [Why Logical Clocks are Easy: Sometimes all you need is the right language.](https://queue.acm.org/detail.cfm?id=2917756) +0. []() +0. [Interval Tree Clocks](https://ferd.ca/interval-tree-clocks.html) +0. [Version Vectors are not Vector Clocks](https://haslab.wordpress.com/2011/07/08/version-vectors-are-not-vector-clocks/) +0. [Distributed Systems: Physical, Logical, and Vector Clocks](https://levelup.gitconnected.com/distributed-systems-physical-logical-and-vector-clocks-7ca989f5f780) +0. [The Bloom Clock](https://arxiv.org/pdf/1905.13064.pdf) +0. [Why Logical Clocks are Easy: Sometimes all you need is the right language.](https://queue.acm.org/detail.cfm?id=2917756) # Consensus protocol -1. https://medium.com/s/story/lets-take-a-crack-at-understanding-distributed-consensus-dad23d0dc95 -1. [Spectrum: A Framework for Adapting Consensus Protocols](https://arxiv.org/abs/1902.05873) +0. []() +0. https://medium.com/s/story/lets-take-a-crack-at-understanding-distributed-consensus-dad23d0dc95 +0. [Spectrum: A Framework for Adapting Consensus Protocols](https://arxiv.org/abs/1902.05873) # Locality -1. [Think Local: Reducing Coordination and Improving Performance when Designing around Distributed State](https://vimeo.com/304106598) +0. []() +0. [Think Local: Reducing Coordination and Improving Performance when Designing around Distributed State](https://vimeo.com/304106598) # Distributed transaction -1. [Life beyond Distributed Transactions: an Apostate’s Opinion](http://adrianmarriott.net/logosroot/papers/LifeBeyondTxns.pdf) +0. []() +0. [Life beyond Distributed Transactions: an Apostate’s Opinion](http://adrianmarriott.net/logosroot/papers/LifeBeyondTxns.pdf) diff --git a/documentation/bookmark/documentation.md b/documentation/bookmark/documentation.md index 414242336..97b9ec1bd 100644 --- a/documentation/bookmark/documentation.md +++ b/documentation/bookmark/documentation.md @@ -66,6 +66,7 @@ # Reference 0. []() +0. [Mintlify Writer](https://www.mintlify.com/writer) 0. [TimelineJS: Easy-to-make, beautiful timelines.](http://timeline.knightlab.com/) 0. [Introduction to the Zettelkasten Method](https://zettelkasten.de/introduction/) 0. [Building a community of open-source documentation contributors](https://news.ycombinator.com/newest?next=31705868&n=1171) diff --git a/documentation/bookmark/floating_point.md b/documentation/bookmark/floating_point.md index a344106c2..30e072479 100644 --- a/documentation/bookmark/floating_point.md +++ b/documentation/bookmark/floating_point.md @@ -1,44 +1,58 @@ +# Printing + +0. []() +0. [Dragonbox](https://github.com/jk-jeon/dragonbox) + # Parsing +0. []() 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. []() 0. [Calcium](https://fredrikj.net/calcium/) 0. [Accuracy of Mathematical Functions in Single, Double, Double Extended, and Quadruple Precision](https://members.loria.fr/PZimmermann/papers/accuracy.pdf) 0. [Supporting half-precision floats is really annoying](https://futhark-lang.org/blog/2021-08-05-half-precision-floats.html) # Debugging +0. []() 0. [Keynote: William Kahan - Debugging Tools for Floating-Point Code](https://www.youtube.com/watch?v=qHddEkfQBrA) # Comparison +0. []() 0. [Comparing Floating-Point Numbers Is Tricky](https://www.youtube.com/watch?v=iW7H1KfSJ8s) 0. [Approximate Equality for Floating Point](https://github.com/apple/swift-evolution/blob/master/proposals/0259-approximately-equal.md) # Random generation +0. []() 0. [Drawing random floating-point numbers from an interval](https://hal.archives-ouvertes.fr/hal-03282794/document) 0. [Uniform random floats: How to generate a double-precision floating-point number in [0, 1] uniformly at random given a uniform random source of bits](https://mumble.net/~campbell/2014/04/28/uniform-random-float) # Correctness +0. []() 0. [Floating point expression inspector](https://github.com/graphitemaster/fpinspect) 0. [Herbie: Find and fix floating-point problems.](https://herbie.uwplse.org/) # Format +0. []() 0. [decimal128 floating-point format](https://en.wikipedia.org/wiki/Decimal128_floating-point_format) # Reference +0. []() 0. [How Java’s Floating-Point Hurts Everyone Everywhere](https://people.eecs.berkeley.edu/~wkahan/JAVAhurt.pdf) 0. [What aspect of portable floating point did Java back down on?](https://retrocomputing.stackexchange.com/questions/18143/what-aspect-of-portable-floating-point-did-java-back-down-on) # Algorithm +0. []() 0. [Speeding up atan2f by 50x](https://mazzo.li/posts/vectorized-atan2.html) 0. [Kahan summation algorithm](https://en.wikipedia.org/wiki/Kahan_summation_algorithm) diff --git a/documentation/bookmark/fluidics.md b/documentation/bookmark/fluidics.md new file mode 100644 index 000000000..d75c1f4e2 --- /dev/null +++ b/documentation/bookmark/fluidics.md @@ -0,0 +1,6 @@ +# Reference + +0. []() +0. [Water integrator](https://en.wikipedia.org/wiki/Water_integrator) +0. [Fluidics](https://en.wikipedia.org/wiki/Fluidics) + diff --git a/documentation/bookmark/game/balance.md b/documentation/bookmark/game/balance.md new file mode 100644 index 000000000..7ffba1bbf --- /dev/null +++ b/documentation/bookmark/game/balance.md @@ -0,0 +1,6 @@ +# Reference + +0. []() +0. [PAX South 2018 -- Balance in Game Design](https://www.youtube.com/watch?v=NXD8YQ7j_Qk) +0. [How "Bad" Balance Can Be A Good Thing](https://www.youtube.com/watch?v=l1WYmHz3hog) + diff --git a/documentation/bookmark/game/mechanic/enemy.md b/documentation/bookmark/game/mechanic/enemy.md index 51004cd3c..ccf7fdf1d 100644 --- a/documentation/bookmark/game/mechanic/enemy.md +++ b/documentation/bookmark/game/mechanic/enemy.md @@ -1,5 +1,7 @@ # Reference +0. []() +0. [Make Your DnD Monsters Weirder! Bestial Ecosystems Created by Monstrous Inhabitation Review](https://www.youtube.com/watch?v=Txpdb5CYX_Y) 0. [Revamping Ghosts as Monsters for Halloween || D&D with Dael Kingsmill](https://www.youtube.com/watch?v=RlHom7zSWD0) 0. [How Do You Design a Cast of Enemies? ~ Design Doc](https://www.youtube.com/watch?v=RvrVicqDhKI) diff --git a/documentation/bookmark/game/speedrun.md b/documentation/bookmark/game/speedrun.md new file mode 100644 index 000000000..4efd6ac6f --- /dev/null +++ b/documentation/bookmark/game/speedrun.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [What Makes A Game Speedrun Friendly?](https://www.youtube.com/watch?v=ixmOKhM_AlI) + diff --git a/documentation/bookmark/game/storytelling.md b/documentation/bookmark/game/storytelling.md index 2bde03394..28613b8b1 100644 --- a/documentation/bookmark/game/storytelling.md +++ b/documentation/bookmark/game/storytelling.md @@ -1,6 +1,7 @@ # Reference 0. []() +0. [Sparking Curiosity-Driven Exploration Through Narrative in 'Outer Wilds'](https://www.youtube.com/watch?v=QaGu9tGCNbI) 0. [Approaching a Pedagogy of Game Writing](https://www.youtube.com/watch?v=24HHIKOA1ZA) 0. [I Beg You, Please Cripple Your Characters](https://www.youtube.com/watch?v=DGe6ehr0dxs) 0. [Press Y to Cry: Generating Emotions in Videogame Narrative](https://www.youtube.com/watch?v=_lp0libfp5M) diff --git a/documentation/bookmark/graphic/3d/shading.md b/documentation/bookmark/graphic/3d/shading.md new file mode 100644 index 000000000..c184858f9 --- /dev/null +++ b/documentation/bookmark/graphic/3d/shading.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Slang](https://github.com/shader-slang/slang) + diff --git a/documentation/bookmark/investing.md b/documentation/bookmark/investing.md index 4362effb6..66e9aea34 100644 --- a/documentation/bookmark/investing.md +++ b/documentation/bookmark/investing.md @@ -1,6 +1,7 @@ # Reference 0. []() +0. [Predictably Bad Investments: Evidence from Venture Capitalists](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4135861) 0. [Launch YC: The Launchpad for YC Startups](https://www.ycombinator.com/blog/launch-yc-the-launchpad-for-yc-startups) 0. [Launch YC: The Launchpad for YC Startups](https://www.ycombinator.com/launches) diff --git a/documentation/bookmark/license.md b/documentation/bookmark/license.md new file mode 100644 index 000000000..140f62fe6 --- /dev/null +++ b/documentation/bookmark/license.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [](https://github.com/topics/license-management) + diff --git a/documentation/bookmark/math.md b/documentation/bookmark/math.md index 9c36118ed..25c80c8cb 100644 --- a/documentation/bookmark/math.md +++ b/documentation/bookmark/math.md @@ -104,6 +104,7 @@ # _Compendium of resources_ 0. []() +0. [Real Not Complex](https://realnotcomplex.com/) 0. [How to Learn Advanced Mathematics Without Heading to University - Part 1](https://www.quantstart.com/articles/How-to-Learn-Advanced-Mathematics-Without-Heading-to-University-Part-1/) 0. [How to Learn Advanced Mathematics Without Heading to University - Part 2](https://www.quantstart.com/articles/How-to-Learn-Advanced-Mathematics-Without-Heading-to-University-Part-2/) 0. [How to Learn Advanced Mathematics Without Heading to University - Part 3](https://www.quantstart.com/articles/How-to-Learn-Advanced-Mathematics-Without-Heading-to-University-Part-3/) diff --git a/documentation/bookmark/memory_management/garbage_collection.md b/documentation/bookmark/memory_management/garbage_collection.md index 2652cc2a0..aa52ba50a 100644 --- a/documentation/bookmark/memory_management/garbage_collection.md +++ b/documentation/bookmark/memory_management/garbage_collection.md @@ -1,5 +1,7 @@ # Reference +0. []() +0. [A Guide to the Go Garbage Collector](https://tip.golang.org/doc/gc-guide) 0. [Distilling the Real Cost of Production Garbage Collectors](https://users.cecs.anu.edu.au/~steveb/pubs/papers/lbo-ispass-2022.pdf) 0. [Summarizing Garbage Collection](https://eschew.wordpress.com/2016/09/02/summarizing-gc/) diff --git a/documentation/bookmark/microprogramming.md b/documentation/bookmark/microprogramming.md new file mode 100644 index 000000000..cf6a969b9 --- /dev/null +++ b/documentation/bookmark/microprogramming.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [A Brief History of Microprogramming](https://people.cs.clemson.edu/~mark/uprog.html) + diff --git a/documentation/bookmark/open_source.md b/documentation/bookmark/open_source.md index 0bf73c741..a2f0da365 100644 --- a/documentation/bookmark/open_source.md +++ b/documentation/bookmark/open_source.md @@ -1,5 +1,7 @@ # Reference +0. []() +0. [Trust Signals in Open Source Projects](https://hackernoon.com/the-signs-of-a-great-open-source-project) 0. [Awesome OSS Monetization](https://paydevs.github.io/awesome-oss-monetization/) 0. [Open Source Guides](https://opensource.guide/) 0. [Uncurled - everything I know and learned about running and maintaining Open Source projects for three decades.](https://un.curl.dev/) diff --git a/documentation/bookmark/open_source/commercialization.md b/documentation/bookmark/open_source/commercialization.md new file mode 100644 index 000000000..2afcb3506 --- /dev/null +++ b/documentation/bookmark/open_source/commercialization.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Better Than Free](https://kk.org/thetechnium/better-than-fre/) + diff --git a/documentation/bookmark/optics.md b/documentation/bookmark/optics.md index 314505037..2c102073c 100644 --- a/documentation/bookmark/optics.md +++ b/documentation/bookmark/optics.md @@ -1,5 +1,7 @@ # Reference +0. []() +0. [Profunctor Optics: The Categorical View](https://golem.ph.utexas.edu/category/2020/01/profunctor_optics_the_categori.html) 0. [Existential optics](https://www.tweag.io/blog/2022-05-05-existential-optics/) 0. [Optics vs Lenses, Operationally](https://www.brunogavranovic.com/posts/2022-02-10-optics-vs-lenses-operationally.html) 0. [Optics By Example](https://leanpub.com/optics-by-example) @@ -7,7 +9,8 @@ 0. [On Lawful Lenses](https://blog.statebox.org/on-lawful-lenses-6e18a1e17bdf) 0. https://medium.com/urbint-engineering/haskell-lens-operator-onboarding-a235481e8fac 0. https://fstarlang.github.io/general/2018/01/12/lens-indexed-lenses.html -0. [Jeremy Gibbons - Profunctor Optics Modular Data Accessors](https://www.youtube.com/watch?v=sfWzUMViP0M &&& http://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/poptics.pdf) +0. [Jeremy Gibbons - Profunctor Optics Modular Data Accessors](https://www.youtube.com/watch?v=sfWzUMViP0M) + 0. [Profunctor Optics: Modular Data Accessors](http://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/poptics.pdf) 0. http://hackage.haskell.org/package/profunctors-3.3.0.1/docs/Data-Profunctor.html 0. https://github.com/purescript-contrib/purescript-profunctor-lenses 0. https://hackage.haskell.org/package/lens-4.16/docs/Control-Lens-Indexed.html diff --git a/documentation/bookmark/optimization.md b/documentation/bookmark/optimization.md index 3ccbed5ac..7e7b7d851 100644 --- a/documentation/bookmark/optimization.md +++ b/documentation/bookmark/optimization.md @@ -1,31 +1,39 @@ # Inlining +0. []() 0. [Defunctionalization](https://en.wikipedia.org/wiki/Defunctionalization) # Hashing +0. []() 0. [Fibonacci Hashing: The Optimization that the World Forgot (or: a Better Alternative to Integer Modulo)](https://probablydance.com/2018/06/16/fibonacci-hashing-the-optimization-that-the-world-forgot-or-a-better-alternative-to-integer-modulo/) # Compilation +0. []() 0. ["Outperforming Imperative with Pure Functional Languages" by Richard Feldman](https://www.youtube.com/watch?v=vzfy4EKwG_Y) 0. [CompilerGym: Making compiler optimizations accessible to all](https://ai.facebook.com/blog/compilergym-making-compiler-optimizations-accessible-to-all) 0. [Future Directions for Optimizing Compilers](https://arxiv.org/abs/1809.02161) # Pre-fetching +0. []() 0. [Prefetching in Functional Languages](https://www.cl.cam.ac.uk/~tmj32/papers/docs/ainsworth20-ismm.pdf) # Partial evaluation +0. []() 0. [AnyDSL - A Partial Evaluation Framework for Programming High-Performance Libraries](https://anydsl.github.io/) # For the compiler +0. []() 0. [Self Hosting a Million-Lines-Per-Second Parser](https://bjou-lang.org/blog/7-10-2019-self-hosting-a-million-lines-per-second-parser/7-10-2019-self-hosting-a-million-lines-per-second-parser.html) # Reference +0. []() +0. [Software optimization resources](https://www.agner.org/optimize/) 0. [Finding Missed Optimizations through the Lens of Dead Code Elimination](https://ethz.ch/content/dam/ethz/special-interest/infk/ast-dam/documents/Theodoridis-ASPLOS22-DCE-Paper.pdf) 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) @@ -63,5 +71,6 @@ # JavaScript +0. []() 0. [Javascript Array.push is 945x faster than Array.concat](https://dev.to/uilicious/javascript-array-push-is-945x-faster-than-array-concat-1oki) diff --git a/documentation/bookmark/optimization/compiler.md b/documentation/bookmark/optimization/compiler.md new file mode 100644 index 000000000..4c1f525c3 --- /dev/null +++ b/documentation/bookmark/optimization/compiler.md @@ -0,0 +1,6 @@ +# Reference + +0. []() +0. [Compiler Optimizations](https://compileroptimizations.com/) +0. [The Exo Language](https://exo-lang.dev/) + diff --git a/documentation/bookmark/recycling.md b/documentation/bookmark/recycling.md new file mode 100644 index 000000000..935a62251 --- /dev/null +++ b/documentation/bookmark/recycling.md @@ -0,0 +1,6 @@ +# Reference + +0. []() +0. [The Chemical Story Behind Non-Petroleum-Based Plastics](https://sustainable-nano.com/2014/06/26/the-chemical-story-behind-non-petroleum-based-plastics/) +0. [Plastic-eating superworms with ‘recycling plant’ in their guts might get a job gobbling up waste](https://www.youtube.com/watch?v=Ub1LBeNQDxw) + diff --git a/documentation/bookmark/security/authentication.md b/documentation/bookmark/security/authentication.md index 152f17b1b..dfa8900d4 100644 --- a/documentation/bookmark/security/authentication.md +++ b/documentation/bookmark/security/authentication.md @@ -1,6 +1,8 @@ # Reference 0. []() +0. [persona](https://withpersona.com/home-wf) +0. [Authentication is Difficult](https://blog.jchw.io/authentication-is-difficult/) 0. [A07:2021 – Identification and Authentication Failures ](https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/) 0. [The future of authentication is both stateful and stateless](https://clerk.dev/blog/future-of-auth-stateless-and-stateful) 0. [Move beyond passwords](https://developer.apple.com/videos/play/wwdc2021/10106/) diff --git a/documentation/bookmark/software/engineering/alert.md b/documentation/bookmark/software/engineering/alert.md new file mode 100644 index 000000000..91076dc7a --- /dev/null +++ b/documentation/bookmark/software/engineering/alert.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Alerts, what are they good for?](https://medium.com/@tophatengblog/alerts-what-are-they-good-for-fe085e9ab4db) + diff --git a/documentation/bookmark/testing.md b/documentation/bookmark/testing.md index c28708d0e..f67c69688 100644 --- a/documentation/bookmark/testing.md +++ b/documentation/bookmark/testing.md @@ -1,33 +1,46 @@ # Concolic Testing +0. []() 0. [Robby Findler: Concolic Testing with Higher-Order Inputs](https://www.youtube.com/watch?v=aO9nOCqNdfQ) # Symbolic +0. []() 0. [Crux](https://crux.galois.com/) # White box +0. []() 0. [Ricardo Peña - White-Box Path Generation in Recursive Programs - Lambda Days 2020](https://www.youtube.com/watch?v=7RXJhPaQCkc) # Mocking +0. []() 0. [Testing Without Mocks: A Pattern Language](https://www.jamesshore.com/Blog/Testing-Without-Mocks.html) # Visual Testing +0. []() 0. [Stories are tests](https://storybook.js.org/blog/stories-are-tests/) 0. [Visual Testing Handbook](https://storybook.js.org/tutorials/visual-testing-handbook/) # Cross-Branch Testing +0. []() 0. [Cross-Branch Testing](https://www.hillelwayne.com/post/cross-branch-testing/) # Coverage +0. []() 0. [Modified condition/decision coverage](https://en.wikipedia.org/wiki/Modified_condition/decision_coverage) +# Property-based + +0. []() +0. [Property-based Testing Patterns](https://blog.ssanj.net/posts/2016-06-26-property-based-testing-patterns.html) + # Reference +0. []() 0. [Test Anything Protocol](http://testanything.org/) diff --git a/documentation/bookmark/testing/metamorphic.md b/documentation/bookmark/testing/metamorphic.md new file mode 100644 index 000000000..7432b3583 --- /dev/null +++ b/documentation/bookmark/testing/metamorphic.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Metamorphic Testing of Version Control Systems](https://elib.uni-stuttgart.de/bitstream/11682/12221/1/MA_MetaVECTT_Reichel.pdf) + diff --git a/documentation/bookmark/user_interface/a11y__accessibility.md b/documentation/bookmark/user_interface/a11y__accessibility.md new file mode 100644 index 000000000..34eba799d --- /dev/null +++ b/documentation/bookmark/user_interface/a11y__accessibility.md @@ -0,0 +1,9 @@ +# Reference + +0. []() +0. [a11yphant: Learning web accessibility made easy](https://a11yphant.com/) +0. [Inclusive Design Principles](https://inclusivedesignprinciples.org/) +0. [Making Accessibility More Accessible](https://austingil.com/making-accessibility-more-accessible/) +0. [Detecting Hover-Capable Devices](https://css-irl.info/detecting-hover-capable-devices/) +0. [Nobody talks about the real reason to use Tabs over Spaces](https://www.reddit.com/r/javascript/comments/c8drjo/nobody_talks_about_the_real_reason_to_use_tabs/?st=jxuy98ok&sh=8487bdfa) + diff --git a/documentation/bookmark/user_interface/accessibility.md b/documentation/bookmark/user_interface/accessibility.md deleted file mode 100644 index 0880d713d..000000000 --- a/documentation/bookmark/user_interface/accessibility.md +++ /dev/null @@ -1,7 +0,0 @@ -# Reference - -0. [Inclusive Design Principles](https://inclusivedesignprinciples.org/) -0. [Making Accessibility More Accessible](https://austingil.com/making-accessibility-more-accessible/) -0. [Detecting Hover-Capable Devices](https://css-irl.info/detecting-hover-capable-devices/) -0. [Nobody talks about the real reason to use Tabs over Spaces](https://www.reddit.com/r/javascript/comments/c8drjo/nobody_talks_about_the_real_reason_to_use_tabs/?st=jxuy98ok&sh=8487bdfa) - diff --git a/lux-js/commands.md b/lux-js/commands.md index 34b4a750c..a71f5e2e8 100644 --- a/lux-js/commands.md +++ b/lux-js/commands.md @@ -20,16 +20,15 @@ cd ~/lux/lux-js/ \ && mv target/program.jar jvm_based_compiler.jar ## Use JVM-based compiler to produce a JS/Node-based compiler. -## @ library/lux/data/text TODO: Comment/turn-off when generating a JS compiler using a JVM-based compiler because Nashorn's implementation of "replaceAll" is incorrect. cd ~/lux/lux-js/ \ && lux clean \ -&& time java -jar jvm_based_compiler.jar build --source ~/lux/lux-js/source --target ~/lux/lux-js/target --module program \ +&& time java -jar jvm_based_compiler.jar build --source ~/lux/lux-js/source --target ~/lux/lux-js/target --module program --program _ \ && mv target/program.js node_based_compiler.js ## Use JS/Node-based compiler to produce another JS/Node-based compiler. cd ~/lux/lux-js/ \ && lux clean \ -&& node --stack_size=8192 node_based_compiler.js build --source ~/lux/lux-js/source --target ~/lux/lux-js/target --module program +&& node --stack_size=8192 node_based_compiler.js build --source ~/lux/lux-js/source --target ~/lux/lux-js/target --module program --program _ ``` # Try @@ -38,7 +37,7 @@ cd ~/lux/lux-js/ \ ## Compile Lux's Standard Library's tests using a JS/Node-based compiler. cd ~/lux/stdlib/ \ && lux clean \ -&& node --stack_size=8192 ~/lux/lux-js/target/program.js build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux \ +&& node --stack_size=8192 ~/lux/lux-js/target/program.js build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux --program _ \ && node ~/lux/stdlib/target/program.js ``` diff --git a/lux-js/project.lux b/lux-js/project.lux index c7be34e6f..7112c796f 100644 --- a/lux-js/project.lux +++ b/lux-js/project.lux @@ -1,5 +1,5 @@ ["" - ["identity" ["com.github.luxlang" "lux-js" "0.6.6-SNAPSHOT"] + ["identity" ["com.github.luxlang" "lux-js" "0.7.0-SNAPSHOT"] "info" ["url" "https://github.com/LuxLang/lux" "scm" "https://github.com/LuxLang/lux.git" "licenses" [["name" "Lux License v0.1.2" @@ -18,11 +18,12 @@ "dependencies" [... ["com.github.luxlang" "stdlib" "0.6.5" "tar"] ] - "program" "program"] + "program" program._] "js" - ["lux" ["com.github.luxlang" "lux-js" "0.6.6-SNAPSHOT" "js"]] + ["lux" ["com.github.luxlang" "lux-js" "0.7.0-SNAPSHOT" "js"]] "jvm" - ["lux" ["com.github.luxlang" "lux-jvm" "0.6.6-SNAPSHOT" "jar"] - "dependencies" [["org.openjdk.nashorn" "nashorn-core" "15.1" "jar"]]]] + ["lux" ["com.github.luxlang" "lux-jvm" "0.7.0-SNAPSHOT" "jar"] + "dependencies" [["com.github.luxlang" "lux-jvm-function" "0.6.5" "jar"] + ["org.openjdk.nashorn" "nashorn-core" "15.1" "jar"]]]] diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux index c692a41a0..69656c4bc 100644 --- a/lux-js/source/program.lux +++ b/lux-js/source/program.lux @@ -22,9 +22,6 @@ ["[0]" utf8]]] [collection ["[0]" array (.only Array)]]] - [macro - ["^" pattern] - ["[0]" template]] [math [number ["n" nat] @@ -32,10 +29,13 @@ ["[0]" i64]]] ["[0]" world ["[0]" file] - ["[1]/[0]" program]] - ["@" target (.only) - ["_" js]] + ["[1]/[0]" environment]] [meta + ["@" target (.only) + ["_" js]] + [macro + ["^" pattern] + ["[0]" template]] [compiler ["[0]" phase (.only Operation Phase)] [reference @@ -56,7 +56,8 @@ [generation ["[0]" reference] ["[0]" js (.only) - ["[0]" runtime]]]]]] + ["[0]" runtime] + ["[1]/[0]" reference]]]]]] [default ["[0]" platform (.only Platform)]] [meta @@ -177,11 +178,17 @@ [] (getMember self [member java/lang/String]) java/lang/Object (case (ffi.of_string member) (static runtime.i64_high_field) - (|> value .nat runtime.high jvm_int + (|> value + .nat + runtime.high + jvm_int (ffi.is java/lang/Object)) (static runtime.i64_low_field) - (|> value .nat runtime.low jvm_int + (|> value + .nat + runtime.low + jvm_int (ffi.is java/lang/Object)) _ @@ -221,7 +228,7 @@ java/lang/Object (|> (java/util/Arrays::copyOfRange value (|> args - (array.read! 0) + (array.item 0) maybe.trusted (as Int) ffi.as_int) @@ -235,14 +242,18 @@ (-> (Array java/lang/Object) org/openjdk/nashorn/api/scripting/JSObject) (let [js_object (is (-> java/lang/Object org/openjdk/nashorn/api/scripting/JSObject) (function (_ sub_value) - (<| (case (ffi.is [java/lang/Object] sub_value) + (<| (case (ffi.as [java/lang/Object] sub_value) {.#Some sub_value} - (|> sub_value (as (Array java/lang/Object)) js_structure) + (|> sub_value + (as (Array java/lang/Object)) + js_structure) {.#None}) - (case (ffi.is java/lang/Long sub_value) + (case (ffi.as java/lang/Long sub_value) {.#Some sub_value} - (|> sub_value ffi.of_long js_int) + (|> sub_value + ffi.of_long + js_int) {.#None}) ... else @@ -252,10 +263,12 @@ [] ... Methods (StructureValue - [] (getValue self []) java/lang/Object - (ffi.is java/lang/Object value)) + [] (getValue self []) + java/lang/Object + (as java/lang/Object value)) (org/openjdk/nashorn/api/scripting/AbstractJSObject - [] (isArray self []) boolean + [] (isArray self []) + boolean (ffi.as_boolean #1)) (org/openjdk/nashorn/api/scripting/AbstractJSObject [] (getMember self [member java/lang/String]) @@ -277,11 +290,11 @@ (static runtime.variant_tag_field) (|> value - (array.read! 0) + (array.item 0) maybe.trusted) (static runtime.variant_flag_field) - (case (array.read! 1 value) + (case (array.item 1 value) {.#Some set!} set! @@ -290,18 +303,18 @@ (static runtime.variant_value_field) (|> value - (array.read! 2) + (array.item 2) maybe.trusted js_object (ffi.is java/lang/Object)) _ - (panic! (exception.error ..unknown_member [(as Text member) (as java/lang/Object value)]))) - ) + (panic! (exception.error ..unknown_member [(as Text member) (as java/lang/Object value)])))) (org/openjdk/nashorn/api/scripting/AbstractJSObject - [] (getSlot self [idx int]) java/lang/Object + [] (getSlot self [idx int]) + java/lang/Object (|> value - (array.read! (|> idx java/lang/Integer::longValue (as Nat))) + (array.item (|> idx java/lang/Integer::longValue (as Nat))) maybe.trusted js_object (as java/lang/Object))) @@ -313,7 +326,7 @@ (exception.report (list ["Class" (ffi.of_string (java/lang/Object::toString (java/lang/Object::getClass object)))] ["Object" (ffi.of_string (java/lang/Object::toString object))] - ["Keys" (case (ffi.is org/openjdk/nashorn/api/scripting/ScriptObjectMirror object) + ["Keys" (case (ffi.as org/openjdk/nashorn/api/scripting/ScriptObjectMirror object) {.#Some object} (|> object (org/openjdk/nashorn/api/scripting/ScriptObjectMirror::getOwnKeys true) @@ -327,7 +340,7 @@ (-> Text org/openjdk/nashorn/api/scripting/ScriptObjectMirror (Maybe Int)) (|> i64 (org/openjdk/nashorn/api/scripting/JSObject::getMember [(ffi.as_string half)]) - (maybe#each (|>> (ffi.is java/lang/Number))) + (maybe#each (|>> (ffi.as java/lang/Number))) maybe#conjoint (maybe#each (|>> java/lang/Number::longValue ffi.of_long)))) @@ -353,7 +366,7 @@ (org/openjdk/nashorn/api/scripting/JSObject::getMember [(ffi.as_string runtime.variant_flag_field)] js_object) (org/openjdk/nashorn/api/scripting/JSObject::getMember [(ffi.as_string runtime.variant_value_field)] js_object)] (^.multi [{.#Some tag} ?flag {.#Some value}] - [[(ffi.is java/lang/Number tag) (lux_object value)] + [[(ffi.as java/lang/Number tag) (lux_object value)] [{.#Some tag} {try.#Success value}]]) {.#Some [(java/lang/Number::intValue (as java/lang/Number tag)) (maybe.else (ffi.null) ?flag) @@ -374,14 +387,14 @@ (if (n.< num_keys idx) (case (org/openjdk/nashorn/api/scripting/JSObject::getMember (ffi.as_string (%.nat idx)) js_object) {.#Some member} - (case (ffi.is org/openjdk/nashorn/internal/runtime/Undefined member) + (case (ffi.as org/openjdk/nashorn/internal/runtime/Undefined member) {.#Some _} (again (++ idx) output) {.#None} (case (lux_object member) {try.#Success parsed_member} - (again (++ idx) (array.write! idx (as java/lang/Object parsed_member) output)) + (again (++ idx) (array.has! idx (as java/lang/Object parsed_member) output)) {try.#Failure error} {.#None})) @@ -395,13 +408,13 @@ (-> java/lang/Object (Try Any)) (`` (<| (if (ffi.null? js_object) (exception.except ..null_has_no_lux_representation [{.#None}])) - (case (ffi.is org/openjdk/nashorn/internal/runtime/Undefined js_object) + (case (ffi.as org/openjdk/nashorn/internal/runtime/Undefined js_object) {.#Some _} (exception.except ..undefined_has_no_lux_representation []) {.#None}) (,, (with_template [] - [(case (ffi.is js_object) + [(case (ffi.as js_object) {.#Some js_object} {try.#Success js_object} @@ -409,7 +422,7 @@ [java/lang/Boolean] [java/lang/String])) (,, (with_template [ ] - [(case (ffi.is js_object) + [(case (ffi.as js_object) {.#Some js_object} {try.#Success ( js_object)} @@ -418,7 +431,7 @@ [java/lang/Number java/lang/Number::doubleValue] [StructureValue StructureValue::getValue] [IntValue IntValue::getValue])) - (case (ffi.is org/openjdk/nashorn/api/scripting/ScriptObjectMirror js_object) + (case (ffi.as org/openjdk/nashorn/api/scripting/ScriptObjectMirror js_object) {.#Some js_object} (case (check_int js_object) {.#Some value} @@ -451,7 +464,7 @@ (do maybe.monad [function (|> function (as java/lang/Object) - (ffi.is org/openjdk/nashorn/api/scripting/JSObject))] + (ffi.as org/openjdk/nashorn/api/scripting/JSObject))] (if (ffi.of_boolean (org/openjdk/nashorn/api/scripting/JSObject::isFunction function)) {.#Some function} {.#None}))) @@ -469,8 +482,8 @@ (org/openjdk/nashorn/api/scripting/JSObject::call {.#None} (|> (array.empty 2) (is (Array java/lang/Object)) - (array.write! 0 (to_js inputs)) - (array.write! 1 (to_js lux))) + (array.has! 0 (to_js inputs)) + (array.has! 1 (to_js lux))) macro)))) (exception (cannot_apply_a_non_function [object java/lang/Object]) @@ -642,7 +655,7 @@ platform.#phase_wrapper ..phase_wrapper platform.#write (|>> _.code (at utf8.codec encoded))]))) -(def (program context program) +(def (lux_program context program) (Program _.Expression _.Statement) (let [@process (_.var "process") on_node_js? (|> @process @@ -681,11 +694,11 @@ output (org/openjdk/nashorn/api/scripting/JSObject::call {.#None} (|> (array.empty 5) (is (Array java/lang/Object)) - (array.write! 0 name) - (array.write! 1 (as java/lang/Object (extender phase))) - (array.write! 2 (to_js archive)) - (array.write! 3 (to_js parameters)) - (array.write! 4 (to_js state))) + (array.has! 0 name) + (array.has! 1 (as java/lang/Object (extender phase))) + (array.has! 2 (to_js archive)) + (array.has! 3 (to_js parameters)) + (array.has! 4 (to_js state))) handler)] (lux_object (as java/lang/Object output))))) @@ -696,7 +709,7 @@ (def (declare_success! _) (-> Any (Async Any)) - (async.future (at world/program.default exit +0))) + (async.future (at world/environment.default exit +0))) (def (scope body) (-> _.Statement _.Statement) @@ -720,7 +733,8 @@ (io.io platform) generation.bundle (function.constant extension/bundle.empty) - ..program + ..lux_program + (reference.constant js/reference.system) [(And Register Text) _.Expression _.Statement] ..extender service diff --git a/lux-jvm/commands.md b/lux-jvm/commands.md index 724083f8b..42b24ba39 100644 --- a/lux-jvm/commands.md +++ b/lux-jvm/commands.md @@ -22,17 +22,17 @@ cd ~/lux/lux-jvm/ && java -jar target/program.jar repl --source ~/lux/stdlib/sou # Try ``` -cd ~/lux/lux-jvm/ && time java -jar target/program.jar build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux +cd ~/lux/lux-jvm/ && time java -jar target/program.jar build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux --program _ cd ~/lux/lux-jvm/ && java -jar target/program.jar export --source ~/lux/stdlib/source --target ~/lux/stdlib/target cd ~/lux/stdlib/ \ && cd ~/lux/lux-jvm/ \ -&& time java -jar target/program.jar build --source ~/lux/stdlib/source --library ~/lux/stdlib/target/library.tar --target ~/lux/stdlib/target --module test/lux +&& time java -jar target/program.jar build --source ~/lux/stdlib/source --library ~/lux/stdlib/target/library.tar --target ~/lux/stdlib/target --module test/lux --program _ ## Use new JVM compiler to compile tests for the Standard Library cd ~/lux/stdlib/ \ && lein clean \ -&& java -jar ~/lux/lux-jvm/target/program.jar build --host_dependency ~/.m2/repository/com/github/luxlang/lux-jvm-function/0.6.5/lux-jvm-function-0.6.5.jar --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux \ +&& java -jar ~/lux/lux-jvm/target/program.jar build --host_dependency ~/.m2/repository/com/github/luxlang/lux-jvm-function/0.6.5/lux-jvm-function-0.6.5.jar --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux --program _ \ && java -jar ~/lux/stdlib/target/program.jar ``` diff --git a/lux-jvm/source/program.lux b/lux-jvm/source/program.lux index 17fe054ef..85b517bbd 100644 --- a/lux-jvm/source/program.lux +++ b/lux-jvm/source/program.lux @@ -169,19 +169,19 @@ (let [context (context.jvm (cli.target service))] (exec (do async.monad [[loader host platform] (async.future ..platform) - _ (compositor.compiler - ..lux_compiler - context - ..expander - (analysis.bundle loader host) - (io.io platform) - generation.bundle - (|>> ..extender (declaration.bundle loader)) - (/program.program /runtime.class_name) /reference.constant - [Anchor (type_literal (Bytecode Any)) Definition] - ..extender - service - [(packager.package context) - (format (cli.target service) (at file.default separator) "program.jar")])] + _ (compositor.compiler ..lux_compiler + context + ..expander + (analysis.bundle loader host) + (io.io platform) + generation.bundle + (|>> ..extender (declaration.bundle loader)) + (/program.program /runtime.class_name) + /reference.constant + [Anchor (type_literal (Bytecode Any)) Definition] + ..extender + service + [(packager.package context) + (format (cli.target service) (at file.default separator) "program.jar")])] (..declare_success! [])) (io.io []))))) diff --git a/lux-lua/commands.md b/lux-lua/commands.md index 6dd497307..6ffa0453e 100644 --- a/lux-lua/commands.md +++ b/lux-lua/commands.md @@ -20,7 +20,7 @@ cd ~/lux/lux-lua/ \ ## Compile Lux's Standard Library's tests using a JVM-based compiler. cd ~/lux/stdlib/ \ && lein clean \ -&& java -jar ~/lux/lux-lua/target/program.jar build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux \ +&& java -jar ~/lux/lux-lua/target/program.jar build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux --program _ \ && ~/lua-5.4.2/install/bin/lua ~/lux/stdlib/target/program.lua ``` diff --git a/lux-lua/project.lux b/lux-lua/project.lux index 1e54cef63..b92be693a 100644 --- a/lux-lua/project.lux +++ b/lux-lua/project.lux @@ -29,5 +29,5 @@ ["com.github.luxlang" "rembulan-stdlib" "0.1" "jar"] ["com.github.luxlang" "rembulan-compiler" "0.1" "jar"]] - "program" "program" + "program" program._ "configuration" ["lua_compiler?" ""]]] diff --git a/lux-lua/source/program.lux b/lux-lua/source/program.lux index 150feec52..e1de9fdb0 100644 --- a/lux-lua/source/program.lux +++ b/lux-lua/source/program.lux @@ -27,10 +27,10 @@ ["[0]" i64]]] [meta ["[0]" static] + ["[0]" code] [macro ["^" pattern] - ["[0]" local] - ["[0]" code]] + ["[0]" local]] ["@" target (.only) ["_" lua]] ["[0]" compiler @@ -53,7 +53,8 @@ [generation ["[0]" reference] ["[0]" lua (.only) - ["[0]" runtime]]]]]] + ["[0]" runtime] + ["[1]/[0]" reference]]]]]] [default ["[0]" platform (.only Platform)]] [meta @@ -64,7 +65,7 @@ ["[1]" script]]]]] ["[0]" world ["[0]" file] - ["[1]/[0]" program]]]] + ["[1]/[0]" environment]]]] [program ["/" compositor]]) @@ -866,7 +867,7 @@ platform.#phase_wrapper ..phase_wrapper platform.#write (|>> _.code (at utf8.codec encoded))]))))) -(def (program context program) +(def (lux_program context program) (Program _.Expression _.Statement) (let [$program (_.var (reference.artifact context))] (_.statement (_.apply (list (runtime.lux//program_args (_.var "arg")) @@ -875,7 +876,7 @@ (def (declare_success! _) (-> Any (Async Any)) - (async.future (at world/program.default exit +0))) + (async.future (at world/environment.default exit +0))) (def (lux_compiler it) (-> Any platform.Custom) @@ -899,7 +900,8 @@ (io.io platform) generation.bundle (function.constant extension/bundle.empty) - ..program + ..lux_program + (reference.constant lua/reference.system) [(type_literal [Register _.Label]) _.Expression _.Statement] diff --git a/lux-mode/lux-mode.el b/lux-mode/lux-mode.el index 1d6637087..ca2a16a83 100644 --- a/lux-mode/lux-mode.el +++ b/lux-mode/lux-mode.el @@ -386,8 +386,8 @@ Called by `imenu--generic-function'." ;; Code (code//quotation (altRE "`" "`'" "'" "," ",\\*" ",'")) (code//super-quotation (altRE "``" ",,")) - (code//template (altRE "with_template" "template")) - (code//macro (altRE "macro" "syntax")) + (code//template (altRE "with_template")) + (code//macro (altRE "macro" "template" "syntax")) ;; Miscellaneous (jvm-host (altRE "import" "export" "class" "interface" "object" "synchronized" "class_for")) (alternative-format (altRE "char" "bin" "oct" "hex")) @@ -399,7 +399,8 @@ Called by `imenu--generic-function'." (extension (altRE "analysis" "synthesis" "generation" "declaration")) (definition (altRE "\\.require" "def" "inlined" "type" - "exception"))) + "exception" + "vocabulary"))) (let ((control (altRE control//flow control//pattern-matching control//logic diff --git a/lux-python/commands.md b/lux-python/commands.md index 869413fa7..c49f375f1 100644 --- a/lux-python/commands.md +++ b/lux-python/commands.md @@ -20,7 +20,7 @@ cd ~/lux/lux-python/ \ ## Compile Lux's Standard Library's tests using a JVM-based compiler. cd ~/lux/stdlib/ \ && lux clean \ -&& java -jar ~/lux/lux-python/target/program.jar build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux \ +&& java -jar ~/lux/lux-python/target/program.jar build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux --program _ \ && python3 ~/lux/stdlib/target/program.py ``` diff --git a/lux-python/project.lux b/lux-python/project.lux index b9b95ff62..be674f0dc 100644 --- a/lux-python/project.lux +++ b/lux-python/project.lux @@ -21,4 +21,4 @@ ["org.python" "jython-standalone" "2.7.2" "jar"]] - "program" "program"]] + "program" program._]] diff --git a/lux-python/source/program.lux b/lux-python/source/program.lux index cf4398f89..8cbe4e0e4 100644 --- a/lux-python/source/program.lux +++ b/lux-python/source/program.lux @@ -29,10 +29,10 @@ ["[0]" i64]]] [meta ["[0]" static] + ["[0]" code] [macro ["^" pattern] - ["[0]" template] - ["[0]" code]] + ["[0]" template]] ["@" target (.only) ["_" python]] ["[0]" compiler @@ -56,7 +56,8 @@ [generation ["[0]" reference] ["[0]" python (.only) - ["[0]" runtime]]]]]] + ["[0]" runtime] + ["[1]/[0]" reference]]]]]] [default ["[0]" platform (.only Platform)]] [meta @@ -68,7 +69,7 @@ ["[1]" script]]]]] ["[0]" world ["[0]" file] - ["[1]/[0]" program]]]] + ["[1]/[0]" environment]]]] [program ["/" compositor]]) @@ -538,7 +539,7 @@ platform.#phase_wrapper ..phase_wrapper platform.#write (|>> _.code (at utf8.codec encoded))]))) -(def (program context program) +(def (lux_program context program) (Program (_.Expression Any) (_.Statement Any)) (all _.then (_.import "sys") @@ -553,7 +554,7 @@ (def (declare_success! _) (-> Any (Async Any)) - (async.future (at world/program.default exit +0))) + (async.future (at world/environment.default exit +0))) (def (scope body) (-> (_.Statement Any) (_.Statement Any)) @@ -588,7 +589,8 @@ ..platform generation.bundle (function.constant extension/bundle.empty) - ..program + ..lux_program + (reference.constant python/reference.system) [Register (type_literal (_.Expression Any)) (type_literal (_.Statement Any))] diff --git a/lux-ruby/commands.md b/lux-ruby/commands.md index 0546f063f..3ec117745 100644 --- a/lux-ruby/commands.md +++ b/lux-ruby/commands.md @@ -20,7 +20,7 @@ cd ~/lux/lux-ruby/ \ ## Compile Lux's Standard Library's tests using a JVM-based compiler. cd ~/lux/stdlib/ \ && lein clean \ -&& java -jar ~/lux/lux-ruby/target/program.jar build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux \ +&& java -jar ~/lux/lux-ruby/target/program.jar build --source ~/lux/stdlib/source --target ~/lux/stdlib/target --module test/lux --program _ \ && RUBY_THREAD_VM_STACK_SIZE=15700000 ruby ~/lux/stdlib/target/program/main.rb ``` diff --git a/lux-ruby/project.lux b/lux-ruby/project.lux index e23b606b2..8d759a09b 100644 --- a/lux-ruby/project.lux +++ b/lux-ruby/project.lux @@ -1,5 +1,5 @@ ["" - ["identity" ["com.github.luxlang" "lux-ruby" "0.6.6-SNAPSHOT"] + ["identity" ["com.github.luxlang" "lux-ruby" "0.7.0-SNAPSHOT"] "description" "A Ruby compiler for Lux." "info" ["url" "https://github.com/LuxLang/lux" "scm" "https://github.com/LuxLang/lux.git" @@ -21,4 +21,4 @@ ["org.jruby" "jruby-complete" "9.2.15.0" "jar"]] - "program" "program"]] + "program" program._]] diff --git a/lux-ruby/source/program.lux b/lux-ruby/source/program.lux index df8ed9b66..324d4cefc 100644 --- a/lux-ruby/source/program.lux +++ b/lux-ruby/source/program.lux @@ -22,20 +22,17 @@ [collection ["[0]" array (.only Array)] ["[0]" list (.use "[1]#[0]" functor)]]] - [macro - ["^" pattern] - ["[0]" template]] [math [number (.only hex) ["n" nat] ["i" int] ["[0]" i64]]] - ["[0]" world - ["[0]" file] - ["[1]/[0]" program]] - ["@" target (.only) - ["_" ruby]] [meta + ["@" target (.only) + ["_" ruby]] + [macro + ["^" pattern] + ["[0]" template]] ["[0]" compiler ["[0]" phase (.only Operation Phase) (.use "[1]#[0]" monad)] [reference @@ -57,7 +54,8 @@ [generation ["[0]" reference] ["[0]" ruby (.only) - ["[0]" runtime]]]]]] + ["[0]" runtime] + ["[1]/[0]" reference]]]]]] [default ["[0]" platform (.only Platform)]] [meta @@ -65,7 +63,10 @@ ["[0]" context] ["[0]" cli] ["[0]" packager - ["[1]" ruby]]]]]]] + ["[1]" ruby]]]]] + ["[0]" world + ["[0]" file] + ["[1]/[0]" environment]]]] [program ["/" compositor]]) @@ -966,7 +967,7 @@ platform.#phase_wrapper ..phase_wrapper platform.#write (|>> _.code (at utf8.codec encoded))]))) -(def (program context program) +(def (lux_program context program) (Program _.Expression _.Statement) (let [normal_runtime? (_.do "const_defined?" (list (_.string (_.code _.command_line_arguments))) @@ -981,7 +982,7 @@ (def (declare_success! _) (-> Any (Async Any)) - (async.future (at world/program.default exit +0))) + (async.future (at world/environment.default exit +0))) (def (lux_compiler it) (-> Any platform.Custom) @@ -998,7 +999,8 @@ ..platform generation.bundle (function.constant extension/bundle.empty) - ..program + ..lux_program + (reference.constant ruby/reference.system) [Register _.Expression _.Statement] ..extender service diff --git a/stdlib/commands.md b/stdlib/commands.md index 874ee070a..0dbd64e87 100644 --- a/stdlib/commands.md +++ b/stdlib/commands.md @@ -92,7 +92,7 @@ cd ~/lux/stdlib/ \ cd ~/lux/stdlib/ \ && lux clean \ && lux with ruby with scriptum build \ -&& RUBY_THREAD_VM_STACK_SIZE=15700000 ruby ~/lux/stdlib/target/program.rb | tee ~/lux/documentation/library/standard/ruby.md +&& RUBY_THREAD_VM_STACK_SIZE=15700000 ruby ~/lux/stdlib/target/program/main.rb | tee ~/lux/documentation/library/standard/ruby.md ``` --- diff --git a/stdlib/source/documentation/lux.lux b/stdlib/source/documentation/lux.lux index 947fec8a1..1ffc31a13 100644 --- a/stdlib/source/documentation/lux.lux +++ b/stdlib/source/documentation/lux.lux @@ -893,6 +893,6 @@ /test.documentation /world.documentation]))) -(def _ +(.def _ (program inputs (io.io (debug.log! ($.markdown ..documentation))))) diff --git a/stdlib/source/documentation/lux/ffi.js.lux b/stdlib/source/documentation/lux/ffi.js.lux index cc4a6a8b2..a0e8edaef 100644 --- a/stdlib/source/documentation/lux/ffi.js.lux +++ b/stdlib/source/documentation/lux/ffi.js.lux @@ -54,14 +54,14 @@ [(= "function" (type_of (function (_ value) value)))]) - ($.definition /.constant + ($.definition /.global "Allows using definitions from the JavaScript host platform." - [(constant .Frac [Math PI])]) + [(global .Frac [Math PI])]) - ($.definition /.closure + ($.definition /.function (format "Allows defining closures/anonymous-functions in the form that JavaScript expects." \n "This is useful for adapting Lux functions for usage by JavaScript code.") [(is /.Function - (closure [left right] - (do_something (as Foo left) (as Bar right))))])] + (function [left right] + (do_something (as Foo left) (as Bar right))))])] [])) diff --git a/stdlib/source/documentation/lux/ffi.py.lux b/stdlib/source/documentation/lux/ffi.py.lux index 2701c47a1..d2da39eff 100644 --- a/stdlib/source/documentation/lux/ffi.py.lux +++ b/stdlib/source/documentation/lux/ffi.py.lux @@ -45,11 +45,11 @@ ("static" getsize [String] "io" "try" Integer) ("static" getmtime [String] "io" "try" Float))]) - ($.definition /.lambda + ($.definition /.function (format "Allows defining closures/anonymous-functions in the form that Python expects." \n "This is useful for adapting Lux functions for usage by Python code.") [(is ..Function - (lambda [left right] - (do_something (as Foo left) - (as Bar right))))])] + (function [left right] + (do_something (as Foo left) + (as Bar right))))])] [])) diff --git a/stdlib/source/documentation/lux/meta/macro.lux b/stdlib/source/documentation/lux/meta/macro.lux index 6e2557f3f..204efdd8c 100644 --- a/stdlib/source/documentation/lux/meta/macro.lux +++ b/stdlib/source/documentation/lux/meta/macro.lux @@ -18,19 +18,19 @@ (.List $.Module) ($.module /._ "" - [($.definition /.single_expansion - (format "Given code that requires applying a macro, does it once and returns the result." - \n "Otherwise, returns the code as-is.") - [(single_expansion syntax)]) + [... ($.definition /.single_expansion + ... (format "Given code that requires applying a macro, does it once and returns the result." + ... \n "Otherwise, returns the code as-is.") + ... [(single_expansion syntax)]) - ($.definition /.expansion - (format "Given code that requires applying a macro, expands repeatedly until no more direct macro-calls are left." - \n "Otherwise, returns the code as-is.") - [(expansion syntax)]) + ... ($.definition /.expansion + ... (format "Given code that requires applying a macro, expands repeatedly until no more direct macro-calls are left." + ... \n "Otherwise, returns the code as-is.") + ... [(expansion syntax)]) - ($.definition /.full_expansion - "Expands all macro-calls everywhere recursively, until only primitive/base code remains." - [(full_expansion syntax)]) + ... ($.definition /.full_expansion + ... "Expands all macro-calls everywhere recursively, until only primitive/base code remains." + ... [(full_expansion syntax)]) ($.definition /.symbol (format "Generates a unique name as a Code node (ready to be used in code templates)." @@ -52,48 +52,49 @@ (, g!_) ("jvm monitorexit" (, g!lock))] (, g!body))))))))]) - ($.definition /.one_expansion - "Works just like expand, except that it ensures that the output is a single Code token." - [(one_expansion token)]) + ... ($.definition /.one_expansion + ... "Works just like expand, except that it ensures that the output is a single Code token." + ... [(one_expansion token)]) - ($.definition /.log_single_expansion! - (format "Performs a macro-expansion and logs the resulting code." - \n "You can either use the resulting code, or omit them." - \n "By omitting them, this macro produces nothing (just like the lux.comment macro).") - [(log_single_expansion! - (def (foo bar baz) - (-> Int Int Int) - (int.+ bar baz))) - (log_single_expansion! "omit" - (def (foo bar baz) - (-> Int Int Int) - (int.+ bar baz)))]) + ... ($.definition /.log_single_expansion! + ... (format "Performs a macro-expansion and logs the resulting code." + ... \n "You can either use the resulting code, or omit them." + ... \n "By omitting them, this macro produces nothing (just like the lux.comment macro).") + ... [(log_single_expansion! + ... (def (foo bar baz) + ... (-> Int Int Int) + ... (int.+ bar baz))) + ... (log_single_expansion! "omit" + ... (def (foo bar baz) + ... (-> Int Int Int) + ... (int.+ bar baz)))]) - ($.definition /.log_expansion! - (format "Performs a macro-expansion and logs the resulting code." - \n "You can either use the resulting code, or omit them." - \n "By omitting them, this macro produces nothing (just like the lux.comment macro).") - [(log_expansion! - (def (foo bar baz) - (-> Int Int Int) - (int.+ bar baz))) - (log_expansion! "omit" - (def (foo bar baz) - (-> Int Int Int) - (int.+ bar baz)))]) + ... ($.definition /.log_expansion! + ... (format "Performs a macro-expansion and logs the resulting code." + ... \n "You can either use the resulting code, or omit them." + ... \n "By omitting them, this macro produces nothing (just like the lux.comment macro).") + ... [(log_expansion! + ... (def (foo bar baz) + ... (-> Int Int Int) + ... (int.+ bar baz))) + ... (log_expansion! "omit" + ... (def (foo bar baz) + ... (-> Int Int Int) + ... (int.+ bar baz)))]) - ($.definition /.log_full_expansion! - (format "Performs a macro-expansion and logs the resulting code." - \n "You can either use the resulting code, or omit them." - \n "By omitting them, this macro produces nothing (just like the lux.comment macro).") - [(log_full_expansion! - (def (foo bar baz) - (-> Int Int Int) - (int.+ bar baz))) - (log_full_expansion! "omit" - (def (foo bar baz) - (-> Int Int Int) - (int.+ bar baz)))])] + ... ($.definition /.log_full_expansion! + ... (format "Performs a macro-expansion and logs the resulting code." + ... \n "You can either use the resulting code, or omit them." + ... \n "By omitting them, this macro produces nothing (just like the lux.comment macro).") + ... [(log_full_expansion! + ... (def (foo bar baz) + ... (-> Int Int Int) + ... (int.+ bar baz))) + ... (log_full_expansion! "omit" + ... (def (foo bar baz) + ... (-> Int Int Int) + ... (int.+ bar baz)))]) + ] [/local.documentation /syntax.documentation /template.documentation])) diff --git a/stdlib/source/library/lux.lux b/stdlib/source/library/lux.lux index fa0108157..be2a9eb33 100644 --- a/stdlib/source/library/lux.lux +++ b/stdlib/source/library/lux.lux @@ -4884,62 +4884,61 @@ {#None} (failure (..wrong_syntax_error (symbol ..loop))))))) -(def (with_expansions' label tokens target) - (-> Text (List Code) Code (List Code)) - (case target - (pattern#or [_ {#Bit _}] - [_ {#Nat _}] - [_ {#Int _}] - [_ {#Rev _}] - [_ {#Frac _}] - [_ {#Text _}]) - (list target) - - [_ {#Symbol [module name]}] - (if (and (text#= "" module) - (text#= label name)) - tokens - (list target)) - - (with_template#pattern [] - [[location { elems}] - (list [location { (list#conjoint (list#each (with_expansions' label tokens) elems))}])]) - ([#Form] - [#Variant] - [#Tuple]))) - (def .public with_expansions - (macro (_ tokens) - (case (parsed (andP (tupleP (someP bindingP)) (someP anyP)) tokens) - {#Some [bindings bodies]} - (loop (again [bindings bindings - map (is (Property_List (List Code)) - (list))]) - (let [normal (is (-> Code (List Code)) - (function (_ it) - (list#mix (function (_ [binding expansion] it) - (list#conjoint (list#each (with_expansions' binding expansion) it))) - (list it) - map)))] - (case bindings - {#Item [var_name expr] &rest} - (do meta#monad - [expansion (case (normal expr) - (list expr) - (single_expansion expr) + (let [with_expansions' (is (-> Text (List Code) Code (List Code)) + (function (with_expansions' label tokens target) + (case target + (pattern#or [_ {#Bit _}] + [_ {#Nat _}] + [_ {#Int _}] + [_ {#Rev _}] + [_ {#Frac _}] + [_ {#Text _}]) + (list target) + + [_ {#Symbol [module name]}] + (if (and (text#= "" module) + (text#= label name)) + tokens + (list target)) + + (with_template#pattern [] + [[location { elems}] + (list [location { (list#conjoint (list#each (with_expansions' label tokens) elems))}])]) + ([#Form] + [#Variant] + [#Tuple]))))] + (macro (_ tokens) + (case (parsed (andP (tupleP (someP bindingP)) (someP anyP)) tokens) + {#Some [bindings bodies]} + (loop (again [bindings bindings + map (is (Property_List (List Code)) + (list))]) + (let [normal (is (-> Code (List Code)) + (function (_ it) + (list#mix (function (_ [binding expansion] it) + (list#conjoint (list#each (with_expansions' binding expansion) it))) + (list it) + map)))] + (case bindings + {#Item [var_name expr] &rest} + (do meta#monad + [expansion (case (normal expr) + (list expr) + (single_expansion expr) - _ - (failure (all text#composite - "Incorrect expansion in with_expansions" - " | Binding: " (text#encoded var_name) - " | Expression: " (code#encoded expr))))] - (again &rest (property#with var_name expansion map))) - - {#End} - (at meta#monad #in (list#conjoint (list#each normal bodies)))))) - - {#None} - (failure (..wrong_syntax_error (symbol ..with_expansions)))))) + _ + (failure (all text#composite + "Incorrect expansion in with_expansions" + " | Binding: " (text#encoded var_name) + " | Expression: " (code#encoded expr))))] + (again &rest (property#with var_name expansion map))) + + {#End} + (at meta#monad #in (list#conjoint (list#each normal bodies)))))) + + {#None} + (failure (..wrong_syntax_error (symbol ..with_expansions))))))) (def (flat_alias type) (-> Type Type) @@ -4960,136 +4959,58 @@ _ type)) -(def (static_simple_literal name) - (-> Symbol (Meta Code)) - (do meta#monad - [type+value (definition_value name) - .let [[type value] type+value]] - (case (flat_alias type) - (with_template#pattern [ ] - [{#Named ["library/lux" ] _} - (in ( (as value)))]) - (["Bit" Bit bit$] - ["Nat" Nat nat$] - ["Int" Int int$] - ["Rev" Rev rev$] - ["Frac" Frac frac$] - ["Text" Text text$]) - - _ - (failure (text#composite "Cannot anti-quote type: " (symbol#encoded name)))))) - -(def (static_literal token) - (-> Code (Meta Code)) - (case token - [_ {#Symbol [def_module def_name]}] - (if (text#= "" def_module) - (do meta#monad - [current_module current_module_name] - (static_simple_literal [current_module def_name])) - (static_simple_literal [def_module def_name])) - - (with_template#pattern [] - [[meta { parts}] - (do meta#monad - [=parts (monad#each meta#monad static_literal parts)] - (in [meta { =parts}]))]) - ([#Form] - [#Variant] - [#Tuple]) - - _ - (meta#in token) - ... TODO: Figure out why this doesn't work: - ... (at meta#monad in token) - )) - (def .public static - (macro (_ tokens) - (case tokens - (list pattern) - (do meta#monad - [pattern' (static_literal pattern)] - (in (list pattern'))) - - _ - (failure (..wrong_syntax_error (symbol ..static)))))) - -(type Multi_Level_Case - [Code (List [Code Code])]) - -(def (case_level^ level) - (-> Code (Meta [Code Code])) - (meta#in (case level - [_ {#Tuple (list expr binding)}] - [expr binding] - - _ - [level (` #1)]))) - -(def (multi_level_case^ levels) - (-> (List Code) (Meta Multi_Level_Case)) - (case levels - {#End} - (failure "Multi-level patterns cannot be empty.") - - {#Item init extras} - (do meta#monad - [extras' (monad#each meta#monad case_level^ extras)] - (in [init extras'])))) - -(def (multi_level_case$ g!_ [[init_pattern levels] body]) - (-> Code [Multi_Level_Case Code] (List Code)) - (let [inner_pattern_body (list#mix (function (_ [calculation pattern] success) - (let [bind? (case pattern - [_ {#Symbol _}] - #1 - - _ - #0)] - (` (case (, calculation) - (, pattern) - (, success) - - (,* (if bind? - (list) - (list g!_ (` {.#None})))))))) - (` {.#Some (, body)}) - (is (List [Code Code]) (list#reversed levels)))] - (list init_pattern inner_pattern_body))) - -(def pattern#multi - (pattern - (macro (_ tokens) - (case tokens - (list#partial [_meta {#Form levels}] body next_branches) - (do meta#monad - [mlc (multi_level_case^ levels) - .let [initial_bind? (case mlc - [[_ {#Symbol _}] _] - #1 + (let [simple_literal (is (-> Symbol (Meta Code)) + (function (simple_literal name) + (do meta#monad + [type+value (definition_value name) + .let [[type value] type+value]] + (case (flat_alias type) + (with_template#pattern [ ] + [{#Named ["library/lux" ] _} + (in ( (as value)))]) + (["Bit" Bit bit$] + ["Nat" Nat nat$] + ["Int" Int int$] + ["Rev" Rev rev$] + ["Frac" Frac frac$] + ["Text" Text text$]) + + _ + (failure (text#composite "Cannot anti-quote type: " (symbol#encoded name))))))) + literal (is (-> Code (Meta Code)) + (function (literal token) + (case token + [_ {#Symbol [def_module def_name]}] + (if (text#= "" def_module) + (do meta#monad + [current_module current_module_name] + (simple_literal [current_module def_name])) + (simple_literal [def_module def_name])) - _ - #0)] - expected ..expected_type - g!temp (..generated_symbol "temp")] - (in (list g!temp - (` ({{.#Some (, g!temp)} - (, g!temp) - - {.#None} - (case (, g!temp) - (,* next_branches))} - ("lux type check" {.#Apply (, (type_code expected)) Maybe} - (case (, g!temp) - (,* (multi_level_case$ g!temp [mlc body])) - - (,* (if initial_bind? - (list) - (list g!temp (` {.#None}))))))))))) - - _ - (failure (..wrong_syntax_error (symbol ..pattern#multi))))))) + (with_template#pattern [] + [[meta { parts}] + (do meta#monad + [=parts (monad#each meta#monad literal parts)] + (in [meta { =parts}]))]) + ([#Form] + [#Variant] + [#Tuple]) + + _ + (meta#in token) + ... TODO: Figure out why this doesn't work: + ... (at meta#monad in token) + )))] + (macro (_ tokens) + (case tokens + (list pattern) + (do meta#monad + [pattern' (literal pattern)] + (in (list pattern'))) + + _ + (failure (..wrong_syntax_error (symbol ..static))))))) (def .public (same? reference sample) (All (_ a) @@ -5107,24 +5028,22 @@ _ (failure (..wrong_syntax_error (symbol ..as_expected)))))) -(def location - (Meta Location) - (function (_ compiler) - {#Right [compiler (the #location compiler)]})) - (def .public undefined - (macro (_ tokens) - (case tokens - {#End} - (do meta#monad - [location ..location - .let [[module line column] location - location (all "lux text concat" (text#encoded module) "," (nat#encoded line) "," (nat#encoded column)) - message (all "lux text concat" "Undefined behavior @ " location)]] - (in (list (` (..panic! (, (text$ message))))))) - - _ - (failure (..wrong_syntax_error (symbol ..undefined)))))) + (let [location (is (Meta Location) + (function (_ compiler) + {#Right [compiler (the #location compiler)]}))] + (macro (_ tokens) + (case tokens + {#End} + (do meta#monad + [location location + .let [[module line column] location + location (all "lux text concat" (text#encoded module) "," (nat#encoded line) "," (nat#encoded column)) + message (all "lux text concat" "Undefined behavior @ " location)]] + (in (list (` (..panic! (, (text$ message))))))) + + _ + (failure (..wrong_syntax_error (symbol ..undefined))))))) (def .public type_of (macro (_ tokens) @@ -5143,42 +5062,43 @@ _ (failure (..wrong_syntax_error (symbol ..type_of)))))) -(def (templateP tokens) - (-> (List Code) (Maybe [Text (List Text) (List Code)])) - (do maybe#monad - [% (local_declarationP tokens) - .let' [[tokens [name parameters]] %] - % (tupleP (someP anyP) tokens) - .let' [[tokens templates] %] - _ (endP tokens)] - (in [name parameters templates]))) - (def .public template - (macro (_ tokens) - (case (templateP tokens) - {#Some [name args input_templates]} - (do meta#monad - [g!tokens (..generated_symbol "tokens") - g!compiler (..generated_symbol "compiler") - g!_ (..generated_symbol "_") - .let [rep_env (list#each (function (_ arg) - [arg (` ((,' ,) (, (local$ arg))))]) - args)] - this_module current_module_name] - (in (list (` (..macro ((, (local$ name)) (, g!tokens) (, g!compiler)) - (case (, g!tokens) - (list (,* (list#each local$ args))) - {.#Right [(, g!compiler) - (list (,* (list#each (function (_ template) - (` (`' (, (with_replacements rep_env - template))))) - input_templates)))]} - - (, g!_) - {.#Left "Invalid syntax."})))))) + (let [templateP (is (-> (List Code) (Maybe [Text (List Text) (List Code)])) + (function (_ tokens) + (do maybe#monad + [% (local_declarationP tokens) + .let' [[tokens [name parameters]] %] + % (tupleP (someP anyP) tokens) + .let' [[tokens templates] %] + _ (endP tokens)] + (in [name parameters templates])))) + simple_replacement_environment (is (-> (List Text) Replacement_Environment) + (list#each (function (_ arg) + [arg (` ((,' ,) (, (local$ arg))))]))) + instantiated_template (is (-> Replacement_Environment Code Code) + (function (_ replacement_environment template) + (` (`' (, (with_replacements replacement_environment + template))))))] + (macro (_ tokens) + (case (templateP tokens) + {#Some [name args input_templates]} + (do meta#monad + [g!tokens (..generated_symbol "tokens") + g!compiler (..generated_symbol "compiler") + g!_ (..generated_symbol "_") + this_module ..current_module_name] + (in (list (` (..macro ((, (local$ name)) (, g!tokens) (, g!compiler)) + (case (, g!tokens) + (list (,* (list#each local$ args))) + {.#Right [(, g!compiler) + (list (,* (list#each (instantiated_template (simple_replacement_environment args)) + input_templates)))]} + + (, g!_) + {.#Left "Invalid syntax."})))))) - {#None} - (failure (..wrong_syntax_error (symbol ..template)))))) + {#None} + (failure (..wrong_syntax_error (symbol ..template))))))) (with_template [ ] [(def .public @@ -5198,76 +5118,73 @@ (def .public char (macro (_ tokens compiler) (case tokens - (pattern#multi (list [_ {#Text input}]) - (|> input "lux text size" ("lux i64 =" 1))) - (|> input ("lux text char" 0) - nat$ list - [compiler] {#Right}) + (list [_ {#Text input}]) + (if (|> input "lux text size" ("lux i64 =" 1)) + (|> input ("lux text char" 0) + nat$ list + [compiler] {#Right}) + {#Left (..wrong_syntax_error (symbol ..char))}) _ {#Left (..wrong_syntax_error (symbol ..char))}))) -(def target - (Meta Text) - (function (_ compiler) - {#Right [compiler (the [#info #target] compiler)]})) - -(def (platform_name choice) - (-> Code (Meta Text)) - (case choice - [_ {#Text platform}] - (..meta#in platform) - - [_ {#Symbol symbol}] - (do meta#monad - [symbol (..global_symbol symbol) - type+value (..definition_value symbol) - .let [[type value] type+value]] - (case (..flat_alias type) - (pattern#or {#Primitive "#Text" {#End}} - {#Named ["library/lux" "Text"] {#Primitive "#Text" {#End}}}) - (in (as ..Text value)) - - _ - (failure (all text#composite - "Invalid target platform (must be a value of type Text): " (symbol#encoded symbol) - " : " (..code#encoded (..type_code type)))))) - - _ - (failure (all text#composite - "Invalid target platform syntax: " (..code#encoded choice) - \n "Must be either a text literal or a symbol.")))) - -(def (target_pick target options default) - (-> Text (List [Code Code]) (Maybe Code) (Meta (List Code))) - (case options - {#End} - (case default - {#None} - (failure (all text#composite "No code for target platform: " target)) - - {#Some default} - (meta#in (list default))) - - {#Item [key pick] options'} - (do meta#monad - [platform (..platform_name key)] - (if (text#= target platform) - (meta#in (list pick)) - (target_pick target options' default))))) - (def .public for - (macro (_ tokens) - (case (..parsed (..andP (..someP (..andP ..anyP ..anyP)) - (..maybeP ..anyP)) - tokens) - {.#Some [options default]} - (do meta#monad - [target ..target] - (target_pick target options default)) + (let [target (is (Meta Text) + (function (_ compiler) + {#Right [compiler (the [#info #target] compiler)]})) + platform_name (is (-> Code (Meta Text)) + (function (_ choice) + (case choice + [_ {#Text platform}] + (..meta#in platform) + + [_ {#Symbol symbol}] + (do meta#monad + [symbol (..global_symbol symbol) + type+value (..definition_value symbol) + .let [[type value] type+value]] + (case (..flat_alias type) + (pattern#or {#Primitive "#Text" {#End}} + {#Named ["library/lux" "Text"] {#Primitive "#Text" {#End}}}) + (in (as ..Text value)) - {.#None} - (failure (..wrong_syntax_error (symbol ..for)))))) + _ + (failure (all text#composite + "Invalid target platform (must be a value of type Text): " (symbol#encoded symbol) + " : " (..code#encoded (..type_code type)))))) + + _ + (failure (all text#composite + "Invalid target platform syntax: " (..code#encoded choice) + \n "Must be either a text literal or a symbol."))))) + target_pick (is (-> Text (List [Code Code]) (Maybe Code) (Meta (List Code))) + (function (target_pick target options default) + (case options + {#End} + (case default + {#None} + (failure (all text#composite "No code for target platform: " target)) + + {#Some default} + (meta#in (list default))) + + {#Item [key pick] options'} + (do meta#monad + [platform (platform_name key)] + (if (text#= target platform) + (meta#in (list pick)) + (target_pick target options' default))))))] + (macro (_ tokens) + (case (..parsed (..andP (..someP (..andP ..anyP ..anyP)) + (..maybeP ..anyP)) + tokens) + {.#Some [options default]} + (do meta#monad + [target target] + (target_pick target options default)) + + {.#None} + (failure (..wrong_syntax_error (symbol ..for))))))) ... TODO: Delete "scope_type_vars" (including the #scope_type_vars Lux state) and "parameter" ASAP. (for "{old}" (these (def (scope_type_vars state) @@ -5296,40 +5213,39 @@ (failure (..wrong_syntax_error (symbol ..$))))))) (these (def .public parameter ""))) -(def (refer_code imported_module alias referrals) - (-> Text Text (List Referral) Code) - (` (..refer (, (text$ imported_module)) - (, (text$ alias)) - (,* (list#each (function (_ [macro parameters]) - (` ((, (symbol$ macro)) (,* parameters)))) - referrals))))) - (def .public require - (macro (_ _imports) - (do meta#monad - [current_module ..current_module_name - imports (imports_parser #0 current_module {#End} _imports) - .let [=imports (|> imports - (list#each (is (-> Importation Code) - (function (_ [module_name m_alias =refer]) - (` [(, (text$ module_name)) (, (text$ (..maybe#else "" m_alias)))])))) - tuple$) - =refers (list#each (is (-> Importation Code) - (function (_ [module_name m_alias =refer]) - (refer_code module_name (..maybe#else "" m_alias) =refer))) - imports) - =module (` ("lux def module" (, =imports)))] - g!_ (..generated_symbol "")] - (in {#Item =module - (for "Python" - ... TODO: Remove this hack once Jython is no longer being used as the Python interpreter. - ... Without it, I get this strange error - ... {library/lux/tool/compiler/language/lux/generation.no_buffer_for_saving_code} - ... Artifact ID: 0 - ... Which only ever happens for the Python compiler. - (list#partial (` ("lux def" (, g!_) [] #0)) - =refers) - =refers)})))) + (let [refer_code (is (-> Text Text (List Referral) Code) + (function (_ imported_module alias referrals) + (` (..refer (, (text$ imported_module)) + (, (text$ alias)) + (,* (list#each (function (_ [macro parameters]) + (` ((, (symbol$ macro)) (,* parameters)))) + referrals))))))] + (macro (_ _imports) + (do meta#monad + [current_module ..current_module_name + imports (imports_parser #0 current_module {#End} _imports) + .let [=imports (|> imports + (list#each (is (-> Importation Code) + (function (_ [module_name m_alias =refer]) + (` [(, (text$ module_name)) (, (text$ (..maybe#else "" m_alias)))])))) + tuple$) + =refers (list#each (is (-> Importation Code) + (function (_ [module_name m_alias =refer]) + (refer_code module_name (..maybe#else "" m_alias) =refer))) + imports) + =module (` ("lux def module" (, =imports)))] + g!_ (..generated_symbol "")] + (in {#Item =module + (for "Python" + ... TODO: Remove this hack once Jython is no longer being used as the Python interpreter. + ... Without it, I get this strange error + ... {library/lux/tool/compiler/language/lux/generation.no_buffer_for_saving_code} + ... Artifact ID: 0 + ... Which only ever happens for the Python compiler. + (list#partial (` ("lux def" (, g!_) [] #0)) + =refers) + =refers)}))))) (type .public Immediate_UnQuote (Primitive "#Macro/Immediate_UnQuote")) @@ -5467,30 +5383,29 @@ {#None} (failure (..wrong_syntax_error (symbol ..Interface))))))) -(def (recursive_type g!self g!dummy name body) - (-> Code Code Text Code Code) - (` {.#Apply (..Primitive "") - (.All ((, g!self) (, g!dummy)) - (, (let$ (local$ name) (` {.#Apply (..Primitive "") (, g!self)}) - body)))})) - (def .public Rec - (macro (_ tokens) - (case tokens - (list [_ {#Symbol "" name}] body) - (do meta#monad - [body' (expansion body) - g!self (generated_symbol "g!self") - g!dummy (generated_symbol "g!dummy")] - (case body' - (list body' labels) - (in (list (..recursive_type g!self g!dummy name body') labels)) + (let [recursive_type (is (-> Code Code Text Code Code) + (function (recursive_type g!self g!dummy name body) + (` {.#Apply (..Primitive "") + (.All ((, g!self) (, g!dummy)) + (, (let$ (local$ name) (` {.#Apply (..Primitive "") (, g!self)}) + body)))})))] + (macro (_ tokens) + (case tokens + (list [_ {#Symbol "" name}] body) + (do meta#monad + [body' (expansion body) + g!self (generated_symbol "g!self") + g!dummy (generated_symbol "g!dummy")] + (case body' + (list body' labels) + (in (list (recursive_type g!self g!dummy name body') labels)) - (list body') - (in (list (..recursive_type g!self g!dummy name body'))) + (list body') + (in (list (recursive_type g!self g!dummy name body'))) - _ - (failure (..wrong_syntax_error (symbol ..Rec))))) + _ + (failure (..wrong_syntax_error (symbol ..Rec))))) - _ - (failure (..wrong_syntax_error (symbol ..Rec)))))) + _ + (failure (..wrong_syntax_error (symbol ..Rec))))))) diff --git a/stdlib/source/library/lux/control/function/inline.lux b/stdlib/source/library/lux/control/function/inline.lux index 6d5f3bebf..a06d2daf7 100644 --- a/stdlib/source/library/lux/control/function/inline.lux +++ b/stdlib/source/library/lux/control/function/inline.lux @@ -11,42 +11,43 @@ ["[0]" meta (.only) ["[0]" code (.only) ["<[1]>" \\parser (.only Parser)]] - ["[0]" macro (.only) - [syntax (.only syntax) - ["|[0]|" export]]]]]]) + ["[0]" macro (.only with_symbols) + [syntax (.only syntax)]]]]]) + +(type Declaration + [Text (List Code)]) (def declaration - (Parser [Text (List Code)]) + (Parser Declaration) (.form (<>.and .local (<>.some .any)))) (def inline - (Parser [Code [Text (List Code)] Code Code]) - (|export|.parser - (all <>.and - ..declaration - .any - .any - ))) + (Parser [Declaration Code Code]) + (all <>.and + ..declaration + .any + .any + )) (def .public inlined - (syntax (_ [[privacy [name parameters] type term] ..inline]) - (do [! meta.monad] - [@ meta.current_module_name - g!parameters (|> (macro.symbol "parameter") - (list.repeated (list.size parameters)) - (monad.all !)) - .let [inlined (` (("lux in-module" - (, (code.text @)) - (.is (, type) - (.function ((, (code.local name)) (,* parameters)) - (, term)))) - (,* (list#each (function (_ g!parameter) - (` ((,' ,) (, g!parameter)))) - g!parameters)))) - g!parameters (|> g!parameters - (list#each (function (_ parameter) - (list parameter (` .any)))) - list#conjoint)]] - (in (list (` (def (, privacy) (, (code.local name)) - (syntax ((, (code.local name)) [(,* g!parameters)]) + (syntax (_ [[[name parameters] type term] ..inline]) + (with_symbols [g!_] + (do [! meta.monad] + [@ meta.current_module_name + g!parameters (|> (macro.symbol "parameter") + (list.repeated (list.size parameters)) + (monad.all !)) + .let [inlined (` (("lux in-module" + (, (code.text @)) + (.is (, type) + (.function ((, (code.local name)) (,* parameters)) + (, term)))) + (,* (list#each (function (_ g!parameter) + (` ((,' ,) (, g!parameter)))) + g!parameters)))) + g!parameters (|> g!parameters + (list#each (function (_ parameter) + (list parameter (` .any)))) + list#conjoint)]] + (in (list (` (syntax ((, g!_) [(,* g!parameters)]) (.at meta.monad (,' in) (.list (.`' (, inlined)))))))))))) diff --git a/stdlib/source/library/lux/debug.lux b/stdlib/source/library/lux/debug.lux index a4866a106..ad5fa71fb 100644 --- a/stdlib/source/library/lux/debug.lux +++ b/stdlib/source/library/lux/debug.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except private) + [lux (.except private type) ["[0]" ffi (.only import)] [abstract ["[0]" monad (.only do)]] @@ -81,7 +81,7 @@ ("static" isArray [.Any] ffi.Boolean))) @.python - (these (type PyType + (these (.type PyType (Primitive "python_type")) (import (type [.Any] PyType)) @@ -385,7 +385,7 @@ (exception.report (list ["Type" (%.type type)]))) -(type Representation +(.type Representation (-> Any Text)) (def primitive_representation @@ -547,7 +547,7 @@ expectedT meta.expected_type] (function.constant (exception.except ..type_hole [location expectedT]))))) -(type Target +(.type Target [Text (Maybe Code)]) (def target diff --git a/stdlib/source/library/lux/ffi/export.js.lux b/stdlib/source/library/lux/ffi/export.js.lux index 66009f8ba..3f8561b78 100644 --- a/stdlib/source/library/lux/ffi/export.js.lux +++ b/stdlib/source/library/lux/ffi/export.js.lux @@ -18,8 +18,9 @@ ["[0]" static] ["[0]" code (.only) ["<[1]>" \\parser]] - ["[0]" macro (.only) - [syntax (.only syntax)]] + [macro + [syntax (.only syntax)] + ["[0]" expansion]] [target ["/" js]] [compiler @@ -88,7 +89,7 @@ (syntax (_ [exports (<>.many .any)]) (let [! meta.monad] (|> exports - (monad.each ! macro.expansion) + (monad.each ! expansion.complete) (at ! each (|>> list#conjoint (monad.each ! ..definition))) (at ! conjoint) diff --git a/stdlib/source/library/lux/ffi/export.lua.lux b/stdlib/source/library/lux/ffi/export.lua.lux index 30af57aa4..c00493f77 100644 --- a/stdlib/source/library/lux/ffi/export.lua.lux +++ b/stdlib/source/library/lux/ffi/export.lua.lux @@ -18,8 +18,9 @@ ["[0]" static] ["[0]" code (.only) ["<[1]>" \\parser]] - ["[0]" macro (.only) - [syntax (.only syntax)]] + [macro + [syntax (.only syntax)] + ["[0]" expansion]] [target ["/" lua]] [compiler @@ -104,7 +105,7 @@ (syntax (_ [exports (<>.many .any)]) (let [! meta.monad] (|> exports - (monad.each ! macro.expansion) + (monad.each ! expansion.complete) (at ! each (|>> list#conjoint (monad.each ! ..definition))) (at ! conjoint) diff --git a/stdlib/source/library/lux/ffi/export.py.lux b/stdlib/source/library/lux/ffi/export.py.lux index 370ed7a9d..7633ed73a 100644 --- a/stdlib/source/library/lux/ffi/export.py.lux +++ b/stdlib/source/library/lux/ffi/export.py.lux @@ -18,8 +18,9 @@ ["[0]" static] ["[0]" code (.only) ["<[1]>" \\parser]] - ["[0]" macro (.only) - [syntax (.only syntax)]] + [macro + [syntax (.only syntax)] + ["[0]" expansion]] [target ["/" python]] [compiler @@ -81,7 +82,7 @@ (syntax (_ [exports (<>.many .any)]) (let [! meta.monad] (|> exports - (monad.each ! macro.expansion) + (monad.each ! expansion.complete) (at ! each (|>> list#conjoint (monad.each ! ..definition))) (at ! conjoint) diff --git a/stdlib/source/library/lux/ffi/export.rb.lux b/stdlib/source/library/lux/ffi/export.rb.lux index 1558aad67..7a102720a 100644 --- a/stdlib/source/library/lux/ffi/export.rb.lux +++ b/stdlib/source/library/lux/ffi/export.rb.lux @@ -20,8 +20,9 @@ ["[0]" type] ["[0]" code (.only) ["<[1]>" \\parser]] - ["[0]" macro (.only) - [syntax (.only syntax)]] + [macro + [syntax (.only syntax)] + ["[0]" expansion]] [target ["/" ruby]] [compiler @@ -130,7 +131,7 @@ (syntax (_ [exports (<>.many .any)]) (let [! meta.monad] (|> exports - (monad.each ! macro.expansion) + (monad.each ! expansion.complete) (at ! each (|>> list#conjoint (monad.each ! ..definition))) (at ! conjoint) diff --git a/stdlib/source/library/lux/ffi/node_js.js.lux b/stdlib/source/library/lux/ffi/node_js.js.lux index 1f3f2fb4a..3ee4c8d33 100644 --- a/stdlib/source/library/lux/ffi/node_js.js.lux +++ b/stdlib/source/library/lux/ffi/node_js.js.lux @@ -1,6 +1,6 @@ (.require [library - [lux (.except) + [lux (.except require) ["[0]" ffi] [control ["[0]" function] diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux index 36047a0ed..09010717a 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/extension/analysis/jvm.lux @@ -57,7 +57,7 @@ ["[0]" parser] ["[0]" alias (.only Aliasing)] ["[0]T" lux (.only Mapping)]]]] - ["[0]" type (.only) + ["[0]" type (.use "[1]#[0]" equivalence) ["[0]" check (.only Check) (.use "[1]#[0]" monad)]]]]] ["[0]" // ["[1][0]" lux (.only custom)] @@ -92,7 +92,8 @@ (import java/lang/Object "[1]::[0]" - (equals [java/lang/Object] boolean)) + (equals [java/lang/Object] boolean) + (toString [] java/lang/String)) (import java/lang/reflect/Type "[1]::[0]") @@ -282,12 +283,12 @@ [too_many_candidates] ) -(exception .public (cannot_cast [from .Type - to .Type +(exception .public (cannot_cast [from (Type Value) + to (Type Value) value Code]) (exception.report - (list ["From" (%.type from)] - ["To" (%.type to)] + (list ["From" (..signature from)] + ["To" (..signature to)] ["Value" (%.code value)]))) (with_template [] @@ -935,11 +936,11 @@ (in {/////analysis.#Extension extension_name (list (/////analysis.text sub_class) objectA)}) (/////analysis.except cannot_possibly_be_an_instance (format sub_class " !<= " object_class)))))])) -(def (class_candidate_parents class_loader source_name fromT target_name target_class) +(def (class_candidate_parents class_loader from_name fromT to_name to_class) (-> java/lang/ClassLoader External .Type External (java/lang/Class java/lang/Object) (Operation (List [[Text .Type] Bit]))) (do [! phase.monad] - [source_class (phase.lifted (reflection!.load class_loader source_name)) - mapping (phase.lifted (reflection!.correspond source_class fromT))] + [from_class (phase.lifted (reflection!.load class_loader from_name)) + mapping (phase.lifted (reflection!.correspond from_class fromT))] (monad.each ! (function (_ superJT) (do ! @@ -947,32 +948,16 @@ .let [super_name (..reflection superJT)] super_class (phase.lifted (reflection!.load class_loader super_name)) superT (reflection_type mapping superJT)] - (in [[super_name superT] (java/lang/Class::isAssignableFrom super_class target_class)]))) - (case (java/lang/Class::getGenericSuperclass source_class) + (in [[super_name superT] (java/lang/Class::isAssignableFrom super_class to_class)]))) + (case (java/lang/Class::getGenericSuperclass from_class) {.#Some super} - (list.partial super (array.list {.#None} (java/lang/Class::getGenericInterfaces source_class))) + (list.partial super (array.list {.#None} (java/lang/Class::getGenericInterfaces from_class))) {.#None} - (if (java/lang/reflect/Modifier::isInterface (java/lang/Class::getModifiers source_class)) + (if (java/lang/reflect/Modifier::isInterface (java/lang/Class::getModifiers from_class)) {.#Item (as java/lang/reflect/Type (ffi.class_for java/lang/Object)) - (array.list {.#None} (java/lang/Class::getGenericInterfaces source_class))} - (array.list {.#None} (java/lang/Class::getGenericInterfaces source_class))))))) - -(def (inheritance_candidate_parents class_loader fromT target_class toT fromC) - (-> java/lang/ClassLoader .Type (java/lang/Class java/lang/Object) .Type Code (Operation (List [[Text .Type] Bit]))) - (case fromT - {.#Primitive _ (list.partial self_classT super_classT super_interfacesT+)} - (monad.each phase.monad - (function (_ superT) - (do [! phase.monad] - [super_name (at ! each ..reflection (check_jvm superT)) - super_class (phase.lifted (reflection!.load class_loader super_name))] - (in [[super_name superT] - (java/lang/Class::isAssignableFrom super_class target_class)]))) - (list.partial super_classT super_interfacesT+)) - - _ - (/////analysis.except ..cannot_cast [fromT toT fromC]))) + (array.list {.#None} (java/lang/Class::getGenericInterfaces from_class))} + (array.list {.#None} (java/lang/Class::getGenericInterfaces from_class))))))) (def (object::cast class_loader) (-> java/lang/ClassLoader Handler) @@ -981,18 +966,20 @@ (list fromC) (do [! phase.monad] [toT (///.lifted meta.expected_type) - target_name (at ! each ..reflection (check_jvm toT)) + toJT (check_jvm toT) [fromT fromA] (typeA.inferring (analyse archive fromC)) - source_name (at ! each ..reflection (check_jvm fromT)) + fromJT (check_jvm fromT) + .let [from_name (..reflection fromJT) + to_name (..reflection toJT)] can_cast? (is (Operation Bit) (`` (cond (,, (with_template [ ] [(let [=primitive (reflection.reflection )] - (or (and (text#= =primitive source_name) - (or (text#= target_name) - (text#= =primitive target_name))) - (and (text#= source_name) - (text#= =primitive target_name)))) + (or (and (text#= =primitive from_name) + (or (text#= to_name) + (text#= =primitive to_name))) + (and (text#= from_name) + (text#= =primitive to_name)))) (in true)] [reflection.boolean box.boolean] @@ -1006,34 +993,39 @@ ... else (do ! - [_ (phase.assertion ..primitives_are_not_objects [source_name] - (not (dictionary.key? ..boxes source_name))) - _ (phase.assertion ..primitives_are_not_objects [target_name] - (not (dictionary.key? ..boxes target_name))) - target_class (phase.lifted (reflection!.load class_loader target_name)) - _ (do ! - [source_class (phase.lifted (reflection!.load class_loader source_name))] - (phase.assertion ..cannot_cast [fromT toT fromC] - (java/lang/Class::isAssignableFrom source_class target_class)))] - (loop (again [[current_name currentT] [source_name fromT]]) - (if (text#= target_name current_name) - (in true) - (do ! - [candidate_parents (is (Operation (List [[Text .Type] Bit])) - (class_candidate_parents class_loader current_name currentT target_name target_class))] - (case (|> candidate_parents - (list.only product.right) - (list#each product.left)) - {.#Item [next_name nextT] _} - (again [next_name nextT]) - - {.#End} - (in false)))))))))] + [_ (phase.assertion ..primitives_are_not_objects [from_name] + (not (dictionary.key? ..boxes from_name))) + _ (phase.assertion ..primitives_are_not_objects [to_name] + (not (dictionary.key? ..boxes to_name))) + to_class (phase.lifted (reflection!.load class_loader to_name)) + from_class (phase.lifted (reflection!.load class_loader from_name))] + (if (java/lang/Class::isAssignableFrom from_class to_class) + (loop (again [[current_name currentT] [from_name fromT]]) + (if (text#= to_name current_name) + (in true) + (do ! + [candidate_parents (is (Operation (List [[Text .Type] Bit])) + (class_candidate_parents class_loader current_name currentT to_name to_class))] + (case (|> candidate_parents + (list.only product.right) + (list#each product.left)) + {.#Item [next_name nextT] _} + (again [next_name nextT]) + + {.#End} + (in false))))) + (in (case [(type#= java/lang/Object fromT) + (parser.array? toJT)] + [#1 {.#Some _}] + true + + _ + false)))))))] (if can_cast? - (in {/////analysis.#Extension extension_name (list (/////analysis.text source_name) - (/////analysis.text target_name) + (in {/////analysis.#Extension extension_name (list (/////analysis.text from_name) + (/////analysis.text to_name) fromA)}) - (/////analysis.except ..cannot_cast [fromT toT fromC]))) + (/////analysis.except ..cannot_cast [fromJT toJT fromC]))) _ (/////analysis.except ///.invalid_syntax [extension_name %.code args])))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/runtime.lux index 270ff3256..437f6624d 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/js/runtime.lux @@ -796,7 +796,7 @@ @array//delete )) -(def runtime +(def full Statement (all _.then runtime//structure @@ -814,13 +814,13 @@ (def .public generate (Operation [Registry Output]) (do ///////phase.monad - [_ (/////generation.execute! ..runtime) - _ (/////generation.save! ..module_id {.#None} ..runtime)] + [_ (/////generation.execute! ..full) + _ (/////generation.save! ..module_id {.#None} ..full)] (in [(|> registry.empty (registry.resource true unit.none) product.right) (sequence.sequence [..module_id {.#None} - (|> ..runtime + (|> ..full _.code (at utf8.codec encoded))])]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/runtime.lux index 8a124aadc..e8ba62726 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/lua/runtime.lux @@ -427,7 +427,7 @@ @array//write )) -(def runtime +(def full Statement (all _.then ..runtime//adt @@ -440,13 +440,13 @@ (def .public generate (Operation [Registry Output]) (do ///////phase.monad - [_ (/////generation.execute! ..runtime) - _ (/////generation.save! ..module_id {.#None} ..runtime)] + [_ (/////generation.execute! ..full) + _ (/////generation.save! ..module_id {.#None} ..full)] (in [(|> registry.empty (registry.resource true unit.none) product.right) (sequence.sequence [..module_id {.#None} - (|> ..runtime + (|> ..full _.code (at utf8.codec encoded))])]))) diff --git a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/runtime.lux b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/runtime.lux index 194b97c7e..b193b5b84 100644 --- a/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/runtime.lux +++ b/stdlib/source/library/lux/meta/compiler/language/lux/phase/generation/ruby/runtime.lux @@ -595,11 +595,11 @@ @array//write )) -(def runtime +(def full Statement (all _.then (_.when ..mruby? - ... We're in DragonRuby territory. + ... We're in mRuby/DragonRuby territory. (_.statement (_.do "class_eval" (list) {.#Some [(list (_.local "_")) (_.statement @@ -617,13 +617,13 @@ (def .public generate (Operation [Registry Output]) (do ///////phase.monad - [_ (/////generation.execute! ..runtime) - _ (/////generation.save! ..module_id {.#None} ..runtime)] + [_ (/////generation.execute! ..full) + _ (/////generation.save! ..module_id {.#None} ..full)] (in [(|> registry.empty (registry.resource true unit.none) product.right) (sequence.sequence [..module_id {.#None} - (|> ..runtime + (|> ..full _.code (at utf8.codec encoded))])]))) diff --git a/stdlib/source/library/lux/meta/macro/pattern.lux b/stdlib/source/library/lux/meta/macro/pattern.lux index 4c78c8c36..367c77bd4 100644 --- a/stdlib/source/library/lux/meta/macro/pattern.lux +++ b/stdlib/source/library/lux/meta/macro/pattern.lux @@ -11,8 +11,8 @@ ["[0]" try]] [data [collection - ["[0]" list (.use "[1]#[0]" monoid monad)]]]]] - ["[0]" // (.only) + ["[0]" list (.use "[1]#[0]" monoid monad mix)]]]]] + ["[0]" // (.only with_symbols) [vocabulary (.only vocabulary)] ["/[1]" // (.use "[1]#[0]" monad)]]) @@ -40,7 +40,6 @@ [tuple_list] [text$] - [generated_symbol] [type_definition] [record_slots] [text#composite] @@ -50,8 +49,6 @@ [tuple$] [zipped_2] - [multi_level_case^] - [multi_level_case$] [type_code] [expected_type] @@ -116,35 +113,81 @@ _ (///.failure (..wrong_syntax_error (symbol ..with_template))))))) +(type Level + [Code Code]) + +(def (level it) + (-> Code (Meta Level)) + (///#in (case it + [_ {.#Tuple (list expr binding)}] + [expr binding] + + _ + [it (.` #1)]))) + +(type Multi + [Code (List Level)]) + +(def (multiP levels) + (-> (List Code) (Meta Multi)) + (case levels + {.#End} + (///.failure "Multi-level patterns cannot be empty.") + + {.#Item init extras} + (do ///.monad + [extras' (monad.each ///.monad ..level extras)] + (in [init extras'])))) + +(def (multiG g!_ [[init_pattern levels] body]) + (-> Code [Multi Code] (List Code)) + (.let [inner_pattern_body (list#mix (function (_ [calculation pattern] success) + (.let [bind? (case pattern + [_ {.#Symbol _}] + #1 + + _ + #0)] + (.` (case (., calculation) + (., pattern) + (., success) + + (.,* (if bind? + (list) + (list g!_ (.` {.#None})))))))) + (.` {.#Some (., body)}) + (list.reversed levels))] + (list init_pattern inner_pattern_body))) + (def .public multi (pattern (macro (_ tokens) (case tokens (list.partial [_meta {.#Form levels}] body next_branches) - (do ///.monad - [mlc (multi_level_case^ levels) - .let [initial_bind? (case mlc - [[_ {.#Symbol _}] _] - #1 - - _ - #0)] - expected ..expected_type - g!temp (..generated_symbol "temp")] - (in (list g!temp - (.` ({{.#Some (., g!temp)} - (., g!temp) - - {.#None} - (.case (., g!temp) - (.,* next_branches))} - ("lux type check" {.#Apply (., (type_code expected)) Maybe} - (.case (., g!temp) - (.,* (multi_level_case$ g!temp [mlc body])) - - (.,* (if initial_bind? - (list) - (list g!temp (.` {.#None}))))))))))) + (with_symbols [g!temp] + (do ///.monad + [mlc (multiP levels) + .let [initial_bind? (case mlc + [[_ {.#Symbol _}] _] + #1 + + _ + #0)] + expected ..expected_type] + (in (list g!temp + (.` ({{.#Some (., g!temp)} + (., g!temp) + + {.#None} + (.case (., g!temp) + (.,* next_branches))} + ("lux type check" {.#Apply (., (type_code expected)) Maybe} + (.case (., g!temp) + (.,* (multiG g!temp [mlc body])) + + (.,* (if initial_bind? + (list) + (list g!temp (.` {.#None})))))))))))) _ (///.failure (..wrong_syntax_error (symbol ..multi))))))) @@ -237,12 +280,11 @@ (def (untemplated_pattern pattern) (-> Code (Meta Code)) - (do ///.monad - [g!meta (..generated_symbol "g!meta")] + (with_symbols [g!meta] (case pattern (..with_template [ ] [[_ { value}] - (in (.` [(., g!meta) { (., ( value))}]))]) + (///#in (.` [(., g!meta) { (., ( value))}]))]) ([.#Bit bit$] [.#Nat nat$] [.#Int int$] @@ -252,11 +294,11 @@ [.#Symbol name$]) [@composite {.#Form {.#Item [@global {.#Symbol global}] parameters}}] - (do ///.monad + (do [! ///.monad] [micro (///.try (..named_unquote global))] (case micro {try.#Success micro} - (do ///.monad + (do ! [[_ output] (..one_expansion ((//.function micro) parameters))] (in [@composite output])) diff --git a/stdlib/source/test/lux/control/function/inline.lux b/stdlib/source/test/lux/control/function/inline.lux index 441ddef3c..94a21ede2 100644 --- a/stdlib/source/test/lux/control/function/inline.lux +++ b/stdlib/source/test/lux/control/function/inline.lux @@ -15,9 +15,10 @@ (template (_ m0 m1) [(i.+ (i.* m0 m0) (i.* m1 m1))])) -(/.inlined .public (quadrance/2 m0 m1) - (-> Int Int Int) - (!quadrance/2 m0 m1)) +(def .public quadrance/2 + (/.inlined (_ m0 m1) + (-> Int Int Int) + (!quadrance/2 m0 m1))) (def .public test Test diff --git a/stdlib/source/test/lux/meta/extension.lux b/stdlib/source/test/lux/meta/extension.lux index 8be85f9c0..bfe11a0e0 100644 --- a/stdlib/source/test/lux/meta/extension.lux +++ b/stdlib/source/test/lux/meta/extension.lux @@ -33,13 +33,13 @@ ["[0]" ruby] ["[0]" php] ["[0]" scheme] - ["[0]" jvm - (.,, (.for "JVM" (.,, (.these ["[1]" bytecode] + (.,, (.for "JVM" (.,, (.these ["[0]" jvm + ["[1]" bytecode] ["[0]" class] ["[0]" version] [encoding - ["[0]" name]])) - (.,, (.these))))]] + ["[0]" name]]])) + (.,, (.these))))] [compiler ["[0]" phase] [meta diff --git a/stdlib/source/test/lux/meta/target/js.lux b/stdlib/source/test/lux/meta/target/js.lux index 9604b26b3..94fc0c470 100644 --- a/stdlib/source/test/lux/meta/target/js.lux +++ b/stdlib/source/test/lux/meta/target/js.lux @@ -3,13 +3,13 @@ [lux (.except) ["_" test (.only Test)] [abstract - [monad (.only do)] - ["[0]" predicate]] + [monad (.only do)]] [control ["[0]" pipe] - ["[0]" function] ["[0]" maybe (.use "[1]#[0]" functor)] - ["[0]" try (.only Try) (.use "[1]#[0]" functor)]] + ["[0]" try (.only Try) (.use "[1]#[0]" functor)] + ["[0]" function (.only) + ["[0]" predicate]]] [data ["[0]" bit (.use "[1]#[0]" equivalence)] ["[0]" text (.only \n) (.use "[1]#[0]" equivalence) diff --git a/stdlib/source/unsafe/lux/data/binary.lux b/stdlib/source/unsafe/lux/data/binary.lux index e90aa4b39..d3b824dfb 100644 --- a/stdlib/source/unsafe/lux/data/binary.lux +++ b/stdlib/source/unsafe/lux/data/binary.lux @@ -306,26 +306,27 @@ (again ("lux i64 +" 1 index))))))))])))) ... TODO: Turn into a template ASAP. -(`` (inlined .public (copy! bytes source_offset source target_offset target) - (-> .Nat .Nat ..Binary Nat ..Binary ..Binary) - (with_expansions [ (java/lang/System::arraycopy source (ffi.as_int (.int source_offset)) - target (ffi.as_int (.int target_offset)) - (ffi.as_int (.int bytes))) - (.exec - - target)] - (.for (,, (.static @.old)) - (,, (.static @.jvm)) - - ... Default - (.loop (again [index 0]) - (.if ("lux i64 <" (.int bytes) (.int index)) - (.exec - (..has_8! ("lux i64 +" target_offset index) - (..bits_8 ("lux i64 +" source_offset index) source) - target) - (again ("lux i64 +" 1 index))) - target)))))) +(`` (def .public copy! + (inlined (_ bytes source_offset source target_offset target) + (-> .Nat .Nat ..Binary Nat ..Binary ..Binary) + (with_expansions [ (java/lang/System::arraycopy source (ffi.as_int (.int source_offset)) + target (ffi.as_int (.int target_offset)) + (ffi.as_int (.int bytes))) + (.exec + + target)] + (.for (,, (.static @.old)) + (,, (.static @.jvm)) + + ... Default + (.loop (again [index 0]) + (.if ("lux i64 <" (.int bytes) (.int index)) + (.exec + (..has_8! ("lux i64 +" target_offset index) + (..bits_8 ("lux i64 +" source_offset index) source) + target) + (again ("lux i64 +" 1 index))) + target))))))) ... TODO: Turn into a template ASAP. (`` (with_expansions [ (java/util/Arrays::copyOfRange binary @@ -333,10 +334,11 @@ (ffi.as_int (.int limit))) (.let [limit ("lux i64 +" size offset)] )] - (inlined .public (slice offset size binary) - (-> .Nat .Nat ..Binary ..Binary) - (.for (,, (.static @.old)) - (,, (.static @.jvm)) - - ... Default - (..copy! size offset binary 0 (..empty size)))))) + (def .public slice + (inlined (_ offset size binary) + (-> .Nat .Nat ..Binary ..Binary) + (.for (,, (.static @.old)) + (,, (.static @.jvm)) + + ... Default + (..copy! size offset binary 0 (..empty size))))))) -- cgit v1.2.3