libera/#commonlisp - IRC Chatlog
Search
22:10:34
pjb
Currently, I can't save images with ccl on macOS. No deployment! I'm looking into Lispworks…
22:14:16
kakuhen
huh that's funny, I was able to successfully save a lisp image recently and prepend kernel on some project I'm working on that uses cl-sdl2
22:14:49
kakuhen
my only gripe with ccl is that cl-sdl2 will activate my macbook's graphics card even if I specifically ask for software rendering and no hardware acceleration
22:15:28
kakuhen
I can "solve" this problem by creating an app bundle and setting NSSupportsAutomaticGraphicsSwitching to YES in the Info.plist file, but that's not a quick solution, or one I can easily automate, yet.
22:17:41
mrcom
pjb: Maybe https://github.com/Clozure/ccl/issues/344 - no saved image on Mojave, Big Sur. SAVE-APPLICATOIN bugging out; TOPLEVEL not reached in PROCESS-EXIT-APPLICATION.
22:21:43
kakuhen
the command in particular I used was (ccl:save-application "a.out" :toplevel-function #'main :prepend-kernel t)
22:23:03
pjb
there's something strange happening. I put traces and break and the toplevel form is not reached when it should save the image; only the prepended kernel is saved, but not the image.
22:23:40
kakuhen
i will note my program acts funny on mac os when you try to close it the usual way, but that's because cl-sdl2 itself has an issue on mac
22:24:31
kakuhen
so on mac your graphics stuff--especially Cocoa-related--needs to be on the main thread (or else the operating system will crash your entire application)
22:24:52
kakuhen
but for some reason when you invoke the function to quit sdl, you get stuck on a syscall
22:25:13
kakuhen
when I test this game on a REPL I usually run the game in a separate thread with bordeaux threads and kill the thread once I'm done; very gross workaround, but it works.
22:27:01
kakuhen
the cl-sdl2 maintainers claim this issue only exists on SBCL, but CCL has the same problem; and I'm not sure how I'd go about collecting information to file an issue
22:27:14
pjb
kakuhen: when you quit, ccl uses process-interrupt to terminate the various threads. This may be the source of the problem.
22:29:40
kakuhen
does it behave differently on freebsd or linux then? because the game quits normally there
22:30:10
kakuhen
it's literally just mac os that has this issue, regardless of the implementation I tested it on
22:30:32
pjb
I've not posted it to linux yet. It uses mclgui, which implement the GUI classes of MCL on Cocoa (MCL implemented them on the Mac OS Toolbox and Quickdraw).
22:49:44
mrcom
I'm getting random SIGSEGVs on main thread when choosing menu items. Usually they work, sometimes they don't.
23:35:01
nij-
Thanks Josh_2. I've been looking into options of CL scripting. But I haven't tested the start-time. I'd still think the fastest way is to have a running CL daemon.
0:07:11
akater[m]
<nirnam> "have anyone created gnu info..." <- There's an info version of the standard draft. Two of them, actually. A `.tex` copy of a standard can be converted to texi, then to info, pdf, html. I did build it recently. clhs is still more convenient.
3:04:34
etimmons
Josh_2: that link does not describe scripting with a CL daemon. cl-launch can make startup time fast by dumping your script as an image
3:42:35
kakuhen
i notice a lot of people saying it will basically never happen again, but why? are the maintainers of major implementations too stubborn to get together for a week and agree on some changes?
3:43:43
beach
kakuhen: The cost of something like what the ANSI committee did was estimated to about a million USD as I recall.
3:44:25
beach
There may be less prestigious specifications like WSCL, but probably not by any major standardization organization.
3:45:09
beach
And if you think it is a matter of "getting together for a week", you seriously underestimate the issues of programming-language design.
3:46:05
beach
kakuhen: But don't worry. You are not alone. We regularly have people come here and suggest "improvements" to the standard, while being clueless about the implications in terms of what the compiler can do.
3:46:27
kakuhen
i know the original CL spec didnt happen overnight, and if i had to guess the time it took to even get a draft, probably years
3:47:25
beach
kakuhen: A more important question is: why do you care? People use languages without an independent standard every day.
3:48:21
kakuhen
Right, but in the case for Python, there almost a "canonical" implementation people flock to (CPython). Is that true for Common Lisp?
3:48:48
kakuhen
When the standard marks something as deprecated, and the standard never changes, then isn't it meaningless to consider it deprecated?
3:49:08
beach
moon-child: Correct, it does not. If it is published by the same people who supply the implementation. Hence "independent".
3:49:36
kakuhen
my issue isn't with the standard never changing, but if the standard implies something is prone to change, then I think it's reasonable that some people ask "when will that happen? if at all?"
3:49:42
beach
kakuhen: The solution is simple. Pick an implementation and forget the others exist. Then you have the same situation as Python.
3:54:48
beach
kakuhen: I find it fascinating that people are willing to use something like Python which does not have an independent standard, but which is mainly defined by a "canonical implementation", but then, when it comes to Common Lisp, suddenly, they are worried about the standard not being updated, even though they could just forget about all but one implementation, and be in the exact same situation as with Python.
3:56:13
kakuhen
Because CPython dominates all of the other Python implementations. Usage statistics from Quicklisp suggest SBCL is very close to a "canonical" implementation, but it's nowhere near the situation of say CPython vs. Jython
3:56:54
kakuhen
and often times I find myself having to worry how other implementations may handle some aspects of the standard that let them do pretty much whatever they want
3:57:48
kakuhen
granted, there is probably a random number library out there that works fabulously across implementations, but the closest I've got to one gives looots of style warnings from SBCL
3:58:55
kakuhen
with that said, common lisp seems to be in a great position where you can simply load the relevant libraries for what you want that isn't covered well enough by the standard, but this still doesn't satisfy my point earlier regarding deprecations
3:59:11
beach
kakuhen: If you give it some thought, I think you will see that the situation is much worse with something like Python, all aspects of which can change overnight at the whim of some maintainer.
3:59:25
kakuhen
i.e. if the standard declares something as deprecated, then should I look for a library or risk using what's marked deprecated by the standard and assuming it will never change?
4:00:41
beach
Also, look at the channel logs. This question comes up several times a year. You won't add anything to the existing information.
4:05:39
lisp-newbie
List question: I have a list where every car is itself a cons which is a key value pair, I want to get the value for a certain key, but it's not a plist because each car is not a key, it's another cons which is a key/value cons. Does anyone know how can I do this?
4:09:16
lotuseater
lisp-newbie: and if you "know" all keys will be of type string you can provide ":test #'string=" to ASSOC
4:10:59
lisp-newbie
Oh haha beach you are saying that is the default way of doing such a thing? the framework I'm using just turns it into an assoc list and that's how to do it.
4:12:20
lotuseater
lisp-newbie: assoc-lists are useful when dealing with small amounts of key-value pairs. anything beyond that is better to handle with hash tables
4:13:42
lisp-newbie
(assoc (lack.request:request-body-parameters *request*) "id" :test #'string=) this gave me an error: Constant "id" conflicts with its asserted type LIST.
4:16:40
lotuseater
this is one of the good things when using SLIME or friends, typing a known symbol as operator and it shows you good named arguments and possible keywords etc in the bottom bar
4:18:00
beach
lotuseater: I use that feature all the time, which is why I don't have to remember this information myself.
4:19:33
lisp-newbie
How about embedded keys?? Do I have to do the same assoc twice? Or is there a direct way to do it? Say:
4:19:54
lotuseater
yes it's a lifesaver feature. I remember a time where I didn't use it and thought "oh noez what did this had as keywords?"
5:30:58
kakuhen
Is there a neat way to "cast" the type of a bignum to, say, (unsigned-byte 64)? Right now I am simply taking the integer modulo 2^64 to achieve this.
5:33:19
beach
So you just want to ignore upper bits, even if that means returning a different value than that of the original number?
5:34:25
kakuhen
As of now, my expression is (mod (logior (ash value count) (ash value (- 64 count))) #.(expt 2 64))
5:42:19
moon-child
I think that will not behave correctly if your input is greater than 64 bits; you should mask before shifting
5:43:57
moon-child
(let ((mask #.(1- (expt 2 64)))) (logand mask (logior (ash value count) (ash (logand value mask) (- 64 count)))))
5:47:35
hayley
If you use SBCL then you could use SB-ROTATE-BYTE to generate the right machine instruction for a circular shift, and then use a portable implementation for other Lisp implementations.
6:20:11
kakuhen
I see. I'm using CCL so I decided to just write the usual C version "directly," without considering the fact it's non-portable across architectures :x
6:36:21
hayley
I don't see why it would be non-portable, assuming you wrote it in Common Lisp. Then it would merely go slower if the implementation requires bignums to work.
7:19:56
kakuhen
Is there something like #'float but for double-float? My implementation only seems to offer double-float as a class and type
8:54:27
beach
We now have 35 WSCL issues defined: https://github.com/s-expressionists/wscl/tree/main/wscl-issues/proposed and, as before, help would be appreciated where these issues need to be checked on more implementations.
9:46:06
contrapunctus
nirnam: why not use Emacs? With Evil you have a complete implementation of Vim editing. You can use TRAMP to access remote machines. The Lisp tooling, I hear, is unparalleled in Emacs. So...why not? 🤔 (also, EWW is a great browser for documentation - mostly textual, but can also display images.)
9:59:42
nij-
Emacs takes times to learn. It'd be a slightly painful learning process who has settled in their systems that fulfill most of their needs.. or at least it was how it felt for me before I switched to emacs ;)
10:01:21
nij-
But really.. I think the fundamental difference between emacs and vim is that emacs is lisp, but vim is not. That lisp is better could be obvious to lispers, but I find it hard to explain to those who aren't.