libera/#commonlisp - IRC Chatlog
Search
6:58:37
ns12
Hello! For CMUCL, what is the difference between https://cmucl.org and https://www.cons.org/cmucl/ ? Which is the official website?
7:34:49
lisp123
Although the official repo is here https://gitlab.common-lisp.net/cmucl/cmucl/wikis/home
7:37:02
hayley
cons.org redirects to https://wiki.zs64.net/Main_Page for me, and according to https://wiki.zs64.net/Was_ist_ZS64.net a guy called Martin seems to host Lisp pages.
7:54:31
remexre
is package-inferred-system supposed to hook up something that makes (uiop:define-package (:import-from :foo/bar)) automatically try to asdf:load-system, or do I need to manually run the load-system in SLIME every time I add a new file to the import graph?
7:58:36
lisp123
hayley: There's a few. It's still actively maintained by the few that use it (which pale in comparison to SBCL user base)
8:06:05
ns12
Apparently CMUCL is not in the Ubuntu repositories because CMUCL does not support 64-bit. Ubuntu no longer supports 32-bit.
8:38:42
jackdaniel
it is a maintained common lisp implementation, so no - it is not obsolete. that said sbcl (that is based on cmucl) has much larger mindshare among common lisp developers
8:41:09
jackdaniel
(that lead to it being ported to more architectures and more performance improvements)
8:41:57
jackdaniel
also since it is more popular software is more often tested on it than on other implementations
8:43:53
ns12
CMUCL appears to have some extra features such as a GUI debugger/profiler, and Hemlock (Emacs implementation). Are these useful?
8:44:25
phoe
the slime debugger is a GUI debugger enough for me, or does CMUCL have something better?
8:45:54
jackdaniel
phoe: I don't understand implication - since slime debugger is good enough for you, then you wonder whether cmucl has something better?
8:46:23
ns12
CMUCL also includes an X11 interface (CLX), but that has already been ported to SBCL https://github.com/sharplispers/clx
8:47:17
jackdaniel
ns12: cmucl bundles quite a few things, some of them are available as portable libraries - as you have noted clx is one of them
8:47:24
ns12
phoe: https://cmucl.org says: "a graphical source-level debugger using a Motif interface, and a code profiler".
8:48:03
phoe
hmmm, http://www.chiark.greenend.org.uk/doc/cmucl-docs/debugger.html says "Note: there are two debugger interfaces in CMUCL: the TTY debugger (described below) and the Motif debugger. Since the difference is only in the user interface, (...)"
8:56:39
phoe
or you can multiarch to add the i386 architecture, it works for me for running cmucl on amd64
9:31:43
ecraven
has anyone here worked with modbus tcp with CL before? any libraries to read from a modbus tcp server?
10:29:37
beach
SBCL inherited the breakpoint facility of CMUCL, but in SBCL it is used only for tracing (not the encapsulation tracing). As I recall, SBCL does not even document the breakpoint interface, so it is hard to write a real debugger for SBCL. The SBCL stepper uses a different mechanism.
10:40:44
yitzi
I can attest to the difficulty of using SBCL's breakpoints to build a debugger. Finding the correct source line information isn't easy and sometimes the breakpoints don't appear to be triggered.
12:14:00
ns12
phoe: Why wouldn't it help? Conium is described as "a portability library for debugger- and compiler-related tasks".
12:15:32
yitzi
I contemplated using in common-lisp-jupyter but ended writing my own stuff b.c. it is broken on several implementations or hasn't been updated. Plus the semantics of compiling notebook cells is a bit different.
12:43:43
Xach
Hmm, is there a hacker's delight-ish formula for getting the index of the last set bit in an integer?
12:46:43
phoe
last set bit, you mean like, 16 = #b10000 so the 4th bit, but 17 = #b10001 so the 0th bit?
12:51:56
phoe
I have variables x1, x2, ..., xn, and I want to return true only if none of them are EQUAL to one another. is there a hacker's delight-ish formula for doing that in Lisp?
12:56:44
yitzi
phoe: So basically the same semantics as /=? I recall that it is done with a nested loop.
13:03:33
phoe
_death: I wish I was able to write (none #'equal x1 x2 x3 x4 x5 x6) but NONE is not a standard function
13:06:33
_death
if it's so few variables, and you don't know much about their values, a simple macro that expands to (and (not (equal x1 x2)) (not (equal x1 x3)) ... (not (equal x5 x6))) seems ok?
13:11:21
jackdaniel
(this kind of none is different than some and every - latter accept any number of sequences)
13:15:46
jackdaniel
I guess that a fancy-ish way of doing this is mapping combinations (i.e using alexandria function)
13:16:07
jackdaniel
and since it may be put behind a functional interface it doesn't matter much, does it?
13:20:17
Bike
(defun none (seq) (let* ((len (length seq)) (table (make-hash-table :test #'equal :size len))) (map nil (lambda (o) (setf (gethash o table) t)) seq) (= (hash-table-count table) len))). it's not short AND it's not elegant
13:20:17
Colleen
Bike: drmeister said 28 minutes, 19 seconds ago: No - I haven't seen those bugs - I'll take a look today.
13:29:38
yitzi
You could use mapcar with sxhash and /= as shortcut before the loop. Not sure if that would be faster though.
13:37:24
yitzi
Is remove-duplicates required to return the same sequence if there are no duplicates?
13:37:38
heisig
jackdaniel: remove-duplicates returns a copy, so EQ won't work. But (= (length list) (length (remove-duplicates list :test #'equal))) will.
13:38:18
heisig
Or rather it "may share with sequence or may be identical to sequence if no elements need to be removed".
13:39:22
heisig
Bike: The one I wrote for SICL uses a table: https://github.com/robert-strandh/SICL/blob/master/Code/Sequence/delete-duplicates.lisp
13:41:13
jackdaniel
I've only plagiarised Bike's subconcious conclusion where he hinted remove-duplicates
13:41:14
phoe
jackdaniel: ...the only issue is that EQ won't work, because R-D is allowed to cons up a new list that is EQUAL but not EQ
13:42:07
jackdaniel
(most likely, if there are no duplicates, the original list will be returned though; sure, relying on undefined behavior is bad)
13:43:17
resttime
I'm curious, what use cases have/are there to define new SBCL intrinsics? Been reading a little about them, trying to figure out the 'what', and figure that knowing more 'why's would help. Here's one I found https://pvk.ca/Blog/2014/08/16/how-to-define-new-intrinsics-in-sbcl/ so my current impression is that it's modification of the assembly that gets generated on output
13:44:49
jackdaniel
i.e when you have a running system with a bottleneck but you can't avoid the particular calculation - then you may try to squeeze something that way
13:48:06
resttime
So would an example be like if (optimize (speed 3)) is not fast enough, then delving into intrinsics lets you optimize (or at least modify the DISASSEMBLE) even further?
13:53:05
resttime
Hmmm, might have to look more into it. I somewhat been learning how to optimize vector maths for my raytracer. Declared types, ftypes, speed 3, safety 0, dynamic-extent and stuff wherever I could. I hope intrinsics stuffs aren't too advanced for me
13:55:35
phoe
resttime: I know that heisig has been pushing SBCL to its limits with regard to vectorized code, maybe he can give you some pointers
13:58:21
_death
sbcl also uses hash-tables sometimes.. makes me wonder why I remember remove/delete-duplicates performing badly (doubt I was using a nonstandard test)
14:01:27
resttime
Oh, okay I'll throw out a question out here after working through rest of tutorial. Been following this: https://raytracing.github.io/books/RayTracingInOneWeekend.html but using Common Lisp instead. Current performance is 'decent' such that I can get something like a 400px wide render in 'decent' time but starting to slow down as more features like materials are added.
14:01:56
resttime
I figure it can be much faster somehow and it might be the vector maths as bottleneck
14:08:13
phoe
Bike: thanks for that SICP pointer, I've managed to recreate the standalone REQUIRE in https://plaster.tymoon.eu/view/2789#2789 - my only worry is if I should define what happens when there is a REQUIRE without any AMB, since in my current implementation it means THROWing without a matching CATCH
14:08:51
phoe
and I've written some basic tests from the SICP exercises, more might come later - triples and dwellings and 8 queens are probably the most important ones
14:09:52
sm2n
resttime: As someone who did the same thing, iirc the biggest wins came from declaring float array types and inlining
14:10:43
sm2n
But the one I was working on also used GFs, so there was some balance between ergonomics and performance-at-all-costs
14:15:37
heisig
sm2n, resttime: SIMD vectorization and manual/semi-automated lowering of AREF to ROW-MAJOR-AREF can boost the performance a lot, at least for number crunching.
14:16:08
resttime
jackdaniel: sm2n: ah yeah I did do a bunch of profiling and inlining as well before adding materials: https://i.imgur.com/S8gKKDh.png MAKE-RAY and MAKE-HIT-RECORD are default DEFSTRUCT constructors, I dunno how to make these faster at all. My vectors used to be defstruct too then I switched their implementations to simple-array single-float after some advice and similarly found super fast
14:16:10
resttime
speed up. Maybe I need to do it again somehow with these too then redefine how my vector operations work on this theoretical new representation of data
14:18:04
heisig
resttime: The current state is at https://github.com/marcoheisig/sb-simd. But I recommend waiting a few more weeks until it is published.
14:19:17
heisig
This also means now is the time to send me some feedback :) If anyone on this channel has some time to read/think things through, I'd really appreciate it.
14:19:56
heisig
The preferred format for handing in feedback on sb-simd is via Github issues, or by writing me on #petalisp.
14:21:41
sm2n
resttime: what are you calcuating in MAKE-RAY? mine just makes a unit vector from a direction and sticks it in an object with an origin point
14:23:29
resttime
heisig: I wish I was experienced enough to provide feedback xD but I'll make sure to check it out
14:24:22
heisig
mfiano: SBCL is not good at open coding AREF. If you hoist all stride and index calculation outside of the innermost loop, and replace (AREF A i1 ... iN-1 iN) by (ROW-MAJOR-AREF A (+ ... iN)), the code usually runs much faster.
14:24:25
resttime
sm2n: Yeah I think so, let me double check and I've definitely inlined whole bunch of stuff too
14:26:05
heisig
mfiano: Doing so by hand is tedious, but I am working on a loop optimization framework that does it automatically.
14:27:42
sm2n
heisig: How difficult would it be to add support for other archs? For example, aarch64
14:29:28
heisig
sm2n: Extending sb-simd is really simple, adding FMA on x86-64 took me less than a day. The tricky part is to get the SIMD instructions into SBCL in the first place.
14:30:35
sm2n
I see, I'll download it and play with it a bit. Don't know if I'll have any meaningful feedback though
14:30:53
resttime
sm2n: Oh misunderstood question, yeah MAKE-RAY just default constructor origin is either at the camera or the point on object the ray scatters/bounces off. Direction is where camera is shooting ray or calculation off of the surface scatter/bounce
14:32:43
jackdaniel
also, if you don't specialize on the structure class, then you may request the allocation to be a vector
14:40:25
resttime
jackdaniel: Hmmm, gonna have to think about how to reuse object if possible. I did do something similar althought just for my vector maths lib where possible with a pattern to supply a third parameter to set in a function like (vec3 out a b) with inspiration from https://github.com/mfiano/origin (thanks mfiano, gave your repo a look a while back for an example). What do you mean about
14:40:28
resttime
specialization and request allocation to be vector? (unfamiliar with it, wondering if it's just type declarations)
14:41:32
resttime
I went through the whole Raytracing in the weekend series in Rust before, when I added parallelism it was super easy, hoping it'll be same
14:44:19
rotateq
resttime: there's still a video series on youtube about how writing a raytracer in CL from which i learned much :)
14:48:17
resttime
Found it, section on structures here: https://github.com/guicho271828/sbcl-wiki/wiki/Object-representation-(lowtags,-widetags,-memory-consumption,-arrays)