libera/commonlisp - IRC Chatlog
Search
5:16:04
qhong
recalling the discussion about software longevity a few days ago, what you guys think about a Nix/Guix replicate that runs in a single Lisp image a la asdf?
5:30:07
kagevf
I use guix to install nyxt since that's the only way I could figure out how to get all the right versions of nyxt, sbcl, and emacs ... necessary to connect to nyxt's swank server from slime
5:32:31
kagevf
qhong: what would the nix/guix inside CL do? find, and build CL systems? and allow easy switching between different versions? and also act as a package manager? so it would replace asdf and QL, plus add the versioning?
6:07:49
qhong
kagevf: I also think that reproducibility is a pain point of the status quo of CL eco-system. Hyrum law is real. I have no hope contemporary CL projects still work after just 20 years
6:19:18
qhong
mfiano: AFAIU CLPM is akin to a traditional package manager (ala pip, npm etc) rather than a functional pm
6:21:45
mfiano
Of course. Many existing software systems rely on stateful actions during installation. ASDF is programmable to do anything you could want.
6:22:59
lisp123w
kathe: I was trying Sly recently last week but had some pretty bad experiences so reverted to Slime
6:23:44
lisp123w
But in general Sly has some more advanced features (like stickers, which allows to mark a region to get automatic printing on the output) and a better search
6:24:09
moon-child
qhong: cl is in general ideologically aligned towards flexibility over analyzability
6:26:05
qhong
UNIX (and UNIX toolchain) allows as much flexibility (albeit much more poorly designed) on its FS state as CL (and ASDF), yet ppl eventually curse it and invented Nix/Guix
6:27:50
moon-child
mfiano: well, that is interesting, because jails encapsulate non-referentially-transparent things (such as network devices). Probably not super relevant to present discussion
6:28:26
moon-child
qhong: in particular, I can trivially calculate (and isolate) the closure of some object in unix, but not in lisp
6:28:32
qhong
As for edge cases, Nix/Guix has to deal with them manually too and it doesn't seem like too much a practical issue
6:29:08
moon-child
and I can observe all the side effects of an arbitrary operation (see ptrace, dtrace, this has been effected in practice)
6:29:08
qhong
mfiano: I understand you can certainly break it, my question is how many packages actually do it
6:30:36
moon-child
qhong: the closure of an object is the set containing that object and all the objects it points to
6:30:48
moon-child
(actually, the implementation generally gets such a closure, e.g. for fasls; but you do not)
6:31:27
qhong
moon-child: you mean one can get who-reference for arbitrary datum? damn I always want it so hard when CLing
6:31:41
lisp123w
kathe: I think Sly works better for multiple REPLs (I was doing a setup where I had SBCL / CCL / CLISP all on 1 command each), but I didn't want to spend time debugging the issues I had (lag on remote connection to an Image, some other strange bugs) so I reverted to Slime and it suited me.
6:32:35
lisp123w
kathe: However, the stickers thing in SLY is really good - so don't discount it based on my words. Its just that I was doing some bespoke setups which Sly had some issues on my machine
6:33:29
EdLangley[m]
Lispworks's delivery system can do a bunch of stuff that's unsafe if symbols are interned dynamicaly
6:34:12
kathe
lisp123w: thanks. on a different note, would you suggest that i learn to work with emacs in parallel with learning common lisp?
6:34:46
mfiano
Can you take care of dynamic runtime code that generates symbols looking for a specific package with uiop:symbol-call, alexandria:format-symbol in macro's, etc?
6:35:43
qhong
Basically, before build, all dependency are renamed to their nominal names, and after build, all dependencies plus newly created packages are renamed to their unique name
6:36:25
mfiano
I wouldn't want anything to do with such restrictions, but then again, I don't like Linux either.
6:36:49
lisp123w
kathe: Yes, it will be useful for many reasons I won't go into. The trick with Emacs is read the tutorial and guide (don't just jump in), then learn the keybindings C-h k (which lets you see what a keystroke does), C-h f (which describes function at point), C-h v (which describes variable at point), C-h b or C-h m (to see what keybindings are active in the buffer). But I'll shut up now (you can ask #emacs for more help there)
6:37:17
EdLangley[m]
And I can tell when a system uses them, because inevitably my preference of doing (setf print-case :downcase) breaks loading such systems :)
6:38:32
mfiano
ACTION is amused at the thought of #'(setf documentation) being changed when you look at it.
6:41:09
qhong
Actually I think there is an outrageous hack to make macros finding specific package at runtime still work
6:41:41
qhong
First I assume they will use keyword symbols instead of strings, then we can unintern those keywords after each build, and hack `find-package` so they recognize such keyword
6:43:14
lisp123w
EdLangley[m]: !!! Thank you for that archaic macro, very useful to protect against unintended consequences
6:47:23
EdLangley[m]
So, I think the best way (at the moment) to make building systems deterministic is to compute a dependency graph of the system you want to load and then do a depth-first postorder traversal of the graph, building each system you encounter in a subprocess
6:52:32
qhong
EdLangley[m]: hmm, interesting. so, because we can't do isolation in Lisp, let's use UNIX process virtualization to do isolation
7:46:36
kathe
phoe: i assure you that i will definitely buy the book, only i want to be ready for it. :)
7:46:43
moon-child
I dare say if you have completely learned common lisp you will not get much value out of the book, but
7:47:47
kathe
phoe: will you please consider writing a similar walk-through for 'clos' using 'mop'? currently there are disparate books, mostly going beyond what's really required to work under common lisp.
7:49:25
phoe
the only sane way to access keene's book is to *somehow* grab a physical copy or to visit Library Generic
7:51:07
moon-child
https://www.abebooks.com/products/isbn/9780201175899?clickid=WmHzvNy54xyIWLPUVSRa73dbUkGyAWwJITkbUg0&cm_mmc=aff-_-ir-_-64682-_-77798&ref=imprad64682&afn_sr=impact
7:57:05
mfiano
Hmm I think I'll read this book this weekend. Looks like I will enjoy it better than AMOP. I found too many errors in that book that stunted my learning and questioned my sanity.
7:58:28
phoe
kathe: if you're alluding to TCLCS, I simply had enough reviewers from all over my known Lisp world
8:00:25
phoe
the main issue with keene book is that some examples don't really work anymore, and they're kind of badly chosen (e.g. the lock primitive)
8:00:36
kathe
phoe: the 'mit' press book explains 3 different approaches to 'mop' implementation without relying on common lisp.
8:00:50
phoe
and paepcke's is kind of a collection of articles rather than a singular and consistent book
8:09:09
phoe
kathe: https://www.reddit.com/r/lisp/comments/6qc61v/second_edition_published_interpreting_lisp/dkw66fl/
11:19:34
kathe
looks like it's either going to require extreme dedication for me to erase 24 years of ingrained key-stroke muscle memory, or i'm going to have to use "vim + vlime".
11:20:57
kathe
emacs has this interesting thing called buffers which become useful when grabbing code from/to the emacs email client, emacs code editor, emacs irc client and org-mode.
11:23:03
kathe
it would allow me to never take my hands off the keyboard and not have to switch between multiple onscreen windows for various applications. emacs has all of it in one place. in addition to having fantastic support for common lisp development.
11:44:24
ns12
How do BSD users get their Common Lisp libraries if they do not use Quicklisp? The ports tree for FreeBSD, NetBSD, and OpenBSD are mostly devoid of Common Lisp libraries.
11:46:15
kathe
ns12, i don't think there are very many common lisp developers working on any of the 'bsd' systems.
11:51:32
phoe
ns12: it doesn't, at least for me on mostly default evil settings - but I use smartparens instead
12:04:51
ns12
kathe: So what OS do Common Lisp programmers use? Linux? Some Linux distributions use NetBSD's ports tree (pkgsrc). There are zero Common Lisp libraries in pkgsrc.
12:11:09
phoe
they are a constant source of anguish and conflicts to anyone who has them installed and wants to use e.g. Quicklisp
12:14:15
ns12
Isn't that ASDF's fault for not allowing users to arbitrarily add/remove/reorder the directories where libraries are found?
12:16:48
ns12
AFAIK, it is not possible to make ASDF ignore a single directory such as /usr/share/common-lisp/cl-asdf/
12:19:20
ns12
Suppose I have installed many Common Lisp libraries using APT. The libraries get installed in /usr/share/common-lisp/ (e.g. /usr/share/common-lisp/cl-lib1/, /usr/share/common-lisp/cl-lib2, etc.).
12:19:20
ns12
How do I make ASDF completely ignore the existence of /usr/share/common-lisp/cl-lib1/ only?
12:20:14
phoe
(let ((asdf:*central-registry* (remove #p"/usr/share/common-lisp/cl-lib1/" asdf:*central-registry* :test #'equalp))) ...) ?
12:21:32
ns12
asdf:*central-registry* is NIL by default, so there is really nothing to remove from it.
12:22:15
ns12
"I'd simply clone cl-lib1 into my local-projects and have this one provide cl-lib1.asd" - Yes, but then ASDF will complain/warn that there are two different versions of the same library ...
12:23:42
phoe
I do not have a lot of practical ASDF experience, I use it for simple cases most of the time
12:23:45
ns12
"I have no idea how to exclude it the "proper" way" - I actually have no idea whether or not it is possible. I'll read the docs again (for the fourth time...).
12:25:19
ns12
Me too, I use it for simple cases most of the time. I just have not figured out how to make ASDF ignore one single library at a specified filepath.
12:35:01
_death
maybe something like putting (:source-registry (:exclude "cl-lib1")) in ~/.config/common-lisp/source-registry.conf (I've not tried it.. check the manual for more info)
12:56:41
phoe
minion: memo for marcoxa: a CDR idea would be to make DESCRIBE for symbols configurable, so e.g. if I create some custom namespace mapping from symbols to my custom objects, I can have this reflected in (describe 'foo); the portable DESCRIBE-OBJECT mechanism doesn't allow for that.
13:04:20
phoe
_death: I'm looking at LISP-NAMESPACE and the horrible hack it uses for actually adding things to DESCRIBE output
13:04:45
phoe
and the worst thing is that it seems to work, and that LISP-NAMESPACE is the 51st most popular Quicklisp system
13:06:58
_death
just because someone wrote something doesn't mean it's a good idea?.. and just because it's been downloaded many times doesn't mean it's popular (= used by many)
13:09:50
beach
Perhaps it is best to supply something entirely different both for DESCRIBE and DOCUMENTATION. I mean, no other module depends on them, so we might as well design a new mechanism for them.
13:10:28
beach
That way, we could plan for internationalization, for instance, but also for something other than raw text for DOCUMENTATION.
13:12:35
phoe
I assume we could use a client technique to pass additional arguments to DESCRIBE or DOCUMENTATION, just like Eclector does with READ
13:14:13
Shinmera
Granted, I never had the time to actually make use of it. But I hoped it would find some use when the Radiance documentation was translated into Japanese. Sadly it never got beyond the primary documentation file (so no docstrings were localised)
13:14:46
beach
Anyway, I was also thinking of structured documentation that can contain links, and that can be presented in different ways.
13:15:40
Shinmera
I think someone here used my documentation-utils package with an extension of their own to provide structured docstrings that are then just compiled down to a plaintext version for backwards compat.
13:25:11
phoe
...the elephant in the room that is here is that none of the implementations seem to define an :AFTER (SYMBOL T) method on DESCRIBE-OBJECT
13:35:03
_death
so there's a semantic network project called sneps.. sneps3 is from 2012 and seems to use ltk/common-graphics or a java gui.. it also has allegro-specific code for loading (no asdf), wonder how much effort would be needed to get it to work portably.. and it seems they decided to rewrite in clojure :o
13:41:38
_death
with some gamedev toolkit (trial) maybe an interface like http://www.wikiwebapp.com/ can be written for introspecting the lisp image
13:56:46
_death
I did just try some alloy examples, and seems to mostly work.. menu-bar items appear to have wrong widths (maybe has something to do with stumpwm?)
13:57:43
Shinmera
fwiw we just released a jam game written using Trial that's fully open source: https://github.com/Shinmera/vpetjam with binaries / screenshots here: https://shinmera.itch.io/vegetablemash
13:59:03
Shinmera
_death: The glfw backend uses the fond text renderer, which is abandoned. The maintained backend is the msdf renderer, but that one requires precompiling texture atlases for fonts using an external tool. |3b| has been working on the pure-lisp version of that for some time, and hopefully it'll be ready for use this year so I can switch to that and purge the fond one.
14:07:55
morganw
Could I ask, was there ever a working prototype or theory about how to run a Common Lisp game on Android or iOS?
14:25:30
foxfromabyss
Is there a better way of searching for a library, than querying this? https://www.quicklisp.org/beta/releases.html
14:27:13
phoe
is there anything in the spec that guarantees that (let ((x 1) (x 2)) x) will signal an error?
14:29:27
foxfromabyss
Is it also possible to find the source code for a quicklisp library? specifically looking for a readme or smth similar
14:29:45
phoe
foxfromabyss: https://github.com/quicklisp/quicklisp-projects/tree/master/projects/zpb-ttf
14:30:00
foxfromabyss
yes but .. i am *searching* for a library and not sure if the one i found is the one I am looking for
14:53:04
epolanski
hey all, pretty new to common lisp. I wanted to ask if there's some library to write html front ends in pure common lisp. I don't really need much js interop I can implement all I need on my own
14:56:49
epolanski
interesting I want to give it a spin, I have recently released a pet project and since I have already all E2E tests setup I thought it would be nice to create an experimental branch and TDD the same application in a different language, possibly common lisp
15:18:38
epolanski
ok but generating templates is one of the issues, what about interacting with dom APIs?
15:19:57
epolanski
e.g. making SPAs in scala, elm, haskell, ocaml is possible, wonder if that's true for common lisp as well
15:22:24
epolanski
can I use something like https://github.com/cxxxr/valtan to implement some bindings to JS apis?
15:23:17
Shinmera
You can use stuff like Parenscript to pretend like you're writing CL which is then spit out as JS
15:24:07
Shinmera
There is currently no full implementation that can compile to JS, and it is unlikely it would be worth it anyway, due to the runtime size imposed by the CL standard.
15:26:17
Shinmera
Common Lisp is a big standard, with a lot of stuff that is needed to make an implementation compliant. For instance, the entire compiler needs to be available at runtime. By necessity this makes the runtime large.
15:26:20
epolanski
I'm new to CL but I've read that many CL functions are not implemented in CL itself but, e.g. in C
15:29:13
Shinmera
epolanski: To preempt things, how functions are implemented is an implementation detail. However, all implementations that are in serious use implement most of their library in CL. C is only really used to interface with the operating system or to implement very hairy things like the GC.
15:29:14
epolanski
I'm not ultra fond of the book to be honest, not as much as I was in SICP when I've first read it
15:31:23
minion
epolanski: please look at PCL: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
15:32:57
epolanski
Shinmera: then I guess that it's similar to how JS node makes syscalls implemented in a different language.
15:33:34
beach
epolanski: And you can remove Land of Lisp from your list. It contains so many errors that it is embarrassing, and it is likely to give the reader many incorrect ideas.
15:34:55
aeth
iirc, Land of Lisp has a whole chapter that only works in CLISP, which hasn't had a stable release in over 10 years (July 2010)
15:34:56
Shinmera
Snide comment: "don't trust hacker news" seems like a generally applicable recommendation :)
15:35:22
aeth
and imo CLISP was never that good of an implementation unless you needed low RAM (because it's bytecode interpreted, not native compiled)
15:36:41
pve
Clearly there should exist a "html templating library construction kit", that makes the user answer questions like "Name of library?", "Use CLOS? Y/N", "Single or multiple packages?", "Coding style? [80's, 90's, ...]" etc and then output the library. This way people could get the feeling of rolling their own, without wasting a bunch of time ;)
15:37:12
Xach
There are a few users who post good/interesting Lisp info on HN. I follow lispm, mikelevins, reikonomusha and a few others directly via https://hnrss.github.io rather than going to the site.
15:38:06
aeth
HN was always about startups... Lisp and programming-in-general content has gone down and complaining-about-housing-costs-in-SF has gone up as the bull market rallies for over a decade now.
15:49:45
_death
I found land of lisp entertaining, but I was not a newbie at the time, and I wouldn't recommend it to newbies
15:54:33
aeth
tyson2: well, my impression at the time, and it has been years, is that it seemed oudated.
15:56:25
aeth
my impression of PCL is that it doesn't seem... linear? I definitely read the chapters out of order as needed
15:57:48
tyson2
I decided not to try using PCL on windows, will install it in WSL (probably using Docker image), and develop from emacs on windows, which I'm comfortable with
16:11:15
etimmons
qhong: Since you referenced the discussion a few days ago, I'm guessing you're also interested in loading multiple versions of the same system into the same image? Perhaps even as part of the dependency tree of a single project?
16:11:27
etimmons
If so, I think your rename-package hack will also likely make generic functions way less useful.
16:11:50
etimmons
Let's assume there's a system (and package) FOO. It defines the class BAR and has a generic function BAZ with a method specialized on BAR.
16:12:05
etimmons
Then I have a system qux that somehow pulls in two different versions of FOO in its dependency tree. Let's say they're renamed to FOO@1 and FOO@2.
16:12:16
etimmons
Under the current practice, it'd be completely fine to share instances of BAR across different branches of the dependency tree.
16:12:32
etimmons
But if that happens with the rename-package hack, you'll likely end up calling FOO@2:BAZ on a FOO@1:BAR instance. No such method exists for that: boom.
16:15:08
etimmons
beach: I really need to read your paper on that. It's very interesting to me, but so far I've been inferring capabilities based on what other people are saying
16:16:10
beach
The only invention is the cell thing to make function calls as fast as in typical Common Lisp implementations.
16:16:17
qhong
etimmons: I'm still thinking about what reproducible mean under CL context. I think the problem stems from the absence of distinction between "software" and "config" in Lisp system. Different version of "software" should be definitely isolated, but maybe not so config. We may heuristically count all special variables and generic functions as configs.
16:16:44
etimmons
I guess my biggest question is how can different environments interact (if at all). That's not something I've been able to glean from listening to others
16:17:38
phoe
EdLangley[m]: the main issue with GENERIC-{FLET,LABELS} is the special operator CL:FUNCTION - we want it to return the GF itself, rather than some intermediate function that wraps over it (as would be the case with FBIND)
16:19:19
phoe
_death: https://www.reddit.com/r/lisp/comments/s1itqi/the_common_lisp_omnificent_gui_online_lisp/
16:19:39
phoe
tyson2: https://www.reddit.com/r/lisp/comments/s1itqi/the_common_lisp_omnificent_gui_online_lisp/
16:22:22
phoe
EdLangley[m]: it seems that a real GENERIC-FBIND trying to bind a function named FOO would need to bind a generic function object as some lexical variable #:FOO, then walk the body form and rewrite it in order to replace (FOO ...) calls with (FUNCALL #:FOO ...) and value occurrences of #'FOO with just #:FOO
16:22:49
phoe
and that's ugly but necessary if we want CL:FUNCTION to work correctly in that context
16:23:44
phoe
either that, or get an implementation-defined FBIND, or use some kind of DEFGENERIC-with-an-anonymous-name trickeries like that post mentioned
16:41:49
Bike
i wonder if an fbind could be useful for other things. if not generic functions, some other kinds of funcallable instances.