Go to file
VaclavT b7fd6a9411 readme updates 2021-05-20 23:05:41 +02:00
.vscode doc updates 2021-03-15 23:37:05 +01:00
clib print ascii code of a character (ktoi) 2021-05-15 00:02:06 +02:00
doc date functions added 2021-05-20 23:03:03 +02:00
stdlib date functions added 2021-05-20 23:03:03 +02:00
tests date functions added 2021-05-20 23:03:03 +02:00
tmp debug changes 2021-03-07 17:23:09 +01:00
utils rename utils 2021-05-20 23:05:00 +02:00
.gitignore small lisp updates 2021-02-21 21:53:45 +01:00
CMakeLists.txt split by regexp and [rl]tring added 2021-03-24 00:18:27 +01:00
Readme.md readme updates 2021-05-20 23:05:41 +02:00
debug.lsp todo update 2021-05-10 19:25:23 +02:00
ml.cpp MlValue::is_string added 2021-05-15 23:43:24 +02:00
ml.h MlValue::is_string added 2021-05-15 23:43:24 +02: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 slightly nicer code 2021-05-03 18:29:29 +02:00
ml_io.h include path changes 2021-02-26 09:49:01 +01:00
ml_profiler.cpp stack trace at this moment only for main thread 2021-05-03 18:31:26 +02:00
ml_profiler.h stack trace at this moment only for main thread 2021-05-03 18:31:26 +02:00
ml_string.cpp added two string functions, doc updates 2021-05-10 19:07:50 +02:00
ml_string.h itok function implemented 2021-05-10 19:14:35 +02: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
  • better error reporting..for example ls_dir on non existing dir should prind pwd dir

TODO

  • add debug support, at least call stack
  • multiline editing (kilo editor)
  • execute system command should capture stderr
  • add some mem stats to benchmark
  • create pastebin like web using ml

Code

  • documentation
  • rename constants in ml_profiler.h
  • replace to_string macro in ml.cpp
  • add url of source/inspiration to clib/*.cpp
  • add instrumentation (time, nr of evals, num of atoms, debug info, debug environment etc)

Language

  • support for "t" symbol as a true
  • support for exceptions
  • string functions
    • compare - needed for sorting, cmp ignore case
    • 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
  • add include-stdlib function for other libs in stdlib dir (during startup stdlib.lsp is loaded only)
  • syntax highlighting do VS Code

Performance

  • define is one of most frequent callee, when in scope with very few vars, lookup sequentially
  • first, second are often called -> implement in c++
  • 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, scope ..) repeatedly assign to acc

Compile

mkdir -p build
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 ml_profiler.cpp clib/json11.cpp clib/csvparser.cpp clib/sslclient.cpp clib/printf.cpp
// on linux c++ -o build/ml -O2 -L/usr/local/lib -L/usr/local/opt/openssl/lib -lm -lstdc++ -lcrypto -lssl *.o
c++ -o build/ml -O2 -L/usr/local/lib -L/usr/local/opt/openssl/lib -lm -lstdc++ -lcrypto -lssl -Wl,-stack_size -Wl,0x1000000 *.o

// or cmake

Install

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

or

utils/local_install.sh

Example of use

ml -f tests/test.lsp

https://github.com/adam-mcdaniel/wisp https://github.com/dropbox/json11 https://github.com/antirez/linenoise

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