I like ECL for its ability to compile Lisp to C and have a native executable. One dream I have is to write a game using the CL-SDL2 bindings and cross compile it for Wasm; It seems possible to do now but the flow isn't very well defined. I got pretty close hacking around a month or two ago but didn't quite finish.
That's why the support is "preliminary". I plan to write some compelling examples for the emscripten target. Here is a "raw" build that shows repl (on some browsers results of evaluation show in the javascript console): http://turtleware.eu/static/ecl/ecl.html -- this is a little older build, but following instructions in INSTALL will get you to the same place.
Thanks! I think that the number of changes between ECL and MKCL is quite big. ECL had a short break in development between 2013 and 2015, other than that it is an actively developed project.
Janet is not an implementation of common lisp, so you cannot run lisp code with it. ECL is an implementation of common lisp, so it can run common lisp code.
If you don't care about running common lisp code, you can get up and running in janet more quickly.
In terms of ease of embedding in C code, a comparison of different languages IME would be Lua/Fennel > Janet > Chibi Scheme > Guile Scheme > ECL.
yes, objective C is a superset of C, so you can include janet's amalgamation follow the regular embedding steps. i'm sure you can get it running from swift as well.
Tangential: I wanted to embed a sane sandboxed scripting language in a node app and found… nothing. Only options were a completely broken node sub vm, half-broken js sandbox which isn’t maintained and slightly less half broken js sandbox?
Does everyone roll their own when they need to embed logic expressions in their yamls?
I've wondered the same. There's https://jsonlogic.com/ but that seems like a data interchange format for logic, not something an end user or developer would write themselves.
Lua is usually the embedded language of choice. If you are focused on security, you could check out the Roblox fork, Luau (https://github.com/Roblox/luau) where the creators took extra care to lock down the language on what scripts could do.
I am just installing from source on the tiny Linux laptop I travel with. Until recently I always paid for a LispWorks Pro license, but after retiring check out dropped that and am just using SBCL. I like the idea of having a "second Common Lisp" so I want to try out a Emacs+Slime workflow.
It would be interesting to see if writing "shell scripts" in ECL and compiling to small static binaries would work in terms of startup and execution speed.
While simple scripts can produce binaries as small as simple C programs, you are forgetting that dynamically loading libraries has its own cost. e.g. a "hello world" on my machine is a 50 kb binary, which sounds awesome, but running otool on the binary shows a different story.
hello:
@rpath/libecl.21.2.dylib (compatibility version 21.2.1, current version 0.0.0)
/opt/local/lib/libgmp.10.dylib (compatibility version 15.0.0, current version 15.1.0)
/opt/local/lib/libgc.1.dylib (compatibility version 7.0.0, current version 7.2.0)
/opt/local/lib/libffi.8.dylib (compatibility version 10.0.0, current version 10.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
Depending on how many dynamically linked libraries you have to load, this can result in lower runtime performance than simply using e.g. Clozure CL, which has pretty fast startup time (approx. 13 ms on my machine) but much larger binaries since the binary is essentially self-contained and contains a whole CL implementation, runtime, kernel, etc. inside.
Yes I have found that in my testing of other compiled programs, where you have a choice between dynamically loaded libs and compiling fully static. It would be a trade-off and even on simple programs there is a difference in RAM usage and execution time due to the overhead.
21 comments
[ 4.7 ms ] story [ 41.5 ms ] threadThanks to the dev team :)
If I'm not mistaken, ECL is (one of a few) embeddable languages that can generate a C code and provide real threads, even if used as a library.
[1] https://gitlab.common-lisp.net/mkcl/mkcl
https://news.ycombinator.com/item?id=23164614 https://news.ycombinator.com/item?id=28255116
If you don't care about running common lisp code, you can get up and running in janet more quickly.
In terms of ease of embedding in C code, a comparison of different languages IME would be Lua/Fennel > Janet > Chibi Scheme > Guile Scheme > ECL.
Does everyone roll their own when they need to embed logic expressions in their yamls?
It's mature and fully sandboxed.
https://github.com/babashka/nbb
https://www.biwascheme.org/