Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



SBCL'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).


Also, 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.


Roswell 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://github.com/fukamachi/woo https://github.com/fukamachi/ningle

p.s. Not the author, but a big fan.


Last I tried it's not reliable. E.g. generating binaries through VM images is coin toss.


Just 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.)


You might find Fennel interesting:

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.


If 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.


That's interesting, you are right, same person.


You might like TXR Lisp.

https://www.nongnu.org/txr


> recompile on error and continue

I'm not familiar with this. Anyone care to explain?


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.


SBCL is so large because it's not particularly optimized for size. A stripped libecl.so is a couple of megabytes.


I just tested this in Allegro CL 10.1: with and w/o the compiler: 15MB and 11MB.


Why not just use a smarter compiler/linker that trims out unused library code?


Some CL implementations do this ("tree shaking", as it is called). But some of the more popular open-source implementations (SBCL, Clozure CL) do not.


It 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.


Can 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.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: