mlisp/Readme.md

101 lines
3.0 KiB
Markdown

### BUGS
- (read-file "nonexisting/file.csv") shows only "could not open file"
### TODO
- support for (), nil, t, in lsp code replace 0 by nil in logicals
- casting to string (like ti int and to float)
- some performance functionality (at least counting how many times symbol was evaluated)
- documentation
- add url of source/inspiration to clib/*.cpp
- add stdtest - to test every functionality
- rename ivaluize
- add benchmark
- add instrumentation (time, nr of evals, num of atoms, debug info, debug environment etc)
- in casting functions (as_string..)
- better exception description
- add better print (coloring output)
- add command line options -h for help, -v for version, -b for no stdlib.lsp on startup
- add readline like functionality (libnoise)
- multiline editting (kilo editor)
- execute system command should capture stderr
- add builtin or lib function sleep
- add built in for and, or
- add debug support
- file functions
- name it here
- string functions
- compare - needed for sorting
- uppper/lower case
- trim
- replace
- regexp functions
- date support
- decode-universal-time
- env functions
- get env
- set env
- add hash datatype
- conversion functions like parse-integer
- in test.lisp some explaining prints
- format (sprintf)
- setq
- mapcar (funcall, apply)
#### Performance
- push_back - repeatedly without reserving size
- mini_sprintf - unnecesary copying between vector and list
#### Install
```
cp build/ml /usr/local/bin/ml
cp stdlib/*.lsp /usr/local/var/mlisp/
```
#### Compile
```
gcc -o ml -I/usr/local/opt/openssl/include -Iclib -L/usr/local/lib -L/usr/local/opt/openssl/lib -lm -lstdc++ -lcrypto -lssl -Wl,-stack_size -Wl,0x1000000 --std=c++17 main.cpp ml.cpp ml_io.cpp ml_date.cpp ml_string.cpp clib/json11.cpp clib/csvparser.cpp clib/sslclient.cpp clib/printf.cpp
```
or
cmake
### Example of use
```
time ./build/ml -c '(include "../example.lisp") (print (fact 1000))'
./build/ml -f debug.lisp
```
### Links
https://hyperpolyglot.org/lisp
https://www.tutorialspoint.com/lisp/index.htm
https://github.com/adam-mcdaniel/wisp
http://www.ulisp.com/show?1AWG
http://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/
https://github.com/dropbox/json11
#### std::vector
https://stackoverflow.com/questions/12271017/initial-capacity-of-vector-in-c
https://baptiste-wicht.com/posts/2012/12/cpp-benchmark-vector-list-deque.html
#### parse http headers in c++
```
^(?:((?:https?|s?ftp):)\/\/)([^:\/\s]+)(?::(\d*))?(?:\/([^\s?#]+)?([?][^?#]*)?(#.*)?)?
```
https://stackoverflow.com/questions/25896916/parse-http-headers-in-c
#### read stdout and stderr from popen
https://stackoverflow.com/questions/478898/how-do-i-execute-a-command-and-get-the-output-of-the-command-within-c-using-po
#### VPS providers
https://www.skysilk.com/cloud/pricing/#classId=Standard&section=2
https://contabo.com/en/
https://www.hetzner.com/de/
#### Editor
https://viewsourcecode.org/snaptoken/kilo/07.syntaxHighlighting.html
http://antirez.com/news/108
https://github.com/antirez/kilo