6 ms·
I kind of wish there was a lisp with the "recompile on error and continue" feature of Common Lisp but without a massive standard library. A standalone SBCL prog
by nonbirithm 7y ago
I kind of wish there was a lisp with the "recompile on error and continue" feature of Common Lisp but without a massive standard library. A standalone SBCL program seems to be around 40MB at minimum. It feels like it would be doable if only CL wasn't designed with the kitchen sink included. Recently I've gotten into Janet[0] and really like the language, although I do miss CL's recompilation magic at times. It feels like a Lisp dialect with similar style to Lua: tables, coroutines, small language core, embeddable as a single C file, etc.
[0] https://www.janet-lang.org https://www.janet-lang.org
- kazinator 7y agoYou might like TXR Lisp. https://www.nongnu.org/txr https://www.nongnu.org/txr
- lispm 7y agoSBCL's programs are 40MB because they contain all dev tools and the code is native code, which is also large. There are a bunch of Common Lisp implementations which are smaller (CLISP), can create small applications (Lispworks), can be embedded (ECL) or can compile to smallish C code (mocl).
- sansnomme 7y agoAlso, Common Lisp's standard library cannot compare to Python, Java etc. They have a lot of language manipulation tools but not actually anything that will help you ship quickly if you are building generic CRUD style applications. CL tends to shine when it comes to extremely domain specific niche stuff where you practically have to write your own tooling from scratch.
- soiheard 7y agoRoswell comes to mind for application building and distro management. Add in ningle for web app building and woo for the server (the benchmarks are really good), and you're basically good to go. I think the main problem is there's too many implementations of the same thing in CL, so devs basically have to agree on a very specific subset of tools for every project, which adds a fair bit of overhead. https://roswell.github.io/ https://roswell.github.io/ https://github.com/fukamachi/woo https://github.com/fukamachi/woo https://github.com/fukamachi/ningle https://github.com/fukamachi/ningle p.s. Not the author, but a big fan.
- sansnomme 7y agoLast I tried it's not reliable. E.g. generating binaries through VM images is coin toss.
- xenophonf 7y agoJust clang on my system is around 80MB, so when you consider that an SBCL image includes a compiler, a linker, and a loader—and if you have Quicklisp installed, a build system and a package manager—40MB starts to look like a bargain! I personally wonder if CL's "computer program as an image" instead of the Unix process-oriented architecture will see a comeback in this modern era of virtualization and rump kernels and containers. In theory a Docker image for an SBCL program would be just the Lisp image itself plus the small handful of standard POSIX libraries on which the Linux version of SBCL depends (e.g., libc, libm, libpthread, etc.)
- FPGAhacker 7y agoYou might find Fennel interesting: https://github.com/bakpakin/Fennel https://github.com/bakpakin/Fennel It's a lua based lisp. Technomancy of clojure fame has taken a shine to it and become a large contributor.
- mindB 7y agoIf it's the same project I'm thinking of, Janet is actually by the same developer as fennel. Janet was kind of his followup project to fennel.
- FPGAhacker 7y agoThat's interesting, you are right, same person.
- klipt 7y agoWhy not just use a smarter compiler/linker that trims out unused library code?
- gmfawcett 7y agoSome CL implementations do this ("tree shaking", as it is called). But some of the more popular open-source implementations (SBCL, Clozure CL) do not.
- darkpuma 7y agoIt can also be error prone. Analysising arbitrary lisp code to see which functions could conceivably ever be called isn't as trivial as it might first seems.
- dTal 7y agoCan you elaborate? It seems trivial - just scan every function call. Surely it's not possible to call a function without typing its name somewhere? (Obviously if there's funny business with 'eval' this won't work, but then it reduces to the halting problem in the general case so that's fine. Most programs don't use eval.)
- dmos62 7y ago> recompile on error and continue I'm not familiar with this. Anyone care to explain?
- Jtsummers 7y agohttps://malisper.me/debugging-lisp-part-1-recompilation/ https://malisper.me/debugging-lisp-part-1-recompilation/ That's a good example. When an error is signaled you're able to modify the program (via recompilation of functions, changing of values) and restart at a point you select. There are other things you can do, but this is a particularly powerful option.
- aidenn0 7y agoSBCL is so large because it's not particularly optimized for size. A stripped libecl.so is a couple of megabytes.
- e40 7y agoI just tested this in Allegro CL 10.1: with and w/o the compiler: 15MB and 11MB.