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/>
anticomputer has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
livoreno has joined #commonlisp
karlosz has quit [Ping timeout: 252 seconds]
[deleted] has joined #commonlisp
karlosz has joined #commonlisp
livoreno has quit [Ping timeout: 268 seconds]
karlosz has quit [Ping timeout: 252 seconds]
tyson2 has quit [Remote host closed the connection]
NotThatRPG has joined #commonlisp
ebrasca has quit [Remote host closed the connection]
thuna` has quit [Remote host closed the connection]
waleee has quit [Ping timeout: 244 seconds]
<z4kz> beach: re: 'do you have a plan for that?'
<z4kz> yes, I do
<z4kz> (sorry for the delay in replying back)
<z4kz> I'm still working thru practical common lisp
<z4kz> and I have common-lisp exercism.io setup on my computer
<z4kz> that's to get me started
igemnace has quit [Remote host closed the connection]
modula has joined #commonlisp
frgo has quit [Ping timeout: 268 seconds]
defaultxr has quit [Ping timeout: 268 seconds]
modula is now known as defaultxr
tyson2 has joined #commonlisp
karlosz has joined #commonlisp
[deleted] has quit [Read error: Connection reset by peer]
livoreno has joined #commonlisp
yauhsien has joined #commonlisp
anticomputer_ has joined #commonlisp
anticomputer has quit [Remote host closed the connection]
yauhsien has quit [Quit: Leaving...]
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
notzmv has quit [Ping timeout: 268 seconds]
[deleted] has joined #commonlisp
livoreno has quit [Ping timeout: 240 seconds]
karlosz_ has joined #commonlisp
karlosz has quit [Ping timeout: 268 seconds]
karlosz_ is now known as karlosz
tyson2 has quit [Remote host closed the connection]
anticomputer_ has quit [Remote host closed the connection]
anticomputer has joined #commonlisp
emerge has quit [Changing host]
emerge has joined #commonlisp
SR-71 has joined #commonlisp
emerge is now known as gentoo-penguin
gentoo-penguin has quit [Quit: Adiós amigos!!!]
pranavats has left #commonlisp [Error from remote client]
cosimone has quit [Ping timeout: 268 seconds]
hineios has quit [Ping timeout: 252 seconds]
hineios has joined #commonlisp
aartaka has joined #commonlisp
notzmv has joined #commonlisp
gxt___ has joined #commonlisp
gxt__ has quit [Remote host closed the connection]
jealousmonk has joined #commonlisp
frgo has joined #commonlisp
jmdaemon has joined #commonlisp
azimut has joined #commonlisp
pranavats has joined #commonlisp
mrcom has quit [Ping timeout: 245 seconds]
pranavats has left #commonlisp [Error from remote client]
<Nilby> dbotton: Here's my highly unsatisfactory code for geting loadable systems https://plaster.tymoon.eu/view/3335#3335
<Shinmera> dbotton: you can steal this https://github.com/Shirakumo/dist/blob/master/asdf.lisp
<Shinmera> note that while what I do covers almost every case, in general what you're asking for is impossible. you need to load the ASDs (and thus potential systems) to determine what systems there are.
MajorBiscuit has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 252 seconds]
pranavats has joined #commonlisp
_cymew_ has joined #commonlisp
igemnace has joined #commonlisp
<Nilby> Shinmera: A good demonstration that CL easy readability is convenient fiction. I feel like this could have been fixed a long time ago with few tweaks like a standard walker and *read-intern*, but how to fix stuff like eclector.reader:find-character => (code-char #xFFFD) ? Maybe more reader error conditions?
<Shinmera> the reader isn't the issue
<Shinmera> ASD files can be any arbitrary code, and system definitions could look like literally anything. The only way to get stuff out is to evaluate it.
<Shinmera> and *that* is a problem.
<beach> Nilby: Your code has several occurrences of incorrect indentation, and there are several violations of the rules stated on page 13 of the LUV slides.
<beach> But maybe that's part of why it is unsatisfactory.
<hayley> Looks to be a case of tab infestation.
<beach> Maybe so.
<Nilby> Shinmera: Yes. I completely agree, but even if everyone omitted any evaled code in ASD's it's trouble.
<beach> Nilby: There are also some questionable practices in terms of software engineering, i.e., a function silently doing nothing when the input is not what it expects.
<hayley> Now I wonder if there are enough hooks in ASDF, that just gleaning at the DEFSYSTEM form would give wrong results, even if the form fits the "shape" one expects.
pve has joined #commonlisp
<Nilby> hayley: as you may know, ASDF was eventually made so you can do nearly everything without evaling, and it turns out it's possible to load much of quicklisp dist without eval, but still just the reading probalems that Shinmera has to work around. e.g. undefined package prefixes, unknown character names. I guess nobody puts structure literals in ASDs.
Spawns_Carpeting has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
Spawns_Carpeting has joined #commonlisp
gxt___ has quit [Remote host closed the connection]
shka has joined #commonlisp
_cymew_ has quit [Read error: No route to host]
_cymew_ has joined #commonlisp
<Nilby> but there's still things like :version (:read-file-form "version.sexp") or even the popular :long-description #.(uiop:read-file-string #P"README")
gxt___ has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
rodicm has joined #commonlisp
_cymew_ has quit [Ping timeout: 240 seconds]
MajorBiscuit has joined #commonlisp
jealousmonk has quit [Ping timeout: 268 seconds]
Psybur has quit [Remote host closed the connection]
Psybur has joined #commonlisp
<Nilby> beach: Thanks, but you can probably save your critiquing effort, since I have always been incorrigible.
jmdaemon has quit [Ping timeout: 268 seconds]
_cymew_ has joined #commonlisp
<Seok__> I found cl-intbytes useful for processing integer bytes, is there a similar library for single and double floats?
<jackdaniel> Shinmera's library has a casting function that is a portability layer for the implementation-specific casts extension (which are cheap)
<jackdaniel> float-features I think
<Seok__> thanks!
<Shinmera> That's the name.
random-nick has joined #commonlisp
cognemo has quit [Quit: ZNC 1.8.2 - https://znc.in]
cognemo has joined #commonlisp
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
cosimone has joined #commonlisp
causal has quit [Quit: WeeChat 3.6]
igemnace has quit [Remote host closed the connection]
MajorBiscuit has quit [Ping timeout: 268 seconds]
MajorBiscuit has joined #commonlisp
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 240 seconds]
aartaka has quit [Ping timeout: 245 seconds]
MajorBiscuit has joined #commonlisp
aartaka has joined #commonlisp
aartaka has quit [Ping timeout: 268 seconds]
azimut has quit [Remote host closed the connection]
aartaka has joined #commonlisp
azimut has joined #commonlisp
xaotuk has quit [Ping timeout: 268 seconds]
aartaka has quit [Ping timeout: 268 seconds]
aartaka has joined #commonlisp
<dbotton> Thanks Nilby and Shinmera
<dbotton> I've decided to scale my project idea to still use .asd but if systems not setup up "right" as a project you will have to edit it by hand, but can still with in reason click to open files.
aartaka has quit [Ping timeout: 240 seconds]
aartaka has joined #commonlisp
jeosol has quit [Quit: Client closed]
azimut has quit [Remote host closed the connection]
aartaka has quit [Ping timeout: 268 seconds]
azimut has joined #commonlisp
aartaka has joined #commonlisp
easye has quit [Remote host closed the connection]
easye has joined #commonlisp
mon_aaraj has quit [Ping timeout: 268 seconds]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
mon_aaraj has joined #commonlisp
aartaka has quit [Ping timeout: 245 seconds]
aartaka has joined #commonlisp
Alfr has quit [Quit: Leaving]
waleee has joined #commonlisp
xaotuk has joined #commonlisp
xaotuk has quit [Ping timeout: 268 seconds]
xaotuk has joined #commonlisp
rodicm has quit [Ping timeout: 268 seconds]
dmgk has joined #commonlisp
jeosol has joined #commonlisp
<jeosol> Good morning all
<jackdaniel> hey
<jeosol> Hi jackdaniel
<jeosol> just came here to thank all the sbcl devs, upgraded from 2.2.6 to 2.2.7 without any issues
<jeosol> I work with Python (no language wars) but I very much appreciate this about working with CL/SBCL, most upgrades give no issues except small ones (like compression lib change with 2.2.6*)
rodicm has joined #commonlisp
NotThatRPG has joined #commonlisp
Posterdati has quit [Read error: Connection reset by peer]
thuna` has joined #commonlisp
<rendar> i guess that getting '(' while reading a symbol name is an error, all must be space separated, right?
dBc has joined #commonlisp
<rendar> e.g. (+ a( <- error
<Bike> nope
<Bike> no need to guess, either, you can try it
<rendar> Bike, i'm trying it, and i get always errors
<Bike> (let ((a 2)) (+ a(+ 4 5))) => 11
<Bike> what error do you get?
<jackdaniel> I've typed "(+ a(" followed by ret and I see an error :)
<NotThatRPG> ASDF is ready for a 3.3.6 bugfix release, with a bunch of fixes. Per semantic versioning, this should be entirely backwards compatible. I encourage people to download a copy of 3.3.5.10 and try it out with their systems. Bugs can be reported at https://gitlab.common-lisp.net/asdf/asdf/-/issues Thanks!
<rendar> Bike, wait
<rendar> Bike, ok, its not an error, thanks
<Bike> Great
<rendar> but how that works?
<rendar> in (+ a(+ 4 5)) we have first element=+, second=a third=(+ 4 5) ?
<beach> rendar: The reader sees a character that is not a "constituent character".
<beach> rendar: Correct.
<beach> clhs 2
Posterdati has joined #commonlisp
<beach> rendar: The reader algorithm is quite well specified.
<phantomics> Morning everyone, does anyone know the fastest way to keep a count of active workers in an lparallel kernel? I want to make the count frequently so I can efficiently assign tasks to inactive workers and frequently calling (task-categories-running) seems like it will have substantial overhead
<White_Flame> rendar: and the main term involved here is that #\( is a terminating macro character, eg it will terminate any token being built and start a new one
<NotThatRPG> Get your pre-release ASDF here: https://gitlab.common-lisp.net/asdf/asdf/-/wikis/Pre-release-ASDF
NotThatRPG is now known as NotThatRPG_away
<Bike> should i put asdf in the topic?
<beach> Can't hurt.
<jackdaniel> last time we had libraries versions in the topic the length was quite big, and there was no clear criteria what should be listed there
<yitzi> I think that makes sense. To https://asdf.common-lisp.dev/
<jackdaniel> ah, a link. sure, link to asdf website should be fine
<jackdaniel> perhaps along with quicklisp
<beach> rendar: Does that make sense?
<jeosol> does wrapping a call in handler-case result in performance hit? I am assuming it's neglible.  Context: I am trying to make a task run as fast as possible
<jeosol> *neglible if any
<jackdaniel> you pay the price only when you need to use the handler
<beach> Oh? A handler must be entered into the dynamic environment, no?
<jackdaniel> (i.e when there is no non-local jump, then there shouldn't be any performance hit, otherwise - I guess that it depends)
<jeosol> jackdaniel: ok, thanks, that's good to know
<jeosol> I am just trying to use it to catch some errors and just fail silently
<jeosol> pardon if I get the term wrong. Catch vs signal ...
<jackdaniel> beach: can't you allocate the handler at compilation time?
<scymtym> many implementations cons a little bit and bind (as well as later undoing the binding) a dynamic variable
<jeosol> scymtym: ok
<beach> jackdaniel: The handler code, yes, but the dynamic environment must be modified somehow.
<jackdaniel> yes, but binding a special variable is not overly expensive (unless someone is really desperate, but at that point perhaps common lisp is not the right choice)
<beach> That's still a non-zero cost.
<White_Flame> for a super tight inner loop in performance sensitive code, I wouldn't do it
alvaro121 has joined #commonlisp
<jackdaniel> well, we've talked about a "performance hit", not "zero cost"
<beach> Fine.
<Bike> yeah i guess the topic was pretty long with all the releases, huh
azimut has quit [Quit: ZNC - https://znc.in]
azimut has joined #commonlisp
<White_Flame> here's the disassembly for a single hander-case around a single function call: https://plaster.tymoon.eu/view/3337#3337
<scymtym> consing a handler binding, manipulating a dynamic variable (including undoing the binding for any kind of exit) can far exceed the execution cost of some operations
alvaro121_ has quit [Ping timeout: 268 seconds]
<jeosol> White_Flame: thanks for sharing that
<White_Flame> it's all straightline code, though, so take it for what it's worth
<White_Flame> eg, no weird breakouts for allocation or whatever
<White_Flame> and SBCL, speed 3 safety 0
<jeosol> what do you mean by performance sensitive. I have a call that takes an instance
<jeosol> ah, perhaps if I compile with speed 3 it may be faster, hmmm
<Bike> i wouldn't worry about this unless you need to
<aeth> safety 0 is benchmark mode. Never use it in your code. Ever.
<Bike> premature optimization is the root of all evil, etc
<aeth> safety 1 is, eh. That's OK
<aeth> how is (speed 3) (safety 1) a premature optimization, though?
<aeth> it's just... better.
<Bike> i meant worrying about handler-case
<aeth> ah, OK, because some people get carried away about being anti-optimization
<jeosol> right now, I can get my calls, I do a 1000 such calls, to run around 1-1.5 seconds. sbcl in docker takes 3.6 seconds
<Bike> i mean, i said it before you even mentioned safety 1, so obviously i wasn't referring to you
<jeosol> I will share a benchmark plots to give some context on what I driving at...
<Bike> if you're on sbcl, it has pretty good profiling tools for figuring out what particular is taking up time
<jeosol> will share soon. I have the cases running: bare metal repl and sbcl in docker
<aeth> If you have (iirc) CASE or some arithmetic, (speed 3) is basically free speed. The best kind of optimization. Might hurt compilation times or inspecting with the debugger or something, otherwise idk why it's even configurable instead of the default
<aeth> opimtization's only bad when you have to think about it
<jeosol> Bike: Good point. I will look into that. There is an external call to a Fortran exe (can't optimize this at all). Beside that call, I want everything on the SBCL side to be tight as possible
<jackdaniel> aeth: you've said it - might hurt inspecting; examining what's wrong is quite important
<Bike> what are you using the handler-case for?
<Bike> cos like if you want to catch errors you need to have it, but if you're doing something more specific there may be alternate solutions
<jackdaniel> defaults aim at balancing speed, safety and debuggability
<jeosol> Bike: sometimes I may get input that makes a call go wrong. I have hunchentoot in front, so I just want to fail silently
<aeth> jackdaniel: Except :type in defclass slots in SBCL by default :-/
<aeth> so annoying that it doesn't check
<aeth> (unless that changed... they update way to often)
<jeosol> so be clear, I have not compiled the SBCL code in any special
<Bike> and your failure is in the form of an error you don't control? because in that case you're not going to be able to lose the handler-case
<jeosol> aeth: does it use that now. I have the types specified in my slots
<Bike> unless you precheck the input maybe, but that would probably be slower
<White_Flame> jeosol: so there's no loop involved, just the performance of a single chain of events?
<aeth> jeosol: I wrote a metaclass to ensure that it checks
<jackdaniel> ccl does check at default safety, sbcl needs (safety 3) I think
<White_Flame> Bike: prechecking might speed it up, because then type inference knows what's up
<Bike> jeosol: the sbcl manual explains exactly what it does with types in 4.2 "Handling of Types", including defclass slots
<jeosol> White_Flame: I am doing a series of calls to hunchentoot server that runs SBCL task. The ratio of server request time and sbcl task is 0.99 so far
<jeosol> Bike: thank you. I try to specify the types at least for documentation. With recent updates, I recall SBCL complained when I have a type as float but left :initform nil (from old code)
<jackdaniel> right, if you allow nil, then it should be (or null float)
<jeosol> Bike: I do some form of value sanitation usually to check ranges are ok.
<NotThatRPG_away> Thanks jackdaniel -- it would be good to get feedback before the release. Especially from users of implementations I find it hard to test locally.
NotThatRPG_away is now known as NotThatRPG
<scymtym> jeosol: yes, the :INITFORM vs. :TYPE check is a relatively recent improvement. people are talking about (defclass foo () ((%bar :type integer :writer (setf bar)))) (setf (bar (make-instance 'foo)) #\c) signaling a TYPE-ERROR at runtime which only happens with elevated safety
<jeosol> scymtym: thank you for clarifying that.
<scymtym> jeosol: sure
<jeosol> just to check, how much speed up (empirically) can you get with (speed 3) ...
<Bike> on sbcl, one of the nicer things about speed 3 is that it will make the compiler give you an overwhelming amount of advice on how to make your code faster
<Bike> it might be worth trying even just to see that
<jeosol> Bike: really, ah, I didn't know that
<jeosol> I am will run two tests and compare
<jeosol> so what's a generally strategy in using speed and safety. You go up to safety 3 to ensure everything works ok, and then do safety 0 and speed 3?
<jeosol> say in deploy mode?
<jackdaniel> jeosol: unless reallyd desperate, the minimum for safety is 1
<jackdaniel> 0 is for local code that you are absolutely certain that it is correct under any circumstances
<jeosol> jackdaniel: thanks. My bad
<pjb> If you don't care what the result will be, then why not use safety 0 or 1. But then also, why run the program at all???
<pjb> always run with (safety 3) !
<jeosol> just looked at the sbcl manual. there is a comment about corrupting the heap with "no type checks" when (= safety 0)
<jeosol> pjb: haha. thanks
<Bike> yeah, don't use safety 0 unless you are very sure what you are doing.
<aeth> don't safety 0
<aeth> maaaaaaybe there's a bounds check that you can eliminate inside of a LOCALLY where you're absolutely sure it's impossible to go out of bounds with
<jeosol> I have never configured these before and just used default setting. Now everything runs well, I want to optimize a bit and remove unnecessary code paths
<White_Flame> yeah, hit speed 3 and (try to) follow SBCL's notes as far as you care to take it
<Bike> well, start with speed 3 and worry about safety later, is my advice
<aeth> safety 0 in SBCL is literally just there for benchmarks as far as I'm concerned.
<White_Flame> the safety checks are not going to be as expensive as the stuff speed 3 notes
<aeth> are you in a microoptimization benchmarks contest? No? Then don't safety 0
<jeosol> aeth: ok, thanks. So minimum safety 1.
<aeth> yeah
<aeth> otherwise you basically just get a worse, slower C
<aeth> within an elaborate runtime that isn't expecting C-style vulns
<jeosol> aeth: no optimization context per se. This is following from a previous convo with you on SBCL in bare metal repl and SBCL in docker. The former is my benchmark and the latter something I am improving
<jeosol> so far brought the docker version from 14 secons to 3.7 seconds but these are changes on the docker side of things, not SBCL related. The bare metal repl is 0.8-1.5 seconds
Alfr has joined #commonlisp
<jeosol> *contest
<jeosol> I track when the hunchentoot (A) and function call (B). The durations B/A ~ 0.98.
<jeosol> For task B, I read in CLOS instanced serialized to disk (it's the exact same each time), and then I changed some variables based on the call, then do call another function that takes that CLOS instance
rainthree has joined #commonlisp
<jackdaniel> well, if you read data from disk, then that should rather dominate other things
<jeosol> jackdaniel: Good point. I read it in the first time, and then cache it
<jeosol> I used to have SBCL write to some db. So I removed that.
<jeosol> For the first call, it will read the object. The issue is that this test case is smaller compared to some other cases. The slots of the instance hold 3-dimensional arrays. My small test case is 100x1x1).
<jeosol> Realistic test cases could be have several 3d properties each > 300k elements.
<jeosol> I am also dealing with memory issues if I hold those arrays in memory which is what I do currently.
<jeosol> Thanks everyone for chiming it, I appreciate the help. I have the cases running now and will share some of the benchmarks soon.
dBc has quit [Quit: leaving]
<jeosol> for the performance and tuning hints to sbcl, I need to run (declaim (optimize (safety 1) (speed 3))) at toplevel?
<Bike> just the speed, i think
<jeosol> aeth: what is the default settings for speed and safety
<jeosol> Bike: so default for safety is 1?
<aeth> iirc, SBCL has its own implementation-specific stuff for this
<jeosol> I am checking the manual, (well skimming) I can't find it. Will look in detail
<jeosol> I just want to know so I save the first results, then run with higher speed and seel what performance boost I get.
<aeth> (sb-ext:describe-compiler-policy)
<Bike> jeosol: i don't think the safety level changes how verbose sbcl is.
frgo has quit []
<aeth> speed changes the verbosity, though. Lots of notes about how you could make things faster, by changing what you're doing entirely, even if you... can't.
xaotuk has quit [Ping timeout: 240 seconds]
<Bike> i think the messages i was talking about come up on speed 3 regardless of the other settings.
<aeth> I have to do this in a few places: (locally (declare #+sbcl (sb-ext:muffle-conditions sb-ext:compiler-note)) ...)
<jeosol> aeth: thanks
<aeth> when you actually want to be generic and note doesn't want you to
<Bike> and, like aeth alluded to, these will basically all be microoptimization hints. sbcl isn't smart enough to tell you a more efficient organization of your code
<jeosol> Bike: the hints have suggests to improve code -- haha, hopefully it's not to change things radically
<jeosol> Bike: that was my point. I have used suggestions from here over time, so organization is ok, I guess.
<jeosol> As long SBCL duration is only marginally higher than the external exe, everything is fine
WBarends has joined #commonlisp
xaotuk has joined #commonlisp
<NotThatRPG> I've always wondered if there's some way to selectively mute those notes, so I can go through a big swodge of them, fix the ones I can fix, and muffle the ones I can't or don't want to
<Bike> you can use muffle-conditions like aeth said, but i think getting more specific than "all notes" is not generally possible
<NotThatRPG> I never got that to work, but I will try again!
rodicm has quit [Quit: Leaving]
NotThatRPG is now known as NotThatRPG_away
<Bike> my understanding is that you just put in the declare, and then sbcl won't note things about code within the lexical scope of the declaration
<WBarends> The sicp book uses environment diagrams to explain the environment model and lexical, dynamic scope of variables and also state. The language in use in the book is scheme a lisp-1 language. Does ther exits a similar diagramatic way for common lisp a lisp-2 language?
<jackdaniel> WBarends: it is basically the same, but with an extra namespace for functions, that is when the symbol is the first atom on the list that is evaluated
infra_red[m] has quit [Quit: You have been kicked for being idle]
morganw has joined #commonlisp
NotThatRPG_away has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<rendar> beach, yes, thanks
<rendar> (sorry i was afk)
<beach> Good! (no problem)
<rendar> so, (+ (+ a b)b) is indeed valid
<beach> Yes.
<beach> But it is not the conventional style.
<WBarends> jackdaniel: Basically you call it and that's propably right. But functions (defun) are only defined at the toplevel. So running along the environments from low level to toplevel searching for variables and procedures during an invocation of a procedure should be a more complicated than in scheme.
<rendar> (+(+a b)b) is also valid, yes i know, its that i'm writing a little lisp interpreter in python for learning
<rendar> so i was wondering about those internals
<beach> Oh dear!
<rendar> huh?
<beach> WBarends: No, there is LABELS and FLET too.
<beach> rendar: It seems every other newbie is doing this.
<beach> WBarends: Not really. And that's done only at compile time, and it is a minor part of the compilation process.
<beach> WBarends: I mean, yes, it is slightly more complicated, because the compiler needs to search a particular namespace, rather than just the single one in Scheme.
<WBarends> beach: Do you mean that LABELS and FLET add the procedures to the functions name space?
<beach> Yes.
<WBarends> beach: would you say that as a mental model i can use environment diagrams as used in sicp?
<rendar> beach, also Peter Norvig did this
<rendar> and he is not a newbie :D
<Bike> WBarends: the difference is pretty trivial. theoretically speaking, it's like if all functions were assigned names in a lisp-1 space that are distinct from all variable names. like for example if variable names had "p" on the front and function names "f"
<Bike> i don't know why i said p instead of v.
<Bike> so yeah, sicp should apply fine
<WBarends> Bike: Oke, but sometimes you need funcall, apply and at othertimes it is the car of of list that invokes the procedure. So "v" and "f" a-lone is not sufficient.
<Bike> WBarends: it is unambiguous in any context what lookup is to be done
<Bike> #'foo means lookup ffoo. in (apply foo ...) foo is a variable, so lookup vfoo
<Bike> and fapply, since apply is a function name there
<Bike> in this way you can rewrite any lisp-2 program into a lisp-1 program
<_death> there are other differences, e.g. the evaluation rule
<aeth> but CL is a Lisp-3 because the third main namespace (of many, but nobody cares about tagbodies) is class/type
<Bike> tagbody tags are lexical and classes are not, so tags are actually more germane
<yitzi> I think we should just call it Lisp-n, where n > 1 and leave it at that.
<Bike> _death: i don't think that would affect lisp-2 -> lisp-1? it would the other way, tho
<Bike> and yeah lispn is the way to go
<_death> Bike: if you consider only the difference of interpretation of the car, perhaps.. but then maybe there's also evaluation order.. what I'm saying is that SICP offers a view of a region of basic models, and the model of CL is more complicated in a variety of ways
karlosz has quit [Quit: karlosz]
mon_aaraj has quit [Ping timeout: 245 seconds]
<Bike> i mean in context i'm pretty much only talking about variable bindings and environments, yeah
<_death> right, I extrapolated beyond environments
mon_aaraj has joined #commonlisp
Alfr has quit [Quit: Leaving]
<copec> What emacs on macos are ya'll using these days?
<dbotton> 28.1
<morganw> I've always used this one: https://emacsformacos.com/
<dbotton> ditto
<morganw> caveat: I just wiped my Mac to install Guix on it, so I no longer use it
<jeosol> update: I ran the analyses I was talking about 1000 serial calls: backend_server (Python) to sbcl/hunchentoot. The task duration is call on sbcl side.  No difference with (speed 1) vs (speed 3) perhaps task duration is too small. Also, majority of the task is external exe bottle neck. Here is the full table (see explanation header on top)
Dynom_ has joined #commonlisp
Dynom_ is now known as Guest72
NotThatRPG has joined #commonlisp
<jeosol> Thank you to everyone that chimed in regarding safety, speed, and performance optimizations with SBCL. I think I have done as much as possible on SBCL side. Here is a plot of ratio the durations. The one that pertains to SBCL (blue line) is steady at ~ 0.99: https://drive.google.com/file/d/1DMF8t8xLDLp0TfUCE6JJDrXPa4JY48dI/view
analogsalad has joined #commonlisp
frgo has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
cage has joined #commonlisp
Alfr has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 252 seconds]
Lord_of_Life_ is now known as Lord_of_Life
MajorBiscuit has quit [Ping timeout: 252 seconds]
karlosz has joined #commonlisp
karlosz has quit [Client Quit]
karlosz has joined #commonlisp
<hexology> does (declaim (optimize ...)) apply to all compilation units that don't specifically have their own declaration or declamation attached? or only to the current compilation unit?
<Bike> undefined, i think
<hexology> hmm.. so if i have several separate list files in my program (with one package per file), i might need/want to declaim my desired optimization settings in each one?
<Bike> maybe, yeah
orestarod has joined #commonlisp
tyson2 has joined #commonlisp
<jeosol> Bike: really, then I don't think the optimization was applied in my case. I just ran the (declaim ...) part at the top level and ql loaded the required system
<jeosol> However in my case with the default speed 1, I think there probably isn't much to be had
<Bike> what optimization?
mon_aaraj has quit [Ping timeout: 268 seconds]
rainthree has quit [Ping timeout: 252 seconds]
mrvdb has quit [Quit: ZNC 1.8.2 - https://znc.in]
mrvdb has joined #commonlisp
notzmv has quit [Ping timeout: 268 seconds]
SR-71 has quit [Ping timeout: 240 seconds]
alvaro121_ has joined #commonlisp
alvaro121 has quit [Ping timeout: 252 seconds]
mon_aaraj has joined #commonlisp
notzmv has joined #commonlisp
jmdaemon has joined #commonlisp
<pjb> hexology: AFAIK, declaimations are global. Proclaim Establishes the declaration specified by declaration-specifier in the global environment.
<Bike> clhs declaim
<Bike> second paragraph
<pjb> Bike: is that more restrictive than compilation-units?
<Bike> with-compilation-unit doesn't mention proclamations or declaim at all
<pjb> would be a good issue for wscl
mon_aaraj has quit [Ping timeout: 245 seconds]
tyson2 has quit [Remote host closed the connection]
cage has quit [Quit: rcirc on GNU Emacs 27.1]
mon_aaraj has joined #commonlisp
karlosz has quit [Ping timeout: 252 seconds]
karlosz has joined #commonlisp
mon_aaraj has quit [Ping timeout: 240 seconds]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
mon_aaraj has joined #commonlisp
<NotThatRPG> Pretty sure DECLAIM is under-specified. It's certainly been a problem in figuring out how ASDF should deal with optimizations
MajorBiscuit has joined #commonlisp
<pjb> NotThatRPG: basically: (defmacro declaim (&rest decls) `(eval-when (:compile-toplevel :load-toplevel :execute) ,@(mapcar (lambda (decl) `(proclaim ',decl)) decls)))
<Bike> yes, but that doesn't actually help for the question of whether the effects last past the file or not
MajorBiscuit has quit [Ping timeout: 268 seconds]
<pjb> I consider that libraries should not contain optimization proclaimations. It should be the user who sets them depending on his needs. Therefore if they're limited to the file or the compilation-unit doesn't matter for me.
<NotThatRPG> Right: as far as we could tell it's up to the implementation to decide the scope of DECLAIM
<White_Flame> for one of my large projects, I have a (optimize-file) macro invocation at the top of each file, defined early in config, to punt learning how this might differ per implementation & environment :-P
Oladon has joined #commonlisp
Guest72 has quit [Quit: WeeChat 3.6]
<_death> I do it on a per function basis, and use declaim for say inline/ftype declarations
[deleted] has quit [Ping timeout: 240 seconds]
<White_Flame> yeah, on speed sensitive code, I have (fast-body . <body>) and (slow-body . <body>), which also interact with the global optimize-file config
<_death> though I do rely on sbcl's declaim behavior by changing optimize policy in .sbclrc
<White_Flame> with slow body muffling the speed notes when speed 3 is enabled
<aeth> in case anyone wants to do that, the code probably looks like this: (defmacro stfu-sbcl (&body body) `(locally (declare #+sbcl (sb-ext:muffle-conditions sb-ext:compiler-note)) ,@body))
<aeth> outside of SBCL it's just (locally (declare) ...) so it'll work fine
<White_Flame> yep
<White_Flame> actually I did a deftype optimization-note where I put the #+sbcl, for some reason
<_death> for compiler notes, I learned to accept them.. they remind me that my data structures are probably suboptimal
infra_red[m] has joined #commonlisp
<White_Flame> I refuse to have noisy builds
<White_Flame> to me, to "accept" them means intentionally annotating them
<White_Flame> which muffles them
<White_Flame> in focused locations
<_death> in some places, I do need to use potential bignums in code that needs to be performant, so muffling related notes could make sense
<aeth> I mean that's the only time I do it
<aeth> it'll be like (typecase x (double-float ...) (single-float ...) (integer ...) (t ...))
<aeth> and SBCL will tell me that the base case, which must exist, is inefficient. Duh.
<White_Flame> (slow-body (+ (fast-body (aref bignums x)) (fast-body (aref bignums y))))
<aeth> Even if I explicitly spelled out rational or whatever I think it'd still tell me
<aeth> s/base case/default case/
livoreno has joined #commonlisp
<pjb> aeth: do you realize that (typecase x (double-float ...) (single-float ...) (integer ...) (t ...)) is not conforming? In some implementation, you may get a warning about duplicate clauses.
<pjb> See com.informatimago.common-lisp.cesarum.utility:float-typecase etc.
<_death> it's fine to have duplicate clauses
<aeth> uh, wouldn't that just be... a warning?
<aeth> because there's no way to solve the general case of making sure that the second type in a typecase isn't entirely covered by the first, but ofc you sometimes can
<aeth> (in the case where there's only one float type, in case someone doesn't get the issue)
<aeth> (you can get this on almost all implementations if you do e.g. long-float and short-float)
<pjb> aeth: strange, I solved the general case in com.informatimago.common-lisp.cesarum.utility:float-typecase.
<aeth> I mean the general general case, not just for floats, which would require handling SATISFIES
tyson2 has joined #commonlisp
<pjb> aeth: oh, right.
akoana has joined #commonlisp
<_death> it's also being nice to macro writers, or when some type is changed and now overlaps another
morganw has quit [Remote host closed the connection]
<aeth> the flexible float solution is probably to push the present float types to *features*
MajorBiscuit has joined #commonlisp
sjl has joined #commonlisp
<_death> whatever floats the boat
analogsalad has quit [Quit: bye]
edgar-rft has quit [Read error: Connection reset by peer]
edgar-rft has joined #commonlisp
<Bike> duplicate typecase clauses would be a style warning at best, since the behavior of the typecase is totally defined, it's just that one clause will never happen
Brucio-61 has quit [Ping timeout: 268 seconds]
Brucio-61 has joined #commonlisp
<resttime> How much does SBCL use SIMD intrinsics when compiling? I'm wondering whether the compiler works fine or it's necessary to learn how to use sb-simd to squeeze out max performance for numerical operations
<resttime> Basically a declare optimize 3 safety 0 vs hand-writing code with intrinsics
dmgk has left #commonlisp [#commonlisp]
<White_Flame> I don't believe it uses them by default, but there is a simd compatibility library and some asm/vop examples for explicitly using them
<kakuhen> compile some function you've written and invoke DISASSEMBLE
<kakuhen> and I'd strongly recommend against setting safety to 0 for performance; there's often a good reason the compiler will introduce a type or bounds check at runtime, and its usually because you couldn't convince the compiler you'd consistently get X type or some array Y with exactly N elements
MajorBiscuit has quit [Ping timeout: 240 seconds]
ecraven has quit [Ping timeout: 252 seconds]
danieli has quit [Ping timeout: 252 seconds]
<resttime> White_Flame: Hmmm, guess I'll look more into sb-simd, came across a paper: https://zenodo.org/record/6335627
micro has quit [Ping timeout: 240 seconds]
<resttime> kakuhen: Safety is good, I'm willing to sacrifice for performance since there's nothing critical. I'm trying to push the limits by writing with a raytracer and learn stuff along the way
mon_aaraj has quit [Ping timeout: 268 seconds]
_cymew_ has quit [Ping timeout: 240 seconds]
mon_aaraj has joined #commonlisp
<kakuhen> resttime: here's an extremely basic example of sb-simd
shka has quit [Ping timeout: 240 seconds]
<kakuhen> on my machine, deep-copy-1 on a 4096 element array will cost me about 200,000 processor cycles whereas deep-copy-2 would be about 13,000; the number drops to about 5,000 if you remove bounds checks, but I'd rather pay the cost of bounds checks anyway.
<White_Flame> neat
<resttime> Oh nice, will keep that snippet as example
<kakuhen> resttime: as for disassembly https://plaster.tymoon.eu/view/3341#3341
<kakuhen> Notice how with a sufficiently "good" type declaration I was able to emit much more concise code and not have to compromise on safety
<kakuhen> this is why imo (declare (optimize (speed 3) (safety 0))) is one of the last things you should try doing for extracting performance out of a function
<kakuhen> note: if you know the length of your simple-array ahead of time, the disassembly becomes even shorter (and probably faster)
<resttime> kakuhen: Where does the symbol do-vectorized exist?
<kakuhen> in sb-simd
<kakuhen> if not, then it may have been moved to loopus
<kakuhen> but I'd be surprised if that were the case
<resttime> Found the loopus library doesn't seem to be in there and I'm in the sb-simd package when trying to run the code (was trying to disassemble the deep copyfunctions), https://github.com/marcoheisig/Loopus/blob/main/code/packages.lisp
<Kingsy> anyone use lass in here as a css preprocessor?
jealousmonk has joined #commonlisp
<Shinmera> You might say I do.
<kakuhen> resttime: looks like i have to update my 6 month old code then
<kakuhen> I'm also struggling to find do-vectorized in the current version of sb-simd, huh
<kakuhen> I guess it's something that was ripped before it became an official SBCL contrib?
<Shinmera> While I'm here and not asleep, here's an update on Kandria that may interest the particular set of individuals in this channel: https://twitter.com/Shinmera/status/1554585025789706241
azimut has quit [Ping timeout: 268 seconds]
<resttime> kakuhen: haha well that's alright then I assume it's some kind of looping macro, might have been superseded by loopus
azimut has joined #commonlisp
<kakuhen> yes, the intent of do-vectorized was that you used types exported by sb-simd and the compiler would attempt using the best available simd instruction set on your computer (in my case, avx2)
<White_Flame> which sounds like another trap for binary distribution
<resttime> Ohhh, in the sb-simd paper mentions a INSTRUCTION-SET-CASE macro for selecting best availble code at run time, might've been related/used to implement do-vectorized
<Shinmera> yeah it's capable of doing runtime dispatch for isa selection.
<Shinmera> dunno if it's smart enough to eliminate the dispatch by rewiring at startup, though.
<White_Flame> ah, cool
<Shinmera> GCC has a similar thing which is really neato.
<kakuhen> resttime: well, assuming you can get loopus to compile, you may be able to replace sb-simd:do-vectorized with loopus:for
<resttime> The sb-simd-vectorizer package doesn't seem to exist anywhere though
<kakuhen> Unfortunately it doesn't seem to compile on my machine due to linker errors with libisl.so
<Kingsy> sorry I managed to figure it out, it was in the docs, i wanted emacs support.
<Shinmera> Glad to hear :)
<kakuhen> resttime: i assume that's because the vectorizers get generated for various simd instruction sets on your cpu, then you're supposed to invoke loopus:for and let the backend handle the instruction set
<Kingsy> curious, with clip, isnt it possible to use templates that inherit others? and if so how come the depp tutorial for radiance doesnt do it that way?
<kakuhen> fwiw do-vectorizer doesn't explicitly exist in sb-simd codebase either, but it was provided to be when I was testing the example I sent you on SBCL 2.2.2
<phantomics> From the sb-simd docs, I find it a bit unclear how the instructions map to the sb-vm primitive functions
orestarod has quit [Ping timeout: 268 seconds]
<Shinmera> Kingsy: inherit in what way? You can <c:include> other files, sure.
<Shinmera> As to why, idunno. It's been way too long since I wrote it. Probably thought it unnecessary to complicate matters for the two or what pages that it actually needs.
<Kingsy> Shinmera: well with other frameworks, you get a base.twig or a base.whatever, which contains the <head> and all that other stuff, then you have a view.whatever which always uses the base.
<Shinmera> Ok. I don't really care too much about what other frameworks do.
<Kingsy> no I mean, it makes sense if you wanted to include something in the head (which is common) you would only need to modify one file.
<Kingsy> Shinmera: in that makes sense?
<Shinmera> Sure. Sometimes I do something like that.
<phantomics> https://sb-simd.common-lisp.dev/supported_sse.shtml lists the different add instructions that are supported, am I to assume that sb-vm::%sse-add/simple-array-single-float-1 implements ADDSS?
<Kingsy> as long as its possible then all good. I will look into it later :)
<Kingsy> Shinmera: thanks for answering, appreciate that.
<Shinmera> It's not clear to me whether it's better to have a master file that includes a subfile, or a subfile that includes a scaffold. You can do either, or none.
<Kingsy> usually I like the subfile that includes the scaffold. btu yeah. nice! good to hear.
<kakuhen> aha, I found out why cl-isl does not work on mac os x
<resttime> "The plan is to move that code to a separate project called Loopus."
<kakuhen> I was wondering why cl-isl was really insistent on picking libisl.so rather than libisl.dylib on my system
<kakuhen> especially when pkg-config is able to detect isl on my system and provide cflags
<kakuhen> resttime: yes, if you look at the paper, heisig seems to use loopus:for much like do-vectorized was once used
<kakuhen> so right now I'm on a journey to eventually get cl-isl compiling on my mac, to get loopus.sb-simd compiling, and test loopus:for
<resttime> Issue that I see now is that loopus tries to use this missing symbol&package still so I it's prob outdated a bit https://github.com/marcoheisig/Loopus/blob/bd84132eb5d0e94b1fadcb9be734a3ff8b0c1aff/code/ir/sb-simd.lisp#L46
<kakuhen> i think it'll be fine.
<kakuhen> for instance, sb-simd-avx2:f64.4 will not exist on computers building sb-simd on intel processors without avx2 instructions
<kakuhen> that's because a lot of the types and primitives are automagically generated
pve has quit [Quit: leaving]
thuna` has quit [Remote host closed the connection]
<resttime> kakuhen: Want me to open a PR to add (:darwin "libisl.dynlib") to the prologue.lisp? That'd solve for the future for osx systems
ecraven has joined #commonlisp
<kakuhen> that is not solving the issue on my end right now
<kakuhen> with that said, I was able to manually input ("libisl.dylib") in the debugger
<kakuhen> and compilation succeeds; I'll have to learn how to make cffi pick :darwin first
<kakuhen> I'm also having to make sure my copy of libisl is ABI compatible, since it looks like cl-isl needs version 22, but my system has version 23.
micro has joined #commonlisp
<Kingsy> Shinmera: could I trouble you with a radiance question? I have asked in clschool, but as you are here I am wondering if I could be cheeky
danieli has joined #commonlisp
<kakuhen> looks like my SBCL is hanging in the middle of building cl-isl, so there may be ABI issues... I have no way of definitively telling, and I'm too lazy to install an outdated isl just to see if I can build this tbh
minion has quit [Remote host closed the connection]
<kakuhen> running in terminal now to see if I get dropped to LDB; I suspect that may be happening when SBCL hangs.
specbot has quit [Read error: Connection reset by peer]
minion has joined #commonlisp
specbot has joined #commonlisp
<kakuhen> resttime: looks like you are right
<kakuhen> "READ error during COMPILE-FILE: Package SB-SIMD-VECTORIZER does not exist. Line: 3, Column: 71, File-Position: 96." in code/ir/sb-simd.lisp
<resttime> whew
<kakuhen> with that said, LOOPUS itself, the main package, compiles fine
<kakuhen> LOOPUS.SB-SIMD is giving me issues
<kakuhen> I have no idea why this would make the slynk server unresponsive, but whatever.
<kakuhen> With that said, I also am getting at the very bottom of the debugger output: "Bogus form-number: the source file has probably changed too much to cope with"
akoana has quit [Quit: leaving]
<resttime> Went ahead and created PR, should solve minor annoyance with picking the write lib on OSX, I've written crossplatform CFFi bindings before and just specify the lib name explicitly depending on the platform
<Kingsy> more generic question then if anyone might know, whatis the best way of recompiling an .asd lisp module and I am working on?
NotThatRPG has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<kakuhen> resttime: should be "dylib" not "dynlib"
<kakuhen> also, I have a similar patch but CFFI is still trying to search for libisl.so
<kakuhen> I'm guessing it's because :UNIX is in *FEATURES* as well, but I'm not sure since I've never used CFFI.
<kakuhen> in any case, I proceeded building the package despite the warnings in loopus.sb-simd, and codegen became absolutely borked, so I think the presence of sb-simd-vectorizer is important :<
<kakuhen> s/warnings/errors
<resttime> kakuhen: Yeah, the way DEFINE-FOREIGN-LIBRARY works is that it'll check the load clauses in order, so the one for :DARWIN will have to be before the :UNIX one
<resttime> Pretty much like a COND
<resttime> Wait no a CASE lol
<resttime> And whoops, fixed typo
<resttime> Kingsy: Dunno best way, but I keep a symlink to the project repo in quicklisp/local-projects and quickload the system when needed
<kakuhen> well... looks like it's good I did not SIMDify parts of my flac decoder months ago
<Kingsy> resttime: I think I did it within emacs using SPC-m-c -> f, no restart of radiance needed. after that I just hit the radiance server and the new endpoint was there.. pertty sweet.
<Kingsy> resttime: ah that makes sense. my project is actually in there right now, so just a quickload would have worked too I suppsoe, thats probably what emacs is doing under the hood.
<Kingsy> thanks for answering! appreciated.
<resttime> np, and it kinda depends. My context is if I'm working on a project that depends-on another, I'd make a local copy of the other repo, make changes, add symlink to the quicklisp/local-projects
<resttime> Then every subsequent quickload will automatically prioritise the one in local-projects instead of the one in the quicklisp repo
<resttime> If it's just my own project then I'd just take advantage of hotloading with the SLY/SLIME keybindings
Oladon has quit [Quit: Leaving.]
<Kingsy> hehe thats kinda over my head. but I am sure i will figure it out at some point. I have a depends on and the sly keybinding worked. but we will see.
karlosz has quit [Ping timeout: 252 seconds]
karlosz has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
pmwals09 has joined #commonlisp
pmwals09 has quit [Client Quit]
karlosz has quit [Ping timeout: 252 seconds]