freenode/#lisp - IRC Chatlog
Search
21:14:59
Fare
jackdaniel, I remember my explanation: "it was not feature creep, it was mission creep"
21:16:04
Fare
jackdaniel, there certainly have been plenty of bugs in the 3.3 series. It looks much more stable now, though.
21:17:37
ralt
alright, this seems to work, and I'm pretty happy with it https://gitlab.com/ralt/ballish/-/blob/master/ballish.asd#L33-43
21:22:44
ralt
Fare: any thoughts on the link? does that look like the correct way to go? IOW does it fit your understanding of static-program-op as well?
21:25:19
Fare
ralt: you're doing it for all systems. Don't you want to do it just for one system? (say with an eql specializer)?
21:25:43
Fare
ralt, also, a system should be able to specify a :entry-point instead of setting it like that.
21:26:21
Fare
rpg, ralt found a bug in UIOP docstring, s/REGISTER-DUMP-HOOK/REGISTER-IMAGE-DUMP-HOOK/
21:26:24
ralt
Fare: that would make a lot of sense :) what about the idea behind closing those foreign libraries in a static-program-op?
21:27:06
ralt
the :entry-point thing is because calling (call-next-method) was failing, I assume because it's a :before, and cffi-toolchain is setting it that way in a :before. It's really my lack of Lisp knowledge, there.
21:27:27
Fare
ralt, it sounds to me like it makes sense, as long as you devise a sensible mechanism to reopen in a new properly initialized environment.
21:28:07
Fare
if you don't have a universal such mechanism, it can't become the default for cffi-toolchain.
21:31:24
luis
ralt: It's definitely weird that static-program-op leaves these libraries open when dumping.
21:32:24
ralt
rpg: slime-edit-definition is leading me to the giant asdf.lisp file, can't help with the line number, sorry
21:33:19
Fare
ralt: there is a recipe on how to do better in the asdf/README.md -- (map () 'load (asdf:input-files :monolithic-concatenate-source-op "asdf/defsystem"))
21:35:44
Fare
luis: There were ways around it. I could use `DEFUN*` and `DEFMETHOD*` and `DEFTYPE*` etc. at each statement instead of the wrapping.
21:37:09
rpg
luis -- I think this may be somewhat a problem with SLIME rather than anything else. I don't think it's WITH-UPGRADEABILITY specifically, since that's effectively just EVAL-WHEN.
21:38:59
Fare
it's eval-when, but also declaring every function notinline and other shenanigans to ensure functions can be upgraded.
21:43:20
Fare
a few of the with-upgradability shenanigans with :supersede might have been made obsolete by how ASDF3 preemptively upgrades ASDF early on then restarts if upgraded, vs ASDF2 that was trying to heroically upgrade itself mid-build (and failing in the hard cases).
21:44:41
ralt
luis: should I open a PR with essentially this small loop closing foreign-libraries, but leaving the system ones?
21:44:57
rpg
luis: Does M-. work the same in all lisp implementations? If not, are you specifically talking about SBCL?
21:46:03
luis
rpg: I'm specifically talking about SBCL. I /think/ it's SBCL's SB-INTROSPECT:FIND-DEFINITION-SOURCES-BY-NAME that's returning wrong results for defun* and defgeneric*
21:46:40
Fare
luis: not for defun* and defgeneric*, but for the specific content of an expanded eval-when.
21:47:27
rpg
luis: To debug slime, I have to figure out how to restore my configuration on top of master, including my waiting-for-more-than-six-years pull request :-P
21:48:35
fe[nl]ix
you don't need it if you have a way of loading the latest ASDF first thingg in the .rc file
21:49:14
Fare
fe[nl]ix, "the" .rc file? Good luck convincing 15 different vendors to agree on "the" rc file.
21:52:28
Fare
ralt, cffi-toolchain was supposed to run on SBCL, ECL, MKCL, CLISP -- and could support more with work. Be sure to keep all targets working...
21:53:17
rpg
luis: I don't know -- to be honest. I have been applying this patch on top of slime and running with it ever since.
21:54:46
rpg
I wonder if I meant to make it easier to switch back and forth? Right now one just gets to specify if one prefers the original slime behavior or the ELI behavior (merging history instead of replacing).
21:55:42
ralt
Fare: do you have a trick to run all of those? I know about roswell but am not particularly fan of fukamachi's work.
21:57:15
rpg
luis: WRT finding definitions, I'm not sure how SLIME + SBCL does this. Allegro had 2 halves to it -- the compiler recorded only the source file, I believe, and then there was a way of declaring definition forms that ELI would use to search the corresponding file buffer to find the input definition. I believe SBCL stores file position as well as just the filename. Does slime just jump to the file position? That would account for why it gets
21:58:38
Fare
ralt, roswell is not my style (I wrote cl-launch instead), but basically, you could use what comes with you debian or homebrew or nixpkgs distribution, to start with.
21:59:44
Fare
Then in fare-scripts, I wrote my own scripts to rebuild each of the implementations I care for from source, in the cases where I need recent modifications to the implementation (which was the case a lot when I was writing ASDF3 and discovering plenty of implementation bugs)
22:00:24
ralt
I'm surprised that MKCL is part of your implementations -- the little information I gathered from mailing lists and such showed little to no usage
22:00:26
Fare
(or writing cffi-toolchain and depending on Google-originated patches that hadn't made it to upstream SBCL yet)
22:01:20
Fare
ralt, it has at least one user. It also provided an alternative to ECL in the "linking, not dumping" style, so my code would remain properly abstracted.
22:02:32
rpg
luis: Cool. Tell you what, though -- if we can work out why it is that WITH-UPGRADEABILITY is confusing SBCL, I'm happy to work with you to help fix it. Do you think it's as simple as SBCL looking up to find the enclosing top level form when it decides what the definition's file position is?
22:04:15
Fare
rpg, my understanding of the WITH-UPGRADABILITY issue is that SBCL doesn't remember position information for individual forms (like CCL) but only for toplevel forms, so you'd need to break the with-upgradability into individual forms to have a different toplevel form per function.
22:04:45
Fare
At which point, you'd use defun*, etc., directly, except hoisting the eval-when in them, if still needed.
22:05:25
Fare
the ASDF3 upgrade strategy, as opposed to ASDF2, might remove the need for some eval-when's -- or not.
22:06:33
Fare
and/or you could further specialize the way ASDF upgrades itself from source, so that it does NOT call perform on each file (which breaks without the eval-when) but specially emulates their behavior without the CLOS infrastructure, specially, just when bootstrapping ASDF.
22:07:53
Fare
I don't see any great clean way to do that, and you'll have to be careful not to break the bundle operations.
22:09:14
Fare
OK. well the inner-forms are themselves expanded. When expanding, does SBCL propagate to the post-expansion forms the information from the pre-expansion forms?
22:15:58
rpg
Fare: I think that ACL ELI's way of doing this was better -- record the source file and then parse it at search time (with the ability to specify defining forms for things like your DEFUN*). Recording textual position is super-brittle if one interactively compiles forms (as, being someone who learned to program on a Symbolics, is something I do *all the time*).
22:16:37
rpg
Recording source file position is great for C, but for a non-batch-compiled language... meh
22:19:44
rpg
luis: BTW, the other long-deferred PR is one that fixes compilation from strings on Allegro.
22:20:18
pjb
rpg: true. However, lisp projects still contain a lot of static and rarely changing code. So this can still be useful 90% of the time even with lisp.
22:23:13
luis
rpg: slime's find-definition doesn't rely on position alone, so it deals perfectly well with chaging source files
22:23:48
rpg
luis: Does it? I find that for example, my compiler warnings start to wander around the file after a number of C-c c
22:24:32
luis
rpg: that's because you're using ACL and a 6-year-old SLIME :) I've fixed that in the meantime
22:24:36
rpg
I think my patch for ACL addresses this by spoofing file names (from the buffer file) when compiling interactively.
22:25:02
rpg
I don't think my SLIME is actually 6 years old -- just my PR. I have rebased it a few times since then.
22:26:09
luis
rpg: I've fixed a bunch of bugs with ACL warning positioning somewhere in the past 2-3 years
22:36:18
ralt
if someone has a hardcoded .so file somewhere, and loads it with cffi:load-foreign-library, does it become a system library?
22:42:49
luis
fe[nl]ix: what's the foreign-library type for? Yet another undocumented feature by young fe[nl]ix :)
22:45:17
yottabyte
question on yason and drakma: this works: (yason:parse (drakma:http-request "https://jsonplaceholder.typicode.com/posts/1" :want-stream t)) but if I don't have the :want-stream t, it fails. but I thought even without the :want-stream, a flexistream is returned
22:49:58
no-defun-allowed
yottabyte: possibly as one of the other values, but it may be closed already as Hunchentoot consumed the contents from it
22:55:24
Fare
if rpg is ok with expanding the with-upgradability into a tens of the same, then fine. IIRC, that slowed down compilation a bit, but that shouldn't matter much.
22:55:57
Fare
It's mostly, do we want to rewrite every defun into a defun*, every defgeneric, maybe every defmethod, etc.
22:56:44
rpg
Fare: If this can be automated, or if someone else does it, fine. But I don't have a weekend to spend grinding on that by hand.
22:58:21
Fare
luis: it might be that the support for :supersede t / nil is what's breaking things, but it looks like this support is not really used anymore in ASDF3, so could be done away with.
23:00:02
rpg
I haven't counted, but presumably the CHARACTER-OFFSET is to the start of the initial WITH-UPGRADEABILITY, not the nested DEFUN.
23:00:22
Fare
This were necessary when upgrading from ASDF2, something less and less relevant, and I believe not used anymore
23:01:03
luis
rpg: the character offset seems to be from the beginning of the file excluding whitespace and comments or something weird like that
23:02:25
Fare
problem: to actually test that nothing is breaking, you must identify the worst old implementation / old asdf combination.
23:06:15
yottabyte
no-defun-allowed: the return of the Drakma request isn't a string without :want-stream t. it's a Flexi-streams either way seemingly. yason can work with json strings, though
23:09:45
luis
Fare, rpg: so, understandably in retrospect, SBCL stores the position of the nearest read (i.e. non-consed) form. And that's with-upgradability.
23:11:06
rpg
luis: I guess what I don't understand is that if that's all it does, why is there even a FORM-PATH?
23:36:46
luis
Fare, rpg: mutation works. (defmacro sort-of-like-upgradability (&body body) (setf (first (first body)) 'defun*) `(progn ,@body)) not sure what the spec has to say about it, though.
23:47:49
Fare
I'm pretty sure the standard says that it's unspecified what happens if you modify a source form.
23:51:29
Fare
IIRC, the problem that the EVAL-WHEN is fixing is to handle the case where an old ASDF compiles a new one, hasn't loaded it yet, and now tries to use the CLOS functions that are super confused between the old and the new state. And then there's the case when the gf is defined in one file, but some of the methods used by ASDF are defined in the next file, but are not available anymore (and that's why we use concatenate-source-op).
0:04:33
luis
but that's not a problem for find-definition. defclass and defmethod, it's when the macro discards the defun cons and replaces it with a new defun* cons that we get into trouble
0:05:06
luis
so if defun* actually accepted the defun form as input and included it in the expansion that'd work
0:05:07
Fare
well, it will still do it, but this the toplevel read form will have only one thing in it, no problem.
0:07:55
Fare
there are historical reasons why the forms are grouped in a common eval-when, but I don't think there is any current constraint why they must remain so.
0:09:11
Fare
if the forms are separate, then no matter how confused SBCL is about the macroexpansion, it will remember the position of the toplevel form, which will happen to be the location you need.
0:10:14
Fare
it's the grouping that's an issue, not the eval-when as such. You could have individual eval-whens.
0:11:03
luis
ok, I see what you mean now. Still, find-definition would still point at with-upgradability instead of defun. It'd be a little bit less wrong, but still wrong.
0:18:08
solrize
does anyone know if there's a way to increase the max allowed recursion depth in clisp ?
0:27:12
solrize
dlowe, hmm that's the process stack, i'll try that but i didn't think that was the issue
0:43:36
Fare
These days I'd don't push code to master or merge things anymore (though I occasionally still push documentation tweaks), so you'll have to wait for rpg to press the button.
8:03:17
Willi-Smith
Hi, can somebody explain me error "The function SB-EXT:DISABLE-PACKAGE-LOCKS is undefined." when I'm trying "(ql:quickload :ltk)". Run by cl-launch. Thanks.
8:07:42
phoe
sb-ext:disable-package-locks is a SBCL-specific declaration, not a function, so using it as a function is invalid anyway
8:13:44
Willi-Smith
I'm very beginner in lisp and this is my first project with GUI. I need some lightweight environment so I chose cl-launch with sbcl (on arch linux). For run project I use 'cl -Q --source-registry /home/william/.local/share/common-lisp/source: "%f"'. In source folder is unpacked ltk. I guess I'm wrong with my approach.
8:15:08
no-defun-allowed
Huh, the symbol sb-ext:disable-package-locks is present here but not fbound.
8:15:54
no-defun-allowed
I suppose it is; I thought it was once a function, and I think the ltk author must have too.
8:18:23
Willi-Smith
LTK is downloaded from: http://www.peter-herth.de/ltk/, I expect cl-launch uses system sbcl which is sbcl-2.0.3-1
8:22:17
phoe
https://github.com/herth/ltk is where Quicklisp pulls its versions from, so it should work on SBCL 2.0.3
8:30:21
Willi-Smith
Now I can quickload it without error. Last thing is how can I start using ltk package? After I test (ltk::ltk-eyes) this error shows 'READ error during COMPILE-FILE: Package LTK does not exist.'
8:30:51
ym
Hi. I have a simple expression: (mod (apply #'+ angles) (* 2 pi)) ; it returns value > 2pi in some cases. Is it rounding problem?
8:33:50
Willi-Smith
Do I need to create .asd system file for my project or can I only quickload ltk in my .lisp file?
8:34:35
White_Flame
regardless of how it's loaded (and completely regardless of how your other stuff loads), once LTK is in the package should exist
8:37:07
fe[nl]ix
phoe: I statically linked it to libfixposix (git), libcrypto and libssl 1.1.1g, upgraded ASDF to 3.3.4
8:38:39
phoe
does it mean that CFFI is automatically instructed not to look for these libraries externally?
8:39:33
Willi-Smith
This simple .lisp example gives me error "(ql:quickload :ltk) (ltk::ltk-eyes)" > Package LTK does not exist.
8:39:46
fe[nl]ix
phoe: that said, you can simply comment out the loading in the respective sources (cl+ssl or iolib) if you want to play with it
8:42:18
phoe
Willi-Smith: I have no idea what cl-launch does nor I have ever used it in my life; I'm a SLIME user
8:43:53
phoe
nothing I'd like to use if I was beginning to learn, especially if I wanted to use the interactive facilities that Lisp provides
8:44:25
Willi-Smith
I chose it because I can simply run lisp from bash. It works well but Im confused about package importing. It has bad documentation.
8:45:36
no-defun-allowed
I would advise against running Lisp like a "batch" compiler, as using it interactively will make you much more productive and make programming easier.
8:46:26
phoe
so you might find little support for it - there's few people who do it that way and therefore few people who can advise you with that programming style
8:46:52
no-defun-allowed
Willi-Smith: Trust me that you would benefit from interactivity, unless you are able to reason about your entire program without needing to consult a computer.
8:49:19
no-defun-allowed
And even then, you would work faster with interactive tooling; there isn't a reason not to want interactivity.
8:49:51
Willi-Smith
I tried atom with slime but it wasn't so straightforward as this simple bash launcher. I've never worked with emac. Do you recommend me to give it a try?
8:50:33
White_Flame
emacs+slime is the best supported environment for working with Lisp, both the repl .lisp and files, and their interaction
8:51:08
phoe
The idea behind Lisp is that you never really kill or close the Lisp program while you're programming. You instead send commands to the Lisp program that define functions, variables, modify things, or just cause some stuff to happen like (print "hello world")
8:54:12
Willi-Smith
Shall I go with this emac how to https://lispcookbook.github.io/cl-cookbook/emacs-ide.html ?
8:54:16
phoe
ralt: nope - the possibility to transfer running code from one Scheme image to another fully at run-time, stack and continuation and everything.
8:55:51
ralt
Ah, I meant more the concept of having a process that never dies, ala what used to run on mainframes, so that you can take full advantage of instance upgrades and stuff, but abstracted away by the kernel to trust it to run forever
8:59:19
White_Flame
yep, if you've not used emacs before, it's probaly the easiest way to get it up and running with everything
8:59:51
ralt
One thing I really like with this concept is that you no longer need a database, you can store everything in defvar or whatever, and that's effectively persistent
9:01:58
ralt
I would argue most people don't understand how transactions work anyway, so you're making it easier to understand
9:03:55
no-defun-allowed
cl-worlds is an implementation of the "worlds" concept proposed by Warth, Ohshima, Kaehler and Kay for "controlling the scope of side effects".
9:05:22
no-defun-allowed
The basic idea is that one can "sprout" a world from the current world, perform some changes in the world, and then commit those in an atomic manner, after checking that no slots that the computation has read have been changed. Oh, and it lives at https://gitlab.com/Theemacsshibe/cl-worlds or https://github.com/nodefunallowed/cl-worlds
9:05:43
solrize
do most ppl here use slime? do you have it set up so that it launches an inferior lisp as soon as you visit any .lisp file?
9:07:06
solrize
thanks, i got the autolaunch code from someone here and it freaked me out at first, but i see some point to it. other thing i notice is i have to restart slime a lot when the inferior lisp resets... is that an issue for you? i had never used slime before quite recently
9:07:19
phoe
solrize: yes and no, I launch slime manually at the start of my emacs session if I am going to work with lisp stuff
9:07:37
no-defun-allowed
I use a custom metaclass that stores (changed) object slots in a hash table in the current world, so no.
9:09:00
no-defun-allowed
That might make accessing slots somewhat slower, especially if one is accessing a slot bound many parent worlds away for the first time. (After that, however, it'll be cached in the current world.)
9:13:49
no-defun-allowed
ralt: I would suggest skimming http://www.vpri.org/pdf/tr2011001_final_worlds.pdf for the space and time properties of worlds; my implementation is a rough translation of the algorithms in section 5.