freenode/#lisp - IRC Chatlog
Search
6:37:12
v0|d
beach: is there a way to make a very tiny lisp image that removes all the unused functions removed?
6:38:20
v0|d
I mean, GHC can actually compile programs to a small binary w/o repls or anything but a main().
6:40:19
Shinmera
it's called tree-shaking. Most implementations don't offer it because people have plenty of RAM and disk space now.
6:41:36
aeth
I think one problem is that large Lisp programs will probably use most of the language, especially if they're using dependencies that can be very stylistically different from each other.
6:42:06
edgar-rft
it sounds easier than it is because you need to remove all unused implementation-internals, too
6:42:22
aeth
Right, the implementation internals might also use stuff like e.g. structure-objects even if you don't use any
6:52:35
edgar-rft
v0|d: how so what? tree shaking implementation internals or writing a micro assembler
6:55:12
edgar-rft
every ANSI CL function must be defined from something. This "something" must be removed from the final binary, too. What "something" is depends on the Common Lisp implementation.
6:57:40
jackdaniel
(example: small forth interpreter written in C used to bootstrap some functions and target compiler may be a part of a final runtime too)
7:00:09
edgar-rft
the question was howto reduce the size of a binary and the discussion was howto write a treeshaker
7:02:02
edgar-rft
jackdaniel: but it was said that ECL produces small binaries, maybe you're the right man to help :-)
7:03:20
jackdaniel
of course such runtime would only carry bytecodes compiler (but binary itself may be compiled to native beforehand), no ASDF etc
7:04:31
jackdaniel
needless to say, you may add module loading on demand (if present in form of fas files) - that way you may add compiled native module to a runtime
7:07:49
jackdaniel
McCLIM aligning text to right, wrapping by word against a margin and aligned vertically *above* bottom margin: http://i.imgur.com/Vbnr6Qx.png
13:24:16
pierpal
anyway I recommend you this book https://www.amazon.it/dp/B004IASVJK it's highly educational, as are the other books by the same author.
14:52:47
HighMemoryDaemon
What's a good site for pasting my Lisp code to share a link? Hastebin, my go-to, seems to be down.
15:34:50
kilimanjaro
what's the idiomatic way to get just the first value from a call which returns multiple values
15:35:27
kilimanjaro
e.g. i have a function which ends with (gethash foo frob), but i don't want the user to see the second value
15:52:58
kenster
Streaming some lisp programming: https://youtu.be/ZYdsxGa78q4 or https://www.twitch.tv/kingherring
17:41:41
emaczen
How do you tell hunchentoot to serve an image with define-easy-handler? To serve HTML the body is just an HTML string, and so I am confused about how you would serve an image?
17:53:07
Demosthenex
ok, wait. in CL (cdr nil) is nil instead of throwing an error? maybe it's my time spent in scheme, but i thought that'd throw an error
17:55:17
Demosthenex
i always wrap assoc calls in (or (assoc :key alist) '(nil . nil)) so that i can safely cdr a default value when no key exists
17:58:57
Demosthenex
anyway, yeah, i'm enjoying common lisp. working with my son and trying to show him assoc lists.... but i guess we don't need that or for association lists ;]
18:00:31
Demosthenex
just amused that i was trying to show him a "TADAAAA" moment where it'd throw an error when we searched for a bad key, and.... instead it just returned nil. of course i was surprised l;]
18:02:24
pjb
Demosthenex: but since nil is both false, empty list, and no value, this is there reason why you can write (or (cdr (assoc key a-list)) "Hello")