Skip to content

Commit

Permalink
Re-named the require macro to using.
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoejp committed Dec 19, 2023
1 parent 036b400 commit 91355a1
Show file tree
Hide file tree
Showing 1,351 changed files with 1,636 additions and 1,405 deletions.
1 change: 1 addition & 0 deletions documentation/backlink.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Reference

0. [Interesting Programming Languages](https://www.btbytes.com/pl.html)
0. [Programming Language DataBase](https://pldb.pub/concepts/lux.html)
0. [lua-languages: Languages that compile to Lua](https://github.com/hengestone/lua-languages)
0. [Awesome programming languages](https://github.com/ChessMax/awesome-programming-languages)
Expand Down
28 changes: 14 additions & 14 deletions documentation/book/the_lux_programming_language/appendix_a.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ You've already seen some import syntax, but now you'll see all the options avail
If you recall [Chapter 1](chapter_1.md), there was this example code:

```clojure
(.require
(.using
[library
[lux (.except)
[program (.only program)]
Expand Down Expand Up @@ -38,7 +38,7 @@ We also give both of those modules local aliases.

That is what that `"[0]"` syntax does.

The `.require` macro recognizes that syntax for aliases and replaces the `[0]` with the import name directly to the right.
The `.using` macro recognizes that syntax for aliases and replaces the `[0]` with the import name directly to the right.

That means:
* `"[0]"` + `debug` = `debug`
Expand All @@ -52,10 +52,10 @@ So, for example:

It is also important to note that while imports can be nested for convenience, they don't have to be.

The `.require` declaration could just as easily been written like this:
The `.using` declaration could just as easily been written like this:

```clojure
(.require
(.using
[library/lux (.except)]
[library/lux/program (.only program)]
["debug" library/lux/debug]
Expand All @@ -68,12 +68,12 @@ Any module-path fragments included in the import syntax without such options wil

---

It is also possible to have the `.require` macro open interface implementations for you when importing the modules that contain them.
It is also possible to have the `.using` macro open interface implementations for you when importing the modules that contain them.

For example:

```clojure
(.require
(.using
[library
[lux (.except)
[data
Expand Down Expand Up @@ -105,7 +105,7 @@ The `[1]` syntax for aliasing can also be used between modules, and not just whe
For example:

```clojure
(.require
(.using
[library
[lux (.except)
[data
Expand All @@ -125,7 +125,7 @@ Non-aliased paths don't count as context.
This means:

```clojure
(.require
(.using
[library
[lux (.except)
["[0]" data
Expand All @@ -145,7 +145,7 @@ I should also note that you can **both** locally import definitions and open imp
For example:

```clojure
(.require
(.using
[library
[lux (.except)
[data
Expand Down Expand Up @@ -178,7 +178,7 @@ You can import other modules in the hierarchy like this:

```clojure
... In program/foo/baz
(.require
(.using
[library
[lux (.except)]]
["[0]" /quux] ... program/foo/baz/quux, aliased as /quux
Expand All @@ -191,7 +191,7 @@ A single forward slash (`/`) signifies _"this module"_ in the hierarchy, so anyt

Two forward slashes (`//`) signify _"the module above"_, and any forward slash after that allows you to go further **up** the hierarchy.

In the case of `program`, it's enough to just specify three forward slashes (`///`) for the `.require` macro to know which module you're referring to.
In the case of `program`, it's enough to just specify three forward slashes (`///`) for the `.using` macro to know which module you're referring to.

You can think about it like this:

Expand All @@ -203,7 +203,7 @@ Also, this relative path syntax can be nested, like so:

```clojure
... In program/foo/baz
(.require
(.using
[library
[lux (.except)]]
[/
Expand All @@ -219,7 +219,7 @@ Or even:

```clojure
... In program/foo/baz
(.require
(.using
[library
[lux (.except)]]
[/
Expand All @@ -240,7 +240,7 @@ For the second way to do relative imports, you can see this example:

```clojure
... In program/foo/baz
(.require
(.using
[library
[lux (.except)]]
[\\test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ But enough chit-chat.

Let's see them in action.

**Note**: The following examples assume you `.require` the `["^" library/lux/meta/macro/pattern]` module.
**Note**: The following examples assume you `.using` the `["^" library/lux/meta/macro/pattern]` module.

## Pattern-matching macros in the Standard Library

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ I try to figure out ways to get my code to be more pipe-sensitive, to see how fa

My personal record is 14 steps.

**Note**: The following examples assume that you `.require` the `["|" library/lux/control/pipe]` module.
**Note**: The following examples assume that you `.using` the `["|" library/lux/control/pipe]` module.

## Piping macros in the standard library

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ These are the steps:
4. Create `my_project/source/main.lux` and add this code to it:

```clojure
(.require
(.using
[library
[lux (.except)
[program (.only program)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Macros allow you to implement your own features in the language and to have them

I mean, beyond the native syntax for writing numbers, text, variants, tuples and records, every single thing you have written so far has been macros.

`.require` import statements? _Yep, macros_.
`.using` import statements? _Yep, macros_.

Definition statements? _Yep, macros_.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Here is an example:
```clojure
... Taken from library/lux/math/infix.

(.require
(.using
[library
[lux (.except)
[abstract
Expand Down
4 changes: 2 additions & 2 deletions documentation/book/the_lux_programming_language/chapter_16.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The `"test"` parameter specifies the name of a Lux module that serves as the ent
Here is a summary of the file:

```clojure
(.require
(.using
[library
["/" lux (.except)
[program (.only program)]
Expand Down Expand Up @@ -86,7 +86,7 @@ To know how tests work, let's take a look at one of those modules.
From `test/lux/data/collection/stack`.

```clojure
(.require
(.using
[library
[lux (.except)
[test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ And so, Lux provides 4 different types of extensions.
The first type of extension we'll see is the `Analysis` extension:
```clojure
(.require
(.using
[library
[lux (.only)
[extension (.only analysis synthesis generation)]
Expand Down
8 changes: 4 additions & 4 deletions documentation/book/the_lux_programming_language/chapter_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Directives looks similar to expressions, except that their purpose is not to pro

This is a bit of a fuzzy line, since some things which also communicate stuff to the compiler are actually expressions (for example, type annotations, which we'll see in next chapter).

Examples of directives are `.require` declarations at the top of modules, and definitions of all kinds (such as program definitions).
Examples of directives are `.using` declarations at the top of modules, and definitions of all kinds (such as program definitions).

## Programs

Expand Down Expand Up @@ -112,7 +112,7 @@ In the previous chapter we compiled and ran a Lux program, but nothing has been

```clojure
... This will be our program's main module.
(.require
(.using
[library
[lux (.except)
[program (.only program)]
Expand All @@ -125,13 +125,13 @@ In the previous chapter we compiled and ran a Lux program, but nothing has been
(io.io (debug.log! "Hello, world!"))))
```

The first part of this program specifies which dependencies we `require`.
The first part of this program specifies which dependencies we `using`.

All Lux modules automatically import the `library/lux` module, but they don't locally import every single definition, so everything would have to be accessed by using the `library/lux.` prefix or the `.` (short-cut) prefix.

To avoid that, we import the `library/lux` module in a plain way.

By the way, what I just explained about the `library/lux` module is the reason why we couldn't just use the `.require` macro as `require`.
By the way, what I just explained about the `library/lux` module is the reason why we couldn't just use the `.using` macro as `using`.

Then we import the `library/lux/control/io` module. We're giving this module an alias, using that `"[0]"` syntax. The way aliasing works here is that it replaces the `[0]` with the short name of the import, and so `[0]` becomes `io`, and that is the alias given to the import. The same process happens when we import the `library/lux/debug` module. This might seems weird and sort of useless, but the aliasing syntax has some more features and flexibility, enabling you to have your own naming convention when importing modules.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ The reason it exists is that Lux's arithmetic functions are not polymorphic on t
If you import the module for `Nat` numbers, like so:

```clojure
(.require
(.using
[library
[lux
[math
Expand Down
4 changes: 2 additions & 2 deletions documentation/book/the_lux_programming_language/chapter_8.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ The thing about `Monad` is that, with it, you can use `each` functions that also
Let's see that in action:

```clojure
(.require
(.using
[library
[lux (.except)
[data
Expand Down Expand Up @@ -301,7 +301,7 @@ Time for the VIP treatment.
These macros always show up at the right time to saves us from our hurdles!

```clojure
(.require
(.using
[library
[lux (.except)
[data
Expand Down
21 changes: 21 additions & 0 deletions documentation/bookmark/ai__artificial_intelligence/application.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Reference

0. [gencraft: The world's most powerful AI photo and art generation engine](https://gencraft.com/)
0. [SalesGPT - Your Context-Aware AI Sales Assistant](https://github.com/filip-michalsky/SalesGPT)
0. [Keeper: Taxes, reimagined](https://www.keepertax.com/)
0. [AnyLearn](https://anylearn.ai/)
0. [StyleDrop: Text-To-Image Generation in Any Style](https://styledrop.github.io/)
0. [Ortus: Engage in interactive video viewing: Ask questions and immediately receive relevant answers about the video!](https://www.ortusbuddy.ai/)
0. [AgentGPT](https://agentgpt.reworkd.ai/)
0. [Midjourney](https://www.midjourney.com/home)
0. [Elai: Create AI videos from just text](https://elai.io/)
0. [DeepFaceLive: Real-time face swap for PC streaming or video calls](https://github.com/iperov/DeepFaceLive)
0. [Draw Things: AI-assisted Image Generation in Your Pocket](https://drawthings.ai/)
0. [Generative Image Dynamics](https://generative-dynamics.github.io/)
0. [Omniscience: The AI that writes books with your knowledge](https://omniscience.tech/)
0. [Drafts AI: Subject to blog in seconds](https://www.draftsai.com/)

0. [Arktan: Discover and compare 5200+ best AI tools for you and your business](https://arktan.com/)
0. [FutureTools: FutureTools Collects & Organizes All The Best AI Tools So YOU Too Can Become Superhuman!](https://www.futuretools.io/)
0. [Mainions: Passionate AI minions for hire](https://mainions.com/)

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Reference

0. [vLLM: A high-throughput and memory-efficient inference and serving engine for LLMs](https://github.com/vllm-project/vllm)
0. [Getting started with LLMs locally](https://tales.fromprod.com/2023/099/getting-started-with-llms-locally.html)
0. [LMQL is a programming language for LLMs](https://lmql.ai/)
0. [PhaseLLM helps you build robust LLM-driven software products](https://phasellm.com/)
0. [DeepSpeed](https://github.com/microsoft/DeepSpeed)
0. [Innovation Algebra](https://github.com/hannes-marais/innovation-algebra)
0. [GPTCache : A Library for Creating Semantic Cache for LLM Queries](https://github.com/zilliztech/GPTCache)
0. [PrivateGPT: Interact with your documents using the power of GPT, 100% privately, no data leaks](https://github.com/imartinez/privateGPT)
0. [Auto-GPT](https://news.agpt.co/)

0. [LangChain](https://www.langchain.com/)
0. [LangChain](https://integrations.langchain.com/)
0. [Awesome LangChain](https://github.com/kyrolabs/awesome-langchain)
0. [LLM Collection](https://www.promptingguide.ai/models/collection)

6 changes: 6 additions & 0 deletions documentation/bookmark/ai__artificial_intelligence/model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Reference

0. [OpenChatKit](https://github.com/togethercomputer/OpenChatKit)
0. [Transformers.js: State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!](https://github.com/xenova/transformers.js)
0. [MLC LLM](https://llm.mlc.ai/)

4 changes: 4 additions & 0 deletions documentation/bookmark/business/work/tracking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Reference

0. [Don't Do Invisible Work - Chris Albon](https://www.youtube.com/watch?v=HiF83i1OLOM)

5 changes: 0 additions & 5 deletions documentation/bookmark/combinatory_logic.md

This file was deleted.

1 change: 1 addition & 0 deletions documentation/bookmark/communication.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Reference

0. [LEADERSHIP LAB: The Craft of Writing Effectively](https://www.youtube.com/watch?v=vtIzMaLkCaM)
0. [Be honest: little white lies are more harmful than you think](https://psyche.co/ideas/be-honest-little-white-lies-are-more-harmful-than-you-think)
0. [LYING AND VAGUENESS](https://semanticsarchive.net/Archive/TZjY2Q4N/egre_icard_lying_vagueness.pdf)
0. [Dinkus](https://en.wikipedia.org/wiki/Dinkus)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

# Reference

0. []()
0. [The best WebAssembly runtime may be no runtime at all](https://00f.net/2023/12/11/webassembly-compilation-to-c/)
0. [just-in-time code generation within webassembly](https://wingolog.org/archives/2022/08/18/just-in-time-code-generation-within-webassembly)
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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Reference

0. [Trade-offs between Different CRDTs](https://interjectedfuture.com/trade-offs-between-different-crdts/)
0. [A Framework for Convergence](https://vlcn.io/articles/crdt-substrate)
0. [You might not need a CRDT](https://driftingin.space/posts/you-might-not-need-a-crdt)
0. [CRDT: Fractional Indexing](https://madebyevan.com/algos/crdt-fractional-indexing/)
Expand Down
1 change: 1 addition & 0 deletions documentation/bookmark/css.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# Reference

0. [CSS Hooks: Inline styles doing what we thought they couldn't](https://css-hooks.com/)
0. [Fit-to-Width Text](https://kizu.dev/fit-to-width-text/)
0. [Modern CSS Solutions for Old CSS Problems](https://moderncss.dev/)
0. [Floating UI](https://floating-ui.com/)
Expand Down
1 change: 1 addition & 0 deletions documentation/bookmark/design.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Reference

0. [Design Principles: An open source collection of Design Principles and methods](https://principles.design/)
0. [Eastern & Western Design: How Culture Rewires The Brain](https://www.youtube.com/watch?v=8UAsN9wvePE)
0. [Dimensions](https://www.dimensions.com/)
0. [Pixels, Process & Prototypes: UI Design for Engineers](https://www.uidesignforengineers.com/)
Expand Down
1 change: 1 addition & 0 deletions documentation/bookmark/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

# Reference

0. [An intuitive documentation strategy](https://abstraction.blog/2023/11/22/intuitive-documentation-strategy)
0. [Histoire: A new way to write stories](https://histoire.dev/)
0. [Better Explained](https://betterexplained.com/)
0. [Towards a theory of quality in documentation](https://diataxis.fr/quality/)
Expand Down
4 changes: 4 additions & 0 deletions documentation/bookmark/environment_variables.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Reference

0. [9 Things I Hate About Environment Variables](https://prefab.cloud/blog/9-problems-with-env-vars/)

1 change: 1 addition & 0 deletions documentation/bookmark/health.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Reference

0. [Explained: The sugar coating of life](https://news.mit.edu/2023/explained-glycoscience-carbohydrates-1201)
0. [Young blood transfusion](https://en.wikipedia.org/wiki/Young_blood_transfusion)
* [EXCLUSIVE: Ambrosia, the Young Blood Transfusion Startup, Is Quietly Back in Business](https://onezero.medium.com/exclusive-ambrosia-the-young-blood-transfusion-startup-is-quietly-back-in-business-ee2b7494b417)
* [El tratamiento controversial](https://www.youtube.com/watch?v=oksvKi1n3ts)
Expand Down
4 changes: 4 additions & 0 deletions documentation/bookmark/jewelry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Reference

0. [Diamonds Suck!](https://diamondssuck.com/)

4 changes: 4 additions & 0 deletions documentation/bookmark/material/wood.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Reference

0. [woodoo](https://woodoo.com/)

6 changes: 6 additions & 0 deletions documentation/bookmark/math/combinatory_logic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Reference

0. [A correct-by-construction conversion from lambda calculus to combinatory logic](https://www.cambridge.org/core/journals/journal-of-functional-programming/article/correctbyconstruction-conversion-from-lambda-calculus-to-combinatory-logic/B2A7BCF12A7A5D52B294C78A6F04191F)
0. [YOW! Lambda Jam 2018 - Edward Kmett - Combinators Revisited](https://www.youtube.com/watch?v=zhj_tUMwTe0)
0. [Combinatory Logic in Programming](https://doc.lagout.org/science/0_Computer%20Science/2_Algorithms/Combinatory%20Logic%20in%20Programming.pdf)

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Reference

0. [Destination-passing Style](http://www.fitzgibbon.ie/destination_passing_style)

Loading

0 comments on commit 91355a1

Please sign in to comment.