jackdaniel changed the topic of #commonlisp to: Common Lisp, the #1=(programmable . #1#) programming language | Wiki: <https://www.cliki.net> | IRC Logs: <https://irclog.tymoon.eu/libera/%23commonlisp> | Cookbook: <https://lispcookbook.github.io/cl-cookbook> | Pastebin: <https://plaster.tymoon.eu/>
zyni-moe has joined #commonlisp
zyni-moe has quit [Client Quit]
karlosz has joined #commonlisp
rtoy has quit [Quit: rtoy]
akoana has joined #commonlisp
shka has quit [Ping timeout: 255 seconds]
karlosz has quit [Ping timeout: 268 seconds]
NotThatRPG has joined #commonlisp
akoana has quit [Quit: leaving]
NotThatRPG has quit [Ping timeout: 255 seconds]
earl-ducaine has quit [Quit: No Ping reply in 180 seconds.]
kevingal has joined #commonlisp
jeosol has joined #commonlisp
gamaliel has joined #commonlisp
<gamaliel> Hi, does anyone know of a tutorial or introduction to displaced arrays? I'm not very familiar with the topic and wish to understand more. Doesn't necessarily need to be a CL-based tutorial.
sukaeto has quit [Quit: WeeChat 3.0]
sukaeto has joined #commonlisp
sukaeto has quit [Client Quit]
sukaeto has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 248 seconds]
Lord_of_Life has joined #commonlisp
random-nick has quit [Ping timeout: 268 seconds]
<ixelp> common-lisp/cesarum/array.lisp · master · com-informatimago / com.informatimago · GitLab
nij- has joined #commonlisp
nij- has quit [Ping timeout: 248 seconds]
<jeosol> pjb: In the first link, the aref in line 501 has no index? perhaps I don't understand the code
<Bike> that's how you access the element of a zero dimensional array.
<Bike> zero dimensional arrays are weird
<aeth> you can think of a zero dimension array like a box, or perhaps like a point
<gamaliel> pjb: Thank you
tyson2 has quit [Remote host closed the connection]
<jeosol> Bike: aeth: Thanks guys, that just seemed weird to me. TIL
<Bike> it is pretty weird, but it follows straightforwardly from how arrays work
<Bike> how many indices do you need for a one dimensional array? one. for a two dimensional array? two. so for zero dimensions,
<jeosol> so what is an example of a 0D array, scalar?
<Bike> well they still have to be arrays. random objects aren't zero dimensional arrays
<Bike> you can make one with (make-array ())
<jeosol> was thinking tensors --
<jeosol> Bike: thanks
<jeosol> haha, indeed, it is weird, tried it on the sbcl terminal, it works with no errors
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #commonlisp
<jeosol> so (array-dimensions (make-array ()) -> nil; then (len nil) => 0
<aeth> (make-array '() :element-type :double-float :initial-element 42d0) => #0A42.0d0
<jeosol> pjb: The array-equal-p function in line 457 is some beautiful code and nice use of flet...
<aeth> double-floats are the main somewhat practical thing to put in a 0D array to play around with if you want to
<jeosol> I did write an array.lisp library for my application but I assume the content of my arrays are numbers (ints or floats)
<jeosol> Last few weeks, I had to work with python, having worked with lisp for last several years, it was like pulling teeth, fighting jupyter notebook kernels, server issues. A lot of things that just works in CL, many may ignore.
<jeosol> Once you have your CL/lisp environments configured, it's just you and your problem, not fighting the editor, or other issues.
<jeosol> aeth: what do you mean 'put in' ...?
<jeosol> I see the example you gave, missed it.
gamaliel has quit [Quit: Client closed]
phantomics has joined #commonlisp
kevingal has quit [Remote host closed the connection]
<beach> agm: What are your reasons for creating a new Common Lisp implementation? I am asking because some people do it in order to learn how interpreters and compilers work. Others do it because their implementation has some characteristics (speed, portability, interoperability, maintainability) that others don't.
waleee has quit [Ping timeout: 276 seconds]
<beach> agm: Another question: What do you use for garbage collection?
dcb has quit [Quit: MSN Messenger 3.8]
<beach> agm: Yet another: Presumably, you like the Common Lisp language, so why did you decide to write your Common Lisp implementation in a language other than Common Lisp?
semarie has quit [Ping timeout: 248 seconds]
semarie has joined #commonlisp
semarie has quit [Client Quit]
son0p has quit [Ping timeout: 248 seconds]
jeosol has quit [Ping timeout: 260 seconds]
agm has joined #commonlisp
pve has joined #commonlisp
<agm> beach: I use reference counting for garbage collection. i try to steer away from garbage collection, because it brings random freezes, while refcounting is more predictable
<beach> Hmm. Except that reference counting doesn't work. It can't reclaim circular structures.
<agm> beach: c89 is more portable, so you can bootstrap in many platforms. that's the same approach as emacs: a c core and then lisp
<beach> And it is way slower than a tracing GC.
<agm> beach: that's true of classic refcounting, but there's a published algorithm that also collects loop, maybe i will implement some variation of it
<beach> OK, good luck! You didn't mention your reason for doing this. I mean CLISP and ECL are both built this way.
<beach> Thanks.
semarie has joined #commonlisp
<agm> agm: well, it's an interesting challenge, and maybe i can add true native compilation that neither clisp and ecl have
<jackdaniel> agm: that statement is factually incorrect
<jackdaniel> ecl does native compilation via gcc while clisp does native jit compilation vua lightning library
<beach> agm: OK, I think I have a good idea of your thinking for this project. Thanks and good luck.
<jackdaniel> https://github.com/nptcl/npt - another possible point of interest
<ixelp> GitHub - nptcl/npt: ANSI Common Lisp implementation
<semarie> agm: regarding refcount, koka is using Perceus (https://koka-lang.github.io/koka/doc/book.html#why-perceus) for an optimized reference counting with reuse. but I dunno how it is dealing with cycle.
<ixelp> The Koka Programming Language
nij- has joined #commonlisp
Bocaneri has joined #commonlisp
Bocaneri is now known as Guest3094
Sauvin has quit [Read error: Connection reset by peer]
hayley has joined #commonlisp
<hayley> Perceus doesn't deal with cycles, from what I remember from the paper. And the fast reference counters have interesting stop-the-world pauses, and the incremental tracing collectors have interesting barriers c.f. <https://web.eecs.umich.edu/~weimerw/2012-4610/reading/bacon-garbage.pdf>
<hayley> Reference counting is garbage collection too. (scnr)
<jackdaniel> oom process restart is gc too in a sense :)
<jackdaniel> with peculiar characteristics
<hayley> The world's most annoying arena allocator.
<agm> jackdaniel: haha that's funny
avocadoist has quit [Read error: Connection reset by peer]
avocadoist has joined #commonlisp
nij- has quit [Ping timeout: 248 seconds]
avocadoist has quit [Quit: Konversation terminated!]
avocadoist has joined #commonlisp
<Alfr> agm, don't think that algorithm from that paper solves the problem, authors don't say how the required invariants, especially the no strong cycles one, can be established/constructed in an efficient manner; they defer to domain specific knowledge for that.
<hayley> I think state of the art is <https://pages.cs.wisc.edu/~cymen/misc/interests/Bacon01Concurrent.pdf> or maybe <https://users.cecs.anu.edu.au/~steveb/pubs/theses/frampton-2010.pdf#page=61>. But backup tracing is common, and lets you use smaller reference counts too.
<Alfr> agm, further I don't think it will perform well in the presence of many cycles; in particular deleting the last strong pointer to something still being referred to by weak pointers triggers something like a recursive mark-swap phase, the very thing you intend to avoid by using a RC.
<hayley> And I should mention that concurrent tracing exists, too; it's not quite as easy as "tracing pauses but goes fast, refcount doesn't pause but goes slow". Again see my first link, as they describe how achieving good results in both dimensions (throughput and latency) entails using a mixture of the algorithms.
avocadoist has quit [Quit: Konversation terminated!]
avocadoist has joined #commonlisp
<beach> I suspect agm's mind is made up about this, though.
avocadoist has quit [Client Quit]
avocadoist has joined #commonlisp
<Alfr> agm, and as a bonus every pointer needs a strength bit, and every node/object a strength bit, two RC and one mark counter. Fun.
agm has quit [Ping timeout: 255 seconds]
<hayley> For brownie points (having hacked a new collector into SBCL) I would suggest trying to make the collector as loosely coupled as possible, so that a user can choose the most suitable collection algorithm.
avocadoist has quit [Read error: Connection reset by peer]
avocadoist has joined #commonlisp
agm has joined #commonlisp
shka has joined #commonlisp
agm has left #commonlisp [ERC (IRC client for Emacs 28.0.50)]
agm has joined #commonlisp
<agm> it also depends on how common reference cycles are in typical big lisp programs. i'd be interested in such a measurement
<beach> Extremely common.
<beach> Every symbol refers to its package, and every package refers to a bunch of symbols.
<beach> Every generic function refers to its methods, and every method refers to its generic function.
<beach> Methods also refer to specializer classes. And classes refer to methods that use it as a specializer.
<agm> can package be excluded from garbage collection? after all, there's an explicit delete-package function in CL
<beach> DELETE-PACKAGE does not destroy the object. It just unlinks it from the package dictionary.
<hayley> I tend to cook up a few graphs with cycles, so reference counting wouldn't suffice.
<Alfr> Someone asks about big lisp programs and beach naturally thinks of a CL implementation. Certainly appropriate wrt the topic, but still ... :)
jrm has quit [Quit: ciao]
<beach> Alfr: Fair enough.
jrm has joined #commonlisp
<beach> Still any big application will create packages, classes, generic functions, and methods.
<Alfr> beach, I didn't mean to imply that there was anything wrong with that example. Only seemed funny, as people for most purposes won't think of a language implementation as a program by itself.
cage has joined #commonlisp
cage has quit [Remote host closed the connection]
<jackdaniel> it is rare for packages and gfs to be deleted, and methids after dereferencing are usually effectively dead. so perhaps packages and gfs could be put in memry that is not garbage collected, and methods eagerly deallocated when replaced/removed
rgherdt has joined #commonlisp
<jackdaniel> this has certain yucky rifications, but depending on requirements they could be acceptable
<jackdaniel> ramifications
<agm> beach: the examples you made are tipically global objects, so they don't need collection, unless you redefine them (which sometimes happens in interactive programming)
<jackdaniel> common lisp does not mandate garbage collection strictly speaking
<jackdaniel> if there is enough memory to contain whole program until finish of the execution
<jackdaniel> if we have infinite memory (and we clearly do unless we agree that there is most-positive-bignum) then we are all set :)
rgherdt has quit [Ping timeout: 265 seconds]
rgherdt has joined #commonlisp
agm has quit [Ping timeout: 255 seconds]
elderK has joined #commonlisp
prokhor has joined #commonlisp
karlosz has joined #commonlisp
cage has joined #commonlisp
n1to has joined #commonlisp
shka has quit [Ping timeout: 255 seconds]
shka has joined #commonlisp
nij- has joined #commonlisp
occ has quit [Ping timeout: 276 seconds]
shka has quit [Quit: Konversation terminated!]
aartaka has joined #commonlisp
nij- has left #commonlisp [Using Circe, the loveliest of all IRC clients]
shka has joined #commonlisp
n1to has quit [Quit: Leaving]
random-nick has joined #commonlisp
elderK has quit [Quit: Connection closed for inactivity]
masinter has quit [Ping timeout: 276 seconds]
occ has joined #commonlisp
X-Scale has joined #commonlisp
masinter has joined #commonlisp
MajorBiscuit has joined #commonlisp
MajorBiscuit has quit [Client Quit]
MajorBiscuit has joined #commonlisp
dcb has joined #commonlisp
aartaka has quit [Ping timeout: 255 seconds]
aartaka has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 252 seconds]
Inline has joined #commonlisp
MajorBiscuit has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 248 seconds]
X-Scale has quit [Quit: Client closed]
X-Scale has joined #commonlisp
Inline has quit [Quit: Leaving]
aartaka has quit [Ping timeout: 276 seconds]
minion has quit [Remote host closed the connection]
specbot has quit [Read error: Connection reset by peer]
tyson2 has joined #commonlisp
minion has joined #commonlisp
specbot has joined #commonlisp
masinter has quit [Ping timeout: 248 seconds]
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
euandreh1 has joined #commonlisp
minion has quit [Remote host closed the connection]
specbot has quit [Write error: Broken pipe]
euandreh has quit [Ping timeout: 268 seconds]
euandreh1 is now known as euandreh
specbot has joined #commonlisp
specbot has quit [Remote host closed the connection]
specbot has joined #commonlisp
specbot has quit [Remote host closed the connection]
rgherdt has quit [Remote host closed the connection]
specbot has joined #commonlisp
specbot has quit [Remote host closed the connection]
specbot has joined #commonlisp
specbot has quit [Remote host closed the connection]
xaltsc has joined #commonlisp
bjorkintosh has quit [Ping timeout: 248 seconds]
bjorkintosh has joined #commonlisp
bjorkintosh has joined #commonlisp
bjorkintosh has quit [Changing host]
minion has joined #commonlisp
specbot has joined #commonlisp
zxcvz has joined #commonlisp
zxcvz has quit [Client Quit]
attila_lendvai_ has joined #commonlisp
bitmapper has joined #commonlisp
NotThatRPG has joined #commonlisp
n0den1te has joined #commonlisp
NotThatRPG has quit [Ping timeout: 246 seconds]
triffid has quit [Remote host closed the connection]
triffid has joined #commonlisp
masinter has joined #commonlisp
karlosz has quit [Quit: karlosz]
amoroso has joined #commonlisp
Inline has joined #commonlisp
<mfiano> that sentence was semantically invalid
<mfiano> I think you meant to say we clearly do not.
<mfiano> because it is not so clear to me that we have infinite memory in our computers, but I could be wrong, because I can't even remember what time I woke up this morning.
repeter`` has joined #commonlisp
<yitzi> I think the implication is that since most-positive-bignum isn't defined memory must be infinite. If memory is finite then most-positive-bignum should be defined and be the largest value that fits into your actual memory. :)
repeter` has quit [Ping timeout: 276 seconds]
* jackdaniel nods
random-nick has quit [Ping timeout: 276 seconds]
<beach> There is a phrase somewhere in the standard that says an implementation is free to implement a standard macro as a special operator, as long as the macro is also provided. Does anyone remember where that phrase is located?
NotThatRPG has joined #commonlisp
<Bike> clhs 3.1.2.1.2.2
<ixelp> CLHS: Section 3.1.2.1.2.2
<beach> Thanks!
<Bike> no problem
random-nick has joined #commonlisp
Mandus has quit [Ping timeout: 252 seconds]
waleee has joined #commonlisp
Inline has quit [Quit: Leaving]
Inline has joined #commonlisp
Inline has quit [Quit: Leaving]
Inline has joined #commonlisp
amoroso has quit [Quit: Client closed]
rgherdt has joined #commonlisp
amoroso has joined #commonlisp
<phantomics> What's the best way to evaluate one closure within a specific package? For example, while in PKG1 I tried (progn (in-package "PKG2") ...stuff... (in-package "PKG1") item-to-return) but the stuff evaluated as if I was in PKG1 the whole time
Guest3094 is now known as Sauvin
<yitzi> (let ((*package* bla)) ...)
<yitzi> in-package doesn't create a new binding.
jeosol has joined #commonlisp
<Bike> what do you mean by evaluating a closure?
Devon has joined #commonlisp
<phantomics> The goal is to evaluate code in a closure and pass something back, for example (setf something (...)) where the ... is evaluated in a different package
<Devon> phantomics: what is the meta-goal?
gxt__ has quit [Remote host closed the connection]
gxt__ has joined #commonlisp
<phantomics> Evaluating an SBCL (define-vop) form, the standard way of using them seems to be just evaluating with the sb-vm package but that's infeasible in this situation
MajorBiscuit has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
<phantomics> That's still not working. I tried (let ((*package* (find-package "SB-VM"))) (define-vop ...)) but I get an error indicating that define-vop isn't recognized as a macro, thus it's not being evaluated within the sb-vm package
<Bike> that's because the whole form is read before the package is bound
<Bike> reading happens before evaluation. they are not interleaved.
<phantomics> Ok, figured it was a read order issue, is there any expedient way of doing this? This code is being generated by a macro, so I could write a function that recursively goes through the form and does find-symbol for the string of each symbol in sb-vm, but that's really inelegant
n0den1te has quit [Quit: Leaving]
SAL9000 has quit [Remote host closed the connection]
<pjb> phantomics: have your macro generate sb-vm:define-vop instead of define-vop.
<phantomics> pjb: The generated code is full of other sb-vm symbols like inst, various instruction names, etc. Prepending the package name to all would be awkward and hard to read
<pjb> phantomics: then have the package that is current when you read this macro use the sb-vm package.
<pjb> (assuming all those symbols are exported from sb-vm)
tyson2 has joined #commonlisp
euandreh has quit [Ping timeout: 276 seconds]
SAL9000 has joined #commonlisp
zxcvz has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
son0p has joined #commonlisp
<phantomics> pjb: they're not external. I suppose I could write a simple package that imports each of those symbols explicitly and then exports them
tibfulv has quit [Remote host closed the connection]
tibfulv has joined #commonlisp
McParen has joined #commonlisp
euandreh has joined #commonlisp
X-Scale has quit [Quit: Client closed]
tyson2 has joined #commonlisp
<pjb> phantomics: that, or define your macro in sb-vm itself.
<Bike> if you're specifically on sbcl, it has special syntax for switching package for one s-expression
<Bike> (list 'sb-vm::(a b) 7) => ((SB-VM::A SB-VM::B) 7)
<ixelp> SBCL 2.3.2 User Manual
<phantomics> Bike: cool, that should do it. This code is using SBCL-exclusive features so it only needs to be supported in SBCL
<phantomics> pjb: that's not viable either because the macro code is composed using the output of many methods from another package; I would have to implement them all within sb-vm and it would get more and more complicated
cage has quit [Quit: rcirc on GNU Emacs 28.2]
Alfr has quit [Killed (sodium.libera.chat (Nickname regained by services))]
Alfr has joined #commonlisp
markb1 has quit [*.net *.split]
lieven has quit [*.net *.split]
lottaquestions has quit [*.net *.split]
lonjil2 has quit [*.net *.split]
joast has quit [*.net *.split]
kg7ski has quit [*.net *.split]
jmbr has quit [*.net *.split]
micro has quit [*.net *.split]
marsia has quit [*.net *.split]
dcb has quit [*.net *.split]
dale has quit [*.net *.split]
edgar-rft has quit [*.net *.split]
bollu has quit [*.net *.split]
|3b| has quit [*.net *.split]
nocko has quit [*.net *.split]
rdrg109_ has quit [*.net *.split]
froggey has quit [*.net *.split]
smlckz has quit [*.net *.split]
zoglesby has quit [*.net *.split]
zephyr has quit [*.net *.split]
sm2n has quit [*.net *.split]
\f has quit [*.net *.split]
theothornhill has quit [*.net *.split]
milesrout has quit [*.net *.split]
payphone has quit [*.net *.split]
spec has quit [*.net *.split]
djhas-kin has quit [*.net *.split]
mcoll has quit [*.net *.split]
srhm has quit [*.net *.split]
ashpool has quit [*.net *.split]
artyn has quit [*.net *.split]
alethkit has quit [*.net *.split]
ggb has quit [*.net *.split]
whereiseveryone has quit [*.net *.split]
Schnouki has quit [*.net *.split]
lonjil has joined #commonlisp
nocko has joined #commonlisp
edgar-rft has joined #commonlisp
lieven has joined #commonlisp
bollu has joined #commonlisp
spec has joined #commonlisp
smlckz has joined #commonlisp
smlckz has quit [Changing host]
smlckz has joined #commonlisp
jmbr has joined #commonlisp
lottaquestions has joined #commonlisp
rdrg109_ has joined #commonlisp
froggey has joined #commonlisp
dcb has joined #commonlisp
|3b| has joined #commonlisp
ggb has joined #commonlisp
Schnouki has joined #commonlisp
Schnouki has quit [Changing host]
Schnouki has joined #commonlisp
djhas-kin has joined #commonlisp
ashpool has joined #commonlisp
mcoll has joined #commonlisp
alethkit has joined #commonlisp
whereiseveryone has joined #commonlisp
srhm has joined #commonlisp
payphone has joined #commonlisp
\f has joined #commonlisp
markb1 has joined #commonlisp
dale has joined #commonlisp
theothornhill has joined #commonlisp
marsia has joined #commonlisp
sm2n has joined #commonlisp
zoglesby has joined #commonlisp
artyn has joined #commonlisp
milesrout_ has joined #commonlisp
Mandus has joined #commonlisp
micro has joined #commonlisp
kg7ski has joined #commonlisp
MajorBiscuit has quit [Quit: WeeChat 3.6]
EsoAlgo8 has quit [Remote host closed the connection]
EsoAlgo8 has joined #commonlisp
attila_lendvai_ has quit [Read error: Connection reset by peer]
attila_lendvai_ has joined #commonlisp
rogersm has quit [Quit: Leaving...]
karlosz has joined #commonlisp
attila_lendvai_ is now known as attila_lendvai
tyson2` has joined #commonlisp
tyson2 has quit [Ping timeout: 276 seconds]
EsoAlgo8 has quit [Remote host closed the connection]
EsoAlgo8 has joined #commonlisp
bitmapper has quit [Quit: Connection closed for inactivity]
tyson2` has quit [Remote host closed the connection]
tyson2`` has joined #commonlisp
shka has quit [Ping timeout: 276 seconds]
morganw has joined #commonlisp
McParen has left #commonlisp [#commonlisp]
Inline has quit [Quit: Leaving]
EsoAlgo8 has quit [Remote host closed the connection]
perrierjouet has quit [Quit: WeeChat 3.8]
EsoAlgo8 has joined #commonlisp
tyson2`` has quit [Remote host closed the connection]
amoroso has quit [Quit: Client closed]
zxcvz has quit [Quit: zxcvz]
EsoAlgo8 has quit [Remote host closed the connection]
triffid has quit [Remote host closed the connection]
EsoAlgo8 has joined #commonlisp
eddof13 has joined #commonlisp
LW has joined #commonlisp
eddof13 has quit [Client Quit]
pve has quit [Quit: leaving]
rgherdt has quit [Remote host closed the connection]
markb1 has quit [Quit: Leaving]
EsoAlgo8 has quit [Remote host closed the connection]
joast has joined #commonlisp
triffid has joined #commonlisp
perrierjouet has joined #commonlisp
LW has quit [Quit: WeeChat 3.6]
tyson2 has joined #commonlisp