summaryrefslogtreecommitdiff
path: root/README.md
blob: 4888419c03053460355bde26efaae2fcd6b4061f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Fennel Cljlib

Experimental library for the [Fennel](https://fennel-lang.org/) language, that adds many functions from [Clojure](https://clojure.org/)'s standard library.
This is not a one-to-one port of Clojure `core`, because many Clojure features require certain facilities from the runtime.
This library implements lazy sequences, transducers, immutable tables, sets and vectors, transients, and a lot of functions from the `core` namespace.
Some semantics like dynamic scope and parallelism are not supported by Lua runtime at all.
Therefore, certain functions were altered to better suit the domain or omitted entirely.

## Installation

Grab the [cljlb.fnl][1] file, and copy it somewhere into your project.
Now you can require `:cljlib` from Fennel:

``` fennel
(local clj (require :cljlib))
```

To use macros provided by the library, due to the implementation of how macros are stored an additional `require` step in the `import-macros` call is required:

```fennel
(import-macros cljm (doto :cljlib require))
```

Alternatively, the library can be precompiled so it will load slightly faster:

    $ fennel -c cljlib.fnl > cljlib.lua

However, this way the macros provided by this library will not be available.

## Documentation

Documentation is auto-generated with [Fenneldoc](https://gitlab.com/andreyorst/fenneldoc) and can be found [here](https://gitlab.com/andreyorst/fennel-cljlib/-/tree/master/doc).

# Contributing

Please make sure you've read [contribution guidelines][2].

In order to work on the library, edit the `src/cljlib.fnl` file, then run the following command in the project root:

    fennel utils/build

This produces a self-contained version of the library with all dependencies properly included.

Tests can be ran with:

    fennel utils/run-tests

[1]: https://gitlab.com/andreyorst/fennel-cljlib/-/raw/master/cljlib.fnl
[2]: https://gitlab.com/andreyorst/fennel-cljlib/-/tree/master/CONTRIBUTING.md

<!--  LocalWords:  Lua submodule precompile cljlib docstring config
      LocalWords:  namespace destructure runtime Clojure precompiled
 -->