frgo has quit [Read error: Connection reset by peer]
gateway2000 has quit [Quit: Leaving]
gateway2000 has joined #commonlisp
nij- has joined #commonlisp
<nij->
What is the unit of the size in the hash table? I see it's 14 for a newly created, empty hash table.
viaken has joined #commonlisp
gateway2000 has quit [Remote host closed the connection]
<Bike>
nij-: you mean hash-table-size?
gateway2000 has joined #commonlisp
<Bike>
if you do, the unit is just entries. a new hash table on your implementation has space for 14 entries.
<Bike>
14 isn't fixed by the standard or anything though.
<Bike>
you can semi-control the size by passing a :size to make-hash-table.
anticomputer_ has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
triffid has joined #commonlisp
<nij->
Oh I see. What if I want to see how much disk size a huge table takes up?
<Bike>
it's probably on memory, not disk. but lisp doesn't really make that information available, and it can vary a lot as there is no gauarantee of stability
<nij->
I see @@..
<Bike>
you can use your intuition for the most part. a hash table with a bigger size is likely going to take more memory.
<Bike>
on sbcl you can do (sb-introspect::object-size whatever), but this is not an exported interface
<Bike>
ah. yeah, i guess the keyval vector is stored separately from the hash table, huh.
<nij->
The keys are legit integers, and the values are legit strings. Those are not pointers.
<nij->
Mmhmmm yeah
<Bike>
i should have thought of that.
<Bike>
not pointers?
<Bike>
the hash table isn't going to have the string data right in it, probably.
<nij->
I can write a loop to sum them up, if I really want.
<Bike>
this is sort of another reason "size" is ambiguous. do you count the keys and values as part of the size if they're stored indirectly? what if they're referenced by objects other than the hash table? bla bla bla.
<nij->
right
<Bike>
if you want an overall idea of how much memory you're using, there's cl:room
<nij->
wow, nice trick!
ebrasca has quit [Remote host closed the connection]
azimut has joined #commonlisp
notzmv has quit [Ping timeout: 255 seconds]
taiju has quit [Ping timeout: 244 seconds]
tyson2 has quit [Remote host closed the connection]
PoisonedPigeons has joined #commonlisp
PoisonedPigeons has left #commonlisp [#commonlisp]
<beach>
cosimone: I interpret the standard to require the loop variable not to exceed its final value, and that's how I implemented it in SICL LOOP, so it returns 31 in your example. But several Common Lisp implementation use MIT LOOP, and it returns 32 as I recall.
Devon has quit [Ping timeout: 245 seconds]
danieli has quit [Remote host closed the connection]
danieli has joined #commonlisp
danieli has quit [Read error: Connection reset by peer]
danieli has joined #commonlisp
danieli has quit [Read error: Connection reset by peer]
danieli has joined #commonlisp
danieli has quit [Client Quit]
akoana has quit [Quit: leaving]
triffid has quit [Ping timeout: 268 seconds]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
triffid has joined #commonlisp
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
danieli has joined #commonlisp
anticomputer_ has joined #commonlisp
azimut_ has joined #commonlisp
azimut has quit [Ping timeout: 268 seconds]
anticomputer has quit [Ping timeout: 268 seconds]
triffid has quit [Ping timeout: 268 seconds]
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
triffid has joined #commonlisp
anticomputer_ has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
nij- has joined #commonlisp
hineios5 has joined #commonlisp
hineios has quit [Ping timeout: 245 seconds]
hineios5 is now known as hineios
notzmv has joined #commonlisp
karlosz has joined #commonlisp
karlosz has quit [Remote host closed the connection]
karlosz has joined #commonlisp
gateway2000 has quit [Quit: Leaving]
gateway2000 has joined #commonlisp
anticomputer_ has joined #commonlisp
anticomputer has quit [Ping timeout: 268 seconds]
elderK has quit [Quit: Connection closed for inactivity]
pve has joined #commonlisp
<hayley>
"size" doesn't behave so well with structure sharing, either. There can be objects A and B such that size[A] + size[B] ≠ size[(A . B)] - cons-size (when size[] identifies shared structure).
shka has joined #commonlisp
Jach has quit [Ping timeout: 260 seconds]
Jach has joined #commonlisp
frgo has joined #commonlisp
frgo has quit [Remote host closed the connection]
frgo has joined #commonlisp
frgo has quit [Read error: Connection reset by peer]
pranavats has joined #commonlisp
frgo has joined #commonlisp
frgo has quit [Read error: Connection reset by peer]
MajorBiscuit has joined #commonlisp
livoreno has quit [Ping timeout: 272 seconds]
livoreno has joined #commonlisp
causal has quit [Quit: WeeChat 3.5]
frgo has joined #commonlisp
Shinmera has quit [Remote host closed the connection]
Shinmera has joined #commonlisp
<cosimone>
beach: i see. i think the interpretation is reasonable, but perhaps not the only one possible: after all, the standard says that iteration must stop when the variable reaches the specified limit (and both sicl loop and mit loop do), but since "finally" represents the loop epilogue, which is technically code that is executed AFTER the actual loop, i don't think that the iteration variable is forbidden to exceed that value
<cosimone>
after all, i could not find an entry specifically saying what happens to iteration variables specifically used inside a "finally" clause
<beach>
Clearly, the authors of MIT LOOP thought it was OK. The conclusion, then, is that you can not rely on any particular value of the iteration variable in the FINALLY clause.
<beach>
Personally, I would like for this to be better specified, in the spirit of WSCL. But initially, WSCL will just cover domains where most major Common Lisp implementation agree, and this is not such a domain.
<cosimone>
i agree, even if it ends up being "referring to loop iteration variables in a finally clause is implementation-defined". that would make it non-portable, but at least we can be sure it is, in fact, not portable
<beach>
There is no particular reason for this issue to be unspecified, other than the fact that implementations do not agree. MIT LOOP has defects in it, and this issue could very well be considered one more such defect. Again, the only problematic part about specifying the behavior here, is that maintainers of existing Common Lisp implementations may not want additional work.
pranavats has left #commonlisp [Error from remote client]
<aeth>
beach: does WSCL up the minimums on things (mostly or entirely expressed as constants) where the minimums are higher than the 16-bit friendly standard? I think virtually everything allows for large strings but iirc a string longer than 1024 characters (definitely possible) isn't fully portable.
<aeth>
(and if so, probably best to split into 32-bit and 64-bit. That then means you only have to care about one thing (which one it is) and the rest follows)
<aeth>
(because the minimums usually follow from fixnum size, which is usually larger on 64-bit)
<beach>
I haven't given that aspect any thought, but it seems entirely reasonable to me to increase those parameters, provided that most major Common Lisp implementations do it.
<cosimone>
having this aspect of loop fully specified would be best, but even stating that it has to be implementation-defined would be better than being silent on the matter
<aeth>
the other thing would be to encourage more types of arrays... I think the standard only requires bit and character (perhaps several kinds of character), but e.g. octet is near universal if not universal
<aeth>
i.e. (unsigned-byte 8)
<beach>
Yeah, that's a good idea as well.
<aeth>
The odd one out is CLISP (at least the ancient stable version), which doesn't have single-float and double-float arrays. But perhaps there are a few other implementations that are missing something that everyone else seems to have.
<hayley>
There is a rather funny comment in SBCL src/compiler/generic/genesis.lisp about array sizes.
<hayley>
beach: Speaking of, there is one trick that I think could be done with first class global environments, when producing a boot image. Theoretically the allocator used in production could be made to work with a simulated heap, if primitives that use raw memory are made to manipulate the simulated heap.
<hayley>
On the other hand, it may be acceptable for the bootstrap allocator to run slower, if it produces smaller images. genesis in SBCL maintains free lists in order to pack objects better.
<hayley>
Just had that idea in my notes; I'm not sure if it's a good idea.
<beach>
The idea is indeed to have the allocator work with a simulated heap, and I think this is implemented already. All that is missing is a function that, given an ersatz object or a host object used during bootstrapping (such as a CONS) returns an integer representing the pointer value in the final image.
<hayley>
Great!
<hayley>
But the interesting part is that the same code is used in production and in bootstrapping; only the meaning of the primitives is changed during bootstrapping.
anticomputer has joined #commonlisp
anticomputer_ has quit [Ping timeout: 268 seconds]
<beach>
Well, they don't really change I think. They all manipulate integers representing addresses, both in production and during bootstrapping.
<hayley>
Alright then. I guess there has to be duplicated code in SBCL because most of allocation is written in C, which cannot be run in the host (and certainly cannot be made to run on a simulated heap, either).
<beach>
That's entirely possible.
<hayley>
Right, it can, but I don't think bringing in a custom C compiler would be preferable.
<beach>
The Doug Lea-style allocator is written and even has tests for it.
<hayley>
Right. I just wanted to mention that changing the meaning of primitives could suffice for producing an image, which might be simple with first class global environments.
<beach>
Sure.
cosimone has quit [Ping timeout: 245 seconds]
rogersm has quit [Ping timeout: 272 seconds]
rogersm has joined #commonlisp
karlosz has quit [Ping timeout: 240 seconds]
frgo_ has joined #commonlisp
frgo has quit [Ping timeout: 252 seconds]
orestarod has joined #commonlisp
azimut_ has quit [Remote host closed the connection]
azimut has joined #commonlisp
<pjb>
nij-: you can use the (ROOM) and (ROOM T) calls to see memory usage. But it may be rather high-level counts.
mon_aaraj has quit [Ping timeout: 245 seconds]
mon_aaraj has joined #commonlisp
<pjb>
beach: I think there are two reasons why it should be underspecified, and why it should not be conforming to access the loop variable in the finally clause if they reached their end of the loop condition.
<pjb>
beach: First, by example, where :of-type is used for the loop variable, and we go to the last possible value. Implementations that go one beyond will signal a type error. In that case, we'd want the end test to be like (<= (- to step) current).
<pjb>
beach: Second, when using the :by clause, the :to value may never be reached, but we may skip beyond it. (loop for i by 5 to 8 finally (return i)) #| --> 10 |# Of course, both cases can be combined.
<pjb>
beach: why shouldn't (loop for i by 5 to 8 finally (return i)) be equivalent to (loop for i by 5 to (+ 0 (* 5 (floor 8 5))) #| --> 5 |#) where the :to can be reached and could be the final value (like in sicl)?
<pjb>
beach: now the reason of leaving it implementation dependent is that each implementation may choose to optimize the loop test by computing a (possibly "invalid") new value before the test, instead of subtracting the step from the to before comparing the current value.
<pjb>
So I think that it's not conforming to use those loop variables in the finally clauses. You can always rewrite the loop if you want to get one or the other result in the finally clause.
<beach>
I see.
glaucon has joined #commonlisp
<pjb>
Well, for the minimums, I'd say that they allow a CL implementation to run on a microcontroller with limited memory, so they shouldn't be augmented. It is understood that they're higher with usual implementations on usual systems. They only require library writers to be careful with their specifications and documentation, to stay conforming. It is acceptable for a library to specify that it requires strings of minimum size at least
<pjb>
100K or whatever, and therefore imply that it won't run on microcontroller or other limited systems.
<aeth>
That's why I said that it should depend on the 32-bit or 64-bit nature of the system. These days, even microcontrollers are almost always 32-bit afaik.
<pjb>
aeth: most of them, like esp32, but there are a lot of work done on 8-bit MC, such as arduinos. If we could develop a cross CL development IDE for arduino, to let all these users and a lot of newbies use CL instead of C for arduino programming, it'd be cool.
<SR-71>
When loading static-vectos package I get this.
<pjb>
SR-71: check how the CFFI is generated, and what from. Perhaps there's a #define size ssize_t or something like that in the headers? Perhaps you'd just have to add a (defctype size …) and s/:size/size/ ?
<pjb>
But it's strange, the manual says that Foreign Type: :size and Foreign Type: :ssize are built-in…
lisp123 has joined #commonlisp
mon_aaraj has quit [Ping timeout: 245 seconds]
mon_aaraj has joined #commonlisp
orestarod has quit [Ping timeout: 244 seconds]
lisp123 has quit [Remote host closed the connection]
jmdaemon has quit [Ping timeout: 264 seconds]
anticomputer_ has joined #commonlisp
anticomputer has quit [Quit: quit]
mon_aaraj has quit [Ping timeout: 252 seconds]
mon_aaraj has joined #commonlisp
<Shinmera>
SR-71: update quicklisp and make sure you have a recent CFFI.
orestarod has joined #commonlisp
molson_ has quit [Ping timeout: 268 seconds]
<jcowan>
The question of the final value of a loop variable has been plaguing programmers since clanking iron dinosaurs ruled the earth. In Fortran, the final value exceeds the limit; in Basic it is the limit; in C it is the limit by convention. I simply decided long ago to treat the value of a loop variable as undefined if the loop exits normally; I like languages in which the loop variable is only in scope within the loop, like C++ and
<jcowan>
Java (or at least that is available).
thuna` has joined #commonlisp
ebrasca has joined #commonlisp
<SR-71>
Hmm, apparently (defctype :size :int) solves this issue.
<SR-71>
I actually cloned CFFI into local projects for safety.
<SR-71>
Thanks
yauhsien has joined #commonlisp
nyx_land_ has joined #commonlisp
nyx_land has quit [Ping timeout: 272 seconds]
nyx_land_ is now known as nyx_land
yauhsien has quit [Ping timeout: 245 seconds]
triffid has quit [Write error: Connection reset by peer]
azimut has quit [Remote host closed the connection]
anticomputer_ has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
triffid has joined #commonlisp
azimut has joined #commonlisp
waleee has joined #commonlisp
molson has joined #commonlisp
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
igemnace has joined #commonlisp
dBc has joined #commonlisp
orestarod has quit [Ping timeout: 244 seconds]
nij- has quit [Remote host closed the connection]
jeosol has quit [Quit: Client closed]
MajorBiscuit has quit [Ping timeout: 252 seconds]
igemnace has quit [Remote host closed the connection]
mon_aaraj has quit [Ping timeout: 272 seconds]
dBc has quit [Quit: leaving]
mon_aaraj has joined #commonlisp
pjb has quit [Ping timeout: 272 seconds]
orestarod has joined #commonlisp
NotThatRPG has joined #commonlisp
pjb has joined #commonlisp
frgo_ has quit [Remote host closed the connection]
eddof13 has joined #commonlisp
triffid has quit [Ping timeout: 268 seconds]
triffid has joined #commonlisp
mon_aaraj has quit [Ping timeout: 272 seconds]
<NotThatRPG>
jackdaniel: Looks like you have the ability to set the topic string. Would you mind updating it?
jeosol has joined #commonlisp
<Bike>
updating how? taking out the ELS news?
mon_aaraj has joined #commonlisp
livoreno has quit [Ping timeout: 245 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jackdaniel>
NotThatRPG: not at all if it is relevant, what should it be updated to?
mon_aaraj has quit [Ping timeout: 245 seconds]
<NotThatRPG>
jackdaniel: I was just noting that the ELS 2022 new could be removed. Partly because it's not important any longer, but also because it makes me sad that there's no CL news for 4 months!
<jackdaniel>
alright, makes sense. thanks for the prompt
<NotThatRPG>
Maybe someone can suggest a new library release that would be more new and exciting?
<NotThatRPG>
Anyone have something they would like to brag about?
mon_aaraj has joined #commonlisp
<jackdaniel>
well, McCLIM release is 2y overdue and there are plenty of improvements
<hexology>
is there a way to list all the distributions installed w/ quicklisp?
<hexology>
Shinmera: your parachute testing library looks really nice. it might be helpful to have a quick comparison to fiveam? especially for a relative newbie like me who hasn't already used fiveam a lot
Lord_of_Life_ is now known as Lord_of_Life
<jackdaniel>
hexology: sabre wrote a very good comparison of testing frameworks
<hexology>
ooh parachute is the "best general purpose"!
<jackdaniel>
it very well may be, but mind that this is just one person opinion. either way the document you have linked contains a good comparison of features
livoreno has joined #commonlisp
<hexology>
of course, but one person with more experience than i have
eddof13 has joined #commonlisp
jealousmonk has quit [Remote host closed the connection]
causal has joined #commonlisp
notzmv has quit [Ping timeout: 240 seconds]
frgo has quit [Read error: Connection reset by peer]
mon_aaraj has quit [Ping timeout: 252 seconds]
mon_aaraj has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
aartaka has joined #commonlisp
azimut has quit [Ping timeout: 268 seconds]
euandreh has joined #commonlisp
akoana has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 27.1]
molson has quit [Remote host closed the connection]
tyson2 has joined #commonlisp
molson has joined #commonlisp
rogersm has quit [Quit: Leaving...]
<dbotton>
NotThatRPG: have you looked at reddit for new releases and new projects? there aremany all the time, unless I am missing what the ELS news is.
son0p has quit [Ping timeout: 268 seconds]
<NotThatRPG>
dbotton: The ELS news was that ELS was happening, but it was posted in March. I'm afraid I'm not really on reddit, although perhaps I should be
<dbotton>
There is tons of news. Projects. Common Lisp is very alive there
<NotThatRPG>
Neat! But note that I'm not the one who could change the topic -- that's jackdaniel
Guest7254 has quit [Quit: WeeChat 3.5]
<dbotton>
Oh sorry my bad though was talking in general
<Shinmera>
I suppose for one some extensions to Dissect are in order then to fully cover the debugging thing.
pve has quit [Quit: leaving]
<Bike>
restarting and returning from frames seem conceptually fraught to me
<Shinmera>
Not so sure about the Introspection part. The macroexpand things seem out of scope for Definition.
<Bike>
like, it's doable i'm sure, just could go kind of bad
<Shinmera>
Dissect can already go bad with dx variables captured in a trace :/
<Shinmera>
But yeah, I think an extra interface in dissect is in order to do stuff that can only be done "while on the stack"
Jach has joined #commonlisp
<Shinmera>
I'm interested in porting the compiler section to a library
<Shinmera>
The pathnames stuff, among other things, is something I'd like to do in a new library called filesystem-utils, which I had been thinking about for years (companion to pathname-utils)
ahlk has quit [Ping timeout: 252 seconds]
<Shinmera>
Right now I can't remember what all I wanted in there though :v
<Shinmera>
probably stuff like temp files, config dirs, etc in the least.
notzmv has joined #commonlisp
<Shinmera>
but there were other things. guh. Curse my memory
jmdaemon has joined #commonlisp
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Bike>
i can take a closer look at the compiler stuff. i already had to dig into that some for cleavir
<Bike>
it might be necessary to wrap compile and compile-file, since at least historically some implementations didn't signal anything at all and reported what they did through return values or whatever
<Bike>
but that would be pretty inconvenient
<Shinmera>
Still better to have that than nothin'
elderK has joined #commonlisp
varjag has joined #commonlisp
sjl has quit [Ping timeout: 268 seconds]
sjl has joined #commonlisp
shka has quit [Ping timeout: 245 seconds]
orestarod has quit [Ping timeout: 276 seconds]
<qhong>
Is there a library somewhere to do (make-instance '(mixin-1 mixin-2 mixin-3 ...))?
<thuna`>
How do people go about unit testing macros that expand into method definitions?
<thuna`>
I'm using elisp so I would appreciate general advice over specific tools and such
ebrasca has quit [Ping timeout: 252 seconds]
<contrapunctus>
thuna`: this channel is for Common Lisp; for Elisp, try #lisp or #emacs
<Catie>
It's a question about semantics common in Common Lisp, this seems like a pretty solid place to ask. Especially because most elisp programmers don't use generic functions
<pjb>
thuna`: you may test macros using macroexpand-1. This way they won't modify the environment so you won't have to reset it.
<thuna`>
pjb: How would you test it's behavior? Also it doesn't directly expand into a defmethod, but rather a progn which houses one
<pjb>
The behavior of the macro is the code it expands to, not the behavior of that code.
<pjb>
So for unit testing the macro, it's enough.
tyson2 has quit [Remote host closed the connection]
<pjb>
Then of course, you may want to perform integration testing, it will depend on the concrete case.
<thuna`>
Ah. I guess that does work
<kakuhen>
The macro in your case should be generating code, so testing macros indeed should only test the code outputted in this case
<White_Flame>
(equal desired-output (macroexpand-1 desired-input)) would be a dumb easy way to perform the test
<White_Flame>
since it's basically just nested lists
<thuna`>
Right. I was having the macro do unnecessary work, so I'll just split that up into it's own function instead
<kakuhen>
re macros: as long as you arent doing something like running code at macroexpansion time (or invoking e.g. setf without taking into account the environment), your macro is probably fine
<qhong>
Is there a library somewhere to do (make-instance '(mixin-1 mixin-2 mixin-3 ...))?
<Bike>
which would do what, implicitly make a new class that's a subclass of all of those?
<hayley>
dynamic-mixins
<qhong>
Bike: Yes, and it should do some hash-consing so it do it only once
<qhong>
hayley: thanks
son0p has joined #commonlisp
<kakuhen>
just a heads up about dynamic-mixins: if i recall correctly it has issues with metaclasses but otherwise it works perfectly
<qhong>
It also seems to break SLIME's make-instance arglist completion, which is tbh a must to have
<qhong>
guess just need to put in some work to integrate with SLIME