|
2 | 2 |
|
3 | 3 | [](https://www.npmjs.com/package/@jcubic/lips)
|
4 | 4 | 
|
5 |
| -[](https://travis-ci.com/jcubic/lips) |
| 5 | +[](https://travis-ci.com/jcubic/lips) |
6 | 6 | [](https://coveralls.io/github/jcubic/lips?branch=devel)
|
7 | 7 | [](https://gitter.im/jcubic/lips)
|
8 | 8 | [](https://github.com/jcubic/lips/blob/master/LICENSE)
|
@@ -181,6 +181,27 @@ chmod a+x foo.scm
|
181 | 181 |
|
182 | 182 | Executables also return a S-Expression according to SRFI-176 use `lips --version` or `lips -V`.
|
183 | 183 |
|
| 184 | +## Limitations |
| 185 | +Because LIPS is tree walking interpreter sometimes it may be slow. Especially if you want to |
| 186 | +process long arrays and use callback function. If the array is quite large each pice of code |
| 187 | +inside the callback may slow down the processing. For example see: |
| 188 | + |
| 189 | +script [reference.scm](https://github.com/jcubic/lips/blob/devel/scripts/reference.scm) |
| 190 | + |
| 191 | +That generates reference documentation for all builtin functions and macros. |
| 192 | +The slow part is `(names.sort name-compare)` (`Array::sort`) that take quite time to calculate, |
| 193 | +because the array with functions and macros is quite large. If you came into performance issue, |
| 194 | +you can write the part of the code in JavaScript. If you want to do this in LIPS Scheme you can use |
| 195 | +something like this: |
| 196 | + |
| 197 | +```scheme |
| 198 | +(let ((fn (self.eval "(function(a, b) { |
| 199 | + /* any complex code in JS */ |
| 200 | + return a.localeCompare(b); |
| 201 | + })"))) |
| 202 | + (arr.sort fn)) |
| 203 | +``` |
| 204 | + |
184 | 205 | ## Links
|
185 | 206 | * [Gitter Chat](https://gitter.im/jcubic/lips)
|
186 | 207 | * [LISP: Scheme in JavaScript Git Repository](https://github.com/jcubic/lips)
|
|
0 commit comments