Go to file
VaclavT fcb3b4c5c5 int is dead, long live long type! 2021-03-17 23:56:02 +01:00
.vscode doc updates 2021-03-15 23:37:05 +01:00
clib int is dead, long live long type! 2021-03-17 23:56:02 +01:00
doc fixes & enhandcements 2021-03-14 16:15:04 +01:00
stdlib stdlib get-env added 2021-03-15 23:23:55 +01:00
tests doc updates 2021-03-15 23:37:05 +01:00
tmp debug changes 2021-03-07 17:23:09 +01:00
.gitignore small lisp updates 2021-02-21 21:53:45 +01:00
CMakeLists.txt fixes & enhandcements 2021-03-14 16:15:04 +01:00
Readme.md doc updates 2021-03-15 23:37:05 +01:00
debug.lsp fixes & enhandcements 2021-03-14 16:15:04 +01:00
ml.cpp int is dead, long live long type! 2021-03-17 23:56:02 +01:00
ml.h int is dead, long live long type! 2021-03-17 23:56:02 +01:00
ml_date.cpp int is dead, long live long type! 2021-03-17 23:56:02 +01:00
ml_date.h int is dead, long live long type! 2021-03-17 23:56:02 +01:00
ml_io.cpp int is dead, long live long type! 2021-03-17 23:56:02 +01:00
ml_io.h include path changes 2021-02-26 09:49:01 +01:00
ml_string.cpp string pad/rpad/lpad 2021-02-28 12:53:06 +01:00
ml_string.h string pad/rpad/lpad 2021-02-28 12:53:06 +01:00
ml_util.cpp move list of builtins to ml_util.cpp 2021-03-15 23:24:58 +01:00
ml_util.h fixes & enhandcements 2021-03-14 16:15:04 +01:00

Readme.md

BUGS

  • (read-file "nonexisting/file.csv") shows only "could not open file" - should print filename

TODO

  • documentation
  • add url of source/inspiration to clib/*.cpp
  • add stdtest - to test every functionality
  • add -l option (no linenoise)
  • rename ivaluize
  • add instrumentation (time, nr of evals, num of atoms, debug info, debug environment etc)
    • add -p (profile/performance option)
  • add debug support function call could keep call stack
  • add better print (coloring output)
  • multiline editting (kilo editor)
  • execute system command should capture stderr
  • add built in for and, or
  • add some mem stats to benchmark
  • support for (), nil, t, in lsp code replace 0 by nil in logicals
  • 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; set-env cannot be implemented in stdlib.lsp, because popen is in fact subshell
  • format (sprintf)
  • setq
  • mapcar (funcall, apply)
  • syntax highlighting do VS Code
  • add hash datatype
  • create pastebin like web using ml

Performance

  • push_back - repeatedly without reserving size
  • range - with for(int i...) and reserving result size can be 3times faster on (range 1 10000)
  • mini_sprintf - unnecesary copying between vector and list
  • (do ..) repeatedly assign to acc, maybe somewhere else

Install

cp build/ml /usr/local/bin/ml
cp stdlib/*.lsp /usr/local/var/mlisp/

Compile

gcc -std=c99 -c -O2 -o linenoise.o clib/linenoise.c
c++ -c -O2  -I/usr/local/opt/openssl/include -Iclib --std=c++17  ml.cpp ml_io.cpp ml_date.cpp ml_string.cpp ml_util.cpp clib/json11.cpp clib/csvparser.cpp clib/sslclient.cpp clib/printf.cpp
c++ -o ml -O2 -L/usr/local/lib -L/usr/local/opt/openssl/lib -lm -lstdc++ -lcrypto -lssl -Wl,-stack_size -Wl,0x1000000 *.o

or cmake

Example of use

time ./build/ml -c '(include "../example.lisp") (print (fact 1000))'
./build/ml -f debug.lisp

https://markdowntohtml.com/ 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