libera/#commonlisp - IRC Chatlog
Search
11:59:25
pve
Hi, can someone speak about how systems were loaded in CL back in the day? I know there was MK:DEFSYSTEM, but was it used right from the start, or did people just have ad-hoc solutions before it emerged? Did lisps before CL have their own defsystems?
12:00:41
xach
pve: i've seen a number of old projects with a file named something like load.lisp that has a script that loads the software.
12:01:21
Duuqnd
I know Symbolics had their own DEFSYSTEM thing so I'm guessing before ASDF there were lots of DEFSYSTEM implementations.
12:03:49
jackdaniel
the standard mentions (as deprecated) interfaces require and provide that are meant to load "modules" (whatever that means :)
12:04:40
mfiano
I remember using something like clbuild (?) or something or another before QL existed/was popular
12:05:02
xach
clbuild was a way to get things - it didn't introduce a new way to things, it used asdf
12:05:07
jackdaniel
so this is deprected in its inception mechanism for loading programs composed of multiple (or one) files
12:05:55
jackdaniel
there was also sbt that was part of ecl at some point of time (years before I've used it)
15:25:14
lisp123
For example, consider I have a loop that keeps running until a condition is met - at that point I want to run another test with the value of the condition, if that test fails, I want to return to the original loop and keep running
15:30:25
lisp123
For example, say I have a calling function that calls the loop you just mentioned, I want to return control to it (with a certain value) to continue on its way (and if it fails, then come back to the loop)
15:30:59
Bike
don't think of it as "come back". you can just not leave the loop in the first place. that's how jackdaniel's code works.
15:32:09
lisp123
Bike: ah okay, I understand a bit better. But still, all the information in the calling function would need to be passed down into the loop so that it can 'funcall' the calling function again with this information
15:33:03
lisp123
Wanted to check if there was a particularly canonical way before I went down both routes
15:33:06
Bike
for what you described at first i think that would be overcomplicated but i don't know the shape of your code
15:35:00
lisp123
I have a list of conditions that I need to check / calculate, with some conditions being 'dependent' on the values of earlier conditions in the list - hence once I get a value for a particular condition, I want to test the remaining conditions to see if they work, if not, continue the search for the correct value
15:35:36
lisp123
So basically a list of search processes, where I want to store the search paths as well, not just the values found by the searches
15:51:26
lisp123
I will have a think. jackdaniel's solution is the cleanest / easiest to follow, perhaps I should start with that for now and worry about optimisation later
15:52:11
lisp123
shka: yes it seems very straightforward (as in the lines of code are not many - not the concepts - that's very magical :-))
15:54:17
mfiano
I think maybe you are using the wrong terminology when you speak of projects, systems, or packages.
15:55:34
lisp123
mfiano: i found the source material here also https://common-lisp.net/project/clazy/
15:58:39
mfiano
You might be confusing a lot of people around here when you speak of a "package" but mean a "system"
16:06:49
mfiano
lisp123: A package is a collection of symbol objects. There are N packages in a system. A system is a collection of ASDF manifests. There are M systems per project. A project is a collection of code, usually in the form of a Git repository, and is what Quicklisp tracks.
16:13:43
lisp123
mfiano: Thanks, I was aware of the terms, but I don't use ASDF much at all, so I have been using package more generally. Anyways I'll be careful in the future
16:56:25
lucerne
I am seeing some unexpected output in the stderr of one of my scripts, beginning with `#= REPL\[213]:1 =#`. Any idea what could have caused it?
17:13:44
francogrex
Hi, I am trying this "optimized" function but it doesn't deliver at fib n > 43, is there a C long long equivalent (not bignum)? (defun fib (n) (declare (optimize (speed 3) (safety 0)) (type fixnum n)) (if (<= n 1) 1 (the fixnum (+ (fib (1- n)) (fib (- n 2))))))
17:15:07
jackdaniel
I think that a part of your problem comes from the fact that you compute same values too many times
17:16:12
jackdaniel
you can have a performant recursive version, but then you need to either memoize results are build from the bottom (not from the top)
17:26:02
jackdaniel
i.e when you want to go from the bottom: http://turtleware.eu/static/paste/0f7ed93a-fib.lisp.txt
17:28:36
jackdaniel
(and for bigger values most of the time will take printing the number, not the actual computaiton)
17:33:11
xach
jackdaniel: not at the moment, but adding new source control systems is generally fairly easy due to the Power of CLOS and a protocol for "upstream source" objects.
17:36:13
francogrex
I guess I was looking at the wring code here; the not optimized: https://github.com/drujensen/fib
17:39:16
francogrex
they should really choose other functions to benchmark than those that can be done with magic tricks like this one
17:40:02
jackdaniel
and the version with labels does not put rec in the tail position, so even when the implementation can support tail call optimization, it won't (because it can't)
17:40:49
francogrex
jackdaniel: I know, both lisp codes in the "optimized" there fail, badly written I guess
17:49:58
jackdaniel
well, almost, it doesn't handle fib(0), but fixing that is an excercise for the reader ,)
17:51:51
jackdaniel
also a memoized version: http://turtleware.eu/static/paste/cf23cbe0-fib.lisp.txt
17:52:14
jackdaniel
ACTION feels like a github copilot (without loundering the foss code bit though)
17:52:39
ck_
future historians will name us as a civilization that values this particular series very highly
22:00:21
pjb
https://quickref.common-lisp.net/lparallel.html#go-to-the-LPARALLEL_2024COGNATE_2236_2236PMAP-function
22:01:30
jmercouris
I’ll have to do some benchmarking to see when it actually makes sense to spawn new threads
22:03:00
jmercouris
Or will it be creating and killing threads every time I do some parallel operation
22:03:15
mfiano
You can use cl-cpus to set the thread pool worker count to the number of logical cores if you wish
22:04:18
mfiano
Well such testing could have wildly different results on different hardware. What you think is better than no parallelism could be worse across hardware / environment line
22:06:17
mfiano
So if this is for code to be consumed by others, I suggest you use use reasoning of how computers work over the numbers you see at one time on one piece of hardware running one OS on one implementation
22:14:05
mfiano
For example, if you were decoding a large image, instead of spawning a worker for each pixel, or for each row...figure how many "bands" you will need to allocate 1 band to each worker in your pool
22:33:17
lotuseater
pjb: this article by Kent Pitman you linked me yesterday was really interesting, thx
22:41:43
lotuseater
I asked DeepL what "lisp machine style rubout handling" would be in German. It says "Lisp-Maschinenstil-Rubbelbearbeitung". :D
23:08:44
lotuseater
eta: why do you mean unlikely? but yes the translation is just funny and not very useful :D