You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add copy to README.md.
- Add a 'Why Slurp' section near the top that contains a positioning statement.
- Add installation instructions under 'Usage'
- Link to examples in use-cases under 'Usage'
* Add Go interop to 'Features' section in README.
* Add link to tutorial on GitHub wiki.
* Punctuation fix.
* Move README section about extending Slurp to Wiki.
Add 'Documentation' section
Slurp is a highly customisable, embeddable LISP toolkit for `Go` applications.
6
7
8
+
-[Slurp](#slurp)
9
+
-[Why Slurp](#why-slurp)
10
+
-[Features](#features)
11
+
-[Usage](#usage)
12
+
-[Documentation](#documentation)
13
+
14
+
## Why Slurp
15
+
16
+

17
+
18
+
Slurp is for developers who want to design and embed an interpreted language inside of a Go program.
19
+
20
+
Slurp provides composable building-blocks that make it easy to design a custom lisp, even if you've never written an interpreter before. Since Slurp is written in pure Go, your new language can be embedded into any Go program by importing it — just like any other library.
21
+
22
+
> **NOTE:** Slurp is _NOT_ an implementation of a particular LISP dialect.
23
+
>
24
+
> It provides pieces that can be used to build a LISP dialect or can be used as a scripting layer.
25
+
26
+
Slurp is designed around three core values:
27
+
28
+
1.**Simplicity:** The library is small and has few moving parts.
29
+
2.**Batteries Included:** There are no external dependencies and little configuration required.
30
+
3.**Go Interoperability:** Slurp can call Go code and fully supports Go's concurrency features.
31
+
32
+
We hope that you will find Slurp to be powerful, useful and fun to use. We look forward to seeing what you build with it!
33
+
34
+
7
35
## Features
8
36
9
37
* Highly customizable, safe and powerful reader/parser through
10
38
a read table (Inspired by [Clojure](https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java)) (See [Reader](#reader))
11
-
*Built-in data types: nil, bool, string, numbers (int & float),
39
+
*Immutable datatypes including: nil, bool, string, int & float,
12
40
character, keyword, symbol, list, vector & map.
13
41
* Multiple number formats supported: decimal, octal, hexadecimal,
14
42
radix and scientific notations.
@@ -19,65 +47,34 @@ Slurp is a highly customisable, embeddable LISP toolkit for `Go` applications.
19
47
1. simple literals (e.g., `\a` for `a`)
20
48
2. special literals (e.g., `\newline`, `\tab` etc.)
21
49
3. unicode literals (e.g., `\u00A5` for `¥` etc.)
50
+
* Full interoperability with Go: call native Go functions/libraries, and manipulate native Go datatypes from your language.
22
51
* Support for macros.
23
52
* Easy to extend. See [Extending](#extending).
24
53
* Tiny & powerful REPL package.
25
54
* Zero dependencies (outside of tests).
26
55
27
56
## Usage
28
57
29
-
> Slurp requires Go 1.14 or higher.
58
+
Slurp requires Go 1.14 or higher. It can be installed using `go get`:
59
+
60
+
```bash
61
+
go get -u github.com/spy16/slurp
62
+
```
30
63
31
64
What can you use it for?
32
65
33
-
1. Embedded script engine to provide dynamic behavior without requiring re-compilation
34
-
of your application.
35
-
2. Business rule engine by exposing very specific & composable rule functions.
66
+
1. Embedded script engine to provide dynamic behavior without requiring re-compilation of your application ([example](./examples/simple/main.go)).
67
+
2. Business rule engine exposing specific, composable rules ([example](./examples/rule-engine/main.go)).
36
68
3. To build DSLs.
37
-
4. To build your own LISP dialect.
69
+
4. To build your own LISP dialect ([example](https://github.com/wetware/ww)).
38
70
39
-
> Please note that slurp is _NOT_ an implementation of a particular LISP dialect. It provides
40
-
> pieces that can be used to build a LISP dialect or can be used as a scripting layer.
71
+
Refer [./examples](./examples) for more usage examples.
41
72
42
-

73
+
## Documentation
74
+
75
+
In addition to the GoDocs, we maintain in-depth tutorials on the GitHub wiki. The following
76
+
pages are good starting points:
43
77
44
-
Refer [./examples](./examples) for usage examples.
45
-
46
-
## Extending
47
-
48
-
### Reader
49
-
50
-
slurp reader is inspired by Clojure reader and uses a _read table_. Reader can be extended
51
-
to add new syntactical features by adding _reader macros_ to the _read table_. _Reader Macros_
52
-
are implementations of `reader.Macro` function type. All syntax that reader can read are
53
-
implemented using _Reader Macros_. Use `SetMacro()` method of `reader.Reader` to override or
54
-
add a custom reader or dispatch macro.
55
-
56
-
Reader returned by `reader.New(...)`, is configured to support following forms:
57
-
58
-
* Numbers:
59
-
* Integers use `int64` Go representation and can be specified using decimal, binary
0 commit comments