<hayley>
It specifies "identical", i.e. the same under eq.
<hayley>
Unlike assoc, there is no way to change that behaviour.
<akater[m]>
Oh, now I see. But I certainly saw “identical” being interpreted as something broader in a neighbourhood of Lisp which I considered small enough. That,s why I didn't follow that link in CLHS. Weird. Thank you.
KvL has quit [Remote host closed the connection]
dre has joined #commonlisp
VincentVega has quit [Remote host closed the connection]
igemnace has quit [Remote host closed the connection]
ajoberstar has joined #commonlisp
dra_ has quit [Remote host closed the connection]
Colt has quit [Remote host closed the connection]
Colt has joined #commonlisp
Algernon666 has joined #commonlisp
igemnace has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
Catie has quit [Quit: heading home]
Algernon666 has quit [Ping timeout: 252 seconds]
pranavats has joined #commonlisp
KvL has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 260 seconds]
Krystof has quit [Ping timeout: 240 seconds]
frodef has quit [Ping timeout: 252 seconds]
Bike has quit [Quit: Connection closed]
frodef has joined #commonlisp
Oladon has quit [Quit: Leaving.]
KvL has quit [Ping timeout: 260 seconds]
KvL has joined #commonlisp
ajoberstar has quit [Ping timeout: 256 seconds]
Bike has joined #commonlisp
splatt990 has joined #commonlisp
rgherdt has quit [Ping timeout: 256 seconds]
s-liao has quit [Ping timeout: 256 seconds]
KvL has quit [Ping timeout: 240 seconds]
KvL has joined #commonlisp
s-liao has joined #commonlisp
dre has quit [Ping timeout: 240 seconds]
dre has joined #commonlisp
Guest74 has joined #commonlisp
KvL has quit [Ping timeout: 240 seconds]
KvL has joined #commonlisp
miique has joined #commonlisp
xantoz has quit [Read error: Connection reset by peer]
xantoz has joined #commonlisp
<beach>
Good morning everyone!
notzmv has quit [Ping timeout: 240 seconds]
<semz>
Good morning
KvL has quit [Ping timeout: 240 seconds]
KvL has joined #commonlisp
semz has quit [Ping timeout: 268 seconds]
alfonsox has joined #commonlisp
Oladon has joined #commonlisp
semz has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
Bike has quit [Quit: Connection closed]
KvL has quit [Ping timeout: 260 seconds]
KvL has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
jealousmonk has quit [Quit: ERC (IRC client for Emacs 27.1)]
pranavats has left #commonlisp [Error from remote client]
makomo has quit [Quit: WeeChat 3.3]
pranavats has joined #commonlisp
KvL has quit [Ping timeout: 240 seconds]
KvL has joined #commonlisp
KvL has quit [Read error: Connection reset by peer]
karlosz has quit [Remote host closed the connection]
karlosz has joined #commonlisp
Algernon69 has quit [Ping timeout: 240 seconds]
<ns12>
I wonder why CMLCL is packaged in Debian but not in Ubuntu.
<lisp123>
hayley: Nice detective work!
<hayley>
I can't think of anyone that uses CMUCL; I'd sorta expect they moved to SBCL.
<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?
<lisp123>
Martin Cracauer : Previously I worked for Google and before that for ITA software.
<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)
<ns12>
Apparently CMUCL is not in the Ubuntu repositories because CMUCL does not support 64-bit. Ubuntu no longer supports 32-bit.
gaqwas has joined #commonlisp
<beach>
ns12: Out of curiosity, why are you interested in CMUCL?
rgherdt has joined #commonlisp
pve has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
heisig has joined #commonlisp
waleee has quit [Ping timeout: 260 seconds]
theothornhill has quit [Remote host closed the connection]
waleee has joined #commonlisp
<ns12>
beach: Because I have just found it, and I am trying to find out what it offers.
<ns12>
Is it considered obsolete?
Krystof has joined #commonlisp
theothornhill has joined #commonlisp
karlosz has quit [Quit: karlosz]
shka has joined #commonlisp
<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
<jackdaniel>
s/is based on/was forked from/
<ns12>
jackdaniel: And why does SBCL have a much larger mindshare than CMUCL?
<lisp123>
SBCL is Sanely Bootstrappable
<jackdaniel>
it has more developers and cleaner bootstrap procedure
<jackdaniel>
(that lead to it being ported to more architectures and more performance improvements)
<jackdaniel>
also since it is more popular software is more often tested on it than on other implementations
<jackdaniel>
so popularity gives a boost in bug reports, specialized library support and such
<ns12>
CMUCL appears to have some extra features such as a GUI debugger/profiler, and Hemlock (Emacs implementation). Are these useful?
<phoe>
the slime debugger is a GUI debugger enough for me, or does CMUCL have something better?
<jackdaniel>
most likely yes (I don't know)
<jackdaniel>
phoe: I don't understand implication - since slime debugger is good enough for you, then you wonder whether cmucl has something better?
<jackdaniel>
I like applies, does it mean that oranges are tasty?
<phoe>
I never realized that CMUCL has a GUI debugger of its own
<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
<ns12>
phoe: https://cmucl.org says: "a graphical source-level debugger using a Motif interface, and a code profiler".
<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, (...)"
theothornhill has quit [Remote host closed the connection]
<ns12>
I wonder if there is a screenshot of the CMUCL GUI debugger somewhere.
<ns12>
Maybe I should run 32-bit Debian in a VM to try out cmucl ...
<phoe>
or you can multiarch to add the i386 architecture, it works for me for running cmucl on amd64
taiju has quit [Ping timeout: 240 seconds]
taiju has joined #commonlisp
epolanski has joined #commonlisp
s-liao has joined #commonlisp
attila_lendvai has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
d4ryus has quit [Quit: WeeChat 3.3]
cosimone has joined #commonlisp
<ecraven>
has anyone here worked with modbus tcp with CL before? any libraries to read from a modbus tcp server?
d4ryus has joined #commonlisp
xantoz has quit [Read error: Connection reset by peer]
xantoz has joined #commonlisp
treflip has joined #commonlisp
taiju has quit [Ping timeout: 240 seconds]
igemnace has quit [Quit: WeeChat 3.4]
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
attila_lendvai has quit [Quit: Leaving]
frodef has quit [Ping timeout: 268 seconds]
attila_lendvai has joined #commonlisp
frodef has joined #commonlisp
nature has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life has joined #commonlisp
Demosthe1ex is now known as Demosthenex
<rotateq>
interesting, i should explore cmucl some day too
lisp123 has joined #commonlisp
<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.
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
lisp123 has quit [Ping timeout: 250 seconds]
<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.
heisig_ has joined #commonlisp
KvL has joined #commonlisp
heisig has quit [Ping timeout: 252 seconds]
loskutak has joined #commonlisp
winning-luser has joined #commonlisp
rain3 has joined #commonlisp
Algernon91 has quit [Read error: Connection reset by peer]
heisig_ is now known as heisig
Algernon91 has joined #commonlisp
Algernon91 has quit [Ping timeout: 268 seconds]
rain3 has quit [Ping timeout: 268 seconds]
derwolf has quit [Quit: Bye]
derwolf has joined #commonlisp
igemnace has joined #commonlisp
miique has quit [Ping timeout: 240 seconds]
epolanski has quit [Quit: Connection closed for inactivity]
<phoe>
ns12: conium is a fork of swank AFAIK, so I doubt it would help much
<yitzi>
And conium is bitrotted, IMHO.
<ns12>
phoe: Why wouldn't it help? Conium is described as "a portability library for debugger- and compiler-related tasks".
<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.
<yitzi>
using conium that is.
Algernon69 has joined #commonlisp
cage has joined #commonlisp
s-liao has quit [Quit: Client closed]
amb007 has quit [Ping timeout: 240 seconds]
amb007 has joined #commonlisp
kevingal has joined #commonlisp
<Xach>
Hmm, is there a hacker's delight-ish formula for getting the index of the last set bit in an integer?
* Xach
goes to fetch the book
amb007 has quit [Read error: Connection reset by peer]
<phoe>
last set bit, you mean like, 16 = #b10000 so the 4th bit, but 17 = #b10001 so the 0th bit?
<Xach>
Sorry. Leftmost set bit.
<phoe>
oooh, integer-length?
amb007 has joined #commonlisp
<Xach>
Oh, duh.
<Xach>
thanks phoe! I was overthinking it a lot.
<phoe>
(integer-length 16) ;=> 5
<phoe>
whew
<phoe>
I hoped you meant this rather than the other thing
<phoe>
;; mostly since I have no idea how to efficiently compute the other thing
<Xach>
M-. integer-length
<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?
<phoe>
(so, only if all are different)
* Xach
cannot help phoe as phoe helped him
<phoe>
:(
s-liao has joined #commonlisp
<yitzi>
phoe: So basically the same semantics as /=? I recall that it is done with a nested loop.
KvL has quit [Quit: KvL]
<phoe>
yitzi: I'm doing it this way now and I wonder if there is a "cleaner" way
<_death>
hash table?.. you described the problem in general terms
frodef has quit [Ping timeout: 240 seconds]
frodef_ has joined #commonlisp
<yitzi>
phoe: I figured. :)
<phoe>
_death: I wish I was able to write (none #'equal x1 x2 x3 x4 x5 x6) but NONE is not a standard function
<phoe>
and I wonder if there is a short/elegant definition of NONE that I can use
<_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?
<phoe>
hmm
<jackdaniel>
(this kind of none is different than some and every - latter accept any number of sequences)
<phoe>
yes - I was looking at NOTANY in the beginning but it doesn't work in my use case
Bike has joined #commonlisp
<jackdaniel>
I guess that a fancy-ish way of doing this is mapping combinations (i.e using alexandria function)
<jackdaniel>
not sure whether this is more elegant than nested loop
<jackdaniel>
and since it may be put behind a functional interface it doesn't matter much, does it?
<jackdaniel>
I've only plagiarised Bike's subconcious conclusion where he hinted remove-duplicates
<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
<phoe>
oh, right, heisig already mentioned that
<jackdaniel>
read above, I've been already told that
aeth has joined #commonlisp
<jackdaniel>
(most likely, if there are no duplicates, the original list will be returned though; sure, relying on undefined behavior is bad)
<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
<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
<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?
<jackdaniel>
yes
<resttime>
Oh I see, interesting
pdietz has joined #commonlisp
<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
<_death>
heisig: neat
<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
random-nick has joined #commonlisp
<_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)
<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.
<resttime>
I figure it can be much faster somehow and it might be the vector maths as bottleneck
<jackdaniel>
you should first profile your code to dertmine whether it is the vector maths
s-liao has joined #commonlisp
<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
s-liao has quit [Client Quit]
<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
<Bike>
eh, that's a control-error. about what one would expect i think
<sm2n>
resttime: As someone who did the same thing, iirc the biggest wins came from declaring float array types and inlining
<phoe>
for once I am glad that this is not UB but defined to be a control-error
<phoe>
but, yes, I don't think SICP defines that either
<sm2n>
But the one I was working on also used GFs, so there was some balance between ergonomics and performance-at-all-costs
<sm2n>
I need to look into one of those sealer libraries for static dispatch with CLOS
<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.
<heisig>
I'm working on a library for both. Stay tuned for the ELS paper :)
<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
<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
<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.
<heisig>
The preferred format for handing in feedback on sb-simd is via Github issues, or by writing me on #petalisp.
<sm2n>
heisig: oh neat
<mfiano>
I'd like to hear more about row-major-aref boosting performance
<Xach>
my copy of hacker's delight is signed by george boole
<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
<sm2n>
if yours is similar I guess you've already inlined everything else
<resttime>
heisig: I wish I was experienced enough to provide feedback xD but I'll make sure to check it out
<sm2n>
It'd be nice if displaced array slices were a thing
<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.
<resttime>
sm2n: Yeah I think so, let me double check and I've definitely inlined whole bunch of stuff too
<heisig>
mfiano: Doing so by hand is tedious, but I am working on a loop optimization framework that does it automatically.
Cymew has quit [Quit: Konversation terminated!]
<mfiano>
Interesting.
<sm2n>
heisig: How difficult would it be to add support for other archs? For example, aarch64
<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.
<sm2n>
I see, I'll download it and play with it a bit. Don't know if I'll have any meaningful feedback though
<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
<jackdaniel>
perhaps instead of allocating a new object reuse existing ones?
<jackdaniel>
also, if you don't specialize on the structure class, then you may request the allocation to be a vector
<sm2n>
oh also, resttime have you added parallelism yet?
<sm2n>
it's pretty easy to do so with lparallel
<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
<resttime>
specialization and request allocation to be vector? (unfamiliar with it, wondering if it's just type declarations)
<resttime>
sm2n: and nope, not yet but looking forward to it in that case
<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
taiju has joined #commonlisp
<sm2n>
yeah, CL people should be proud of lparallel the same way Rust people are of rayon
<sm2n>
resttime: you can make the backing storage for a struct to be a vector
<rotateq>
resttime: there's still a video series on youtube about how writing a raytracer in CL from which i learned much :)
taiju has quit [Ping timeout: 240 seconds]
<resttime>
rotateq: Interesting, is it the one by Alexander Lehmann I found?
<resttime>
sm2n: I think I might have read something about that actually
<jackdaniel>
structure-object is a superclass of all structure-class instances
kagevf has quit [Ping timeout: 240 seconds]
<jackdaniel>
the relation is similar between standard-object and standard-class
kagevf has joined #commonlisp
<jackdaniel>
and I've meant, that when you use the operator defstruct, you may add a type parameter, then it will construct i.e a vector, not a structure-object when created
notzmv has quit [Ping timeout: 268 seconds]
<jackdaniel>
i.e (defstruct (foo (:type (simple-array fixnum (4)))) a b c d)
<jackdaniel>
you have all accessors in place, but not structure class is defined
<mfiano>
That isn't conforming
<sm2n>
phoe: struct as in defstruct
<jackdaniel>
right, the type must be either a list, vector or (vector size)
<jackdaniel>
thanks for the correction mfiano
<resttime>
jackdaniel: Ooooh interesting, I did not know that was possible. I had only been declaring types for the slots
<Bike>
it kind of makes it a different operation. instead of defining a new kind of storage, you're defining a bunch of accessors for a normal vector or whatever.
<phoe>
sm2n: I don't understand the difference then, every instance of a class defined via DEFSTRUCT is a STRUCTURE-OBJECT
<mfiano>
You can however use (vector size) and then create an alias with deftype to be a simple-array, and SBCL will be smart enough
<jackdaniel>
mfiano: not really non-conforming, rather not portable
<jackdaniel>
" type---one of the type specifiers list, vector, or (vector size), or some other type specifier defined by the implementation to be appropriate. "
<mfiano>
resttime: Note however, that doing this means you can no longer specialize on a nominal type.
<sm2n>
phoe: huh, for some reason I thought there was a difference. Never realized you could dispatch on structs
<jackdaniel>
and it seems that sbcl assumes that in (vector size) size is the type specifier, i.e (vector fixnum) :)
<phoe>
sm2n: you can! structure classes are classes like all others and they obey CLOS dispatch normally
<Bike>
yes, well, down the page in defstruct it says you can do list, vector, or (vector element-type)
<jackdaniel>
ah, I see, thanks
<Bike>
which is less dumb than the "arguments and values" section saying (vector size), since that's not actually a type specifier
<sm2n>
phoe: yup
<Bike>
it is a spec bug :(
<jackdaniel>
spec is the ground truth!
<phoe>
we must live with the contradiction
<Bike>
it's not the only arguments and values section that says stupid things, so whatever
<resttime>
mfiano: looked up nominal just now, not exactly sure meaning, is it that the defgeneric/defmethod functions won't work anymore then? (unable to distinguish the type)
<phoe>
I wish DEFSTRUCT was actually split into a proper chapter and glossary like all other parts of CL
user_ has joined #commonlisp
<phoe>
but, no, it's just one huge page that attempts to describe everything
* phoe
,rant over
<Bike>
well, it's a big macro
<mfiano>
resttime: Using standard-object or structure-object means that you can create custom printed representations without clobbering existing vectors'. I mean you could use the priority argument to set-pprint-dispatch, but...
<phoe>
Bike: well, so is LOOP
<Bike>
point
<Bike>
me, i think the defstruct that defines accessors for sequence type should be split off, and the normal defstruct should just be a :metaclass option to defclass. i can only dream
<Bike>
(that could involve problems with compile time knowledge, though)
<mfiano>
resttime: A structure with a :type specified is no longer a user type, basically. It's just an alias with convenient named accessors (in addition to integral indexing)
<sm2n>
Wait this is actually really neat — you could use this to destructure some fixed size binary protocol/format trivially
<sm2n>
resttime: yes
<mfiano>
So you can't specialize it without possibly affecting other code in other packages.
<Bike>
trivially?
<user_>
hi, anybody willing to hint me regarding fast-http and parsing request from string? I am using (parse-request (make-http-request) callbacks *request*), where callbacks is made with make-callbacks and *request* is a string of request (= "GET / HTTP..."). But I am getting invalid HTTP method error, what am I doing incorrectly?
amb007 has quit [Read error: Connection reset by peer]
<sm2n>
or hmm nvm, that doesn't work because it can't cross element bounds
amb007 has joined #commonlisp
<sm2n>
can't exactly take an accessor to the leading 24 bits of a bytevector
<sm2n>
reminds me that I wanted to write a CL backend to kaitai struct
Algernon69 has quit [Ping timeout: 268 seconds]
<resttime>
Oh hmmmm, I'll have to think about tradeoffs with design and such if DEFSTRUCT isn't a user type
<sm2n>
it is, just not when you declare it to be a vector or list or whatever
<mfiano>
It is a user class that maps to a CL type.
<jackdaniel>
this is only useful when you'd use bare vectors either way - you have somewhat useful accessors
<jackdaniel>
usually you want a standard-class and standard objects
<mfiano>
Common Lisp has a weird hybrid of nominal and structural typing, and this is one area that is troublesome in that regard.
<mfiano>
I would use a regular structure-object if you want a print-object method, rather than increasing the priority argument for set-pprint-dispatch which is a hack
<Bike>
in what sense does CL have structural typing at all? i mean, you can define generic functions on whatever, but that's not part of the type system
amb007 has quit [Ping timeout: 268 seconds]
<jackdaniel>
perhaps (integer 3 8) , 3 and could be considered as "features"
<jackdaniel>
3 and 4 *
amb007 has joined #commonlisp
Algernon69 has joined #commonlisp
<jackdaniel>
hands on, who's staring at "Structural type system" article on wikipedia right now? :)
* phoe
googles it
<phoe>
me
<mfiano>
with a nominal type system (deftype foo () 'bar) would be a distinct type, and not just an alias to the structural of BAR
<mfiano>
but this gets muddy real fast in CL, so that is not a good example
<Bike>
it's ok, i have a copy of TaPL somewhere
<mfiano>
TaPL?
<Bike>
types and programming languages, a book about type systems
<mfiano>
Aha
<Bike>
it's the only reason i know anything about this
<Bike>
anyway, deftype is just a macro mechanism for types. it's just like a type alias in c or haskell, not really even a factor in the type system per se
<jackdaniel>
or (cons foo-type (cons bar-type null))
<Bike>
it doesn't actually let you define a "new" type in a meaningful way, unlike defclass for example
<Bike>
but in lisp new types can only be defined in that nominal way
<Bike>
no ADTs or anything
<mfiano>
Right. What I was getting at earlier is a non-structure-object struct's name behaves just like this nominative aliasing
<Bike>
you mean if you provide :type to defstruct?
<mfiano>
Yes
<Bike>
it doesn't even do that.
<mfiano>
You can't, for example, define a print-object method on it exclusively.
<Bike>
the page has an example (defstruct (binop (:type list)) ...) and says "binop is a conceptual data type in that it is not made a part of the Common Lisp type system. typep does not recognize binop as a type specifier, and type-of returns list when given a binop structure. There is no way to distinguish a data structure constructed by make-binop from
<Bike>
any other list that happens to have the correct structure."
<mfiano>
Ah this is true
<jackdaniel>
so what would constitue a structural type?
<Bike>
a type meaning something like "an object that has a FOO accessor"
<phoe>
accessor? would a slot be enough?
<phoe>
(if we want to pretend that SLOT-VALUE is the universal accessor in the CL world)
<Bike>
lisp does not have this concept at all so don't expect much specificity
<phoe>
yes, that's exactly what I've been poking at
<Bike>
the type of a lisp object is generally closely tied to its class, which is like the name in a nominal system. in a structural type system there is no dependence on classes in this way
<Bike>
say (struct foo) specifies the type of objects with a foo accessor. then if a function is specified to take a (struct foo) argument, you can just as well pass in a (struct foo bar) without bothering to "define a subclass" or whatnot
<mfiano>
I am completely agreeing with everything you said.
<Guest74>
heisig: anywhere to look on this framework you're working on? Could always insight to help optimize my stuff. I only use 1d arrays anyways to represent 2d rasters, but i'm sure my padding/width(to fake conformal arrays) stuff could probably be better.
<Bike>
might be kind of neat if the lisp type system could be extended in some way like this, but it can't, oh well
<jackdaniel>
I need to think about it (this distinction is still not clear to me)
<jackdaniel>
you could define (deftype has-foo (object) `(find-method (... standard-reader-method ... ) ))
<jackdaniel>
bleh, throw satisfies somewhere in between :)
<Bike>
well ok, sure, satisfies lets you do literally anything, and you could probably finagle it to work with subtyping
<mfiano>
nominal typing is common in strictly static type systems
<mfiano>
runtime types can do pretty much anything.
<Bike>
maybe extended sequences are a good example? crhodes's extension lets you specialize protocol methods to treat whatever as a sequence... but to make it work fully, you also need to hook up the nominal typing element by making your sequence class a subclass of SEQUENCE
<Bike>
the type system works in terms of subclassing rather than "does it work with this protocol"
frodef_ has quit [Ping timeout: 240 seconds]
<mfiano>
By the latter do you mean like C#, Go, etc "interfaces"?
<Bike>
i don't know anything about those i'm afraid
frodef has joined #commonlisp
<jackdaniel>
I get that generic functions can't specialize on other types than classes (+ eql) - do we limit ourself to what clos recognizes as a specializable type?
<Bike>
oh, well, here i'm talking about the type system rather than clos
<Bike>
structural types are usually not conceived of in terms of being able to test them at runtime, i don't think
<Bike>
(i mean, types in general aren't, but with a nominal type system you can just do tagging)
<jackdaniel>
so how extensible sequences are a good example then? the fact that /something in the system/ requires object to have a sequence as a superclass is an implementation decision?
<Bike>
well, what i mean is you could define your own class, specialize all the sequence generic functions, but it still wouldn't work unless you also did the subclassing
<Bike>
even though the actual protocol would be fully defined for it
ldb has joined #commonlisp
<mfiano>
Same with Gray streams right?
<Bike>
I suppose so yeah
* jackdaniel
feels dumb because he doesn't understand
<jackdaniel>
but oh well, happens; I need to catch up with other things
<mfiano>
jackdaniel: I think we are getting into duck typing is all.
<jackdaniel>
thanks for attempts to explain it to me
<Bike>
it takes some work to wrap your head around, especially if like me you haven't actually programmed with it
<mfiano>
I am understanding the general ideas here, being familiar with a lot of Blubs, but I am not very into PL or type theory.
<mfiano>
It's sort of unfortunate that all the interesting extensions to CL require implementation support: extensible sequences, Gray streams, PLN, etc.
<Bike>
if it can be done within the language we usually call it a "library" rather than an "extension"
<mfiano>
Yes
heisig has quit [Quit: Leaving]
<mfiano>
Although macros are often touted as a way to extend the language without implementation support.
<yitzi>
The Gray stream protocol doesn't depend on subclassing from from Gray stream classes.
* mfiano
checks his Gray stream usages to remember how it works
<yitzi>
Technically if you define all the methods it should work, unless a particular CL implementation chooses to dispatch on the subclass.
<mfiano>
Well I inherit from trivial-gray-streams:fundamental-binary-input-stream in this one usage
<Bike>
macros are a way to extend the language without implementation support (well, beyond the implementation supporting macros). doesn't mean they can do everything
<Bike>
yitzi: ah
<yitzi>
The protocol proposal says that the classes are there for convenience so you can reuse `stream-write-string` etc.
<mfiano>
Ah
<Bike>
but you probably still want to subclass from STREAM somehow, no?
<yitzi>
If you define `output-stream-p`, etc but have your own superclass it should still work.
ldb has quit [Quit: ERC (IRC client for Emacs 27.2)]
<Bike>
but without subclassing from stream, any type declaration saying something is a stream won't be correct
<Bike>
and you can't use typep, etc
<yitzi>
Bike: Correct.
<yitzi>
I would think using streamp would be better though, since it is made a generic.
<yitzi>
At least that is what is done in Cyclosis (from Mezzano)
<Bike>
well, the point is just that the actual type system can't know your thing can be treated as a stream without the subclassing
<yitzi>
Yep
Algernon69 has quit [Ping timeout: 260 seconds]
<random-nick>
you can use typep with a (satisfies streamp), no?
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
<Bike>
yeah, but that's not what the cl:stream type is.
<random-nick>
hmm yes, clhs says that stream is a class and not that it's a type
tyson2 has quit [Remote host closed the connection]
<mfiano>
All classes are also types of the same name.
<random-nick>
yes, but not all types are classes of the same name
<Bike>
that doesn't seem relevant, since stream is in fact a class
<mfiano>
Well I suppose you could create an anonymous class named NIL
Guest74 has quit [Quit: Ping timeout (120 seconds)]
<jackdaniel>
yes, I saw this passage, I'm wondering whether "named class" applies to the class-name or the class name in the environment
frodef has joined #commonlisp
<beach>
The standard does not seem entirely clear on that I think.
jealousmonk has joined #commonlisp
<beach>
Maybe an issue for WSCL.
<mfiano>
Is "named class" a term?
<jackdaniel>
it is used in the glossary sparingly (in context of class designators)
<mfiano>
Ah
<jackdaniel>
there is 'named constant', but that's for variable namespace
<jackdaniel>
also "proper name n. (of a class) a symbol that names the class whose name is that symbol."
<mfiano>
Ok, I can now feel my brain seeping out my ears. I am going to go rest for a bit.
frodef_ has joined #commonlisp
frodef has quit [Ping timeout: 256 seconds]
<yitzi>
Bike and mfiano: I was able to actually make a functional character output stream that does is not a subclass of stream on ECL that works. Not so on SBCL since it is doing typechecks in terpri, etc.
<jackdaniel>
there is also "traits" library prototype by scymtym
<Bike>
i see, and this works by specializing the mop method applicability methods. so typep wouldn't work. which is fine, it's still interesting. i should put more thought into what an extensible type system could look like.
<jackdaniel>
there is also presentation-typep in clim
<jackdaniel>
along with presentation-subtypep
tyson2 has joined #commonlisp
<jackdaniel>
(presentation generic function may be specialized on the presentation type)
Oladon has quit [Quit: Leaving.]
atgreen has joined #commonlisp
rain3 has joined #commonlisp
frodef_ has quit [Ping timeout: 240 seconds]
frodef has joined #commonlisp
hineios has joined #commonlisp
<phoe>
jackdaniel: aren't all classes named in portable CL if we skip the MOP? even classes that have been removed from the global environment still have their names intact, AFAIK
<jackdaniel>
the gist of deliberations was whether the term "named" applies to the state in the environment or to the result of class-name invoked on the class
<jackdaniel>
"we name him silly-bob" vs "his name is bob"
atgreen has quit [Remote host closed the connection]
<Bike>
you can use (setf (find-class name) nil) and (setf (class-name class) nil) to remove any name association even without the mop.
<Bike>
and in fact it looks like there's a note on class-name saying "The name of an anonymous class is nil."
<jackdaniel>
class-name is not an accessor in cl standard, is it?
<Bike>
they have separate pages for whatever reason.
<phoe>
oh wait a second
* phoe
updates cache
<Bike>
(setf find-class) mutates the environment but does not affect the actual class at all. (setf class-name) does affect the class (and not the environment)
<phoe>
"If S is a symbol such that S =(class-name C) and C =(find-class S), then S is the proper name of C. For further discussion, see Section 4.3 (Classes)."
<phoe>
so there needs to be a mutual relationship for a "proper name" to be formed
<phoe>
in my above example there's no proper name, then
<jackdaniel>
phoe: I think that these things were mentioned in the prior discussion too
<jackdaniel>
alright, starting from tomorrow I will be rather offline until after Holiday, so Merry Christmas and Happy Hannukah everyone :) o/
OlCe` has quit [Remote host closed the connection]
Jing has quit [Read error: Connection reset by peer]
Jing has joined #commonlisp
<jeosol>
Good morning all and seasons greetings
<jeosol>
jackdaniel: Merry Xmas to you too
<jeosol>
I have a question guys relating to maintaining deployed CL resources. Now I have looked at two options: 1) Docker containers and 2) just a repl. For updates, rebuilding my images takes longer for sure (I also use multi-stage build) but with repl option, I push updated code to the machine and can send update command the running repl is updated
<jeosol>
incrementally
<jeosol>
Now I get for easier deployments, CI/CD, devops, etc, containers are better. I wanted what you guys are doing especially at is also related to image-based development in CL. Thanks
<jeosol>
I should add the second option appears ok for now, I just have a small machine (dev) and another for the prod testing, so nothing super complicated
Algernon91 has quit [Ping timeout: 252 seconds]
green__ has joined #commonlisp
atgreen has quit [Read error: Connection reset by peer]
cage has quit [Ping timeout: 268 seconds]
rain3 has quit [Ping timeout: 240 seconds]
azimut has quit [Remote host closed the connection]
gaqwas has joined #commonlisp
azimut has joined #commonlisp
<flip214>
what's the quicklisp build status page?
<flip214>
thanks in advance!
pjb has quit [Remote host closed the connection]
kevingal has quit [Remote host closed the connection]
<concrete-houses>
do most lispers use postgresql when doing a lot of data stuff?
<opalvaults[m]>
Bike: nothing wrong with keyword arguments, I'm just curious if there's a way to select keywords out of a list of database entries in an easier way than using a lambda expression. Also, do arguments in a definition automatically get passed to a lambda function?
<opalvaults[m]>
s/easier/different
<hayley>
Yes, lexical bindings are closed over.
<hayley>
concrete-houses: Most of the time I am parsing whatever data format I am given, but arguably that's not a lot of data.
<hayley>
...parsing without making a copy in a database.
aeth has quit [Ping timeout: 240 seconds]
<Bike>
opalvaults[m]: for a real program using a database you would probably use a better representation. this is just an introductory example for the book.
<Bike>
if you DO want to grab values from a keyword parameter list, you can use getf
<opalvaults[m]>
Bike: gotcha, okay i'll read on then. it looks like this intro is just a quick and dirty and not meant to explain everything all at once. that's interesting how lambda (cd) is able to parse over every argument passed into a procedure
<concrete-houses>
Baker says non relational databases are FASTER? now thats interesting
<phoe>
opalvaults[m]: it has access to these variables - this is how lexical closures work
<phoe>
(let ((x 0)) (lambda () (incf x))) ; here is a simple counter, call it a few times
<opalvaults[m]>
i get the scope of what it has access to, i suppose what is confusing and interesting to me is that lambda automatically iterates over all define arguments. it's not obvious that lambda should be able to do that coming from an Algol related family.
<phoe>
oh, yes - in Lisp that's perfectly normal and expected
<opalvaults[m]>
I'm conditioned to need to iterate over **kwargs (or some such), and test accordingly
<phoe>
again, it's possible due to automatic memory management
<opalvaults[m]>
gotcha! very, very convenient
<opalvaults[m]>
thanks for the info :)
<hayley>
I thought lexical scope came from Algol.
<hayley>
concrete-houses: To a zeroth approximation, having direct pointers rather than looking through an index would be faster. But I'd still like to see that if the join exposes multiple matches, i.e. the program follows a one-to-many relation.
<concrete-houses>
interesting that the wikipedia page for transitive closure mentions graphs -- aren't they all the buzz now?
<hayley>
Yes.
<concrete-houses>
so Baker was right...
<hayley>
He usually is.
<concrete-houses>
wow maybe I have been watching too much Alan Kay but it seems a lot of decades old computing was smarter
<concrete-houses>
sounds like an opportunity to make money by doing more with less
tyson2 has joined #commonlisp
<concrete-houses>
What did Paul Graham mean when he said we faked continuations with closures?
<hayley>
He used closures to implement continuation passing style?
Inline has quit [Remote host closed the connection]
green__ has quit [Remote host closed the connection]
<concrete-houses>
Work does a hunting license lottery...... So they have all these licenses fir 4 seasons and different game.....and need to randomize for 15k or so custoemrs, and then the first 'randomly' pciked customer gets the license that is the top one in a list of licenses they want I think 10 it limit to that list.....as licenses are won the availabel licesne count must be reduced by 1 or if the winner
<concrete-houses>
is a team leader, by the team size, and each team member gets the same lciense.... now in our implementation the non team leader sare in the lottery which seems silly to me.... but would a lisper be able to get random numbers adn run such a lottery pretty easily?
Inline has joined #commonlisp
<concrete-houses>
if the license count is not availble then the second choice is won, if available
<White_Flame>
concrete-houses: of course non-relational databases are faster. Data is clustered and in specific application-aware format
<concrete-houses>
ah ha!
<White_Flame>
assuming he means pre-relational custom flat record databases
<opalvaults[m]>
dre: i freakin' wish devops used common lisp. I'm sadly stuck with python
<opalvaults[m]>
i have to wonder if people who dive into CL just dread working in other languages and/or lose interest in all other languages after learning CL.
<Bike>
scymtym: very cool. is this using the "generalizers" extension or something else?
<scymtym>
Bike: mostly just CLOS and MOP. being able to spell the specializer like that uses SBCL's specializer parsing/unparsing machinery which is historically but not technically related to generalizers. that's only syntax though. one could construct the method by other, slightly less convenient, means
<scymtym>
and the type specifier is just syntax for (satisfies GENERATED-GENERIC-FUNCTION) where GENERATED-GENERIC-FUNCTION returns true for that same specializer and false otherwise
<scymtym>
so in summary, a class conforming to a "role" in a protocol can be "statically" checked, used as a specializer and used as a type
<scymtym>
it gets complicated with protocols that have multiple roles, of course
atgreen has joined #commonlisp
cosimone has quit [Quit: ERC (IRC client for Emacs 27.1)]
<rotateq>
dre: let the universe employ you. problem solved :D
<dre>
:)
<rotateq>
hayley: i often see much good DSL potential as a niche one can do, maybe for the future
<dre>
opalvaults[m], I am a python programmer as well, but I'm learning common lisp and I want to find a way to cram it into more of my projects. (keep in mind, I don't often make projects)
<rotateq>
or other really complex applications that really solve non-trivial tasks
<rotateq>
ah nice dre :)
<rotateq>
there's cl-python for example
<hayley>
In my opinion (which involves no experience with business), using a language you don't know at work is pretty risky.
<dre>
hmm
dra has joined #commonlisp
<dre>
hayley, yeah exactly
<dre>
rotateq, interesting :x
<rotateq>
hayley: yes it is! or that changes every 3 years
<rotateq>
where even the real experts can't track
<hayley>
I didn't like Java or Python very much when I did university courses with them, but I attribute that to the university.
<rotateq>
dre: and all can be kind of vocation you see for yourself :) i try too for myself
<Bike>
i see, i see
<dre>
much of it is that I need to just do it.
<rotateq>
yes here at the university there's a "functional programming" course with Haskell (of course) but the prof is not good at all and this gets the people a superficial idea of things
<dre>
hayley, i really liked python, at university, simply because it was an alternative to matlab.
<hayley>
But trying to do interactive development in Python was tricky, as it appeared things would refuse to reload unless I didn't do a topographical sort in my head.
<rotateq>
in earlier days it was with Scheme and SICP, i know some dude who did it
<dre>
:P
<rotateq>
now 30 years ago
<rotateq>
dre: matlab can get you ... mad XD
<hayley>
...and we actually had to write somewhat fast code for one assignment, which scared me, but I somehow managed to find the best solution by accident, and the performance problems were really in a library we didn't write.
<dre>
I had like, half a day left and we had to implement some sort of robotics algorithm. There was some "matlab on computer to rpi robot, sent over wifi" contraption that was a pain
<hayley>
Ouch.
<dre>
and we were like, getting so late, and panicky about it (cause robot is not moving, close to deadline)
<rotateq>
oh cool robotics, also a LISPy task :)
<dre>
and I'm like "welp nothing to lose lets try this" - python on robot. "if direction is not None and indicator is type(int): foo()" -- worked, saved the assignment, and have been diggin python for a while since.
<rotateq>
using inverse kinematics shall also be useful for robotics i heard
<dre>
but yeah, gotten to the point where there's complaints, and having dabbled in lisp, I get it; I have my foot in the door, and I want more :)
<rotateq>
dre: it's a wonderful journey
<dre>
:)
<rotateq>
I'm still surely a sorcerer's apprentice. :) but taking the time is worth it
<dre>
I got the practical common lisp book, but found it dry compared to "Land of Lisp"
<rotateq>
oh PCL, a great start
<dre>
as a newcommer, Land of Lisp was a much more fun start into the language, but PCL has some great tibbets in it
<rotateq>
yes, but Land of Lisp also has its flaws
<rotateq>
yes it's fun, especially the comics
<dre>
interesting, what are the flaws?
<dre>
or rather,
<dre>
what should I be mindful of as a beginner?
<dre>
I'll probably work my way though PCL soon. I did some of AoC in common lisp which was also a great experience