diff options
54 files changed, 433 insertions, 534 deletions
diff --git a/documentation/bookmark/Localization and Internationalization.md b/documentation/bookmark/Localization and Internationalization.md deleted file mode 100644 index 198d768bd..000000000 --- a/documentation/bookmark/Localization and Internationalization.md +++ /dev/null @@ -1,4 +0,0 @@ -# Reference - -1. [CSS for internationalisation](https://chenhuijing.com/blog/css-for-i18n/) - diff --git a/documentation/bookmark/application_programming_interface.md b/documentation/bookmark/application_programming_interface.md index 47c8613a6..fe5eefb56 100644 --- a/documentation/bookmark/application_programming_interface.md +++ b/documentation/bookmark/application_programming_interface.md @@ -1,4 +1,7 @@ # Reference +0. []() +0. [DBS launches ‘world’s largest’ banking API platform](https://fst.net.au/financial-services-news/dbs-launches-worlds-largest-banking-api-platform/) +0. [Why APIs Matter](https://systemsapproach.substack.com/p/why-apis-matter?s=r) 0. [Aligning on Your API Design Using Jobs to be Done](https://blog.stoplight.io/aligning-on-your-api-design-using-jobs-to-be-done) diff --git a/documentation/bookmark/artificial_intelligence/machine_learning.md b/documentation/bookmark/artificial_intelligence/machine_learning.md index a998c7aaa..0487c5626 100644 --- a/documentation/bookmark/artificial_intelligence/machine_learning.md +++ b/documentation/bookmark/artificial_intelligence/machine_learning.md @@ -49,14 +49,6 @@ 0. https://deeplearning4j.org/ 0. [Deep(er) learning](http://www.jneurosci.org/content/early/2018/07/13/JNEUROSCI.0153-18.2018?versioned=true) -# Neural network - -0. https://github.com/BrainJS/brain.js -0. https://blog.jle.im/entry/practical-dependent-types-in-haskell-1.html -0. https://matloff.wordpress.com/2018/06/20/neural-networks-are-essentially-polynomial-regression/ -0. https://www.quantamagazine.org/foundations-built-for-a-general-theory-of-neural-networks-20190131#AI -0. https://rkevingibson.github.io/blog/neural-networks-as-ordinary-differential-equations/ - # Tensor 0. http://nlp.seas.harvard.edu/NamedTensor.html diff --git a/documentation/bookmark/machine_learning/deep/geometric.md b/documentation/bookmark/artificial_intelligence/machine_learning/deep/geometric.md index 93de8ff17..93de8ff17 100644 --- a/documentation/bookmark/machine_learning/deep/geometric.md +++ b/documentation/bookmark/artificial_intelligence/machine_learning/deep/geometric.md diff --git a/documentation/bookmark/machine_learning/gradient.md b/documentation/bookmark/artificial_intelligence/machine_learning/gradient.md index 1d1db6ddb..1d1db6ddb 100644 --- a/documentation/bookmark/machine_learning/gradient.md +++ b/documentation/bookmark/artificial_intelligence/machine_learning/gradient.md diff --git a/documentation/bookmark/artificial_intelligence/machine_learning/neural_network.md b/documentation/bookmark/artificial_intelligence/machine_learning/neural_network.md new file mode 100644 index 000000000..5465ecfe2 --- /dev/null +++ b/documentation/bookmark/artificial_intelligence/machine_learning/neural_network.md @@ -0,0 +1,10 @@ +# Reference + +0. []() +0. [Softmax Activation Function: Everything You Need to Know](https://www.pinecone.io/learn/softmax-activation/) +0. https://github.com/BrainJS/brain.js +0. https://blog.jle.im/entry/practical-dependent-types-in-haskell-1.html +0. https://matloff.wordpress.com/2018/06/20/neural-networks-are-essentially-polynomial-regression/ +0. https://www.quantamagazine.org/foundations-built-for-a-general-theory-of-neural-networks-20190131#AI +0. https://rkevingibson.github.io/blog/neural-networks-as-ordinary-differential-equations/ + diff --git a/documentation/bookmark/artificial_intelligence/machine_learning/neural_network/graph.md b/documentation/bookmark/artificial_intelligence/machine_learning/neural_network/graph.md new file mode 100644 index 000000000..56aacd71b --- /dev/null +++ b/documentation/bookmark/artificial_intelligence/machine_learning/neural_network/graph.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [How I Learned to Stop Worrying and Love Graphs: Why Machine Learning on Graphs could be the future of AI](https://www.appliedexploration.com/p/graph-neural-networks-future-of-ai) + diff --git a/documentation/bookmark/machine_learning/probabilistic_soft_logic.md b/documentation/bookmark/artificial_intelligence/machine_learning/probabilistic_soft_logic.md index 8ded7ebf1..8ded7ebf1 100644 --- a/documentation/bookmark/machine_learning/probabilistic_soft_logic.md +++ b/documentation/bookmark/artificial_intelligence/machine_learning/probabilistic_soft_logic.md diff --git a/documentation/bookmark/audio.md b/documentation/bookmark/audio.md new file mode 100644 index 000000000..fef45b127 --- /dev/null +++ b/documentation/bookmark/audio.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [JUCE: The leading framework for multi-platform audio applications](https://juce.com/) + diff --git a/documentation/bookmark/business/competitiveness.md b/documentation/bookmark/business/competitiveness.md index da4f83a26..8b4e1ca45 100644 --- a/documentation/bookmark/business/competitiveness.md +++ b/documentation/bookmark/business/competitiveness.md @@ -1,4 +1,6 @@ # Reference +0. []() +0. [On Structural Advantage](https://medium.com/gamemakers/on-structural-advantage-7c6d6440ebc1) 0. [Moats: Durable competitive advantage](https://longform.asmartbear.com/posts/moats/) diff --git a/documentation/bookmark/business/hiring.md b/documentation/bookmark/business/hiring.md new file mode 100644 index 000000000..491a86d01 --- /dev/null +++ b/documentation/bookmark/business/hiring.md @@ -0,0 +1,6 @@ +# Reference + +0. []() +0. [Spotting Talent: A new book offers surprising insights into the traits of outstanding people.](https://www.city-journal.org/spotting-talent) + 0. [Talent: How to Identify Energizers, Creatives, and Winners Around the World](https://www.amazon.com/Talent-Identify-Energizers-Creatives-Winners/dp/1250275814/) + diff --git a/documentation/bookmark/business/luck.md b/documentation/bookmark/business/luck.md new file mode 100644 index 000000000..b3f9ce91f --- /dev/null +++ b/documentation/bookmark/business/luck.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [How to Increase Your Luck Surface Area](https://www.codusoperandi.com/posts/increasing-your-luck-surface-area) + diff --git a/documentation/bookmark/business/management.md b/documentation/bookmark/business/management.md index db406def7..968ecce66 100644 --- a/documentation/bookmark/business/management.md +++ b/documentation/bookmark/business/management.md @@ -1,6 +1,8 @@ # Reference 0. []() +0. [Effective project management in 10 simple steps](https://www.cenizal.com/ten-rules-of-project-management/) +0. [When Everything is Important But Nothing is Getting Done](https://sharedphysics.com/everything-is-important/) 0. [The Power of Introspection: The Fuel That Keeps Teams Resilient](https://www.youtube.com/watch?v=gl1AKeEHTG8) 0. [Preventing burnout: A manager's toolkit](https://about.gitlab.com/blog/2022/05/03/preventing-burnout-a-managers-toolkit/) 0. [The Curse of Systems Thinkers (Part 1)](https://blog.relyabilit.ie/the-curse-of-systems-thinkers/) diff --git a/documentation/bookmark/business/marketing.md b/documentation/bookmark/business/marketing.md new file mode 100644 index 000000000..746d72856 --- /dev/null +++ b/documentation/bookmark/business/marketing.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [All Ears: Track your brand across the new media landscape](https://en.allears.ai/) + diff --git a/documentation/bookmark/business/permission.md b/documentation/bookmark/business/permission.md new file mode 100644 index 000000000..95ee28c15 --- /dev/null +++ b/documentation/bookmark/business/permission.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Ask for no, don’t ask for yes](https://www.mooreds.com/wordpress/archives/3518) + diff --git a/documentation/bookmark/business/productivity.md b/documentation/bookmark/business/productivity.md index a2e28b380..98d8ac064 100644 --- a/documentation/bookmark/business/productivity.md +++ b/documentation/bookmark/business/productivity.md @@ -1,5 +1,7 @@ # Reference +0. []() +0. [Tips for effective engineering](https://budelewski.com/effective-engineering/) 0. [1. Unfolding the interrelationship diagram](https://world.hey.com/rjs/1-unfolding-the-interrelationship-diagram-5a79e3fc) 0. [2. Shaping on the demand side](https://world.hey.com/rjs/2-shaping-on-the-demand-side-f2e6a00d) 0. [3. Shaping with pattern languages](https://world.hey.com/rjs/3-shaping-with-pattern-languages-a00d880c) diff --git a/documentation/bookmark/business/sustainability.md b/documentation/bookmark/business/sustainability.md new file mode 100644 index 000000000..b99e958eb --- /dev/null +++ b/documentation/bookmark/business/sustainability.md @@ -0,0 +1,6 @@ +# Reference + +0. []() +0. [The Propriety Path Platform](https://kk.org/thetechnium/the-propriety-path-platform/) +0. [1,000 True Fans](https://kk.org/thetechnium/1000-true-fans/) + diff --git a/documentation/bookmark/platform/js.md b/documentation/bookmark/compilation/target/js.md index b6ea6916e..b6ea6916e 100644 --- a/documentation/bookmark/platform/js.md +++ b/documentation/bookmark/compilation/target/js.md diff --git a/documentation/bookmark/platform/jvm.md b/documentation/bookmark/compilation/target/jvm.md index 4ea87de28..4ea87de28 100644 --- a/documentation/bookmark/platform/jvm.md +++ b/documentation/bookmark/compilation/target/jvm.md diff --git a/documentation/bookmark/platform/node_js.md b/documentation/bookmark/compilation/target/node_js.md index 2fcfcf3ac..2fcfcf3ac 100644 --- a/documentation/bookmark/platform/node_js.md +++ b/documentation/bookmark/compilation/target/node_js.md diff --git a/documentation/bookmark/platform/php.md b/documentation/bookmark/compilation/target/php.md index 74fe1e7ac..74fe1e7ac 100644 --- a/documentation/bookmark/platform/php.md +++ b/documentation/bookmark/compilation/target/php.md diff --git a/documentation/bookmark/platform/ruby.md b/documentation/bookmark/compilation/target/ruby.md index 8b124a598..8b124a598 100644 --- a/documentation/bookmark/platform/ruby.md +++ b/documentation/bookmark/compilation/target/ruby.md diff --git a/documentation/bookmark/compiler.md b/documentation/bookmark/compiler.md index ea86dca98..8243c5d1c 100644 --- a/documentation/bookmark/compiler.md +++ b/documentation/bookmark/compiler.md @@ -1,17 +1,22 @@ # Methodology -1. [Nada Amin's keynote "Staged Relational Interpreters: Running Backwards, Faster"](https://www.twitch.tv/videos/1011771746) -1. [Scope herding with delimited continuations](https://blog.moertel.com/posts/2005-09-13-scope-herding-with-delimited-continuations.html) -1. [Compiling with Continuations by Andrew W. Appel](https://www.amazon.com/dp/0521416957) -1. [Collapsing Towers of Interpreters](https://www.cs.purdue.edu/homes/rompf/papers/amin-popl18.pdf) -1. [Miniphases: Compilation using Modular and Efficient Tree Transformations](https://infoscience.epfl.ch/record/228518/files/paper.pdf) +0. [Nada Amin's keynote "Staged Relational Interpreters: Running Backwards, Faster"](https://www.twitch.tv/videos/1011771746) +0. [Scope herding with delimited continuations](https://blog.moertel.com/posts/2005-09-13-scope-herding-with-delimited-continuations.html) +0. [Compiling with Continuations by Andrew W. Appel](https://www.amazon.com/dp/0521416957) +0. [Collapsing Towers of Interpreters](https://www.cs.purdue.edu/homes/rompf/papers/amin-popl18.pdf) +0. [Miniphases: Compilation using Modular and Efficient Tree Transformations](https://infoscience.epfl.ch/record/228518/files/paper.pdf) # Security -1. [A Brief Tour of Formally Secure Compilation](http://ceur-ws.org/Vol-2315/paper03.pdf) +0. [A Brief Tour of Formally Secure Compilation](http://ceur-ws.org/Vol-2315/paper03.pdf) # Framework -1. [The GENTLE Compiler Construction System](http://gentle.compilertools.net/index.html) -1. [Nanopass Framework: Clean Compiler Creation Language](http://nanopass.org/) +0. [The GENTLE Compiler Construction System](http://gentle.compilertools.net/index.html) +0. [Nanopass Framework: Clean Compiler Creation Language](http://nanopass.org/) + +# Reference + +0. []() +0. [Monadic Compiler Calculation](https://www.cs.nott.ac.uk/~pszgmh/ccc3.pdf) diff --git a/documentation/bookmark/concurrency/structured.md b/documentation/bookmark/concurrency/structured.md index 4172bfaa2..3eba6e538 100644 --- a/documentation/bookmark/concurrency/structured.md +++ b/documentation/bookmark/concurrency/structured.md @@ -1,5 +1,7 @@ # Reference +0. []() +0. [Context in Go](https://scalabledeveloper.com/posts/context-in-go/) 0. [JEP 428: Structured Concurrency to Simplify Java Multithreaded Programming](https://www.infoq.com/news/2022/06/java-structured-concurrency/) 0. [Seamless, Fearless, and Structured Concurrency](https://verdagon.dev/blog/seamless-fearless-structured-concurrency) 0. [Handling user input with structured concurrency](https://dubroy.com/blog/handling-user-input-with-structured-concurrency/) diff --git a/documentation/bookmark/control_flow/continuation.md b/documentation/bookmark/control_flow/continuation.md new file mode 100644 index 000000000..c6cf3aeb0 --- /dev/null +++ b/documentation/bookmark/control_flow/continuation.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [The Discoveries of Continuations](https://homepages.inf.ed.ac.uk/wadler/papers/papers-we-love/reynolds-discoveries.pdf) + diff --git a/documentation/bookmark/css.md b/documentation/bookmark/css.md index 99f446bbc..50af40496 100644 --- a/documentation/bookmark/css.md +++ b/documentation/bookmark/css.md @@ -11,4 +11,5 @@ 0. [Increasing the performance of elm-css](https://blogg.bekk.no/increasing-the-performance-of-elm-css-34075512d6a6) 0. [The Case for Atomic / Utility-First CSS](https://johnpolacek.github.io/the-case-for-atomic-css/) 0. [Defensive CSS](https://ishadeed.com/article/defensive-css/) + 0. [Defensive CSS](https://defensivecss.dev/) diff --git a/documentation/bookmark/energy.md b/documentation/bookmark/energy.md new file mode 100644 index 000000000..45c8c9b8c --- /dev/null +++ b/documentation/bookmark/energy.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Cogeneration](https://en.wikipedia.org/wiki/Cogeneration) + diff --git a/documentation/bookmark/firmware.md b/documentation/bookmark/firmware.md new file mode 100644 index 000000000..26a77c659 --- /dev/null +++ b/documentation/bookmark/firmware.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Open-Source Firmware Foundation (OSFF)](https://opensourcefirmware.foundation/) + diff --git a/documentation/bookmark/game/progression.md b/documentation/bookmark/game/progression.md index 9b3458e30..cb47dcc95 100644 --- a/documentation/bookmark/game/progression.md +++ b/documentation/bookmark/game/progression.md @@ -1,5 +1,7 @@ # Reference +0. []() +0. [XP for Gold: How it Actually Works](https://www.tribality.com/2020/11/12/xp-for-gold-how-it-actually-works/) 0. [Why D&D Shouldn't Use Character Levels || D&D w/ Dael Kingsmill](https://www.youtube.com/watch?v=SnPX8zfAAFQ) 0. [The Problem with Leveling Up In Dungeons & Dragons (Ep. #228)](https://www.youtube.com/watch?v=2mcCBdXe1Vg) diff --git a/documentation/bookmark/game/ranking.md b/documentation/bookmark/game/ranking.md new file mode 100644 index 000000000..8253c91b2 --- /dev/null +++ b/documentation/bookmark/game/ranking.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [On the Limitations of Elo: Real-World Games, are Transitive, not Additive](https://arxiv.org/abs/2206.12301) + diff --git a/documentation/bookmark/law.md b/documentation/bookmark/law.md index 06c479ac7..da270d6fe 100644 --- a/documentation/bookmark/law.md +++ b/documentation/bookmark/law.md @@ -1,5 +1,7 @@ # Reference +0. []() +0. [Legal Sources for Not-a-Lawyers: learn some law without totally warping your brain](https://writing.kemitchell.com/2022/06/26/Legal-Sources-Not-a-Lawyers) 0. [Text Prudent](https://textprudent.com/) 0. [Reviewers Edition](https://reviewersedition.org/) 0. [Legal Versioning: refined scheme for functional prose projects](https://writing.kemitchell.com/2022/05/28/Legal-Versioning) diff --git a/documentation/bookmark/license/derivative_work.md b/documentation/bookmark/license/derivative_work.md new file mode 100644 index 000000000..a3845842b --- /dev/null +++ b/documentation/bookmark/license/derivative_work.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Derivative Works](https://www.rosenlaw.com/lj19.htm) + diff --git a/documentation/bookmark/packaging.md b/documentation/bookmark/packaging.md index cbfaba779..34b32f530 100644 --- a/documentation/bookmark/packaging.md +++ b/documentation/bookmark/packaging.md @@ -1,4 +1,6 @@ # Reference -1. [Open Sourcing Metapod, Personalized Executable for All.](https://rainway.com/blog/2019/05/14/open-source-metapod/) +0. []() +0. [The Many Layers of Packaging](https://sedimental.org/the_packaging_gradient.html) +0. [Open Sourcing Metapod, Personalized Executable for All.](https://rainway.com/blog/2019/05/14/open-source-metapod/) diff --git a/documentation/bookmark/platform.md b/documentation/bookmark/platform.md index a653d156b..ac9db6902 100644 --- a/documentation/bookmark/platform.md +++ b/documentation/bookmark/platform.md @@ -1,4 +1,6 @@ # Reference -1. [fission](https://fission.codes/) +0. []() +0. [The rise of the extensible app platforms](https://blog.almaer.com/the-rise-of-the-extensible-app-platforms/) +0. [fission](https://fission.codes/) diff --git a/documentation/bookmark/security/authorization.md b/documentation/bookmark/security/authorization.md new file mode 100644 index 000000000..27bb34ee0 --- /dev/null +++ b/documentation/bookmark/security/authorization.md @@ -0,0 +1,6 @@ +# Reference + +0. []() +0. [Granular Access Control with Fıratcan Doğan](https://www.youtube.com/watch?v=l9uuXoLCYlA) + 0. [Permify: Open source authorization as a service](https://www.permify.co/) + diff --git a/documentation/bookmark/security/zero_trust.md b/documentation/bookmark/security/zero_trust.md new file mode 100644 index 000000000..12e889640 --- /dev/null +++ b/documentation/bookmark/security/zero_trust.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Is zero trust living up to expectations?](https://blog.apnic.net/2022/06/27/is-zero-trust-living-up-to-expectations/) + diff --git a/documentation/bookmark/sharing.md b/documentation/bookmark/sharing.md new file mode 100644 index 000000000..58d223390 --- /dev/null +++ b/documentation/bookmark/sharing.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Open Library](https://openlibrary.org/) + diff --git a/documentation/bookmark/text/regular_expression.md b/documentation/bookmark/text/regular_expression.md index 584f5649d..37a1bcf30 100644 --- a/documentation/bookmark/text/regular_expression.md +++ b/documentation/bookmark/text/regular_expression.md @@ -1,4 +1,6 @@ # Reference -1. [Paper: Hyperscan: A Fast Multi-pattern Regex Matcher for Modern CPUs](https://branchfree.org/2019/02/28/paper-hyperscan-a-fast-multi-pattern-regex-matcher-for-modern-cpus/) +0. []() +0. [RegExp v flag with set notation and properties of strings](https://v8.dev/features/regexp-v-flag) +0. [Paper: Hyperscan: A Fast Multi-pattern Regex Matcher for Modern CPUs](https://branchfree.org/2019/02/28/paper-hyperscan-a-fast-multi-pattern-regex-matcher-for-modern-cpus/) diff --git a/documentation/bookmark/user_interface/color.md b/documentation/bookmark/user_interface/color.md index 289fa18a9..9a79c0ef8 100644 --- a/documentation/bookmark/user_interface/color.md +++ b/documentation/bookmark/user_interface/color.md @@ -1,6 +1,7 @@ # Reference 0. []() +0. [Leonardo](https://leonardocolor.io/#) 0. [Color difference](https://en.wikipedia.org/wiki/Color_difference) 0. [How to Choose Colours Procedurally (Algorithms)](http://devmag.org.za/2012/07/29/how-to-choose-colours-procedurally-algorithms/) 0. [CSS System Colors](https://blog.jim-nielsen.com/2021/css-system-colors/) diff --git a/documentation/bookmark/user_interface/i18n__localization_and_internationalization.md b/documentation/bookmark/user_interface/i18n__localization_and_internationalization.md new file mode 100644 index 000000000..61e24d66d --- /dev/null +++ b/documentation/bookmark/user_interface/i18n__localization_and_internationalization.md @@ -0,0 +1,7 @@ +# Reference + +0. []() +0. [](https://i18ncore.com/) +0. [CSS for internationalisation](https://chenhuijing.com/blog/css-for-i18n/) +0. [How to design in every language at once](https://canvatechblog.com/how-to-design-in-every-language-at-once-f2dd66a2780f) + diff --git a/documentation/bookmark/user_interface/localization_and_internationalization.md b/documentation/bookmark/user_interface/localization_and_internationalization.md deleted file mode 100644 index 35d515e1c..000000000 --- a/documentation/bookmark/user_interface/localization_and_internationalization.md +++ /dev/null @@ -1,4 +0,0 @@ -# Reference - -1. [How to design in every language at once](https://canvatechblog.com/how-to-design-in-every-language-at-once-f2dd66a2780f) - diff --git a/documentation/bookmark/versioning.md b/documentation/bookmark/versioning.md new file mode 100644 index 000000000..5942cfbaf --- /dev/null +++ b/documentation/bookmark/versioning.md @@ -0,0 +1,5 @@ +# Reference + +0. []() +0. [Major Version Numbers are Not Sacred](https://tom.preston-werner.com/2022/05/23/major-version-numbers-are-not-sacred.html) + diff --git a/stdlib/source/documentation/lux/tool.lux b/stdlib/source/documentation/lux/tool.lux index 77877d5d1..0c67d1842 100644 --- a/stdlib/source/documentation/lux/tool.lux +++ b/stdlib/source/documentation/lux/tool.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/tool/compiler/language/lux/analysis.lux b/stdlib/source/documentation/lux/tool/compiler/language/lux/analysis.lux index 64776942f..83a47a0b1 100644 --- a/stdlib/source/documentation/lux/tool/compiler/language/lux/analysis.lux +++ b/stdlib/source/documentation/lux/tool/compiler/language/lux/analysis.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/tool/compiler/language/lux/declaration.lux b/stdlib/source/documentation/lux/tool/compiler/language/lux/declaration.lux index ff1036122..cc2088576 100644 --- a/stdlib/source/documentation/lux/tool/compiler/language/lux/declaration.lux +++ b/stdlib/source/documentation/lux/tool/compiler/language/lux/declaration.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/tool/compiler/language/lux/generation.lux b/stdlib/source/documentation/lux/tool/compiler/language/lux/generation.lux index 4b29c8ad0..295ada218 100644 --- a/stdlib/source/documentation/lux/tool/compiler/language/lux/generation.lux +++ b/stdlib/source/documentation/lux/tool/compiler/language/lux/generation.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/tool/compiler/language/lux/synthesis.lux b/stdlib/source/documentation/lux/tool/compiler/language/lux/synthesis.lux index d9f08010e..ed0a4e27b 100644 --- a/stdlib/source/documentation/lux/tool/compiler/language/lux/synthesis.lux +++ b/stdlib/source/documentation/lux/tool/compiler/language/lux/synthesis.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/documentation/lux/tool/compiler/phase.lux b/stdlib/source/documentation/lux/tool/compiler/phase.lux index 5c1831be0..5efcf5d0f 100644 --- a/stdlib/source/documentation/lux/tool/compiler/phase.lux +++ b/stdlib/source/documentation/lux/tool/compiler/phase.lux @@ -1,7 +1,7 @@ (.require [library [lux (.except char) - ["$" documentation (.only documentation:)] + ["$" documentation] [data [text (.only \n) ["%" \\format (.only format)]] diff --git a/stdlib/source/library/lux/ffi.jvm.lux b/stdlib/source/library/lux/ffi.jvm.lux index 5768251a8..12cbdc539 100644 --- a/stdlib/source/library/lux/ffi.jvm.lux +++ b/stdlib/source/library/lux/ffi.jvm.lux @@ -412,32 +412,6 @@ (-> (Type Declaration) Code) (|>> ..signature code.text)) -(def (get_const_parser class_name field_name) - (-> Text Text (Parser Code)) - (do <>.monad - [.let [dotted_name (format "::" field_name)] - _ (<code>.this (code.symbol ["" dotted_name]))] - (in (get_static_field class_name field_name)))) - -(def (get_var_parser class_name field_name self_name) - (-> Text Text Text (Parser Code)) - (do <>.monad - [.let [dotted_name (format "::" field_name)] - _ (<code>.this (code.symbol ["" dotted_name]))] - (in (get_virtual_field class_name field_name (code.local self_name))))) - -(def (put_var_parser class_name field_name self_name) - (-> Text Text Text (Parser Code)) - (do <>.monad - [.let [dotted_name (format "::" field_name)] - [_ _ value] (.is (Parser [Any Any Code]) - (<code>.form (all <>.and (<code>.this (' :=)) (<code>.this (code.symbol ["" dotted_name])) <code>.any)))] - (in (`' ("jvm member put virtual" - (~ (code.text class_name)) - (~ (code.text field_name)) - (~ value) - (~ (code.local self_name))))))) - (def (replaced f input) (-> (-> Code Code) Code Code) (case (f input) @@ -461,16 +435,6 @@ ast )) -(def (field->parser class_name self_name [[field_name _ _] field]) - (-> Text Text [Member_Declaration FieldDecl] (Parser Code)) - (case field - {#ConstantField _} - (get_const_parser class_name field_name) - - {#VariableField _} - (<>.either (get_var_parser class_name field_name self_name) - (put_var_parser class_name field_name self_name)))) - (def (decorate_input [class value]) (-> [(Type Value) Code] Code) (` [(~ (code.text (..signature class))) (~ value)])) @@ -1109,7 +1073,7 @@ (Parser (Type Class)) (<text>.then parser.class <code>.text)) -(def type^^ +(def value^^ (Parser (Type Value)) (<text>.then parser.value <code>.text)) @@ -1124,7 +1088,7 @@ [tvars (<code>.tuple (<>.some var^^)) name <code>.text anns (<code>.tuple (<>.some ..annotation^)) - inputs (<code>.tuple (<>.some type^^)) + inputs (<code>.tuple (<>.some value^^)) output return^^ exs (<code>.tuple (<>.some class^^))] (in [[name {#PublicP} anns] [#method_tvars tvars @@ -1142,7 +1106,7 @@ (~ (return$ #method_output)) [(~+ (list#each class$ #method_exs))])))) -(def .public with_super +(def with_super (syntax (_ [declaration,method,self (<code>.tuple (all <>.and (<text>.then parser.declaration' <code>.text) @@ -1178,12 +1142,128 @@ (list#each ..decorate_input))))))) (meta.failure (exception.error ..insufficient_parameters [expected_arguments actual_arguments])))))) +(.type Get|Set + [External + (List [Member_Declaration FieldDecl]) + Text]) + +(context.def [get|set_context get|set_expression get|set_declaration] + Get|Set) + +(def privacy_modifier^^ + (Parser Privacy) + (all <>.or + (<code>.this (' "public")) + (<code>.this (' "private")) + (<code>.this (' "protected")) + (<code>.this (' "default")))) + +(def state_modifier^^ + (Parser State) + (all <>.or + (<code>.this (' "volatile")) + (<code>.this (' "final")) + (<code>.this (' "default")))) + +(def field_decl^^ + (Parser [Member_Declaration FieldDecl]) + (<>.either (<code>.form (do <>.monad + [_ (<code>.this (' "constant")) + name <code>.text + anns (<code>.tuple (<>.some ..annotation^)) + type value^^ + value <code>.any] + (in [[name {#PublicP} anns] {#ConstantField [type value]}]))) + (<code>.form (do <>.monad + [_ (<code>.this (' "variable")) + name <code>.text + pm privacy_modifier^^ + sm state_modifier^^ + static? (<>.parses? (<code>.this (' "static"))) + anns (<code>.tuple (<>.some ..annotation^)) + type value^^] + (in [[name pm anns] {#VariableField [sm static? type]}]))))) + +(def with_get|set + (syntax (_ [declaration,fields,self (<code>.tuple + (all <>.and + <code>.text + (<code>.tuple (<>.some field_decl^^)) + <code>.text)) + body <code>.any]) + (do meta.monad + [body (get|set_expression declaration,fields,self body)] + (in (list body))))) + +(with_template [<name>] + [(exception .public (<name> [class Text + field Text]) + (exception.report + "Class" (%.text class) + "Field" (%.text field)))] + + [cannot_get_field] + [cannot_set_field] + ) + +(def .public get + (syntax (_ [field <code>.local]) + (do meta.monad + [[class_name member,field/* self] (context.peek ..get|set_context) + .let [fields (|> member,field/* + (list#each (function (_ [member field]) + [(the #member_name member) [member field]])) + (dictionary.of_list text.hash))]] + (case (dictionary.value field fields) + {.#Some [member {#VariableField _ static? :field:}]} + (in (list (if static? + (` ("jvm member get static" + (~ (code.text class_name)) + (~ (code.text (the #member_name member))))) + (` ("jvm member get virtual" + (~ (code.text class_name)) + (~ (code.text (the #member_name member))) + (~ (code.local self))))))) + + _ + (meta.failure (exception.error ..cannot_get_field [class_name field])))))) + +(def .public set + (syntax (_ [field <code>.local + value <code>.any]) + (do meta.monad + [[class_name member,field/* self] (context.peek ..get|set_context) + .let [fields (|> member,field/* + (list#each (function (_ [member field]) + [(the #member_name member) [member field]])) + (dictionary.of_list text.hash))]] + (case (dictionary.value field fields) + {.#Some [member {#VariableField state static? :field:}]} + (case state + {#FinalS} + (meta.failure (exception.error ..cannot_set_field [class_name field])) + + _ + (in (list (if static? + (` ("jvm member put static" + (~ (code.text class_name)) + (~ (code.text (the #member_name member))) + (~ value))) + (` ("jvm member put virtual" + (~ (code.text class_name)) + (~ (code.text (the #member_name member))) + (~ value) + (~ (code.local self)))))))) + + _ + (meta.failure (exception.error ..cannot_set_field [class_name field])))))) + (def (method_def$ fully_qualified_class_name method_parser super_class fields [method_declaration method_def]) (-> External (Parser Code) (Type Class) (List [Member_Declaration FieldDecl]) [Member_Declaration Method_Definition] (Meta Code)) (let [[name pm anns] method_declaration] (case method_def {#ConstructorMethod strict_fp? type_vars self_name arguments constructor_args body exs} - (let [replacer (|> (list#each (field->parser fully_qualified_class_name self_name) fields) + (let [replacer (|> (list) (list#mix <>.either method_parser) parser->replacer)] (meta#in (` ("init" @@ -1195,11 +1275,14 @@ (~ (code.text self_name)) [(~+ (list#each argument$ arguments))] [(~+ (list#each constructor_arg$ constructor_args))] - (~ (replaced replacer body)) + (<| ((~! ..with_get|set) [(~ (code.text fully_qualified_class_name)) + [(~+ (list#each field_decl$ fields))] + (~ (code.text self_name))]) + (~ (replaced replacer body))) )))) {#VirtualMethod final? strict_fp? type_vars self_name arguments return_type body exs} - (let [replacer (|> (list#each (field->parser fully_qualified_class_name self_name) fields) + (let [replacer (|> (list) (list#mix <>.either method_parser) parser->replacer)] (meta#in (` ("virtual" @@ -1213,10 +1296,14 @@ [(~+ (list#each argument$ arguments))] (~ (return$ return_type)) [(~+ (list#each class$ exs))] - (~ (replaced replacer body)))))) + (<| ((~! ..with_get|set) [(~ (code.text fully_qualified_class_name)) + [(~+ (list#each field_decl$ fields))] + (~ (code.text self_name))]) + (~ (replaced replacer body))) + )))) {#OverridenMethod strict_fp? declaration type_vars self_name expected_arguments return_type body exs} - (let [replacer (|> (list#each (field->parser fully_qualified_class_name self_name) fields) + (let [replacer (|> (list) (list#mix <>.either method_parser) parser->replacer)] (do meta.monad @@ -1231,15 +1318,18 @@ [(~+ (list#each argument$ expected_arguments))] (~ (return$ return_type)) [(~+ (list#each class$ exs))] - (~ (replaced replacer - (` (..with_super [(~ (declaration$ declaration)) - (~ (method_decl$$ [method_declaration - [#method_tvars type_vars - #method_inputs (list#each product.right expected_arguments) - #method_output return_type - #method_exs exs]])) - (~ (code.text self_name))] - (~ body)))))))))) + (<| ((~! ..with_super) [(~ (declaration$ declaration)) + (~ (method_decl$$ [method_declaration + [#method_tvars type_vars + #method_inputs (list#each product.right expected_arguments) + #method_output return_type + #method_exs exs]])) + (~ (code.text self_name))]) + ((~! ..with_get|set) [(~ (code.text fully_qualified_class_name)) + [(~+ (list#each field_decl$ fields))] + (~ (code.text self_name))]) + (~ (replaced replacer body))) + ))))) {#StaticMethod strict_fp? type_vars arguments return_type body exs} (let [replacer (parser->replacer (<>.failure ""))] diff --git a/stdlib/source/library/lux/macro/syntax.lux b/stdlib/source/library/lux/macro/syntax.lux index 380713ff0..5f8242c85 100644 --- a/stdlib/source/library/lux/macro/syntax.lux +++ b/stdlib/source/library/lux/macro/syntax.lux @@ -6,41 +6,35 @@ ["[0]" monad (.only do)]] [control ["<>" parser] - ["[0]" maybe] ["[0]" try]] [data ["[0]" text (.use "[1]#[0]" monoid)] [collection - ["[0]" list]]] - [math - [number - ["[0]" nat] - ["[0]" int] - ["[0]" rev] - ["[0]" frac]]]]] + ["[0]" list]]]]] ["[0]" // (.only with_symbols) ["[0]" code (.only) - ["</>" \\parser (.only Parser)]]] - ["[0]" / - ["[1][0]" export]]) + ["</>" \\parser (.only Parser)]]]) (def (self_documenting binding parser) (All (_ a) (-> Code (Parser a) (Parser a))) (function (_ tokens) (case (parser tokens) - {try.#Success [tokens output]} - {try.#Success [tokens output]} - {try.#Failure error} {try.#Failure (all text#composite "Failed to parse: " (code.format binding) text.new_line - error)}))) + error)} + + success + success))) (def (un_paired pairs) (All (_ a) (-> (List [a a]) (List a))) (case pairs - {.#End} {.#End} - {.#Item [[x y] pairs']} (list.partial x y (un_paired pairs')))) + {.#Item [x y] pairs'} + (list.partial x y (un_paired pairs')) + + {.#End} + {.#End})) (def syntaxP (Parser [[Text (Maybe Text) (List Code)] Code]) @@ -91,7 +85,9 @@ (is ((~! </>.Parser) (Meta (List Code))) ((~! do) (~! <>.monad) [(~+ (..un_paired vars+parsers))] - (.at (~! <>.monad) (~' in) (~ body)))) + (.at (~! <>.monad) (~' in) + (is (Meta (List Code)) + (~ body))))) (~ g!tokens)) {try.#Success (~ g!body)} ((~ g!body) (~ g!state)) diff --git a/stdlib/source/library/lux/target/jvm.lux b/stdlib/source/library/lux/target/jvm.lux deleted file mode 100644 index a19962aab..000000000 --- a/stdlib/source/library/lux/target/jvm.lux +++ /dev/null @@ -1,313 +0,0 @@ -(.require - [library - [lux (.except Type Primitive Label) - [data - [collection - [sequence (.only Sequence)]]] - [target - [jvm - [type (.only Type) - ["[0]" category (.only Primitive Class Value Method)]]]]]]) - -(type .public Literal - (Variant - {#Boolean Bit} - {#Int Int} - {#Long Int} - {#Double Frac} - {#Char Nat} - {#String Text})) - -(type .public Constant - (Variant - {#BIPUSH Int} - - {#SIPUSH Int} - - {#ICONST_M1} - {#ICONST_0} - {#ICONST_1} - {#ICONST_2} - {#ICONST_3} - {#ICONST_4} - {#ICONST_5} - - {#LCONST_0} - {#LCONST_1} - - {#FCONST_0} - {#FCONST_1} - {#FCONST_2} - - {#DCONST_0} - {#DCONST_1} - - {#ACONST_NULL} - - {#LDC Literal})) - -(type .public Int_Arithmetic - (Variant - {#IADD} - {#ISUB} - {#IMUL} - {#IDIV} - {#IREM} - {#INEG})) - -(type .public Long_Arithmetic - (Variant - {#LADD} - {#LSUB} - {#LMUL} - {#LDIV} - {#LREM} - {#LNEG})) - -(type .public Float_Arithmetic - (Variant - {#FADD} - {#FSUB} - {#FMUL} - {#FDIV} - {#FREM} - {#FNEG})) - -(type .public Double_Arithmetic - (Variant - {#DADD} - {#DSUB} - {#DMUL} - {#DDIV} - {#DREM} - {#DNEG})) - -(type .public Arithmetic - (Variant - {#Int_Arithmetic Int_Arithmetic} - {#Long_Arithmetic Long_Arithmetic} - {#Float_Arithmetic Float_Arithmetic} - {#Double_Arithmetic Double_Arithmetic})) - -(type .public Int_Bitwise - (Variant - {#IOR} - {#IXOR} - {#IAND} - {#ISHL} - {#ISHR} - {#IUSHR})) - -(type .public Long_Bitwise - (Variant - {#LOR} - {#LXOR} - {#LAND} - {#LSHL} - {#LSHR} - {#LUSHR})) - -(type .public Bitwise - (Variant - {#Int_Bitwise Int_Bitwise} - {#Long_Bitwise Long_Bitwise})) - -(type .public Conversion - (Variant - {#I2B} - {#I2S} - {#I2L} - {#I2F} - {#I2D} - {#I2C} - - {#L2I} - {#L2F} - {#L2D} - - {#F2I} - {#F2L} - {#F2D} - - {#D2I} - {#D2L} - {#D2F})) - -(type .public Array - (Variant - {#ARRAYLENGTH} - - {#NEWARRAY (Type Primitive)} - {#ANEWARRAY (Type category.Object)} - - {#BALOAD} - {#BASTORE} - - {#SALOAD} - {#SASTORE} - - {#IALOAD} - {#IASTORE} - - {#LALOAD} - {#LASTORE} - - {#FALOAD} - {#FASTORE} - - {#DALOAD} - {#DASTORE} - - {#CALOAD} - {#CASTORE} - - {#AALOAD} - {#AASTORE})) - -(type .public Object - (Variant - {#GETSTATIC (Type Class) Text (Type Value)} - {#PUTSTATIC (Type Class) Text (Type Value)} - - {#NEW (Type Class)} - - {#INSTANCEOF (Type Class)} - {#CHECKCAST (Type category.Object)} - - {#GETFIELD (Type Class) Text (Type Value)} - {#PUTFIELD (Type Class) Text (Type Value)} - - {#INVOKEINTERFACE (Type Class) Text (Type Method)} - {#INVOKESPECIAL (Type Class) Text (Type Method)} - {#INVOKESTATIC (Type Class) Text (Type Method)} - {#INVOKEVIRTUAL (Type Class) Text (Type Method)})) - -(type .public Register - Nat) - -(type .public Local_Int - (Variant - {#ILOAD Register} - {#ISTORE Register})) - -(type .public Local_Long - (Variant - {#LLOAD Register} - {#LSTORE Register})) - -(type .public Local_Float - (Variant - {#FLOAD Register} - {#FSTORE Register})) - -(type .public Local_Double - (Variant - {#DLOAD Register} - {#DSTORE Register})) - -(type .public Local_Object - (Variant - {#ALOAD Register} - {#ASTORE Register})) - -(type .public Local - (Variant - {#Local_Int Local_Int} - {#IINC Register} - {#Local_Long Local_Long} - {#Local_Float Local_Float} - {#Local_Double Local_Double} - {#Local_Object Local_Object})) - -(type .public Stack - (Variant - {#DUP} - {#DUP_X1} - {#DUP_X2} - {#DUP2} - {#DUP2_X1} - {#DUP2_X2} - {#SWAP} - {#POP} - {#POP2})) - -(type .public Comparison - (Variant - {#LCMP} - - {#FCMPG} - {#FCMPL} - - {#DCMPG} - {#DCMPL})) - -(type .public Label - Nat) - -(type .public (Branching label) - (Variant - {#IF_ICMPEQ label} - {#IF_ICMPGE label} - {#IF_ICMPGT label} - {#IF_ICMPLE label} - {#IF_ICMPLT label} - {#IF_ICMPNE label} - {#IFEQ label} - {#IFNE label} - {#IFGE label} - {#IFGT label} - {#IFLE label} - {#IFLT label} - - {#TABLESWITCH Int Int label (List label)} - {#LOOKUPSWITCH label (List [Int label])} - - {#IF_ACMPEQ label} - {#IF_ACMPNE label} - {#IFNONNULL label} - {#IFNULL label})) - -(type .public (Exception label) - (Variant - {#Try label label label (Type Class)} - {#ATHROW})) - -(type .public Concurrency - (Variant - {#MONITORENTER} - {#MONITOREXIT})) - -(type .public Return - (Variant - {#RETURN} - {#IRETURN} - {#LRETURN} - {#FRETURN} - {#DRETURN} - {#ARETURN})) - -(type .public (Control label) - (Variant - {#GOTO label} - {#Branching (Branching label)} - {#Exception (Exception label)} - {#Concurrency Concurrency} - {#Return Return})) - -(type .public (Instruction embedded label) - (Variant - {#NOP} - {#Constant Constant} - {#Arithmetic Arithmetic} - {#Bitwise Bitwise} - {#Conversion Conversion} - {#Array Array} - {#Object Object} - {#Local Local} - {#Stack Stack} - {#Comparison Comparison} - {#Control (Control label)} - {#Embedded embedded})) - -(type .public (Bytecode embedded label) - (Sequence (Instruction embedded label))) diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux index eb523d7e0..9530cb8dd 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/analysis/jvm.lux @@ -1902,6 +1902,106 @@ (<code>.tuple (<>.some ..input)) <code>.any))) +(def (with_fake_parameter#pattern it) + (-> pattern.Pattern pattern.Pattern) + (case it + {pattern.#Simple _} + it + + {pattern.#Complex it} + {pattern.#Complex + (case it + {complex.#Variant it} + {complex.#Variant (revised complex.#value with_fake_parameter#pattern it)} + + {complex.#Tuple it} + {complex.#Tuple (list#each with_fake_parameter#pattern it)})} + + {pattern.#Bind it} + {pattern.#Bind (++ it)})) + +(def (with_fake_parameter it) + (-> Analysis Analysis) + (case it + {/////analysis.#Simple _} + it + + {/////analysis.#Structure it} + {/////analysis.#Structure + (case it + {complex.#Variant it} + {complex.#Variant (revised complex.#value with_fake_parameter it)} + + {complex.#Tuple it} + {complex.#Tuple (list#each with_fake_parameter it)})} + + {/////analysis.#Reference it} + {/////analysis.#Reference + (case it + {reference.#Variable it} + {reference.#Variable + (case it + {variable.#Local it} + {variable.#Local (++ it)} + + {variable.#Foreign _} + it)} + + {reference.#Constant _} + it)} + + {/////analysis.#Case value [head tail]} + {/////analysis.#Case (with_fake_parameter value) + (let [with_fake_parameter (is (-> /////analysis.Branch /////analysis.Branch) + (|>> (revised /////analysis.#when with_fake_parameter#pattern) + (revised /////analysis.#then with_fake_parameter)))] + [(with_fake_parameter head) + (list#each with_fake_parameter tail)])} + + {/////analysis.#Function environment body} + {/////analysis.#Function (list#each with_fake_parameter environment) + body} + + {/////analysis.#Apply parameter abstraction} + {/////analysis.#Apply (with_fake_parameter parameter) + (with_fake_parameter abstraction)} + + {/////analysis.#Extension name parameters} + {/////analysis.#Extension name + (list#each with_fake_parameter parameters)})) + +(def .public (hidden_method_body arity bodyA) + (-> Nat Analysis Analysis) + (<| /////analysis.tuple + (list (/////analysis.unit)) + (case arity + (^.or 0 1) + bodyA + + 2 + (let [forced_refencing (/////analysis.tuple (list#each (|>> /////analysis.local) (list.indices (++ arity))))] + {/////analysis.#Case (/////analysis.unit) + [[/////analysis.#when + {pattern.#Bind 2} + + /////analysis.#then + (/////analysis.tuple (list forced_refencing bodyA))] + (list)]}) + + _ + (let [forced_refencing (/////analysis.tuple (list#each (|>> /////analysis.local) (list.indices (++ arity))))] + {/////analysis.#Case (/////analysis.unit) + [[/////analysis.#when + {pattern.#Complex + {complex.#Tuple + (|> (-- arity) + list.indices + (list#each (|>> (n.+ 2) {pattern.#Bind})))}} + + /////analysis.#then + (/////analysis.tuple (list forced_refencing bodyA))] + (list)]})))) + (def .public (analyse_constructor_method analyse archive selfT mapping method) (-> Phase Archive .Type Mapping (Constructor Code) (Operation Analysis)) (let [[visibility strict_fp? @@ -1936,7 +2036,8 @@ list.reversed (list#mix scope.with_local (analyse archive body)) (typeA.expecting .Any) - scope.with)] + scope.with) + .let [arity (list.size arguments)]] (in (/////analysis.tuple (list (/////analysis.text ..constructor_tag) (visibility_analysis visibility) (/////analysis.bit strict_fp?) @@ -1949,7 +2050,10 @@ {/////analysis.#Function (list#each (|>> /////analysis.variable) (scope.environment scope)) - (/////analysis.tuple (list bodyA))} + (<| (..hidden_method_body arity) + (case arity + 0 (with_fake_parameter bodyA) + _ bodyA))} )))))) (.type .public (Virtual_Method a) @@ -2034,7 +2138,8 @@ list.reversed (list#mix scope.with_local (analyse archive body)) (typeA.expecting :return:) - scope.with)] + scope.with) + .let [arity (list.size arguments)]] (in (/////analysis.tuple (list (/////analysis.text ..virtual_tag) (/////analysis.text method_name) (visibility_analysis visibility) @@ -2049,7 +2154,10 @@ {/////analysis.#Function (list#each (|>> /////analysis.variable) (scope.environment scope)) - (/////analysis.tuple (list bodyA))} + (<| (..hidden_method_body arity) + (case arity + 0 (with_fake_parameter bodyA) + _ bodyA))} )))))) (.type .public (Static_Method a) @@ -2205,106 +2313,6 @@ mapping override_mapping)))) -(def .public (hidden_method_body arity bodyA) - (-> Nat Analysis Analysis) - (<| /////analysis.tuple - (list (/////analysis.unit)) - (case arity - (^.or 0 1) - bodyA - - 2 - (let [forced_refencing (/////analysis.tuple (list#each (|>> /////analysis.local) (list.indices (++ arity))))] - {/////analysis.#Case (/////analysis.unit) - [[/////analysis.#when - {pattern.#Bind 2} - - /////analysis.#then - (/////analysis.tuple (list forced_refencing bodyA))] - (list)]}) - - _ - (let [forced_refencing (/////analysis.tuple (list#each (|>> /////analysis.local) (list.indices (++ arity))))] - {/////analysis.#Case (/////analysis.unit) - [[/////analysis.#when - {pattern.#Complex - {complex.#Tuple - (|> (-- arity) - list.indices - (list#each (|>> (n.+ 2) {pattern.#Bind})))}} - - /////analysis.#then - (/////analysis.tuple (list forced_refencing bodyA))] - (list)]})))) - -(def (with_fake_parameter#pattern it) - (-> pattern.Pattern pattern.Pattern) - (case it - {pattern.#Simple _} - it - - {pattern.#Complex it} - {pattern.#Complex - (case it - {complex.#Variant it} - {complex.#Variant (revised complex.#value with_fake_parameter#pattern it)} - - {complex.#Tuple it} - {complex.#Tuple (list#each with_fake_parameter#pattern it)})} - - {pattern.#Bind it} - {pattern.#Bind (++ it)})) - -(def (with_fake_parameter it) - (-> Analysis Analysis) - (case it - {/////analysis.#Simple _} - it - - {/////analysis.#Structure it} - {/////analysis.#Structure - (case it - {complex.#Variant it} - {complex.#Variant (revised complex.#value with_fake_parameter it)} - - {complex.#Tuple it} - {complex.#Tuple (list#each with_fake_parameter it)})} - - {/////analysis.#Reference it} - {/////analysis.#Reference - (case it - {reference.#Variable it} - {reference.#Variable - (case it - {variable.#Local it} - {variable.#Local (++ it)} - - {variable.#Foreign _} - it)} - - {reference.#Constant _} - it)} - - {/////analysis.#Case value [head tail]} - {/////analysis.#Case (with_fake_parameter value) - (let [with_fake_parameter (is (-> /////analysis.Branch /////analysis.Branch) - (|>> (revised /////analysis.#when with_fake_parameter#pattern) - (revised /////analysis.#then with_fake_parameter)))] - [(with_fake_parameter head) - (list#each with_fake_parameter tail)])} - - {/////analysis.#Function environment body} - {/////analysis.#Function (list#each with_fake_parameter environment) - body} - - {/////analysis.#Apply parameter abstraction} - {/////analysis.#Apply (with_fake_parameter parameter) - (with_fake_parameter abstraction)} - - {/////analysis.#Extension name parameters} - {/////analysis.#Extension name - (list#each with_fake_parameter parameters)})) - (def .public (analyse_overriden_method analyse archive selfT mapping supers method) (-> Phase Archive .Type Mapping (List (Type Class)) (Overriden_Method Code) (Operation Analysis)) (let [[parent_type method_name diff --git a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/jvm.lux b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/jvm.lux index 9fdfb4d7c..f43c26adf 100644 --- a/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/jvm.lux +++ b/stdlib/source/library/lux/tool/compiler/language/lux/phase/extension/declaration/jvm.lux @@ -459,7 +459,10 @@ (-> Archive (Type Class) (jvm.Constructor Synthesis) (Operation (Resource Method))) (<| (let [[privacy strict_floating_point? annotations method_tvars exceptions self arguments constructor_argumentsS - bodyS] method]) + bodyS] method + bodyS (case (list.size arguments) + 0 (host.without_fake_parameter bodyS) + _ bodyS)]) (do [! phase.monad] [generate declaration.generation]) declaration.lifted_generation @@ -560,7 +563,10 @@ (do [! phase.monad] [.let [[method_name privacy final? strict_floating_point? annotations method_tvars self arguments returnJ exceptionsJ - bodyS] method] + bodyS] method + bodyS (case (list.size arguments) + 0 (host.without_fake_parameter bodyS) + _ bodyS)] generate declaration.generation] (declaration.lifted_generation (do ! diff --git a/stdlib/source/test/lux/ffi.jvm.lux b/stdlib/source/test/lux/ffi.jvm.lux index f22bb70c1..6edf7e3ac 100644 --- a/stdlib/source/test/lux/ffi.jvm.lux +++ b/stdlib/source/test/lux/ffi.jvm.lux @@ -381,11 +381,11 @@ ("private" value java/lang/Long) ... Constructors ("public" [] (new self [value java/lang/Long]) [] - (:= ::value value)) + (/.set value value)) ... Methods (test/TestInterface0 [] (actual0 self []) java/lang/Long - ::value)) + (/.get value))) (/.import test/TestClass0 "[1]::[0]" @@ -396,13 +396,13 @@ ("private" value java/lang/Long) ... Constructors ("public" [] (new self [value java/lang/Long]) [] - (:= ::value value)) + (/.set value value)) ... Methods (test/TestInterface1 [] (actual1 self [throw? java/lang/Boolean]) java/lang/Long "throws" [java/lang/Throwable] (if (not (/.of_boolean throw?)) - ::value + (/.get value) (panic! "YOLO")))) (/.import test/TestClass1 @@ -428,12 +428,12 @@ ("private" value a) ... Constructors ("public" [] (new self [value a]) [] - (:= ::value value)) + (/.set value value)) ... Methods ((test/TestInterface3 a) [] (actual3 self []) a - ::value)) + (/.get value))) (/.import (test/TestClass3 a) "[1]::[0]" @@ -513,12 +513,12 @@ ("private" value9 a) ... Constructors ("public" [] (new self [value a]) [] - (:= ::value9 value)) + (/.set value9 value)) ... Methods ("public" (set_actual9 self [value a]) void - (:= ::value9 value)) + (/.set value9 value)) ("public" (get_actual9 self []) a - ::value9)) + (/.get value9))) (/.import (test/TestClass9 a) "[1]::[0]" @@ -531,7 +531,7 @@ ("public" value10 a) ... Constructors ("public" [] (new self [init a]) [] - (:= ::value10 init))) + (/.set value10 init))) (/.import (test/TestClass10 a) "[1]::[0]" @@ -543,7 +543,7 @@ ("public" value11 a) ... Constructors ("public" [] (new self [init a]) [] - (:= ::value11 init))) + (/.set value11 init))) (/.import (test/TestClass11 a) "[1]::[0]" |