AI prompts
base on A functional, flexible and concise Lisp.
<p align="center">
<img src="https://github.com/kspalaiologos/kamilalisp/raw/v0.2/logo.png">
</p>
# KamilaLisp Two: Electric Boogaloo
[![codecov](https://codecov.io/gh/kspalaiologos/kamilalisp/branch/v0.2/graph/badge.svg?token=V9D86RYQO8)](https://codecov.io/gh/kspalaiologos/kamilalisp) [![Java CI with Maven](https://github.com/kspalaiologos/kamilalisp/actions/workflows/maven.yml/badge.svg)](https://github.com/kspalaiologos/kamilalisp/actions/workflows/maven.yml)
![WakaTime](https://wakatime.com/badge/user/c3a8c589-783c-4ab2-be05-93fa48bc9a94/project/1c00d725-551f-46d2-a691-1408603a8707.svg)
![GitHub](https://img.shields.io/github/license/kspalaiologos/kamilalisp)
[![](https://tokei.rs/b1/github/kspalaiologos/kamilalisp)](https://github.com/kspalaiologos/kamilalisp)
<span class="badge-patreon"><a href="https://patreon.com/kspalaiologos" title="Donate to this project using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon donate button" /></a></span>
A functional, flexible and concise Lisp inspired by Haskell and APL, among others. A ground-up rewrite.
Useful links:
- Read the book: [An introduction to functional and array programming](https://raw.githubusercontent.com/kspalaiologos/kamilalisp/v0.2/doc/main.pdf).
## Setup
You need **Java17 JDK or newer** installed to build KamilaLisp yourself.
```
git clone https://github.com/kspalaiologos/kamilalisp
cd kamilalisp
mvn package
```
Alternatively, you could download a pre-compiled JAR file for use with **Java 17 or newer**:
```
export VERSION=0.3.0.1
mkdir kamilalisp && cd kamilalisp
# Download the KamilaLisp JAR
curl -L -O https://github.com/kspalaiologos/kamilalisp/releases/download/v$VERSION/kamilalisp-$VERSION.jar
# Verify the signature
curl -L -O https://github.com/kspalaiologos/kamilalisp/releases/download/v$VERSION/kamilalisp-$VERSION.jar.asc
curl https://palaiologos.rocks/pub.pgp | gpg --import # Or alternatively: gpg --recv-keys C868F0B6DE38409D
gpg --verify kamilalisp-$VERSION.jar.asc kamilalisp-$VERSION.jar
```
## Features
KamilaLisp allows for actor programming, concurrent programming, imperative programming, functional programming, array programming, pure functional programming, object-oriented programming, rudimentary logic programming, mathematical programming, backend development, numerical and scientific computation, scripting and system administration, symbolic computation (real and complex analysis), tacit (point-free) programming, concurrent programming and event-driven programming. In more detail:
- Arbitrary precision complex, integer and decimal arithmetic.
- A fully-featured, remote IDE capable of communicating with KamilaLisp instances over the network. Supports multiple workspaces, contains an implementation of a hybrid tiling/floating window manager and editors.
- Many mathematical functions (bernoulli, gamma, trigonometry, arcus functions, hyperbolic functions, inverse hyperbolic functions, FFT, IFFT)
- Bit operations
- Number theoretic, combinatoric and linear algebraic functions (permutations, Levi-Civita, etc...)
- Functional higher order functions (fold, scan, all, none, some, converge, takewhile, dropwhile)
- Functional parallelism (parallel map and filter)
- Mu-recursive functions (SML projections, mu-recursive substitution operator).
- Prototype-based object orientation.
- No memory side effects, all collections are persistent.
- Possibilities of writing code in pure functional paradigm.
- Suffix array and Burrows-Wheeler transform construction.
- APL-style array processing (grade-up, grade-down, find, range, where, encode, decode, replicate, etc...).
- APL-style symbols for common operations.
- Set operations.
- Read/write support for JSON, CSV, XML, Base64, XZ, gzip, lz4, bzip2, tar and zip.
- Date and time manipulations.
- Integrated development environment - supports remote IDE sessions, compressed KamilaLisp code format, project management, multi-workspace and multi-session workflows, broadcasting/synchronising project data among multiple remote sessions.
- Persistent hashmaps, reactive hashmap literals.
- PNG, BMP, JPG and JPEG image I/O.
- File I/O (read, write, append).
- Basic matrix operations (LU decomposition, transpose, trace, matrix multiplication easily implemented as `$(foldl + 0)%[1] \outer-product * A \matrix:transpose A`.
- Performance benchmarks to measure GC time, average, median and standard deviation between runs of various expressions.
- Module system.
- Streams
- Process management (using `sh:process`) - manipulating input/output streams, etc...
- HTTP server - supports resource handlers, path handlers, complex routing, cookies, ...
- SQL database connection, auxiliary database drivers, statements, queries, prepared statements.
- Symbolic matrix LU decomposition, symbolic determinants.
- Pattern matching.
- Memoization.
- Imperative programming support.
- Networking (`net:fetch`, `net:wget`).
- Sockets (`net:client`, `net:server` and their SSL counterparts).
- Parallel processing using the actor model (daemon threads, task threads, message passing paradigm).
- Regular expressions.
- KamilaLisp as a shell (implementations of `sh:ls`, `sh:glob`, `sh:mv`, `sh:basename`, etc... - all usable from the REPL and from code, as they return plain data structures, launching and manipulating external processes).
- String functions (Shannon entropy, unicode handling, byte buffers, levenshtein distance, string interpolation/formatting)
- On-The-Fly Lexical scanner generation.
- Function compositions, partial application, variadic functions, static scoping.
- Tail call optimisation.
- Limits, complex limits.
- Indefinite integrals.
- Differentiation
- Polynomial factoring.
- Laurent, Taylor, MacLaurin and Puiseux series expansion.
- Functional de Bruijn indices.
- Possibility to write standalone non-interactive scripts.
- Symbolic matrix operations.
- Machine word operations (flt64:..., cmplx64:...) - Bessel functions, Hurwitz Zeta, Riemann Zeta, Upper/Lower Incomplete Gamma, Gamma, LogGamma, Pochhammer symbol, erf, erfc, Inverse erf, Inverse erfc, Digamma, Trigamma, Polygamma, Airy Ai, Bessel I, J, K and Y functions, Lerch Phi, Spence's function, Lambert W and Polylogarithm.
- Prompt styling.
- Portable.
- Graph data structure (e.g. directed, acyclic, weighted, etc...).
- Graph colouring (Saturation degree, greedy, largest degree first, smallest degree last, chordal, refinement, Brown backtrack).
- Graph clustering (Givman-Newman, k-Spanning tree, label propagation).
## Examples
SKI calculus:
```lisp
; SKI calculus
(defun SKI x
(match x
((((S 'x) 'y) 'z) (tie (tie x z) (tie y z)))
(((K 'x) 'y) x)
((I 'x) x)
(('x 'y) (tie (SKI x) (SKI y)))
('x x)))
converge SKI '(((S I) I) K)
```
List operations and point-free programming:
```lisp
; Take numbers from 0 to 9999, sum the resulting list and its reverse,
; then take the amount of unique items, and verify if it equals one.
= 1 \⍴∘⊙∘[+ #0 ⌽] \⍳ 10000
; In Haskell:
; (==1) . length . nub $ zipWith (+) <$> id <*> reverse $ [0..10000]
; In APL:
; 1=⍴∪(⊢+⌽)⍳10000
```
## License
KamilaLisp is distributed under the GNU General Public License v3. See [LICENSE](https://github.com/kspalaiologos/kamilalisp/v0.2/main/LICENSE) for details.
## Lisp Roadmap
- MalbolgeLISP v1.0-v1.2 - initial prototypes.
- KamilaLisp v0.1 (beta) - initial Java prototype, concept exploration.
- KamilaLisp v0.2 (beta) - design solidifying, API documentation.
- KamilaLisp v0.3 (release) - polishing more features, improved non-beta versioning scheme.
- KamilaLisp v0.4 (WIP) - a compiler and bytecode virtual machine.
# v0.3 versioning guide
Every KamilaLisp v0.3 release will be signed with PGP and package maintainers are advised to verify the signature. Every release will be tagged as `0.3.x.y` where a bump of `x` signifies a breaking change, while the bump of `y` signifies a non-breaking change.
", Assign "at most 3 tags" to the expected json: {"id":"8271","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"